Skip to content

Commit aab16c1

Browse files
committed
fix for pmg>=2024.10.22
1 parent 8348ede commit aab16c1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

crystal_toolkit/components/localenv.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
LightStructureEnvironments,
2222
)
2323
from pymatgen.analysis.graphs import MoleculeGraph, StructureGraph
24-
from pymatgen.analysis.local_env import LocalStructOrderParams, cn_opt_params
24+
from pymatgen.analysis.local_env import LocalStructOrderParams, CN_OPT_PARAMS
2525
from pymatgen.core import Molecule, Structure
2626
from pymatgen.ext.matproj import MPRester
2727
from pymatgen.io.ase import AseAtomsAdaptor
@@ -77,14 +77,14 @@ def _get_local_order_parameters(structure_graph, n):
7777
# code from @nisse3000, moved here from graphs to avoid circular
7878
# import, also makes sense to have this as a general NN method
7979
cn = structure_graph.get_coordination_of_site(n)
80-
if cn in [int(k_cn) for k_cn in cn_opt_params]:
81-
names = list(cn_opt_params[cn])
80+
if cn in [int(k_cn) for k_cn in CN_OPT_PARAMS]:
81+
names = list(CN_OPT_PARAMS[cn])
8282
types = []
8383
params = []
8484
for name in names:
85-
types.append(cn_opt_params[cn][name][0])
85+
types.append(CN_OPT_PARAMS[cn][name][0])
8686
tmp = (
87-
cn_opt_params[cn][name][1] if len(cn_opt_params[cn][name]) > 1 else None
87+
CN_OPT_PARAMS[cn][name][1] if len(CN_OPT_PARAMS[cn][name]) > 1 else None
8888
)
8989
params.append(tmp)
9090
lost_ops = LocalStructOrderParams(types, parameters=params)

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies = [
1818
"frozendict",
1919
"mp-api",
2020
"pydantic-settings",
21-
"pymatgen",
21+
"pymatgen>=2024.10.22",
2222
"scikit-image",
2323
"scikit-learn",
2424
"shapely",

0 commit comments

Comments
 (0)