-
Notifications
You must be signed in to change notification settings - Fork 6
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 iamc filter for tabulate/ list runs #54
Conversation
@danielhuppmann please take a look on whether this is sufficient for the needs for filtering runs on IAMC data that you perceived (for ixmp4-ts it is sufficient). |
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.
Thanks, looks good to me :)
@meksor might want to take a look as well.
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.
looks good!
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.
Thanks for adding this additional filter (I had thought that this was already implemented)...
One clarifying question: this filter will only return items where a datapoint exists? (not just a measurand linked to the run)
See a possible extension inline.
) | ||
|
||
assert sorted(res["model"].tolist()) == ["Model 2"] | ||
assert sorted(res["scenario"].tolist()) == ["Scenario 2"] |
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.
Suggest to extend the test in the following way:
- Remove all datapoints for the run Model 1, Scenario 1 related to Region 3
- Repeat the assertion form above
res = test_mp.runs.tabulate( default_only=False, iamc={ "region": {"name": "Region 3"}, }, )
- This should now only return Model 2, Scenario 2
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.
@danielhuppmann thanks for raising this. I added a test as you proposed and only runs with existing datapoints are returned 👍
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.
Thanks, looks good to me!
Added
iamc
filter similar tomp.backend.models.tabulate
andmp.backend.scenarios.tabulate
tomp.runs.tabulate
(all applies to.list
methods as well).Why was this added?
To be able to filter runs by whether they have
IAMC
data associated with certain properties, e.g. get all runs that haveIAMC
data for theCumulative Emissions|CO2
variable or theWorld
region.usage: