-
Notifications
You must be signed in to change notification settings - Fork 10
add a 8000 separate error for names with wrong type and remove such keys #638
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
Conversation
One problem that we have here (but also in #636) is if there is a link in the template. Then the key is e.g. |
9c26dbe
to
241570a
Compare
241570a
to
0900383
Compare
0900383
to
1a88532
Compare
If I add
I get:
The validation does not pick up that I try to write a group with a name that is defined as field.
If I have the conflicting field also in the dict, I get:
But the conversion works. |
Comparing the behavior of #636 and this PR, I would prefer the functionality here. But the reported warnings/consistency can still be improved (i.e. what exactly is being removed, element types etc.). |
Link checking does not seem to work properly yet. If I add a link
I don't get a warning, even though I linked a group to a defined field name.
, i get:
|
Yeah, this is expected behavior as we don't really follow links currently. The only thing that I implemented w.r.t. links in this PR is that it picks up that if there is a link, the type you expect to write can be either group or field. Like, if we have To actually follow the link and apply all the same checks as for regular fields is something I would implement in a separate PR. |
I don't understand that. If we want to have a semantically valid file, we should not allow to link a group to a name which is defined as a field (as in my example). |
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.
Mostly lgtm and seems to do what it should, apart from a few comments
Not sure why the tests fail, though |
Co-authored-by: Laurenz Rettig <53396064+rettigl@users.noreply.github.com>
I think at least for pynxtools-mpes/igor this is related to #641 and FAIRmat-NFDI/pynxtools-mpes#52. |
Co-authored-by: Laurenz Rettig <53396064+rettigl@users.noreply.github.com>
Indeed this seems to work with merged #641: FAIRmat-NFDI/pynxtools-igor#8 |
Test from |
Yes, that's true. I think if you want to use a |
@RubelMozumder we now see a bunch of errors and warnings for pynxtools-spm and pynxtools-xrd because we levelled up some of the previous warnings to errors, see |
The logic for attributes with missing fields in the nexus tree still seems to be broken to some extend. If I add (in NXelectron_detector):
I get:
The missing attribute error comes twice, which is not expected. |
Yeah, this occured now because we only remove all collected keys in the end now. For this example, it was special because it is in NXdata and since we do not have signal/axes defined here, we never proceeded to the attributes for axisnames defined in the appdef. So we never removed it from the non-visited list. I have just implemented it such that in the |
The idea is to catch the following situation: a field/group is given that has a name that another group/field at the same level has (and which is therefore reserved).
Approach: