Add .models.shift_period()#873
Draft
khaeru wants to merge 1 commit into
Draft
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #873 +/- ##
=======================================
- Coverage 96.5% 96.5% -0.1%
=======================================
Files 60 60
Lines 5155 5179 +24
=======================================
+ Hits 4976 4999 +23
- Misses 179 180 +1
|
4 tasks
Member
|
This will address iiasa/ixmp#75. |
fea126e to
01018ab
Compare
01018ab to
b3c35ad
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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 Implement ixmp4 shim ixmp#552, Add Python DB API backend ixmp#400, or similar.clone()command, the new function is distinct.historical_total_capacity#542historical_emissionautomatically when shifting y₀ #543firstmodelyear#867historical_activityhave 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.