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).
Partly addresses #254.
Also due to limitations of ixmp.JDBCBackend, is it not supported to set values on model data items of type "variable" or "equation" directly. Thus, this PR can't be completed without iiasa/ixmp#516, iiasa/ixmp#400, or similar.
cf. also iiasa/ixmp#424. While the behaviour is currently provided as an argument to the clone() command, the new function is distinct.
This PR does not directly address, but will make it much easier to address:
542
543
867
The operation of shifting the first model period forward in time is lossy, because parameters like historical_activity have fewer dimensions than the corresponding variables (e.g. ACT). For the opposite operation—shifting the first model period backwards in time—essentially the scenario must be solved again to generate the corresponding solution data in e.g. ACT.
More to be added
How to review
To be added
PR checklist
[ ] Complete the implementation
[ ] Invoke shift_period() from message_ix.Scenario.clone(…) if the corresponding argument is given.
This PR adds a function
shift_period()
that implements, purely in Python, the behaviour ofScenario.clone(…, shift_first_model_year)
. Because the latter is currently implemented in the Java code underlyingixmp.JDBCBackend
, it cannot be extended in parallel with changes to the implementation of MESSAGE in GAMS (or, in the future, other implementations).ixmp.JDBCBackend
, is it not supported to set values on model data items of type "variable" or "equation" directly. Thus, this PR can't be completed without iiasa/ixmp#516, iiasa/ixmp#400, or similar.clone()
command, the new function is distinct.542
543
867
historical_activity
have fewer dimensions than the corresponding variables (e.g.ACT
). For the opposite operation—shifting the first model period backwards in time—essentially the scenario must be solved again to generate the corresponding solution data in e.g.ACT
.More to be added
How to review
To be added
PR checklist
shift_period()
frommessage_ix.Scenario.clone(…)
if the corresponding argument is given.