Skip to content
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

Improving readability of errors #39

Merged
merged 9 commits into from
Mar 19, 2024
Merged

Improving readability of errors #39

merged 9 commits into from
Mar 19, 2024

Conversation

joshua-hampton
Copy link
Collaborator

Started work on improving how errors are printed to display to aid understanding of errors from regex rules. For example, if a value is meant to (but does not) meet the regex rule "datetime", previously the error printed was

[global-attributes:******:time_coverage_start]*** Value '20230609' does not match regex rule: 'datetime'.

Now, an example of a valid value is also printed:

[global-attributes:******:time_coverage_start]*** Value '20230609' does not match regex rule: 'datetime' - Example valid value '2023-11-17T15:00:00'.

@joshua-hampton joshua-hampton marked this pull request as ready for review March 12, 2024 13:14
@joshua-hampton
Copy link
Collaborator Author

This is now ready to be merged. The above regex-rule examples have been filled out to all regex rules in rules.py-Rules-static_regex_rules, and additional quote marks have been added to some error messages around the values for easier reading and understanding, e.g.

Attribute 'long_name' must have definition Cloud Base Altitude (Geometric height above geoid WGS84), not Cloud Base Altitude (Geometric height above geoid (WGS84)).

would now print as

Attribute 'long_name' must have definition 'Cloud Base Altitude (Geometric height above geoid WGS84)', not 'Cloud Base Altitude (Geometric height above geoid (WGS84))'.

This will be particularly helpful when values end in punctuation, clarifying whether that punctuation is part of the value or the message.

@joshua-hampton joshua-hampton merged commit 47a9c61 into main Mar 19, 2024
5 checks passed
@joshua-hampton joshua-hampton deleted the better-errors branch April 24, 2024 11:41
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.

1 participant