-
Notifications
You must be signed in to change notification settings - Fork 121
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
Regression in require behaviour #793
Comments
I assume that I did think through these changes a while back, but can't recollect my thoughts right now... But from a first-principles point of view, I do think that checking all items in a list is more intuitive than any for a "requirement". Question to me is what your use case is? Are you trying to ensure that at least one of "Waste" or "Other" is present? |
Me too
Trying to get this to behave iiasa/climate-assessment#47 @jkikstra wrote the code that uses this and I assume was trying to do a check for one or both of them being there, but I don't actually know (see this comment for the function which calls it iiasa/climate-assessment#47 (comment)) |
cc @phackstock |
Still not sure what the actual use case is from that comment, but I guess we could add a kwarg As for implementation, I guess if any data is present after applying the filters (=kwargs of |
Here's the line where it's used: https://github.com/iiasa/climate-assessment/blob/485f3d24fc646ad8d77c65ac5e787a27dc79db04/src/climate_assessment/checks.py#L788 Up to @jkikstra and @phackstock whether it's easier to add the feature back into pyam or just hack a workaround into climate-assessment |
No strong feelings from my side either way. I would say in the interest of time it's better to build a workaround in climate-assessment. |
require_data
is not a drop in replacement forrequire_variable
. This leads to a regression in behaviour with no easy fix for users.See script below for demonstration.
Script
Behaviour with pyam-iamc 2.0 and require_data
Behaviour with pyam-iamc 1.9 and require_variable
I think the basic difference is that
require_variable
did an OR requirement (any match was marked as a match).require_data
is an AND requirement (all requirements had to match in order to be marked as match).The text was updated successfully, but these errors were encountered: