iiasa / message-ix-models

Tools for the MESSAGEix-GLOBIOM family of models
https://docs.messageix.org/models
Apache License 2.0
16 stars 31 forks source link

Update sdmx version dependency #129

Closed macflo8 closed 5 months ago

macflo8 commented 8 months ago

When running mix-models --help, I got the following:

(base) C:\Users\maczek\PycharmProjects\message-ix-models>mix-models --help
Traceback (most recent call last):
  File "C:\Users\maczek\Anaconda3\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\maczek\Anaconda3\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\maczek\Anaconda3\Scripts\mix-models.exe\_main_.py", line 4, in <module>
  File "C:\Users\maczek\PycharmProjects\message-ix-models\message_ix_models\cli.py", line 138, in <module>
    _import_(name)
  File "C:\Users\maczek\PycharmProjects\message-ix-models\message_ix_models\project\ssp\_init_.py", line 9, in <module>
    from .structure import SSP, SSP_2017, SSP_2024, generate
  File "C:\Users\maczek\PycharmProjects\message-ix-models\message_ix_models\project\ssp\structure.py", line 203, in <module>
    SSP = SSP_2017 = make_enum("ICONICS:SSP(2017)")
  File "C:\Users\maczek\PycharmProjects\message-ix-models\message_ix_models\util\sdmx.py", line 115, in make_enum
    cl = read(urn)
  File "C:\Users\maczek\PycharmProjects\message-ix-models\message_ix_models\util\sdmx.py", line 146, in read
    for _, cls in msg.iter_collections():
AttributeError: 'StructureMessage' object has no attribute 'iter_collections'

sdmx was installed in version 2.10.0

It seems that sdmx.message.StructureMessage.iter_collections() has only been added in version 2.11.0. https://sdmx1.readthedocs.io/en/v2.11.0/api.html

So I guess pyproject.toml dependencies should be updated to "sdmx1" >= 2.11.0

khaeru commented 8 months ago

Thanks! Since this is a simple change, would you mind to open a PR to do it?

glatterf42 commented 8 months ago

See the linked PR, the first commit there introduces the desired change.

glatterf42 commented 5 months ago

Completed with af871f1d29c125d305204ef897fae69c63967361.