IAMconsortium / pyam

Analysis & visualization of energy & climate scenarios
https://pyam-iamc.readthedocs.io/
Apache License 2.0
227 stars 118 forks source link

Allow passing filters when reading from an ixmp4 platform #838

Closed danielhuppmann closed 6 months ago

danielhuppmann commented 6 months ago

Please confirm that this PR has done the following:

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.

codecov[bot] commented 6 months ago

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 :warning:
Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

danielhuppmann commented 6 months ago

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 commented 6 months ago

@danielhuppmann sounds good to me.