-
Notifications
You must be signed in to change notification settings - Fork 301
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
[core only] Development/dependencies dsl #1227
[core only] Development/dependencies dsl #1227
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1227 +/- ##
==========================================
+ Coverage 72.84% 73.47% +0.62%
==========================================
Files 74 76 +2
Lines 8588 8866 +278
==========================================
+ Hits 6256 6514 +258
- Misses 2332 2352 +20 |
There is now a little notebook showing the basic idea of object -> yaml and yaml -> object. |
qcodes/dataset/dependencies.py
Outdated
|
||
|
||
def yaml_to_interdeps(yaml_str: str) -> InterDependencies: | ||
yaml = YAML() |
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.
does this module support the case when ParamSpec class changes but older yaml file is read?
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.
Good point.
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.
It does now, via versioning. The code contains an example of a somewhat contrived upgrade, but it establishes the principle.
nice. it looks neat. are the "bullet points" going to be implemented in this PR? |
@astafan8, yes, the idea is to make this PR give us an MVP. Sorry, I think I forgot write that. Let me do it now: we have decided to implement the DSL into the database, meaning that the four bullet points will be covered. |
perhaps a useful note: I was looking at ruamel, and on their pypi page they state that
Does it impact us in any way? |
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.
Sorry that I haven't reviewed the queries and the upgrade algorithm before. The most important comments are about them.
qcodes/tests/dataset/legacy_DB_generation/generate_version_2.py
Outdated
Show resolved
Hide resolved
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 it's good to go!
This is some internal core dev thing.
Introduction
Here is my proposal for a first iteration DSL to describe dependencies.
The idea is simple: let's use what we already have (and then build on that later). What is it that we have? The
ParamSpecs
. The proposal is therefore to simply write down theParamSpec
in ayamljson file. That is, in all its glory, the DSL.This PR introduces
onetwo objectsand two functions, anInterDependencies
object consumingParamSpecs
andRunDescriber
objectand the functionswith methodsinterdeps_to_yaml
andyaml_to_interdeps
to_json
/from_json
. Note that yaml is also supported.Regarding implementation (to be done in following PRs):
If we want to pursue this, the proposal then includes moving all information from the
dependencies
andlayouts
table into ayaml
file stored in a column in the runs table (just likesnapshot
). I'd further propose that weInterDependencies
object. TheMeasurement
class can then use that.dependencies
andlayout
but read and parse theyaml
file instead:get_setpoints
get_layout
get_dependents
get_dependencies
get_paramspec
ParamSpec
as extensions are needed. One extension comes to mind:ParamSpec
arun_id
(preferably the global one) ~~@QCoDeS/core, let us see if this can work for us.