-
Notifications
You must be signed in to change notification settings - Fork 120
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
Extend the validate()
signature
#804
Extend the validate()
signature
#804
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #804 +/- ##
=====================================
Coverage 94.7% 94.7%
=====================================
Files 62 62
Lines 6012 6058 +46
=====================================
+ Hits 5696 5741 +45
- Misses 316 317 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments, but in principle already good to merge from my side.
pdt.assert_frame_equal(obs, test_df.data[5:6].reset_index(drop=True)) | ||
assert list(test_df.exclude) == [False, True] | ||
|
||
|
||
def test_validate_multiple_criteria(test_df): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could assert here in addition that the deprecation warning is issued.
"Use `upper`, `lower`, and filter-arguments instead.", "Argument `criteria`" | ||
) | ||
if upper or lower is not None and not kwargs.empty: | ||
raise NotImplementedError( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems that Codecov and I came to the same conclusion here :D
Thanks @phackstock - implemented your suggestion for |
Please confirm that this PR has done the following:
Name of contributors Added to AUTHORS.rstDescription of PR
This PR extends the signature of the
validate()
method to take filter-arguments directly instead of using a (nested) dictionary, socan now be called as
This allows to validate only a selection of the datapoints, e.g., filtered by region or model/scenario name. The signature can also more easily be called from a (to-be-implemented) processor in the nomenclature package.
The option to use nested dicts is marked as deprecated with release 3.0.