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

Reconfigure usage of technology modules in tools.costs #221

Merged
merged 13 commits into from
Oct 1, 2024

Conversation

measrainsey
Copy link
Contributor

@measrainsey measrainsey commented Aug 28, 2024

Change the implementation of technology modules (e.g., "energy", "materials") to be more agnostic to module name

In preparation of adding a module for cooling technologies, I have reconfigured the tools.costs code base to be more agnostic to the module name being specified.

The main changes are:

  • Remove the module name from the CSV file names (redundant since the folders are already the module name)
  • Incorporate first_year.csv into tech_map.csv to remove the necessity of the first_year.csv file
  • Transition to using an agnostic module name instead of materials when possible

Because the materials module still requires an additional Intratec dataset, there are still instances where the specific materials module needs to be explicitly mentioned.

This PR's branch is derived from the costs/new-inputs branch, which is under review in the PR #206. Once that PR is approved and merged, I will rebase this branch onto main.

How to review

For @khaeru and/or @glatterf42 : Read the diff and note that the CI checks all pass.

PR checklist

  • Continuous integration checks all ✅
  • Update doc/whatsnew.

@measrainsey measrainsey changed the base branch from main to costs/new-inputs August 28, 2024 15:23
@khaeru khaeru added the costs `.tools.costs`/cost data preparation label Aug 29, 2024
@measrainsey measrainsey force-pushed the costs/reconfig-modules branch 2 times, most recently from 670b91e to c879f8c Compare September 2, 2024 14:08
@measrainsey measrainsey marked this pull request as ready for review September 2, 2024 14:10
Copy link
Member

@glatterf42 glatterf42 left a comment

Choose a reason for hiding this comment

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

Looks good to me, approved assuming the tests pass after the announced rebase :)

doc/whatsnew.rst Outdated Show resolved Hide resolved
message_ix_models/tools/costs/regional_differentiation.py Outdated Show resolved Hide resolved
message_ix_models/tools/costs/regional_differentiation.py Outdated Show resolved Hide resolved
Rounding is causing issues when the base year cost is below 0.5 (such is the case for some cooling technologies). These values are rounded down to 0, which then causes NAs for cost projections.
In cases like these, make `reg_cost_ratio` = 1, so there is no regional differentiation (all costs the same across regions).
Copy link

codecov bot commented Oct 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.5%. Comparing base (4d8ec92) to head (df31a55).
Report is 14 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##            main    #221     +/-   ##
=======================================
- Coverage   66.5%   65.5%   -1.0%     
=======================================
  Files        204     204             
  Lines      15822   15823      +1     
=======================================
- Hits       10526   10379    -147     
- Misses      5296    5444    +148     
Files with missing lines Coverage Δ
message_ix_models/tools/costs/decay.py 100.0% <100.0%> (ø)
..._ix_models/tools/costs/regional_differentiation.py 97.9% <100.0%> (+<0.1%) ⬆️

... and 7 files with indirect coverage changes

@khaeru khaeru merged commit 971c211 into main Oct 1, 2024
26 checks passed
@khaeru khaeru deleted the costs/reconfig-modules branch October 1, 2024 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
costs `.tools.costs`/cost data preparation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants