iiasa / message_ix

The integrated assessment and energy systems model MESSAGEix
https://docs.messageix.org
Apache License 2.0
122 stars 154 forks source link

Add `.models.shift_period()` #873

Open khaeru opened 3 months ago

khaeru commented 3 months ago

This PR adds a function shift_period() that implements, purely in Python, the behaviour of Scenario.clone(…, shift_first_model_year). Because the latter is currently implemented in the Java code underlying ixmp.JDBCBackend, it cannot be extended in parallel with changes to the implementation of MESSAGE in GAMS (or, in the future, other implementations).

More to be added

How to review

To be added

PR checklist

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.6%. Comparing base (175d64d) to head (fea126e).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #873 +/- ## ===================================== Coverage 95.6% 95.6% ===================================== Files 46 46 Lines 4344 4365 +21 ===================================== + Hits 4154 4175 +21 Misses 190 190 ``` | [Files](https://app.codecov.io/gh/iiasa/message_ix/pull/873?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.py](https://app.codecov.io/gh/iiasa/message_ix/pull/873?src=pr&el=tree&filepath=message_ix%2Fmodels.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=iiasa#diff-bWVzc2FnZV9peC9tb2RlbHMucHk=) | `99.1% <100.0%> (+<0.1%)` | :arrow_up: | | [message\_ix/tests/test\_models.py](https://app.codecov.io/gh/iiasa/message_ix/pull/873?src=pr&el=tree&filepath=message_ix%2Ftests%2Ftest_models.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=iiasa#diff-bWVzc2FnZV9peC90ZXN0cy90ZXN0X21vZGVscy5weQ==) | `100.0% <100.0%> (ø)` | |