fix: calculate investment cost for nuclear generators#391
fix: calculate investment cost for nuclear generators#391danielolsen merged 3 commits intodevelopfrom
Conversation
| + 135e3 * 10 * 2 * calculate_inflation(2020) | ||
| ) | ||
| dc_cost = _calculate_dc_inv_costs(mock_grid) | ||
| assert dc_cost == pytest.approx(expected_dc_cost) |
There was a problem hiding this comment.
There are no changes here. Just reorganizing the lines, correct?
| "LTRG1", # Single tech for wind | ||
| "4Hr Battery Storage", # Single tech for storage | ||
| "Seattle", # Single tech for solar | ||
| "*", # Single tech for nuclear |
There was a problem hiding this comment.
That is a pretty bad choice for accessing nuclear information.
There was a problem hiding this comment.
To be clear, this is not wildcard matching. The CSV file literally has an entry *.
There was a problem hiding this comment.
Yeah, it is terrible. I guess there is a documentation but anything else could be more explanatory.
There was a problem hiding this comment.
There is definitely room for improvement. Currently, we're somewhat-arbitrarily selecting one TechDetail to consider for each technology, hard-coded. It would be nice to give the user more flexibility to select different ones, when they are available, or maybe even to define their own.
Purpose
Allow investment costs to be calculated for nuclear generators.
What the code is doing
The functional change is in const.py: the set
gen_inv_cost_techdetails_to_keepdefines the only entries to keep from the NREL ATB data, and none of the existing ones cover nuclear. The category"*"covers nuclear and nuclear only, so there should be no side effects.The changes in test_investment_costs.py are primarily to create a test for nuclear (the changes to
mock_plantandtest_calculate_gen_inv_costs_2030), and secondarily to clean up the code to make it a bit more readable.Testing
The first commit adds the test, which will fail. The second commit implements the fix and the tests pass.
Time estimate
5 minutes.