pymdkit 1.2.8__tar.gz → 1.2.10__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.8/src/pymdkit.egg-info → pymdkit-1.2.10}/PKG-INFO +1 -1
- {pymdkit-1.2.8 → pymdkit-1.2.10}/pyproject.toml +1 -1
- {pymdkit-1.2.8 → pymdkit-1.2.10}/src/pymdkit/__init__.py +1 -1
- {pymdkit-1.2.8 → pymdkit-1.2.10}/src/pymdkit/commands/stable_entry.py +23 -9
- {pymdkit-1.2.8 → pymdkit-1.2.10/src/pymdkit.egg-info}/PKG-INFO +1 -1
- {pymdkit-1.2.8 → pymdkit-1.2.10}/LICENSE +0 -0
- {pymdkit-1.2.8 → pymdkit-1.2.10}/README.md +0 -0
- {pymdkit-1.2.8 → pymdkit-1.2.10}/setup.cfg +0 -0
- {pymdkit-1.2.8 → pymdkit-1.2.10}/src/pymdkit/commands/__init__.py +0 -0
- {pymdkit-1.2.8 → pymdkit-1.2.10}/src/pymdkit/commands/_fileio.py +0 -0
- {pymdkit-1.2.8 → pymdkit-1.2.10}/src/pymdkit/commands/_vasp_output.py +0 -0
- {pymdkit-1.2.8 → pymdkit-1.2.10}/src/pymdkit/commands/_vaspset.py +0 -0
- {pymdkit-1.2.8 → pymdkit-1.2.10}/src/pymdkit/commands/add_groups.py +0 -0
- {pymdkit-1.2.8 → pymdkit-1.2.10}/src/pymdkit/commands/compute_ehull.py +0 -0
- {pymdkit-1.2.8 → pymdkit-1.2.10}/src/pymdkit/commands/compute_msd_all_groups.py +0 -0
- {pymdkit-1.2.8 → pymdkit-1.2.10}/src/pymdkit/commands/compute_rmsd.py +0 -0
- {pymdkit-1.2.8 → pymdkit-1.2.10}/src/pymdkit/commands/electrostatic_energy.py +0 -0
- {pymdkit-1.2.8 → pymdkit-1.2.10}/src/pymdkit/commands/final_energy.py +0 -0
- {pymdkit-1.2.8 → pymdkit-1.2.10}/src/pymdkit/commands/gather_contcar.py +0 -0
- {pymdkit-1.2.8 → pymdkit-1.2.10}/src/pymdkit/commands/nep_rmse.py +0 -0
- {pymdkit-1.2.8 → pymdkit-1.2.10}/src/pymdkit/commands/perturb.py +0 -0
- {pymdkit-1.2.8 → pymdkit-1.2.10}/src/pymdkit/commands/stru2xyz.py +0 -0
- {pymdkit-1.2.8 → pymdkit-1.2.10}/src/pymdkit/commands/submit_vasp.py +0 -0
- {pymdkit-1.2.8 → pymdkit-1.2.10}/src/pymdkit/commands/substitute.py +0 -0
- {pymdkit-1.2.8 → pymdkit-1.2.10}/src/pymdkit/commands/supercell.py +0 -0
- {pymdkit-1.2.8 → pymdkit-1.2.10}/src/pymdkit/commands/symmetrize.py +0 -0
- {pymdkit-1.2.8 → pymdkit-1.2.10}/src/pymdkit/commands/vasp2xyz.py +0 -0
- {pymdkit-1.2.8 → pymdkit-1.2.10}/src/pymdkit/commands/vasp_relax.py +0 -0
- {pymdkit-1.2.8 → pymdkit-1.2.10}/src/pymdkit/commands/vasp_static.py +0 -0
- {pymdkit-1.2.8 → pymdkit-1.2.10}/src/pymdkit/pymdkit_main.py +0 -0
- {pymdkit-1.2.8 → pymdkit-1.2.10}/src/pymdkit.egg-info/SOURCES.txt +0 -0
- {pymdkit-1.2.8 → pymdkit-1.2.10}/src/pymdkit.egg-info/dependency_links.txt +0 -0
- {pymdkit-1.2.8 → pymdkit-1.2.10}/src/pymdkit.egg-info/entry_points.txt +0 -0
- {pymdkit-1.2.8 → pymdkit-1.2.10}/src/pymdkit.egg-info/requires.txt +0 -0
- {pymdkit-1.2.8 → pymdkit-1.2.10}/src/pymdkit.egg-info/top_level.txt +0 -0
|
@@ -5,6 +5,8 @@ from __future__ import annotations
|
|
|
5
5
|
import argparse
|
|
6
6
|
import json
|
|
7
7
|
import re
|
|
8
|
+
from urllib.parse import quote
|
|
9
|
+
from urllib.request import Request, urlopen
|
|
8
10
|
from pathlib import Path
|
|
9
11
|
|
|
10
12
|
COMMAND = "stable-entry"
|
|
@@ -97,20 +99,28 @@ def resolve_public_material_ids(entries, api_key=None):
|
|
|
97
99
|
is_stable=True,
|
|
98
100
|
fields=["material_id", "formula_pretty", "structure"],
|
|
99
101
|
)
|
|
102
|
+
candidates = []
|
|
100
103
|
for doc in cache[formula]:
|
|
101
104
|
structure = doc_get(doc, "structure")
|
|
102
105
|
material_id = mpid_text(doc_get(doc, "material_id"))
|
|
103
106
|
if not structure or not is_public_mpid(material_id):
|
|
104
107
|
continue
|
|
105
|
-
if str(structure.composition.reduced_formula)
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
108
|
+
if str(structure.composition.reduced_formula) == formula:
|
|
109
|
+
candidates.append((doc, structure, material_id))
|
|
110
|
+
chosen = None
|
|
111
|
+
if len(candidates) == 1:
|
|
112
|
+
chosen = candidates[0][2]
|
|
113
|
+
else:
|
|
114
|
+
for _, structure, material_id in candidates:
|
|
115
|
+
if matcher.fit(entry.structure, structure):
|
|
116
|
+
chosen = material_id
|
|
117
|
+
break
|
|
118
|
+
if chosen:
|
|
119
|
+
data = getattr(entry, "data", None)
|
|
120
|
+
if data is None:
|
|
121
|
+
entry.data = {}
|
|
122
|
+
data = entry.data
|
|
123
|
+
data["material_id"] = chosen
|
|
114
124
|
|
|
115
125
|
|
|
116
126
|
def fetch_stable_entries(elements, api_key=None):
|
|
@@ -182,6 +192,10 @@ def download_mp_symmetrized_cif(material_id, path, api_key=None):
|
|
|
182
192
|
headers["X-API-KEY"] = key
|
|
183
193
|
quoted = quote(material_id, safe="")
|
|
184
194
|
urls = [
|
|
195
|
+
f"https://api.materialsproject.org/materials/{quoted}/cif?symmetrized=true",
|
|
196
|
+
f"https://api.materialsproject.org/materials/{quoted}/cif",
|
|
197
|
+
f"https://api.materialsproject.org/materials/core/{quoted}/cif?symmetrized=true",
|
|
198
|
+
f"https://api.materialsproject.org/materials/core/{quoted}/cif",
|
|
185
199
|
f"https://materialsproject.org/materials/{quoted}/cif?download=true&symmetrized=true",
|
|
186
200
|
f"https://materialsproject.org/materials/{quoted}/cif?symmetrized=true",
|
|
187
201
|
f"https://www.materialsproject.org/rest/v2/materials/{quoted}/cif",
|
|
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
|