materialsproject / api

New API client for the Materials Project
https://materialsproject.github.io/api/
Other
107 stars 39 forks source link

Import error with pymatgen 2022.5.19 #733

Open cpashartis opened 1 year ago

cpashartis commented 1 year ago

Hello,

There seems to be an import error on trying from mp_api.client import MPRester

ImportError: cannot import name 'PatchedPhaseDiagram' from 'pymatgen.analysis.phase_diagram' ([...]/pymatgen/analysis/phase_diagram.py)

I'm using version 0.30.8 and pymatgen 2022.5.19 (it seems that this class does not exist and is expected to be in the API)

munrojm commented 1 year ago

Hi @cpashartis, thanks for bringing this up. Is it not possible for you to update pymatgen?

cpashartis commented 1 year ago

For my research group, there are quite a few changes happening in pymatgen with the API in the past year so we tend to keep copies that we know work internally. If you don't want to make something compatible, might I suggest to update your requirements file to use a new pymatgen (I think .7.19 works).

munrojm commented 1 year ago

@cpashartis, that is fair. Since the dependency solver can be a bit finicky with pymatgen and mp_api, we have elected to be conservative on pinning versions. However, with a large API change it is probably warranted as you suggest.