Skip to content

Commit

Permalink
fix for pmg>=2024.10.22
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaume committed Oct 22, 2024
1 parent 8348ede commit aab16c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions crystal_toolkit/components/localenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies = [
"frozendict",
"mp-api",
"pydantic-settings",
"pymatgen",
"pymatgen>=2024.10.22",
"scikit-image",
"scikit-learn",
"shapely",
Expand Down

0 comments on commit aab16c1

Please sign in to comment.