iiasa / message-ix-models

Tools for the MESSAGEix-GLOBIOM family of models
https://docs.messageix.org/models
Apache License 2.0
16 stars 31 forks source link

Create option in `tools.costs` to keep fixed O&M costs same across vintages #195

Open measrainsey opened 1 month ago

measrainsey commented 1 month ago

Add option in costs model (use_vintages) which affect how fixed O&M costs are projected

Currently, fixed O&M costs (fix_cost) are projected in this way: for a certain year_vtg, the fix_cost is a percentage of investment cost (inv_cost). Then from the year_vtg to the end of the modeling horizon, the fixed O&M cost changes by a rate specified by fom_rate (as of present, the default fom_rate is 0, so there is no change).

However, this does not match with the current implementation in MESSAGEix. To match the MESSAGEix implementation, the fix_cost in a certain year_act should be the same across all year_vtg. As such, I've added an option to specify use_vintage. If True then the first projection method for fix_cost is used. If False (which is the default setting now), then fix_cost is calculated for each year_act instead as a percentage of the inv_cost in that year.

Here is a figure showing the difference (Previous refers to use_vintages=True and Updated refers to use_vintages=False) using solar_pv_ppl as an example.

solar-fom-vintages

How to review

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

PR checklist

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 52.1%. Comparing base (dad8f8a) to head (2d29f05).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #195 +/- ## ===================================== Coverage 52.1% 52.1% ===================================== Files 141 141 Lines 11338 11342 +4 ===================================== + Hits 5917 5920 +3 - Misses 5421 5422 +1 ``` | [Files](https://app.codecov.io/gh/iiasa/message-ix-models/pull/195?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=iiasa) | Coverage Δ | | |---|---|---| | [message\_ix\_models/tools/costs/config.py](https://app.codecov.io/gh/iiasa/message-ix-models/pull/195?src=pr&el=tree&filepath=message_ix_models%2Ftools%2Fcosts%2Fconfig.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=iiasa#diff-bWVzc2FnZV9peF9tb2RlbHMvdG9vbHMvY29zdHMvY29uZmlnLnB5) | `97.2% <100.0%> (+<0.1%)` | :arrow_up: | | [message\_ix\_models/tools/costs/demo.py](https://app.codecov.io/gh/iiasa/message-ix-models/pull/195?src=pr&el=tree&filepath=message_ix_models%2Ftools%2Fcosts%2Fdemo.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=iiasa#diff-bWVzc2FnZV9peF9tb2RlbHMvdG9vbHMvY29zdHMvZGVtby5weQ==) | `0.0% <ø> (ø)` | | | [message\_ix\_models/tools/costs/projections.py](https://app.codecov.io/gh/iiasa/message-ix-models/pull/195?src=pr&el=tree&filepath=message_ix_models%2Ftools%2Fcosts%2Fprojections.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=iiasa#diff-bWVzc2FnZV9peF9tb2RlbHMvdG9vbHMvY29zdHMvcHJvamVjdGlvbnMucHk=) | `84.2% <75.0%> (-0.6%)` | :arrow_down: |
khaeru commented 2 hours ago

A minor request: can we please use nested lists rather than a sub-heading in doc/whatsnew? See for example https://github.com/iiasa/message-ix-models/blob/dad8f8a5cbdacb85ae8881e267982dad944b8c70/doc/whatsnew.rst?plain=1#L113-L127

Generally we reserve use of sub-headings to separate "All changes" from an occasional section "Migration notes" when we need to give clear instructions to users on how to adapt to changed code.