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
Consistent import from top-level and first-level namespace of qcodes #1962
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1962 +/- ##
=======================================
Coverage 69.00% 69.01%
=======================================
Files 155 155
Lines 19906 19908 +2
=======================================
+ Hits 13737 13739 +2
Misses 6169 6169 |
Looks good. Other than the change mentioned above I think this just need a changelog entry. |
The travis failure probably points to a circular import. We may have to rething the importing slightly. I would probably try to break this by making the imports in |
@lakhotiaharshit I think we just need to fix the 2 long lines then this should be ready to go |
@jenshnielsen '2 long lines' as in changelog? I just did that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great work! just one question - shouldn't all sub-module-level imports be relative? (see other comments)
qcodes/data/__init__.py
Outdated
from qcodes.data.format import Formatter | ||
from qcodes.data.gnuplot_format import GNUPlotFormat | ||
from qcodes.data.hdf5_format import HDF5Format | ||
from qcodes.data.io import DiskIO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't these be relative imports in order to make the "module" independent on where it itself is located?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Yes, now that you point it out. I think they all should be relative. |
@lakhotiaharshit as in the feedback from codacy :) |
Fix change log
This pr removes does not import the legacy api in the top-level namespace of qcodes by default. If the flag for importing legacy api is set to true in the config file then only the legacy-imports are done. It fixes the example notebooks to reflect this change.
It also copies the imports to the init.py files of the respective modules.
@jenshnielsen