Skip to content

Resolve "Validation of open enumerations does not search for @custom attribute"#669

Merged
lukaspie merged 10 commits intomasterfrom
666-bug-validation-of-open-enumerations-does-not-search-for-custom-attribute
Oct 4, 2025
Merged

Resolve "Validation of open enumerations does not search for @custom attribute"#669
lukaspie merged 10 commits intomasterfrom
666-bug-validation-of-open-enumerations-does-not-search-for-custom-attribute

Conversation

@lukaspie
Copy link
Collaborator

@lukaspie lukaspie commented Jul 21, 2025

Closes #666

Implementation is the following:

  • Logic for closed enums remains untouched.
  • For open enumerations where a value is used that does not match any of the enumeration items, the validator searches for @custom attribute (or @my_attribute_custom attribute for a a given attribute my_attribute).
  • If that attribute is correctly set to True, we just give an info message.
  • An warning level message is given if @custom is set to False.
  • For HDF5 validation: If the @custom attribute is missing, a warning is logged.
  • For template validation: If the @custom attribute is missing, we add it automatically to the template. As the produced file is then correct, we only log an info message (incl. the information that the attribute was added automatically).

Further changes:

  • In the testing framework, I extended the logic for ignoring lines within specific sections in the log comparison. Now the person writing the test can just set ignore_sections = {"FIELD (//Ag__002__VB/start_time)": ["DEBUG - value:"]} and this will also ignore the "DEBUG - value:" line in all sections that start with "FIELD (//Ag__002__VB/start_time). We need this as for fields the line is actually DEBUG - ===== FIELD (//Ag__002__VB/start_time): <HDF5 dataset "start_time": shape (), type "|O"> and I don't want people having to give the whole line including the dataset information.

@lukaspie lukaspie force-pushed the 666-bug-validation-of-open-enumerations-does-not-search-for-custom-attribute branch from 2f2d5a7 to 0a8d199 Compare August 8, 2025 13:42
@lukaspie lukaspie force-pushed the 666-bug-validation-of-open-enumerations-does-not-search-for-custom-attribute branch from 6a5d057 to 96c6f8c Compare September 29, 2025 16:31
@lukaspie lukaspie force-pushed the 666-bug-validation-of-open-enumerations-does-not-search-for-custom-attribute branch from da0bddf to 141979a Compare October 1, 2025 12:55
Copy link
Collaborator

@RubelMozumder RubelMozumder left a comment

Choose a reason for hiding this comment

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

I left a few questions.

Copy link
Collaborator

@RubelMozumder RubelMozumder left a comment

Choose a reason for hiding this comment

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

LGTM! I explained a unresolved comment further. You can take care of that if it makes sense to you.

@lukaspie lukaspie merged commit 28225e8 into master Oct 4, 2025
16 checks passed
@lukaspie lukaspie deleted the 666-bug-validation-of-open-enumerations-does-not-search-for-custom-attribute branch October 4, 2025 09:34
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.

[Bug]: Validation of open enumerations does not search for @custom attribute

3 participants