pymdkit 1.2.2__tar.gz → 1.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pymdkit-1.2.2/src/pymdkit.egg-info → pymdkit-1.2.3}/PKG-INFO +1 -1
- {pymdkit-1.2.2 → pymdkit-1.2.3}/pyproject.toml +1 -1
- {pymdkit-1.2.2 → pymdkit-1.2.3}/src/pymdkit/__init__.py +1 -1
- {pymdkit-1.2.2 → pymdkit-1.2.3}/src/pymdkit/commands/stable_entry.py +22 -8
- {pymdkit-1.2.2 → pymdkit-1.2.3/src/pymdkit.egg-info}/PKG-INFO +1 -1
- {pymdkit-1.2.2 → pymdkit-1.2.3}/LICENSE +0 -0
- {pymdkit-1.2.2 → pymdkit-1.2.3}/README.md +0 -0
- {pymdkit-1.2.2 → pymdkit-1.2.3}/setup.cfg +0 -0
- {pymdkit-1.2.2 → pymdkit-1.2.3}/src/pymdkit/commands/__init__.py +0 -0
- {pymdkit-1.2.2 → pymdkit-1.2.3}/src/pymdkit/commands/_fileio.py +0 -0
- {pymdkit-1.2.2 → pymdkit-1.2.3}/src/pymdkit/commands/_vasp_output.py +0 -0
- {pymdkit-1.2.2 → pymdkit-1.2.3}/src/pymdkit/commands/_vaspset.py +0 -0
- {pymdkit-1.2.2 → pymdkit-1.2.3}/src/pymdkit/commands/add_groups.py +0 -0
- {pymdkit-1.2.2 → pymdkit-1.2.3}/src/pymdkit/commands/compute_ehull.py +0 -0
- {pymdkit-1.2.2 → pymdkit-1.2.3}/src/pymdkit/commands/compute_msd_all_groups.py +0 -0
- {pymdkit-1.2.2 → pymdkit-1.2.3}/src/pymdkit/commands/compute_rmsd.py +0 -0
- {pymdkit-1.2.2 → pymdkit-1.2.3}/src/pymdkit/commands/electrostatic_energy.py +0 -0
- {pymdkit-1.2.2 → pymdkit-1.2.3}/src/pymdkit/commands/final_energy.py +0 -0
- {pymdkit-1.2.2 → pymdkit-1.2.3}/src/pymdkit/commands/gather_contcar.py +0 -0
- {pymdkit-1.2.2 → pymdkit-1.2.3}/src/pymdkit/commands/nep_rmse.py +0 -0
- {pymdkit-1.2.2 → pymdkit-1.2.3}/src/pymdkit/commands/perturb.py +0 -0
- {pymdkit-1.2.2 → pymdkit-1.2.3}/src/pymdkit/commands/stru2xyz.py +0 -0
- {pymdkit-1.2.2 → pymdkit-1.2.3}/src/pymdkit/commands/submit_vasp.py +0 -0
- {pymdkit-1.2.2 → pymdkit-1.2.3}/src/pymdkit/commands/substitute.py +0 -0
- {pymdkit-1.2.2 → pymdkit-1.2.3}/src/pymdkit/commands/supercell.py +0 -0
- {pymdkit-1.2.2 → pymdkit-1.2.3}/src/pymdkit/commands/symmetrize.py +0 -0
- {pymdkit-1.2.2 → pymdkit-1.2.3}/src/pymdkit/commands/vasp2xyz.py +0 -0
- {pymdkit-1.2.2 → pymdkit-1.2.3}/src/pymdkit/commands/vasp_relax.py +0 -0
- {pymdkit-1.2.2 → pymdkit-1.2.3}/src/pymdkit/commands/vasp_static.py +0 -0
- {pymdkit-1.2.2 → pymdkit-1.2.3}/src/pymdkit/pymdkit_main.py +0 -0
- {pymdkit-1.2.2 → pymdkit-1.2.3}/src/pymdkit.egg-info/SOURCES.txt +0 -0
- {pymdkit-1.2.2 → pymdkit-1.2.3}/src/pymdkit.egg-info/dependency_links.txt +0 -0
- {pymdkit-1.2.2 → pymdkit-1.2.3}/src/pymdkit.egg-info/entry_points.txt +0 -0
- {pymdkit-1.2.2 → pymdkit-1.2.3}/src/pymdkit.egg-info/requires.txt +0 -0
- {pymdkit-1.2.2 → pymdkit-1.2.3}/src/pymdkit.egg-info/top_level.txt +0 -0
|
@@ -4,6 +4,7 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
import argparse
|
|
6
6
|
import re
|
|
7
|
+
from itertools import combinations
|
|
7
8
|
from dataclasses import dataclass
|
|
8
9
|
from pathlib import Path
|
|
9
10
|
|
|
@@ -50,18 +51,31 @@ def add_arguments(parser: argparse.ArgumentParser) -> None:
|
|
|
50
51
|
help="Materials Project API key.")
|
|
51
52
|
|
|
52
53
|
|
|
54
|
+
def subsystem_labels(elements):
|
|
55
|
+
"""Return all subsystem labels needed to build the full chemsys hull."""
|
|
56
|
+
labels = []
|
|
57
|
+
for size in range(1, len(elements) + 1):
|
|
58
|
+
for subset in combinations(elements, size):
|
|
59
|
+
labels.append("-".join(subset))
|
|
60
|
+
return labels
|
|
61
|
+
|
|
62
|
+
|
|
53
63
|
def fetch_stable_structures(elements, api_key=None):
|
|
54
64
|
from mp_api.client import MPRester
|
|
55
65
|
|
|
56
|
-
chemsys = "-".join(elements)
|
|
57
66
|
fields = ["material_id", "formula_pretty", "structure"]
|
|
67
|
+
by_mpid = {}
|
|
58
68
|
with MPRester(api_key) as mpr:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
69
|
+
for chemsys in subsystem_labels(elements):
|
|
70
|
+
docs = mpr.materials.summary.search(
|
|
71
|
+
chemsys=chemsys,
|
|
72
|
+
is_stable=True,
|
|
73
|
+
fields=fields,
|
|
74
|
+
)
|
|
75
|
+
for doc in docs:
|
|
76
|
+
entry = normalize_doc(doc)
|
|
77
|
+
by_mpid[entry.material_id] = entry
|
|
78
|
+
return list(by_mpid.values())
|
|
65
79
|
|
|
66
80
|
|
|
67
81
|
def run(args) -> int:
|
|
@@ -77,7 +91,7 @@ def run(args) -> int:
|
|
|
77
91
|
except ModuleNotFoundError as exc:
|
|
78
92
|
if exc.name == "mp_api":
|
|
79
93
|
raise SystemExit(
|
|
80
|
-
"Error: stable-entry requires mp-api. Reinstall pymdkit 1.2.
|
|
94
|
+
"Error: stable-entry requires mp-api. Reinstall pymdkit 1.2.3+ "
|
|
81
95
|
"or run `pip install mp-api`."
|
|
82
96
|
) from exc
|
|
83
97
|
raise
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|