Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for #69,#71, and #72 #77

Merged
merged 1 commit into from
Sep 28, 2015
Merged

fix for #69,#71, and #72 #77

merged 1 commit into from
Sep 28, 2015

Conversation

rmcgurrin
Copy link
Contributor

#69

In the Looper Form of MeasFilterViews.enaml, test that the selected
filter is in the filter dictionary else return -1
#71

In the QtListStrWidget, test if the enable changed when the labels are the same
and the label is in the item list. Also, only signal a name change when the
labels are not the same and the newlabel is not in the item list. In the old
version of code there are some conditions when on_edit is called that result in
the dictionary manager trying to rename an item that does not exist.
#72

Added a new feature to save config in a different directory and load a config
from a different directory. After loading a config, the GUI will restart itself
for the changes to take effectively

@@ -16,6 +16,8 @@
from importlib import import_module
import os
import inspect
from drivers.APS import APS
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect that this line is not necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without it you can't run AWGs.py as a standalone for testing. You'll get
the error below.

python AWGs.py
Registered Driver APS2
Registered Driver Tek5014
Registered Driver Tek7000
:0: FutureWarning: IPython widgets are experimental and may change in
the future.
Traceback (most recent call last):
File "AWGs.py", line 30, in
awg = APS(label='BBNAPS1')
NameError: name 'APS' is not defined

On 9/24/15 3:11 PM, Blake Johnson wrote:

In instruments/AWGs.py
#77 (comment):

@@ -16,6 +16,8 @@
from importlib import import_module
import os
import inspect
+from drivers.APS import APS

I suspect that this line is not necessary.


Reply to this email directly or view it on GitHub
https://github.com/BBN-Q/PyQLab/pull/77/files#r40359775.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, but that is not the problem. If you look at the output you just pasted there, you see that it failed to register the 'APS' driver, but picked up all the rest.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if I change awg=APS2(...) I get a similar failure even though the APS2
driver was registered. I'm not sure what's going on here but I'll dig
into it. I'm cc'ing Brian D as well to see if he has an idea why this
does not work.

Registered Driver APS2
Registered Driver Tek5014
Registered Driver Tek7000
:0: FutureWarning: IPython widgets are experimental and may change in
the future.
Traceback (most recent call last):
File "AWGs.py", line 28, in
awg = APS2(label='BBNAPS1')
NameError: name 'APS2' is not defined

On 9/24/15 3:19 PM, Robert McGurrin wrote:

Without it you can't run AWGs.py as a standalone for testing. You'll
get the error below.

python AWGs.py
Registered Driver APS2
Registered Driver Tek5014
Registered Driver Tek7000
:0: FutureWarning: IPython widgets are experimental and may change in
the future.
Traceback (most recent call last):
File "AWGs.py", line 30, in
awg = APS(label='BBNAPS1')
NameError: name 'APS' is not defined

On 9/24/15 3:11 PM, Blake Johnson wrote:

In instruments/AWGs.py
#77 (comment):

@@ -16,6 +16,8 @@
from importlib import import_module
import os
import inspect
+from drivers.APS import APS

I suspect that this line is not necessary.


Reply to this email directly or view it on GitHub
https://github.com/BBN-Q/PyQLab/pull/77/files#r40359775.

@bcdonovan
Copy link

@rmcgurrin What is your test setup. I have not been able to replicate having the APS module missing.

One thing that I noticed is that the if __name__ == __main__ block is running before the find_drivers call that should prevent any of the drivers though.

Where are you running python from. Inside the instruments directory?

@blakejohnson
Copy link
Collaborator

I'm tempted just to remove these if __name__ == __main__ blocks. They were there for initial development, but now I only expect these modules to function within the context of the ExpSettingsGUI. What do other people thing. @caryan want to chime in?

@rmcgurrin
Copy link
Contributor Author

@bdonavan I'm tried both running from the instruments dir and the PyQlab
dir. I get the same results both ways.

On 9/25/15 10:00 AM, Brian Donovan wrote:

@rmcgurrin https://github.com/rmcgurrin What is your test setup. I
have not been able to replicate having the APS module missing.

One thing that I noticed is that the |if name == main| block
is running before the find_drivers call that should prevent any of the
drivers though.

Where are you running python from. Inside the instruments directory?


Reply to this email directly or view it on GitHub
#77 (comment).

@rmcgurrin
Copy link
Contributor Author

It is kind of nice when you want to just run a smaller standalone pieces
of the GUI for testing . It comes in handy.

On 9/25/15 10:25 AM, Blake Johnson wrote:

I'm tempted just to remove these |if name == main| blocks.
They were there for initial development, but now I only expect these
modules to function within the context of the ExpSettingsGUI. What do
other people thing. @caryan https://github.com/caryan want to chime in?


Reply to this email directly or view it on GitHub
#77 (comment).

@caryan
Copy link
Contributor

caryan commented Sep 25, 2015

Yeah, I like the `if name == main`` for quick testing from a text editor.

BBN-Q#69
In the Looper Form of MeasFilterViews.enaml, test that the selected
filter is in the filter dictionary else return -1

BBN-Q#71
In the QtListStrWidget, test if the enable changed when the labels are the same
and the label is in the item list. Also, only signal a name change when the
labels are not the same and the newlabel is not in the item list. In the old
version of code there are some conditions when on_edit is called that result in
the dictionary manager trying to rename an item that does not exist.

BBN-Q#72
Added a new feature to save config in a different directory and load a config
from a different directory.  After loading a config, the GUI will restart itself
for the changes to take effectively
@rmcgurrin
Copy link
Contributor Author

I updated AWGs.py to move the if __name__ == __main__ to the bottom of the file so that find_drivers() will run first.

Also, changing
"from AWGBase import AWGChannel, AWG, AWGDriver"
to
"from instruments.AWGBase import AWGChannel, AWG, AWGDriver"

allows the script to run but I'm really not sure exactly why that is needed.

The good news is that with these changes you can run AWGs.py as a standalone. The bad news is that when you do run it as a standalone you get some strange results regarding loading the drivers: they get loaded multiple times like below:

Registered Driver APS2
Registered Driver Tek5014
Registered Driver Tek7000
:0: FutureWarning: IPython widgets are experimental and may change in the future.
Registered Driver APS
Registered Driver APS2
Registered Driver Tek5014
Registered Driver Tek7000
Registered Driver APS
Registered Driver APS2
Registered Driver Tek5014
Registered Driver Tek7000

Some of this behavior can be possibly attributed to circular imports. This does not happen when ExpSettingsGUI runs.
I'm going to add an issue for this and root cause it as a lower priority.

blakejohnson added a commit that referenced this pull request Sep 28, 2015
@blakejohnson blakejohnson merged commit 8c60b24 into BBN-Q:develop Sep 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants