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

Fix PRICE_EMISSION definition #912

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

glatterf42
Copy link
Member

@glatterf42 glatterf42 commented Jan 22, 2025

In preparation of the 3.10 release, @khaeru and I noticed that the original PR to fix PRICE_EMISSION (address #723) has become a little cluttered with discussions of how to create a proper test for the calculation update. Meanwhile, @volker-krey suggested that we should just bring the fix to main and open a follow-up issue to create the test later. Thus, this PR adds all changes from #726 that seem to be necessary to fix the calculation and make the tests pass as they are.

Caution

The error with the current calculation of PRICE_EMISSION went undetected so long because our tests were not stringent enough. Hence our initial insistence that #726 contain the exact kind of test to prevent the issue from coming up again. Such a test is missing from this PR on purpose, but that makes it incomplete in that sense. We need to maintain the sense of urgency that this test should be added as quickly as possible.
The only reason we are considering merging this without the test is because both @OFR-IIASA and @yiyi1991 manually confirmed that this fix works on sufficiently complex scenarios.

How to review

  • Read the diff and note that the CI checks all pass.
  • Ensure that changes/additions are self-documenting, i.e. that another
    developer (someone like the reviewer) will be able to understand what the code
    does in the future.
  • If you know of further places in our docs where the PRICE_EMISSION calculation is explained and needs updating, please share that.

PR checklist

  • Continuous integration checks all ✅
  • Add or expand tests; coverage checks both ✅
  • Add, expand, or update documentation.
  • Update release notes.

@glatterf42 glatterf42 added bug Doesn't work as advertised/unintended effects safe to test labels Jan 22, 2025
@glatterf42 glatterf42 added this to the 3.10 milestone Jan 22, 2025
Copy link

codecov bot commented Jan 22, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 10 lines in your changes missing coverage. Please review.

Project coverage is 94.6%. Comparing base (e0f2e02) to head (8de6e41).

Files with missing lines Patch % Lines
message_ix/tests/test_feature_price_emission.py 64.2% 10 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main    #912      +/-   ##
========================================
+ Coverage   24.0%   94.6%   +70.5%     
========================================
  Files         48      48              
  Lines       4394    4456      +62     
========================================
+ Hits        1057    4216    +3159     
+ Misses      3337     240    -3097     
Files with missing lines Coverage Δ
message_ix/models.py 99.0% <ø> (+14.5%) ⬆️
message_ix/tests/test_report.py 100.0% <100.0%> (+79.6%) ⬆️
message_ix/tests/test_tutorials.py 97.6% <ø> (ø)
message_ix/tests/test_feature_price_emission.py 72.6% <64.2%> (+61.9%) ⬆️

... and 42 files with indirect coverage changes

@glatterf42 glatterf42 self-assigned this Jan 22, 2025
@glatterf42 glatterf42 requested a review from khaeru January 22, 2025 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Doesn't work as advertised/unintended effects safe to test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant