-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add functionality in tools.costs
to specify cost reduction scenarios and values
#255
Merged
Merged
Changes from 10 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
f08dfa0
Add functionality to customize cost reduction rates within modules
measrainsey 94684eb
Add test data for customizing cost reductions in materials module
measrainsey 6cc856c
Remove test for get_cost_reduction_data() because function has been r…
measrainsey 0e3ba63
Remove pytest parameterization for test_get_cost_reduction_data()
measrainsey 349c8ee
Edit to pass linting
measrainsey cce5071
Add `else` statement for non-energy modules without custom files
measrainsey 45381dd
Modify if-else statements for reading in custom files
measrainsey 89f7b3d
Fix check for if files exist
measrainsey 9d33ffc
Add docstrings for new functions
measrainsey 68a1d3b
Add PR #255 to doc/whatsnew
measrainsey 5fe759e
Add type hints
measrainsey 7945323
Add tests for `_get_module_cost_reduction()` and `_get_module_scenari…
measrainsey 80a530d
Remove dummy data for materials module
measrainsey 8ed0523
Change type hint for `module` from string to Literal
measrainsey 5993c55
Add type hints for technology sets
measrainsey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Cost reduction in 2100,,,,,, | ||
# ,,,,,, | ||
# Units: % ,,,,,, | ||
message_technology,technology_type,very_low,low,medium,high,very_high | ||
furnace_coal_cement,Materials,0.23,0.24,0.25,0.26,0.27 | ||
gas_ct,Gas/Oil,0.99,0.99,0.99,0.99,0.99 | ||
bio_hpl,Materials,0.77,0.77,0.77,0.77,0.77 |
5 changes: 5 additions & 0 deletions
5
message_ix_models/data/costs/materials/scenarios_reduction.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
message_technology,SSP1,SSP2,SSP3,SSP4,SSP5,LED | ||
furnace_coal_cement,low,low,low,low,low,low | ||
manuf_steel,medium,medium,medium,medium,medium,medium | ||
hp_elec_refining,high,high,high,high,high,high | ||
bio_hpl,very_low,very_low,very_low,very_low,very_low,very_low |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somewhat strange to remove tests, but we seem to cover all lines touched by the PR even without it. Is there truly no need for this unit test any longer?
Even if this function is only ever called by another function, a unit test runs faster than the whole exterior function and grants confidence when debugging the code that this particular part still works or pinpoints the failure.
If it's not too much work, I think I'd like to see the test adjusted rather than removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the test for
get_cost_reduction_data()
because the function was completely removed/replaced, but I now added new tests for the two new functions:_get_module_scenarios_reduction()
and_get_module_cost_reduction()