csdms / pymt

A Python toolkit for running and coupling Earth surface models
https://pymt.readthedocs.io
MIT License
52 stars 20 forks source link

Error from gimli when importing pymt #168

Closed mdpiper closed 1 month ago

mdpiper commented 1 month ago

When using the latest version of gimli (v0.3.2), pymt throws an error on import:

>>> import pymt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/mpiper/projects/pymt/pymt/__init__.py", line 1, in <module>
    from gimli import UnitSystem
ImportError: cannot import name 'UnitSystem' from 'gimli' (/Users/mpiper/anaconda3/envs/pdev/lib/python3.12/site-packages/gimli/__init__.py)

The Python I'm using:

Python 3.12.6 | packaged by conda-forge | (main, Sep 30 2024, 17:55:20) [Clang 17.0.6 ] on darwin
mdpiper commented 1 month ago

@mcflugen If I replace

from gimli import UnitSystem

with

from gimli._system import UnitSystem

in pymt/__init__.py, the import is successful. If this is an appropriate fix for the problem let me know & I'll send a quick PR.