pymdkit 1.2.4__tar.gz → 1.2.5__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.4/src/pymdkit.egg-info → pymdkit-1.2.5}/PKG-INFO +1 -1
- {pymdkit-1.2.4 → pymdkit-1.2.5}/pyproject.toml +1 -1
- {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/__init__.py +1 -1
- {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/stable_entry.py +36 -16
- {pymdkit-1.2.4 → pymdkit-1.2.5/src/pymdkit.egg-info}/PKG-INFO +1 -1
- {pymdkit-1.2.4 → pymdkit-1.2.5}/LICENSE +0 -0
- {pymdkit-1.2.4 → pymdkit-1.2.5}/README.md +0 -0
- {pymdkit-1.2.4 → pymdkit-1.2.5}/setup.cfg +0 -0
- {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/__init__.py +0 -0
- {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/_fileio.py +0 -0
- {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/_vasp_output.py +0 -0
- {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/_vaspset.py +0 -0
- {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/add_groups.py +0 -0
- {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/compute_ehull.py +0 -0
- {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/compute_msd_all_groups.py +0 -0
- {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/compute_rmsd.py +0 -0
- {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/electrostatic_energy.py +0 -0
- {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/final_energy.py +0 -0
- {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/gather_contcar.py +0 -0
- {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/nep_rmse.py +0 -0
- {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/perturb.py +0 -0
- {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/stru2xyz.py +0 -0
- {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/submit_vasp.py +0 -0
- {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/substitute.py +0 -0
- {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/supercell.py +0 -0
- {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/symmetrize.py +0 -0
- {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/vasp2xyz.py +0 -0
- {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/vasp_relax.py +0 -0
- {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/vasp_static.py +0 -0
- {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/pymdkit_main.py +0 -0
- {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit.egg-info/SOURCES.txt +0 -0
- {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit.egg-info/dependency_links.txt +0 -0
- {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit.egg-info/entry_points.txt +0 -0
- {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit.egg-info/requires.txt +0 -0
- {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit.egg-info/top_level.txt +0 -0
|
@@ -14,19 +14,38 @@ def safe_formula(formula):
|
|
|
14
14
|
return re.sub(r"[^A-Za-z0-9_.-]+", "", str(formula))
|
|
15
15
|
|
|
16
16
|
|
|
17
|
+
def mpid_text(value):
|
|
18
|
+
if value is None:
|
|
19
|
+
return ""
|
|
20
|
+
if isinstance(value, dict):
|
|
21
|
+
for key in ("material_id", "task_id", "entry_id", "id", "identifier"):
|
|
22
|
+
if value.get(key):
|
|
23
|
+
return mpid_text(value[key])
|
|
24
|
+
return "-".join(f"{k}-{v}" for k, v in sorted(value.items()))
|
|
25
|
+
for attr in ("string", "identifier"):
|
|
26
|
+
text = getattr(value, attr, None)
|
|
27
|
+
if text:
|
|
28
|
+
return str(text)
|
|
29
|
+
text = str(value)
|
|
30
|
+
match = re.search(r"mp-\d+", text)
|
|
31
|
+
if match:
|
|
32
|
+
return match.group(0)
|
|
33
|
+
match = re.search(r"identifier=['\"]?(mp-[A-Za-z0-9]+)", text)
|
|
34
|
+
if match:
|
|
35
|
+
return match.group(1)
|
|
36
|
+
return text
|
|
37
|
+
|
|
38
|
+
|
|
17
39
|
def entry_id_text(entry):
|
|
18
|
-
entry_id = getattr(entry, "entry_id",
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return str(entry_id[key])
|
|
23
|
-
return "-".join(f"{k}-{v}" for k, v in sorted(entry_id.items()))
|
|
24
|
-
if entry_id:
|
|
25
|
-
return str(entry_id)
|
|
40
|
+
entry_id = getattr(entry, "entry_id", None)
|
|
41
|
+
text = mpid_text(entry_id)
|
|
42
|
+
if text:
|
|
43
|
+
return text
|
|
26
44
|
data = getattr(entry, "data", {}) or {}
|
|
27
45
|
for key in ("material_id", "task_id", "entry_id", "id"):
|
|
28
|
-
|
|
29
|
-
|
|
46
|
+
text = mpid_text(data.get(key))
|
|
47
|
+
if text:
|
|
48
|
+
return text
|
|
30
49
|
return "unknown"
|
|
31
50
|
|
|
32
51
|
|
|
@@ -43,20 +62,21 @@ def add_arguments(parser: argparse.ArgumentParser) -> None:
|
|
|
43
62
|
|
|
44
63
|
|
|
45
64
|
def fetch_stable_entries(elements, api_key=None):
|
|
46
|
-
"""Fetch
|
|
65
|
+
"""Fetch entries and keep only entries stable on the full MP phase diagram."""
|
|
66
|
+
from pymatgen.analysis.phase_diagram import PhaseDiagram
|
|
47
67
|
from pymatgen.ext.matproj import MPRester
|
|
48
68
|
|
|
49
69
|
with MPRester(api_key) as mpr:
|
|
50
70
|
entries = mpr.get_entries_in_chemsys(
|
|
51
71
|
elements,
|
|
52
72
|
inc_structure=True,
|
|
53
|
-
additional_criteria={
|
|
54
|
-
"thermo_types": ["GGA_GGA+U"],
|
|
55
|
-
"is_stable": True,
|
|
56
|
-
},
|
|
73
|
+
additional_criteria={"thermo_types": ["GGA_GGA+U"]},
|
|
57
74
|
)
|
|
75
|
+
phase_diagram = PhaseDiagram(entries)
|
|
76
|
+
stable_entries = list(phase_diagram.stable_entries)
|
|
77
|
+
print(f"Fetched {len(entries)} MP thermo entries; {len(stable_entries)} are stable on the full phase diagram.")
|
|
58
78
|
by_mpid = {}
|
|
59
|
-
for entry in
|
|
79
|
+
for entry in stable_entries:
|
|
60
80
|
by_mpid[entry_id_text(entry)] = entry
|
|
61
81
|
return list(by_mpid.values())
|
|
62
82
|
|
|
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
|