-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Model.initialize #212
Add Model.initialize #212
Conversation
Short look over the implemented code + design, and it looks great! Really nice addition @khaeru |
Rebased after the 2.0 release. |
@behnam-zakeri since this will supersede pieces of iiasa/message_ix#190 and iiasa/message_ix#265, I've asked for your review here of the new code. Please have a read through and let's chat to address any questions or notes that you have. |
Thanks a lot @khaeru for this. Conceptually I agree it's a nice development. Before going through the code, do you think if it's better to rebase those PRs you mentioned and then adjust the relevant part of code to accommodate the new changes? |
Since this has been open almost 3 months, I would prefer to merge it as-is, and then maybe make (a) separate, smaller PR(s), for any necessary changes that come up when refactoring those message_ix PRs. However, if there's any obvious fix that occurs to you while going through, then please mention and I can quickly add it on this branch. |
Adjust models.MESSAGE for iiasa/ixmp#212
- test_data_path need no longer be passed to make_dantzig()
- JPype exceptions do not support this syntax
- Debug Windows tests - Correct tutorial references to model
In iiasa/message_ix#190, @behnam-zakeri and I add a method named
initialize()
to the MESSAGE class (subclass of ixmp.Model), that adds some ixmp items (sets and parameters) to a new or existing Scenario.This PR adds this functionality in ixmp and integrates it with the core classes, so that 'blank' scenarios can be automatically populated with the correct items. This will be one piece for addressing iiasa/message_ix#254.
How to review
test_model.test_model_initialize()
.base.Model.initialize()
and.initialize_items()
.DantzigModel
and changes totesting.make_dantzig()
.ixmp.utils.update_par()
.DantzigModel
is now used in many places, and it knows where to find its own GAMS code, the test functions no longer need to provide the location to thesolve()
method.PR checklist
testing.make_dantzig
to a newModel
subclass.Model.initialize
withScenario.__init__()
.