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

Add dimensions option to CLI validate-scenarios #421

Merged
merged 5 commits into from
Oct 31, 2024

Conversation

dc-almeida
Copy link
Collaborator

@dc-almeida dc-almeida commented Oct 31, 2024

Contributes to #404
Adds a --dimensions option to the validate-scenarios command and sets this variable as described here.
The additional test for implicit dimension setting is separate from original tests to preserve slightly cleaner code because of a technical detail on how the dimensions variable is set by the test CLI runner ((None,)/('',) instead of ()).

Test harmonisation between validate-project and validate-scenarios will come in upcoming PR to ensure the tests: 1) check exit code, 2) check type of exception, 3) check error message.
Setting dimensions according to nomenclature.yaml is done in the CLI function(s) to override DataStructureDefinition's standard order of explicit dimensions -> nomenclature.yaml -> default to ["region", "variable"]. In this way, if nomenclature.yaml does not set dimensions (= None), it checks definitions subfolders (as previously implemented and now updated for validate-project)

@dc-almeida dc-almeida self-assigned this Oct 31, 2024
@dc-almeida dc-almeida marked this pull request as ready for review October 31, 2024 13:12
@dc-almeida dc-almeida added the enhancement New feature or request label Oct 31, 2024
Copy link
Member

@danielhuppmann danielhuppmann left a comment

Choose a reason for hiding this comment

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

Looks good and works, but a few suggestions inline.

tests/data/cli/structure_validation/nomenclature.yaml Outdated Show resolved Hide resolved
nomenclature/testing.py Outdated Show resolved Hide resolved
tests/test_cli.py Outdated Show resolved Hide resolved
tests/test_cli.py Outdated Show resolved Hide resolved
Copy link
Member

@danielhuppmann danielhuppmann left a comment

Choose a reason for hiding this comment

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

Nice, thank you!

@dc-almeida dc-almeida merged commit 4667a27 into IAMconsortium:main Oct 31, 2024
11 checks passed
@dc-almeida dc-almeida deleted the cli-validate-scenarios branch November 4, 2024 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants