-
Notifications
You must be signed in to change notification settings - Fork 114
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 ixmp4-backed platform functions #557
base: enh/ixmp4
Are you sure you want to change the base?
Conversation
I think this is why we have iiasa/message_ix#894 and iiasa/message-ix-models#257. If this parent/synonym functionality is ‘load bearing’, then some test(s) in those PRs will fail. We also are able to search like this (within the IIASA org only) or more broadly to identify downstream repos that use the feature. These will help us answer the question “In order to avoid breaking changes,¹ does the shim/IXMP4Backend need extra code to emulate this behaviour of the JDBCBackend?” (We definitely do not want to put such changes into ixmp4.) In some cases the answer to the question might turn out to be “No—we don't need this.” However, to reach there requires additional work (searching, reading code, discussion with actual users internal and external) that is not on the critical path to our goal: run the message_ix tutorials by May/June. There will also be many such cases. So I would say the way to proceed here is:
Once we finish with a 'first pass' over all the functionality, we can review all such cases and decide which need most attention. Things that would break more downstream code and be expensive to adapt to would get higher priority. Things where the answer turns out to be “No” as above we can communicate via migration instructions like “This is no longer possible with the shim/ixmp4 and will not be possible in the future,” and xfail the tests for IXMP4Backend only. ¹ To be precise, unacceptable breaking changes. Maybe in some cases we can find all of the downstream usage and the people responsible for maintaining it, and they will say, “Please go ahead, it is not a problem for me to update my code.” |
With the above general strategy in mind:
I would say this is non-critical/low priority:
|
e898975
to
e6d91f9
Compare
e6d91f9
to
67c5639
Compare
As suggested in #552 (comment), this PR adds
IXMP4Backend
functions that are required to pass thetest_platform
tests. This is separate to keep the PR reviews manageable.As far as passing the test_platform tests go, this work is incomplete. In some places, I'm not sure best to proceed. For example,
test_add_region
andtest_add_region_synonym
are currently failing because the regions-DataFrame returned from the ixmp4 Backend does not include the data the tests currently expect. This is in turn due to the ixmp4 DB model for regions is different from the one in ixmp.Most notably, ixmp4 requires the
hierarchy
parameter, but doesn't useparent
orsynonym
. I asked @meksor and @danielhuppmann about this and they said that's on purpose and ixmp doesn't really use these parameters anymore, either. So I think it should be fine to adapt the existing tests, but please let me know what you think, @khaeru.Similarly, ixmp4 does not seem to store timeslices in a similar way to the JDBC. It looks like I'll have to add this feature first, but I'm not really familiar with the IAMC data storage we currently have implemented.
Another missing feature is the ability to delete stuff in ixmp4. Both optimization data and items as well as
Run
s as a whole still lack this.There are several more open questions marked as
TODO
inline. For example:ixmp4.Run.clone()
doesn't supportfirst_model_year
andplatform_dest
. How crucial are these features?How to review
TBD
PR checklist
[ ] Update release notes.Will be done in Implement ixmp4 shim #552.