You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When explicitily using the keyword arguments model/scenario, and only when the model name is kept the same as in the scenario to be cloned (scenario: base - in the example below), then the clone command makes a a copy and assigns this the base scenario name "base" scenario instead of making a copy and assigning the copied scenario the "new scenario name".
__
2018-11-26 10:33:35,663 INFO at.ac.iiasa.ixmp.objects.Scenario:215 - loading default Scenario 'Westeros Electrified|baseline' (version: 7, runid: 86)...
2018-11-26 10:33:35,744 INFO at.ac.iiasa.ixmp.objects.Scenario:241 - done loading Scenario from the database!
2018-11-26 10:33:35,744 INFO at.ac.iiasa.ixmp.objects.MsgScenario:457 - spatial and temporal disaggregation maps assignment
2018-11-26 10:33:35,760 INFO at.ac.iiasa.ixmp.objects.MsgScenario:573 - period mapping assignment
2018-11-26 10:33:35,760 INFO at.ac.iiasa.ixmp.objects.MsgScenario:599 - duration period assignment
2018-11-26 10:33:35,760 INFO at.ac.iiasa.ixmp.objects.Scenario:1826 - committing changes of Scenario 'Westeros Electrified|baseline' to the database (runid: 86)...
2018-11-26 10:33:35,856 INFO at.ac.iiasa.ixmp.objects.Scenario:601 - done updating Scenario 'Westeros Electrified|baseline' to the database (runid: 86, version: 7)!
2018-11-26 10:33:35,856 INFO at.ac.iiasa.ixmp.objects.MsgScenario:457 - spatial and temporal disaggregation maps assignment
2018-11-26 10:33:35,872 INFO at.ac.iiasa.ixmp.objects.MsgScenario:573 - period mapping assignment
2018-11-26 10:33:35,872 INFO at.ac.iiasa.ixmp.objects.MsgScenario:599 - duration period assignment
__
With the explicit use of keyword arguments yields the following
scen = base.clone(model='Westeros Electrified', scenario='baseline_1',)
--> the base scenario is cloned and assigned a new version
__
2018-11-26 10:33:35,948 INFO at.ac.iiasa.ixmp.objects.Scenario:215 - loading default Scenario 'Westeros Electrified|baseline' (version: 0, runid: 86)...
2018-11-26 10:33:35,963 INFO at.ac.iiasa.ixmp.objects.Scenario:241 - done loading Scenario from the database!
2018-11-26 10:33:35,963 INFO at.ac.iiasa.ixmp.objects.Scenario:1896 - saving Scenario 'Westeros Electrified|baseline' to database (runid: 111)...
2018-11-26 10:33:36,087 INFO at.ac.iiasa.ixmp.objects.Scenario:604 - done saving Scenario 'Westeros Electrified|baseline' to the database (runid: 111, version: 10)
__
withOUT the explicit use of keyword arguments yields the following
scen = base.clone('Westeros Electrified', 'baseline_2',)
--> the base scenario is cloned with a new scenario name and assigned a new version
__
2018-11-26 10:33:36,109 INFO at.ac.iiasa.ixmp.objects.Scenario:215 - loading default Scenario 'Westeros Electrified|baseline_2' (version: 0, runid: 86)...
2018-11-26 10:33:36,125 INFO at.ac.iiasa.ixmp.objects.Scenario:241 - done loading Scenario from the database!
2018-11-26 10:33:36,125 INFO at.ac.iiasa.ixmp.objects.Scenario:1896 - saving Scenario 'Westeros Electrified|baseline_2' to database (runid: 112)...
2018-11-26 10:33:36,217 INFO at.ac.iiasa.ixmp.objects.Scenario:604 - done saving Scenario 'Westeros Electrified|baseline_2' to the database (runid: 112, version: 4)!
__
The text was updated successfully, but these errors were encountered:
Hi oliver - yes, this is indeed caused by #129. We allow additional kwargs so your scenario kwarg is not getting picked up. Would you mind making a PR which changes scen to scenario in the clone function? In that PR, we would also want to deprecate scen similar to how keep_sol is deprecated.
When explicitily using the keyword arguments model/scenario, and only when the model name is kept the same as in the scenario to be cloned (scenario: base - in the example below), then the clone command makes a a copy and assigns this the base scenario name "base" scenario instead of making a copy and assigning the copied scenario the "new scenario name".
import message_ix
import ixmp
mp = ixmp.Platform(dbtype='HSQLDB')
base = message_ix.Scenario(mp, 'Westeros Electrified', 'baseline', cache=True)
__
2018-11-26 10:33:35,663 INFO at.ac.iiasa.ixmp.objects.Scenario:215 - loading default Scenario 'Westeros Electrified|baseline' (version: 7, runid: 86)...
2018-11-26 10:33:35,744 INFO at.ac.iiasa.ixmp.objects.Scenario:241 - done loading Scenario from the database!
2018-11-26 10:33:35,744 INFO at.ac.iiasa.ixmp.objects.MsgScenario:457 - spatial and temporal disaggregation maps assignment
2018-11-26 10:33:35,760 INFO at.ac.iiasa.ixmp.objects.MsgScenario:573 - period mapping assignment
2018-11-26 10:33:35,760 INFO at.ac.iiasa.ixmp.objects.MsgScenario:599 - duration period assignment
2018-11-26 10:33:35,760 INFO at.ac.iiasa.ixmp.objects.Scenario:1826 - committing changes of Scenario 'Westeros Electrified|baseline' to the database (runid: 86)...
2018-11-26 10:33:35,856 INFO at.ac.iiasa.ixmp.objects.Scenario:601 - done updating Scenario 'Westeros Electrified|baseline' to the database (runid: 86, version: 7)!
2018-11-26 10:33:35,856 INFO at.ac.iiasa.ixmp.objects.MsgScenario:457 - spatial and temporal disaggregation maps assignment
2018-11-26 10:33:35,872 INFO at.ac.iiasa.ixmp.objects.MsgScenario:573 - period mapping assignment
2018-11-26 10:33:35,872 INFO at.ac.iiasa.ixmp.objects.MsgScenario:599 - duration period assignment
__
With the explicit use of keyword arguments yields the following
scen = base.clone(model='Westeros Electrified', scenario='baseline_1',)
--> the base scenario is cloned and assigned a new version
__
2018-11-26 10:33:35,948 INFO at.ac.iiasa.ixmp.objects.Scenario:215 - loading default Scenario 'Westeros Electrified|baseline' (version: 0, runid: 86)...
2018-11-26 10:33:35,963 INFO at.ac.iiasa.ixmp.objects.Scenario:241 - done loading Scenario from the database!
2018-11-26 10:33:35,963 INFO at.ac.iiasa.ixmp.objects.Scenario:1896 - saving Scenario 'Westeros Electrified|baseline' to database (runid: 111)...
2018-11-26 10:33:36,087 INFO at.ac.iiasa.ixmp.objects.Scenario:604 - done saving Scenario 'Westeros Electrified|baseline' to the database (runid: 111, version: 10)
__
withOUT the explicit use of keyword arguments yields the following
scen = base.clone('Westeros Electrified', 'baseline_2',)
--> the base scenario is cloned with a new scenario name and assigned a new version
__
2018-11-26 10:33:36,109 INFO at.ac.iiasa.ixmp.objects.Scenario:215 - loading default Scenario 'Westeros Electrified|baseline_2' (version: 0, runid: 86)...
2018-11-26 10:33:36,125 INFO at.ac.iiasa.ixmp.objects.Scenario:241 - done loading Scenario from the database!
2018-11-26 10:33:36,125 INFO at.ac.iiasa.ixmp.objects.Scenario:1896 - saving Scenario 'Westeros Electrified|baseline_2' to database (runid: 112)...
2018-11-26 10:33:36,217 INFO at.ac.iiasa.ixmp.objects.Scenario:604 - done saving Scenario 'Westeros Electrified|baseline_2' to the database (runid: 112, version: 4)!
__
The text was updated successfully, but these errors were encountered: