-
Notifications
You must be signed in to change notification settings - Fork 309
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
Reorganization of sqlite_base.py #1570
Reorganization of sqlite_base.py #1570
Conversation
also VALUE and VALUES
qcodes.dataset.database now contains only import statements for backwards compatibility. in following commits, all QCoDeS will use sqlite.database instead of qcodes.dataset.database.
... instead of qcodes.dataset.database.*
and _latest_available_version as well
as opposed to from sqlite_base.
This makes the __init__ of sqlite.db_upgrades more concise, and also serves as an example of how to encapsulate code needed by a particular upgrader function.
sqlite_base is left now empty but with all the imports that it used to have for backwards compatibility.
Jupyter Notebooks were not adjusted in this commit.
also add a note that 'connect' is a private function and should not be used by users directly.
Codecov Report
@@ Coverage Diff @@
## master #1570 +/- ##
==========================================
+ Coverage 72.12% 72.18% +0.06%
==========================================
Files 105 112 +7
Lines 12305 12293 -12
==========================================
- Hits 8875 8874 -1
+ Misses 3430 3419 -11 |
@QCoDeS/core I would like to try to be annoying and propose to take care of |
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.
I think the structure is good 👍 My only question is if we should warn on importing from the legacy locations.
The reason of this refactoring is to allow database upgraders to have snippets of code from qcodes that are only relevant to those database versions. For example, when we remove layouts and dependencies tables we will still preserve the code that works with them "as is" in a module for the relevant database upgrade, and will change the sqlite API that qcodes uses as we need (this is the reason for Codacy to report problems on this PR).
The new structure is somewhat explained in the top-level docstrings of the new
sqlite
modules and sub-modules. I also tried to make good commits, so it might be helpful to just follow the commit history to see what happened.The code has only been moving, and import statements have been adjusted. So, the functionality and bodies of functions are intact.
Note that
dataset/sqlite_base.py
anddataset/database.py
modules are now NOT used inside qcodes, but are left with imported entities to facilitate migration of other dev branches of qcodes, and, unfortunately, some third-party tools. All the new development shall be done in the newsqlite
package.Note imports of two notebooks were updated due to this change.
not gonna do now:
dataset
module and move all sqlite-query code (for example, in experiment container module) tosqlite.*
@QCoDeS/core