iiasa / ixmp

The ix modeling platform for integrated and cross-cutting scenario analysis
https://docs.messageix.org/ixmp
Apache License 2.0
36 stars 110 forks source link

Implement IXMP4Backend #516

Open khaeru opened 5 months ago

khaeru commented 5 months ago

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:

Notes

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

khaeru commented 5 months ago

The Python 3.12 job fails with different exceptions than 3.10 and 3.11, for instance here:

ixmp/backend/ixmp4.py:15: in __init__
    import ixmp4
[...]
/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/sqlalchemy/orm/decl_api.py:303: in __get__
    reg[self] = obj = self.fget(cls)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'ixmp4.data.db.unit.model.Unit'>

    @declared_attr.directive
    def columns(cls):
>       return cls.__table__.columns
E       AttributeError: type object 'Unit' has no attribute '__table__'. Did you mean: '__le__'?

/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/ixmp4/data/db/base.py:76: AttributeError

I guess this means ixmp4 does not support Python 3.12, although it is installable.