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

Show all missing rows for require_data() #772

Merged

Conversation

danielhuppmann
Copy link
Member

@danielhuppmann danielhuppmann commented Aug 22, 2023

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 changes the returned dataframe of the require_data() method to not only show the failing scenarios (dataframe of model-scenario combinations), but a dataframe that has all missing combinations of elements.

So if model_a - scen_a does not have the variableEmissions|CO2 at the global level, the method will return the following:

model scenario region variable
model_a scen_a World Emissions|CO2

closes #768

@danielhuppmann danielhuppmann marked this pull request as ready for review August 22, 2023 04:36
@codecov
Copy link

codecov bot commented Aug 22, 2023

Codecov Report

Merging #772 (6755989) into main (9c947a8) will decrease coverage by 0.1%.
The diff coverage is 100.0%.

@@           Coverage Diff           @@
##            main    #772     +/-   ##
=======================================
- Coverage   94.4%   94.4%   -0.1%     
=======================================
  Files         62      62             
  Lines       6130    6132      +2     
=======================================
  Hits        5789    5789             
- Misses       341     343      +2     
Files Changed Coverage Δ
pyam/core.py 95.1% <100.0%> (-0.1%) ⬇️
tests/test_feature_validation.py 100.0% <100.0%> (ø)

... and 1 file with indirect coverage changes

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.

One small comment other than that looks good to me.
I've tried to wrap my head around require_data in its entirety but wasn't quite able to. As long as it's working though that's fine.

tests/test_feature_validation.py Show resolved Hide resolved
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.

Very nice, that should help a lot in finding missing data 👍.
Good to merge from my side.

@danielhuppmann danielhuppmann merged commit e70a0b7 into IAMconsortium:main Aug 22, 2023
17 checks passed
@danielhuppmann danielhuppmann deleted the validate/require-data-output branch August 22, 2023 10:02
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.

Support logical-and in require_data()
2 participants