Skip to content
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

Implement ixmp4 shim #552

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

Implement ixmp4 shim #552

wants to merge 10 commits into from

Conversation

khaeru
Copy link
Member

@khaeru khaeru commented Nov 28, 2024

This PR is intended to aid @glatterf42 in developing model data features in ixmp4. It is not a complete plan or solution for migrating ixmp-based code, workflows, and research to ixmp4; such a plan would involve many additional elements that are not in scope for this PR.

The PR:

  • Adds a IXMP4Backend class that allows ixmp.Platform, ixmp.TimeSeries, and ixmp.Scenario (thus all existing code based on ixmp and message_ix) to talk to ixmp4's API. This functions as a shim between the established and new/developing APIs.
  • Makes minimal changes to allow ixmp.Platform backed by IXMP4Backend to be created and used.
  • Adjusts or parametrizes tests of the ixmp Platform, TimeSeries, and Scenario classes to run against both JDBCBackend and IXMP4Backend, ensuring the latter provides the same behaviour expected of the former per the test suite.
    • This is a precondition for migrating other code (for instance, in message-ix-models or message_data) to, first, use ixmp4 via an IXMP4Backend, and eventually, ixmp4 directly.
  • Serves as a basis for Test against ixmp4 message_ix#894 and Test against ixmp4 message-ix-models#257.

Notes

  • This PR recreates Implement ixmp4 shim #516 with a new branch name. Using the same branch name in ixmp and message_ix allows to minimize the changes to CI in message-ix-models.
  • ixmp4 is not published on PyPI for Python 3.9 and can't be installed in those CI jobs. Possible ways to respond:
    • Separate ixmp4 from the tests dependency, and don't install it on those Pythons.
    • Adjust parametrized tests to not import ixmp4 or run against IXMP4Backend with those Pythons.
    • Document that IXMP4Backend is only available for Python >= 3.10.

How to review

TBD. This branch/PR may not necessarily be merged itself, but may serve as the basis for another PR that adds the IXMP4Backend.

PR checklist

  • Continuous integration checks all ✅
  • Add or expand tests; coverage checks both ✅
  • Add, expand, or update documentation.
  • Update release notes.

@khaeru khaeru added the enh New features & functionality label Nov 28, 2024
khaeru added a commit to iiasa/message_ix that referenced this pull request Nov 28, 2024
khaeru added a commit to iiasa/message-ix-models that referenced this pull request Nov 28, 2024
khaeru added a commit to iiasa/message-ix-models that referenced this pull request Dec 3, 2024
khaeru added a commit to iiasa/message-ix-models that referenced this pull request Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enh New features & functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant