diff --git a/crystal_toolkit/components/localenv.py b/crystal_toolkit/components/localenv.py index 8aa0584b..8cc6a6dc 100644 --- a/crystal_toolkit/components/localenv.py +++ b/crystal_toolkit/components/localenv.py @@ -21,7 +21,7 @@ LightStructureEnvironments, ) from pymatgen.analysis.graphs import MoleculeGraph, StructureGraph -from pymatgen.analysis.local_env import LocalStructOrderParams, cn_opt_params +from pymatgen.analysis.local_env import LocalStructOrderParams, CN_OPT_PARAMS from pymatgen.core import Molecule, Structure from pymatgen.ext.matproj import MPRester from pymatgen.io.ase import AseAtomsAdaptor @@ -77,14 +77,14 @@ def _get_local_order_parameters(structure_graph, n): # code from @nisse3000, moved here from graphs to avoid circular # import, also makes sense to have this as a general NN method cn = structure_graph.get_coordination_of_site(n) - if cn in [int(k_cn) for k_cn in cn_opt_params]: - names = list(cn_opt_params[cn]) + if cn in [int(k_cn) for k_cn in CN_OPT_PARAMS]: + names = list(CN_OPT_PARAMS[cn]) types = [] params = [] for name in names: - types.append(cn_opt_params[cn][name][0]) + types.append(CN_OPT_PARAMS[cn][name][0]) tmp = ( - cn_opt_params[cn][name][1] if len(cn_opt_params[cn][name]) > 1 else None + CN_OPT_PARAMS[cn][name][1] if len(CN_OPT_PARAMS[cn][name]) > 1 else None ) params.append(tmp) lost_ops = LocalStructOrderParams(types, parameters=params) diff --git a/pyproject.toml b/pyproject.toml index c58638ee..86b376b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ dependencies = [ "frozendict", "mp-api", "pydantic-settings", - "pymatgen", + "pymatgen>=2024.10.22", "scikit-image", "scikit-learn", "shapely",