Becksteinlab / MDPOW

Calculation of water/solvent partition coefficients with Gromacs.
https://mdpow.readthedocs.io
GNU General Public License v3.0
25 stars 10 forks source link

Python 3.9 test fails due jax not properly declaring its python compatibility #286

Closed orbeckst closed 1 week ago

orbeckst commented 1 week ago

Under Python 3.9, tests are not even collected because the jax package (via pymbar) did not correctly declare that it needs Python 3.10 due to their use of unions in their Type hints:

___________________ ERROR collecting mdpow/tests/test_fep.py ___________________
mdpow/tests/test_fep.py:11: in <module>
    import mdpow.fep
mdpow/fep.py:160: in <module>
    from alchemlyb.estimators import TI, BAR, MBAR
../../../micromamba/envs/test/lib/python3.9/site-packages/alchemlyb/estimators/__init__.py:1: in <module>
    from .bar_ import BAR
../../../micromamba/envs/test/lib/python3.9/site-packages/alchemlyb/estimators/bar_.py:3: in <module>
    from pymbar.other_estimators import bar as BAR_
../../../micromamba/envs/test/lib/python3.9/site-packages/pymbar/__init__.py:32: in <module>
    from .mbar import MBAR
../../../micromamba/envs/test/lib/python3.9/site-packages/pymbar/mbar.py:44: in <module>
    from pymbar import mbar_solvers
../../../micromamba/envs/test/lib/python3.9/site-packages/pymbar/mbar_solvers.py:24: in <module>
    from jax import config
../../../micromamba/envs/test/lib/python3.9/site-packages/jax/__init__.py:25: in <module>
    from jax._src.cloud_tpu_init import cloud_tpu_init as _cloud_tpu_init
../../../micromamba/envs/test/lib/python3.9/site-packages/jax/_src/cloud_tpu_init.py:37: in <module>
    def get_tpu_library_path() -> str | None:
E   TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
orbeckst commented 1 week ago

see https://github.com/alchemistry/alchemlyb/issues/327

orbeckst commented 1 week ago

We might just punt and drop 3.9 if it's not immediately clear how to deal with jax or what version to pin (just for 3.9... might just not be worth the effort). Instead add 3.11 and 3.12 ... #283