-
Notifications
You must be signed in to change notification settings - Fork 321
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
Dev/move deps to interdependencies #1477
Dev/move deps to interdependencies #1477
Conversation
Simply using raise foo from bar does not yield an exception chain that pytest can catch (at least not using our standard chain inspection). Therefore, we raise, except, reraise. That works
…amHPNielsen/Qcodes into dev/move_deps_to_interdependencies
@QCoDeS/core, a question that this PR is now facing is: what does it take to uniquely determine a parameter in a run? Up until now, we have imposed in the I think it would be good if we could manage to use the same identifier everywhere, that is to say that we use whatever thing must be unique as the parameter identifier. Also, I feel that unique names are somewhat too restrictive. The name-label-unit combination being unique feels more natural? Now that the I realise that this is potentially a lot of effort for a rather small payoff, but I wonder if having and using some "formal" ID would not benefit us in the long run? I guess I can condense this stream of consciousness down to two questions:
|
ideally, "some ID" should identify a parameter within a run, where parameter is represented via ParamSpec which is just an bag with name,label,unit. IDs can be specific to the scope/context (one ID within sqlite, other ID within interdeps), or global -- i don't know yet what's the "good enough". Since going to something like this takes some effort and some db upgrades, i think it's definitely worth doing, but we can take small steps. So, just to suggest the first step: introduce IDs that are |
Codecov Report
@@ Coverage Diff @@
## master #1477 +/- ##
==========================================
+ Coverage 70.52% 71.23% +0.71%
==========================================
Files 103 103
Lines 11608 11994 +386
==========================================
+ Hits 8186 8544 +358
- Misses 3422 3450 +28 |
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.
Mainly some smallish suggestions from the first read through
qcodes/dataset/dependencies.py
Outdated
old_error, deps_error[1]) | ||
|
||
inffs_error = self.validate_paramspectree(inferences) | ||
if not inffs_error is None: |
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.
if not inffs_error is None: | |
if inffs_error is not None: |
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.
Yes.
The test suite error chain detection has been improved, so we can remove the clonky raise-catch-reraise from helper function
|
||
@pytest.mark.usefixtures("experiment") | ||
@pytest.mark.parametrize("storage_type", ['numeric', 'array']) | ||
def test_datasaver_arrays_of_different_length(storage_type): |
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.
Let's hammer this a bit with hypothesis.
Merge: 4f34fdd 1d9cfc3 Author: William H.P. Nielsen <[email protected]> Merge pull request #1477 from WilliamHPNielsen/dev/move_deps_to_interdependencies
This PR may replace #1438
The idea is to move all information about how parameters are related to each other into a new
InterDependencies
object and thus out of the theParamSpec
.Changes proposed in this pull request:
ParamSpec
only have four attributes: name, datatype, label, unitInterDependencies
take three input arguments: dependencies, inferences, and standalonesAll validation takes place upon instantiating an
InterDependencies
object, i.e. if it exists, it is valid.You can get an impression of how this will work by looking at the
ParamSpecBase
and theInterDependencies_
objects of this PR. If you like it, we can begin to discuss how to proceed with rolling this out, deprecating old things etc. I have a plan for that, but let's first decide whether we like this design.Open questions:
InterDependencies
object serialize itself? Do we need a DB upgrade?InterDependencies_
for how parameters may relate to each other the correct rules. I think they are, but I'd like your input on that.@QCoDeS/core
AB#2861