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

Refactor IIASA-connection-API and rework all related tests #413

Merged
merged 24 commits into from
Jul 8, 2020

Conversation

danielhuppmann
Copy link
Member

@danielhuppmann danielhuppmann commented Jul 6, 2020

Please confirm that this PR has done the following:

  • Tests Added
  • Documentation Added
  • Description in RELEASE_NOTES.md Added

Description of PR

This PR harmonizes the behavior of the iiasa.Connection class functions, prepares for a refactoring of the IIASA-backend API, and reworks the tests to use a dedicated test database instance (making the tests more precise by comparing full IamDataFrame instance rather than just length of returned objects).

Changes In detail:

pyam/iiasa.py Outdated Show resolved Hide resolved
pyam/iiasa.py Outdated Show resolved Hide resolved
tests/conftest.py Outdated Show resolved Hide resolved
tests/test_iiasa.py Outdated Show resolved Hide resolved
tests/test_iiasa.py Outdated Show resolved Hide resolved
tests/test_iiasa.py Show resolved Hide resolved
tests/test_iiasa.py Show resolved Hide resolved
tests/test_iiasa.py Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jul 6, 2020

Codecov Report

Merging #413 into master will increase coverage by 0.10%.
The diff coverage is 92.07%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #413      +/-   ##
==========================================
+ Coverage   93.26%   93.37%   +0.10%     
==========================================
  Files          35       35              
  Lines        4129     4149      +20     
==========================================
+ Hits         3851     3874      +23     
+ Misses        278      275       -3     
Impacted Files Coverage Δ
pyam/iiasa.py 88.12% <91.30%> (-0.24%) ⬇️
tests/test_iiasa.py 91.66% <92.04%> (+4.37%) ⬆️
pyam/testing.py 75.00% <100.00%> (ø)
tests/conftest.py 97.33% <100.00%> (+0.23%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 911dcd4...6253c79. Read the comment docs.

@danielhuppmann
Copy link
Member Author

@stickler-ci is incorrectly reporting linting errors (they have been fixed)

@danielhuppmann
Copy link
Member Author

@znicholls @byersiiasa @Rlamboll @gidden, FYI - this PR will make the integration with the IIASA-database-API more stable (because of more and more explicit tests), but it also adds one important change: the functions read_iiasa() and query() directly return an IamDataFrame. Other functions are marked as deprecated (including a log message), but will continue to work for at least one more release.

Apologies for the inconvenience, but I didn't find a practical way to avoid the immediate pain on the return type. Please ping any users that you know to be using this feature.

Copy link
Collaborator

@znicholls znicholls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found one typo, otherwise my quick glance didn't see anything obviously problematic. Thanks for the heads up @danielhuppmann !!

doc/source/tutorials/iiasa_dbs.ipynb Outdated Show resolved Hide resolved
Co-authored-by: Zeb Nicholls <zebedee.nicholls@climate-energy-college.org>
@danielhuppmann danielhuppmann merged commit 7f1a0e8 into IAMconsortium:master Jul 8, 2020
@danielhuppmann danielhuppmann deleted the iiasa/api branch July 8, 2020 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants