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.
Files changed (35) hide show
  1. {pymdkit-1.2.4/src/pymdkit.egg-info → pymdkit-1.2.5}/PKG-INFO +1 -1
  2. {pymdkit-1.2.4 → pymdkit-1.2.5}/pyproject.toml +1 -1
  3. {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/__init__.py +1 -1
  4. {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/stable_entry.py +36 -16
  5. {pymdkit-1.2.4 → pymdkit-1.2.5/src/pymdkit.egg-info}/PKG-INFO +1 -1
  6. {pymdkit-1.2.4 → pymdkit-1.2.5}/LICENSE +0 -0
  7. {pymdkit-1.2.4 → pymdkit-1.2.5}/README.md +0 -0
  8. {pymdkit-1.2.4 → pymdkit-1.2.5}/setup.cfg +0 -0
  9. {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/__init__.py +0 -0
  10. {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/_fileio.py +0 -0
  11. {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/_vasp_output.py +0 -0
  12. {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/_vaspset.py +0 -0
  13. {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/add_groups.py +0 -0
  14. {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/compute_ehull.py +0 -0
  15. {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/compute_msd_all_groups.py +0 -0
  16. {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/compute_rmsd.py +0 -0
  17. {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/electrostatic_energy.py +0 -0
  18. {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/final_energy.py +0 -0
  19. {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/gather_contcar.py +0 -0
  20. {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/nep_rmse.py +0 -0
  21. {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/perturb.py +0 -0
  22. {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/stru2xyz.py +0 -0
  23. {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/submit_vasp.py +0 -0
  24. {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/substitute.py +0 -0
  25. {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/supercell.py +0 -0
  26. {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/symmetrize.py +0 -0
  27. {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/vasp2xyz.py +0 -0
  28. {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/vasp_relax.py +0 -0
  29. {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/commands/vasp_static.py +0 -0
  30. {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit/pymdkit_main.py +0 -0
  31. {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit.egg-info/SOURCES.txt +0 -0
  32. {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit.egg-info/dependency_links.txt +0 -0
  33. {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit.egg-info/entry_points.txt +0 -0
  34. {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit.egg-info/requires.txt +0 -0
  35. {pymdkit-1.2.4 → pymdkit-1.2.5}/src/pymdkit.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pymdkit
3
- Version: 1.2.4
3
+ Version: 1.2.5
4
4
  Summary: A unified command-line toolkit for atomistic / MD structure workflows.
5
5
  Author-email: Yueda Wang <ydwang0608@ustc.edu.cn>
6
6
  License-Expression: GPL-3.0-or-later
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pymdkit"
7
- version = "1.2.4"
7
+ version = "1.2.5"
8
8
  description = "A unified command-line toolkit for atomistic / MD structure workflows."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -1,3 +1,3 @@
1
1
  """pymdkit -- a unified CLI for atomistic / MD structure workflows."""
2
2
 
3
- __version__ = "1.2.4"
3
+ __version__ = "1.2.5"
@@ -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
- if isinstance(entry_id, dict):
20
- for key in ("material_id", "task_id", "entry_id", "id"):
21
- if entry_id.get(key):
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
- if data.get(key):
29
- return str(data[key])
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 stable thermo entries matching the Materials Project phase diagram."""
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 entries:
79
+ for entry in stable_entries:
60
80
  by_mpid[entry_id_text(entry)] = entry
61
81
  return list(by_mpid.values())
62
82
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pymdkit
3
- Version: 1.2.4
3
+ Version: 1.2.5
4
4
  Summary: A unified command-line toolkit for atomistic / MD structure workflows.
5
5
  Author-email: Yueda Wang <ydwang0608@ustc.edu.cn>
6
6
  License-Expression: GPL-3.0-or-later
File without changes
File without changes
File without changes