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

Implement explicit API for categorize() #837

Merged
merged 13 commits into from Mar 15, 2024

Conversation

danielhuppmann
Copy link
Member

@danielhuppmann danielhuppmann commented Mar 14, 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 implements the explicit signature for categorize() and marks the existing signature and the top-level function as deprecated (to be removed for release 3.0) similar to #804 for the validate() method.

For explanation: the rationale for the top-level function pyam.categorize(df) made sense only because it allowed to apply filters by other dimensions (model, scenario, region, unit) in addition to the criteria based on variable and years. The new signature allows to directly slice-and-validate on any dimension.

@danielhuppmann danielhuppmann self-assigned this Mar 14, 2024
Copy link

codecov bot commented Mar 14, 2024

Codecov Report

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

Project coverage is 95.0%. Comparing base (ddbb88e) to head (595be43).
Report is 5 commits behind head on main.

❗ Current head 595be43 differs from pull request most recent head b234348. Consider uploading reports for the commit b234348 to get more accurate results

Files Patch % Lines
pyam/core.py 88.8% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main    #837   +/-   ##
=====================================
  Coverage   95.0%   95.0%           
=====================================
  Files         64      63    -1     
  Lines       6134    6134           
=====================================
+ Hits        5828    5831    +3     
+ Misses       306     303    -3     

☔ 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 14, 2024 19:57
@gidden
Copy link
Member

gidden commented Mar 15, 2024

As noted in #819, the feature was implemented as described. I'm indifferent whether this gets merged or the other.

@gidden
Copy link
Member

gidden commented Mar 15, 2024

LGTM, thanks @danielhuppmann also for adding some tests =)

@gidden gidden merged commit 90f7073 into IAMconsortium:main Mar 15, 2024
12 checks passed
@danielhuppmann
Copy link
Member Author

Learned from the best about being careful of having complete documentation and good test coverage... And I didn't want to be all nitpicky about your PR.

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.

None yet

2 participants