-
Notifications
You must be signed in to change notification settings - Fork 4
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
Detect cycles in depends_on #254
Conversation
|
||
root = make_group(h5root) | ||
with pytest.raises(ValueError, match="Circular depends_on"): | ||
_ = root[()] |
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.
Thanks.
Did you try loading a NMX file from coda to check that the error is raised?
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 did now and it does find a cycle:
'/entry/instrument/detector_panel_0/transformations/orientation',
'/entry/instrument/detector_panel_0/transformations/axis6',
'/entry/instrument/detector_panel_0/transformations/axis5',
'/entry/instrument/detector_panel_0/transformations/axis4',
'/entry/instrument/detector_panel_0/transformations/axis3',
'/entry/instrument/detector_panel_0/transformations/axis2',
'/entry/instrument/detector_panel_0/transformations/axis1'
'/entry/instrument/detector_panel_0/transformations/stageZ'
'/entry/instrument/detector_panel_0/transformations/orientation'
Can you explain why you think this is a good approach? I thought it would be easy to misjudge a typo for a chain-end, i.e., say But maybe I misunderstood what you meant? |
This is what I meant. I don't have a strong opinion on this. But I figured that since we treat |
I guess close to 100% of the code or config files used to write files is written by hand. I am not sure what you are saying. I think self-loops are just as bad as other loops? |
We have integration tests with broken files that have circular
depends_on
graphs. ScippNeXus currently runs in an infinite loop in those cases.This PR adds
depends_on
chains are detected and lead toValueError
s.depends_on
are treated asdepends_on == '.'
. While this does not comply with the standard, I see no reason not to do this.