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

Allow passing filters when reading from an ixmp4 platform #838

Merged
merged 15 commits into from
Mar 21, 2024

Conversation

danielhuppmann
Copy link
Member

@danielhuppmann danielhuppmann commented Mar 18, 2024

Please confirm that this PR has done the following:

  • Tests Added
  • Documentation Added
  • Name of contributors Added to AUTHORS.rst
  • Description in RELEASE_NOTES.md Added

Description of PR

This PR allows passing filters when reading from an ixmp4 platform and it extends read_iiasa() to first try reading from ixmp4 platforms hosted by IIASA.

@danielhuppmann danielhuppmann self-assigned this Mar 18, 2024
@danielhuppmann danielhuppmann changed the title Ixmp4/filters Allow passing filters when reading from an ixmp4 platform Mar 18, 2024
Copy link

codecov bot commented Mar 20, 2024

Codecov Report

Attention: Patch coverage is 85.18519% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 95.0%. Comparing base (ddbb88e) to head (7bfe5d8).
Report is 6 commits behind head on main.

Files Patch % Lines
pyam/iiasa.py 66.6% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main    #838     +/-   ##
=======================================
- Coverage   95.0%   95.0%   -0.1%     
=======================================
  Files         64      63      -1     
  Lines       6134    6150     +16     
=======================================
+ Hits        5828    5843     +15     
- Misses       306     307      +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@danielhuppmann danielhuppmann marked this pull request as ready for review March 20, 2024 08:14
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.

Looks good to me overall.
Some minor comments in line.

pyam/iiasa.py Outdated Show resolved Hide resolved
pyam/iiasa.py Outdated Show resolved Hide resolved
pyam/iiasa.py Outdated Show resolved Hide resolved
pyam/ixmp4.py Show resolved Hide resolved
pyam/ixmp4.py Show resolved Hide resolved
tests/test_ixmp4.py Outdated Show resolved Hide resolved
pyam/iiasa.py Outdated Show resolved Hide resolved
pyam/iiasa.py Show resolved Hide resolved
pyam/iiasa.py Show resolved Hide resolved
Co-authored-by: Philip Hackstock <20710924+phackstock@users.noreply.github.com>
@danielhuppmann
Copy link
Member Author

Responding here to a larger comment by @phackstock in the review: this PR only touches the pyam.read_iiasa() method, and if there are ixmp databases and ixmp4 platforms with the same name, the default is now using ixmp4.

But a user will still have the possibility to make that selection explicitly either using:

df_ixmp = pyam.iiasa.Connection(name).query(**filters)
df_ixmp4 = pyam.read_ixmp4(name, **filters)

It is our responsibility to keep potential overlaps of "database existence" to a minimum and keep the actual data consistent between new and legacy instances.

@phackstock
Copy link
Contributor

@danielhuppmann sounds good to me.

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.

Good to be merged from my side

@danielhuppmann danielhuppmann merged commit d911120 into IAMconsortium:main Mar 21, 2024
14 checks passed
@danielhuppmann danielhuppmann deleted the ixmp4/filters branch March 21, 2024 09:14
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