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 parsing of data-validation yaml files #366

Merged
merged 16 commits into from
Aug 12, 2024
Merged

Conversation

danielhuppmann
Copy link
Member

@danielhuppmann danielhuppmann commented Aug 12, 2024

This PR adds a class DataValidator, enables parsing the validation criteria from a yaml file and makes sure that the filter criteria are defined in a DataStructureDefinition (only if that dimension is defined there).

@danielhuppmann danielhuppmann marked this pull request as ready for review August 12, 2024 12:18
Copy link
Contributor

@phackstock phackstock left a comment

Choose a reason for hiding this comment

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

Two small comments in line but already good to merge.

tests/test_data_validation.py Outdated Show resolved Hide resolved
data_validator.validate_with_definition(dsd)

# validating against a DataStructure without the offending dimension passes
dsd = DataStructureDefinition(
Copy link
Contributor

Choose a reason for hiding this comment

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

You're already testing a compliant DataValidator above in test_DataValidator_from_file so I'd say you can remove those lines from the test and just test for the error.

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, the idea here was to test here that really only the dimensions are tested where a codelist exists in the DataStructureDefinition. Tried to explain that in the docstring, but not clear enough, I guess...

nomenclature/processor/iamc.py Show resolved Hide resolved
nomenclature/processor/iamc.py Outdated Show resolved Hide resolved
danielhuppmann and others added 2 commits August 12, 2024 15:20
Co-authored-by: Philip Hackstock <20710924+phackstock@users.noreply.github.com>
Co-authored-by: Philip Hackstock <20710924+phackstock@users.noreply.github.com>
@danielhuppmann danielhuppmann merged commit 9867535 into main Aug 12, 2024
12 checks passed
@danielhuppmann danielhuppmann deleted the feature/validate-data branch August 12, 2024 15:47
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