-
Notifications
You must be signed in to change notification settings - Fork 10
Add proper warning. #636
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
Add proper warning. #636
Conversation
743b84e
to
7324290
Compare
I ran the code with
Error:
|
7324290
to
724bc11
Compare
I am still not happy with the contents of this PR. IMO, a correct approach would be:
I have summarized my ideas in #638. Please have a look and see what you think @RubelMozumder @rettigl. |
|
To be clear, I think this should be a validation error (and should be logged as such), this should never be passed to the writer in the first place. Note that with the current approach in this PR, we are indeed not raising an error at all, but we still write the group
This basically just tells you that there already is a group called
Where exactly is it doing this? There is only this warning:
Yes, this is why we raise a validation error to indicate that this needs fixing. The question is: do we still want to write a correct file or not? IMO, it is fine to remove the key and write a file afterwards which is correct.
We can only keep concepts/data that are correctly matching with NeXus. Note that we have had logic to remove keys if they are not correct for a while now (see ada259b). I think it's totally fine to do that as long as you tell the user why you are doing it and giving a validation error that can be fixed. |
To be clear, my comment above is not necessarily negative with respect to what this PR is doing. We should just clearly discuss what we want to have and what the role of the individual parts (validator, writer, plugins) shall be. Only then we can implement a working solution. Would be more than happy to have further discussions on this. |
|
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:
And the conversion crashes with a value error. |
I did not overlook how the errror message is implemented here. Again, as I said multiple times, these are different problems that should result in different validation results! There are two issues:
Again, the first check shall come before the second. Then the second only comes up if you define a concept name of a group that does not match with that of a named group, but not across types. See the logic in #639.
We can still log messages of My preference would be in this order:
|
Handled in PR #638 |
PR #623 is readdressed here!
This PR writes log messages considering the following possible cases:
identifierNAME[identifier]
andCOLLECTION[identifier]
.Dissussion :
In case of a confined group and a field name
PR #638 is handling the issues noted here.