Adjust to ixmp Backend/Model refactor#249
Conversation
Codecov Report
@@ Coverage Diff @@
## master #249 +/- ##
=========================================
Coverage ? 66.72%
=========================================
Files ? 15
Lines ? 1139
Branches ? 0
=========================================
Hits ? 760
Misses ? 379
Partials ? 0
Continue to review full report at Codecov.
|
gidden
left a comment
There was a problem hiding this comment.
Hey @khaeru, this looks absolutely superb. I couldn't find any suggestions in the code specifically, but I did notice one doc page didn't render as expected (or I think so).
One question here - how will this play with the now languishing MACRO PR #223? Is it worth pulling that in as is (given that it is no worse and arguably better than present day) and then adjusting this PR as needed? I'm not sure I have the bandwith to do it the other way around, and am afraid that it simply die on the vine.
| The MESSAGE Python class encapsulates the GAMS code for the core MESSAGE mathematical formulation. | ||
| The *model_options* arguments are received from :meth:`.Scenario.solve`, and—except for *solve_options*—are passed on to the parent class :class:`~ixmp.model.gams.GAMSModel`; see there for a full list of options. | ||
|
|
||
| .. autoclass:: MESSAGE_MACRO |
There was a problem hiding this comment.
This looks to be broken on RTD? https://message-ix-khaeru.readthedocs.io/en/feature-ixmp-backend/api.html#message_ix.models.MESSAGE.defaults
There was a problem hiding this comment.
Good eye. The code is working as intended, but that's indeed not what we want the user to be seeing in the documentation. I'll try for a fix.
A rebase/merge from |
|
See the above comment on IAMconsortium/pyam#281; IAMconsortium/pyam#280 broke the build, so I will now try to add a workaround. |
|
Okay, that worked. Thanks @gidden for the quick review. |
iiasa/ixmp#182 modularizes
ixmp.coreinto abstract Backend and Model classes, and concrete JDBCBackend and GAMSModel classes. This PR adjusts message_ix accordingly.How to review
Details
message_ix jumps stack layers in a few places by communicating directly with ixmp_source.
Click to show source…
- MsgScenario.getTypeList in `cat_list`: https://github.com/iiasa/message_ix/blob/570f79833eddf046f7779db3f68fb86c0b13b0cc/message_ix/core.py#L94 - MsgScenario.addCatEle in `add_cat`: https://github.com/iiasa/message_ix/blob/570f79833eddf046f7779db3f68fb86c0b13b0cc/message_ix/core.py#L111 - MsgScenario.getCatEle in `cat`: https://github.com/iiasa/message_ix/blob/570f79833eddf046f7779db3f68fb86c0b13b0cc/message_ix/core.py#L123 - MsgScenario.getFirstModelYear in `firstmodelyear`: https://github.com/iiasa/message_ix/blob/570f79833eddf046f7779db3f68fb86c0b13b0cc/message_ix/core.py#L272 - MsgScenario.getTecActYrs. Note this was incorrectly in **ixmp**.Scenario; iiasa/ixmp#182 deletes it in ixmp.The code here:
._backend(name, ...)that calls backend API methods namedixmp.Backend.ms_{name}(...)..years_active()from ixmp.Scenario..remove_solution()—it only duplicated ixmp.Scenario.message_ix.model_settingsand addsmessage_ix.modelscontaining two subclasses ofixmp.GAMSModelnamedMESSAGEandMESSAGE_MACRO.pathlib. This should eventually be delegated to ixmp.config.Config.MESSAGEmodel class.PR checklist