Skip to content

Conversation

@rayosborn
Copy link
Contributor

  • Moves code that check for valid values forminOccurs, maxOccurs, optional, and recommended to a separate function.
  • Adds checks on the optional and recommended attributes to the FieldValidator.
  • Outputs dimension warnings as informational messages, since their specfications in NXDL files contain a number of anomalies.
  • Reduces the deprecated use of signal and axis attributes in NXfields to a warning.

The specification of dimensions in the NXDL files contains some serious anomalies, which generate unnecessary warnings. They may now be viewed in the informational messages but not listed as warnings.
These are still strongly deprecated.
@rayosborn rayosborn merged commit 37b1de8 into nexpy:main Dec 13, 2025
15 checks passed
@rayosborn rayosborn deleted the check-occurrences branch December 13, 2025 23:27
@rayosborn
Copy link
Contributor Author

rayosborn commented Dec 13, 2025

@takluyver, I have refactored the code that was included in your PR #247, because your fix was also useful in fixing the FieldValidator as well as the ApplicationValidator. The new version has now been merged into the main branch. If the new code no longer fixes your original issue, please let me know. If there are no problems, I will try to release this as a bug release in the next week.

@takluyver
Copy link
Contributor

Thanks! I've given it a quick try and it seems to still do what I'm expecting. 👍

Demoting the dimension-related messages to INFO also hides the issue I had in #248. I hope you can get the issues with the spec worked out, though.

Copy link
Contributor Author

@rayosborn rayosborn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for confirming. I think that the way that dimensions are defined within the NeXus standard will require a lot more thought. Many of the definitions in the base classes are far too restrictive and/or inconsistent with common usage, and fixing them to work with rigorous validation tools won't be trivial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants