Skip to content

Bug fix for XML schema 2.0: require valid Fortran IDs for schemes, groups, and suites#730

Merged
climbfuji merged 9 commits into
NCAR:developfrom
climbfuji:bugfix/valid_fortran_id_for_scheme_group_suite_names
Apr 14, 2026
Merged

Bug fix for XML schema 2.0: require valid Fortran IDs for schemes, groups, and suites#730
climbfuji merged 9 commits into
NCAR:developfrom
climbfuji:bugfix/valid_fortran_id_for_scheme_group_suite_names

Conversation

@climbfuji

@climbfuji climbfuji commented Mar 30, 2026

Copy link
Copy Markdown
Collaborator

Bug fix for XML schema 2.0: require valid Fortran IDs for schemes, groups, and suites

This PR introduces fortran_id_type_unique in schema/suite_v2.0.xsd and requires either fortran_id_type_unique or the existing fortran_id_type for scheme, group, and suite names depending on the context. For nested suite elements, duplicates are allowed, what matters is that the final suite -- after recursive substitution of the nested suite constructs -- contains no duplicates. The PR also adds unit tests for catching invalid Fortran IDs.

User interface changes? No: Scheme, group and suite names that weren't Fortran IDs were never allowed. Without this PR, they would lead to compilation errors for the auto-generated caps.

Fixes #723

Testing: all pass
test removed: n/a
unit tests: added unit tests to check for valid Fortran identifiers for schemes, groups, and suites
system tests:
manual testing:

@climbfuji climbfuji force-pushed the bugfix/valid_fortran_id_for_scheme_group_suite_names branch from b3e41ef to 9b7dbff Compare March 30, 2026 14:43
@climbfuji climbfuji changed the title Bug fix for XML schema 2.0: require valid Fortran IDs for schemes, groups, and suites; fix doctests in parse_object.py and parse_source.py" Bug fix for XML schema 2.0: require valid Fortran IDs for schemes, groups, and suites Mar 30, 2026
@climbfuji climbfuji self-assigned this Mar 30, 2026
@climbfuji climbfuji marked this pull request as ready for review March 30, 2026 14:54
@climbfuji climbfuji requested review from a team and gold2718 as code owners March 30, 2026 14:54

@mkavulich mkavulich left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, thanks for this fix!

@peverwhee peverwhee left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

one question!

Comment thread schema/suite_v2_0.xsd Outdated
Comment thread schema/suite_v2_0.xsd Outdated

@peverwhee peverwhee left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

thanks @climbfuji !

@climbfuji

Copy link
Copy Markdown
Collaborator Author

@gold2718 This is also ready for your review

@gold2718 gold2718 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I have one question and a suggestion / request to use more explanatory filenames for testing.

Comment thread schema/suite_v2_0.xsd Outdated
Comment thread test/unit_tests/test_sdf.py Outdated
Comment thread test/unit_tests/test_sdf.py
@climbfuji climbfuji requested a review from gold2718 April 14, 2026 13:30

@gold2718 gold2718 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There is a(n optional) typo fix but otherwise, this looks okay.

Comment thread test/unit_tests/test_sdf.py Outdated
exc_strings = [
"The value 'scheme-1' is not accepted by the pattern '[A-Za-z][A-Za-z0-9_]{0,63}",
"The value 'group-1' is not accepted by the pattern '[A-Za-z][A-Za-z0-9_]{0,63}",
"he value 'ver-test-suite' is not accepted by the pattern '[A-Za-z][A-Za-z0-9_]{0,63}",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Just noticed the typo here. he test is still valid but it roubles the soul.

Comment thread test/unit_tests/test_sdf.py Outdated
@climbfuji

Copy link
Copy Markdown
Collaborator Author

@mkavulich This can now be merged

@climbfuji climbfuji merged commit 6d8c4e3 into NCAR:develop Apr 14, 2026
15 checks passed
@climbfuji climbfuji deleted the bugfix/valid_fortran_id_for_scheme_group_suite_names branch April 14, 2026 22:02
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.

Dashes in suite names are causing failures

5 participants