emmet-builders 0.84.10rc1__tar.gz → 0.85.0rc0__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.

Potentially problematic release.


This version of emmet-builders might be problematic. Click here for more details.

Files changed (100) hide show
  1. {emmet_builders-0.84.10rc1/emmet_builders.egg-info → emmet_builders-0.85.0rc0}/PKG-INFO +7 -30
  2. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/abinit/phonon.py +12 -14
  3. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/abinit/sound_velocity.py +1 -1
  4. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/materials/absorption_spectrum.py +16 -10
  5. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/materials/dielectric.py +10 -7
  6. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/materials/elasticity.py +13 -9
  7. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/materials/electrodes.py +1 -1
  8. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/materials/electronic_structure.py +1 -1
  9. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/materials/magnetism.py +2 -1
  10. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/materials/piezoelectric.py +23 -19
  11. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/materials/provenance.py +3 -4
  12. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/materials/substrates.py +2 -2
  13. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/materials/summary.py +2 -2
  14. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/settings.py +14 -9
  15. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/utils.py +5 -4
  16. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/vasp/materials.py +11 -4
  17. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/vasp/task_validator.py +3 -1
  18. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0/emmet_builders.egg-info}/PKG-INFO +7 -30
  19. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet_builders.egg-info/SOURCES.txt +5 -30
  20. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet_builders.egg-info/requires.txt +2 -9
  21. emmet_builders-0.85.0rc0/pyproject.toml +66 -0
  22. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/requirements/ubuntu-latest_py3.11.txt +31 -34
  23. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/requirements/ubuntu-latest_py3.11_extras.txt +69 -105
  24. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/requirements/ubuntu-latest_py3.12.txt +31 -34
  25. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/requirements/ubuntu-latest_py3.12_extras.txt +69 -105
  26. emmet_builders-0.85.0rc0/requirements/ubuntu-latest_py3.13.txt +394 -0
  27. emmet_builders-0.85.0rc0/requirements/ubuntu-latest_py3.13_extras.txt +666 -0
  28. emmet_builders-0.85.0rc0/tests/conftest.py +7 -0
  29. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/tests/test_absorption.py +1 -1
  30. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/tests/test_chemenv.py +1 -1
  31. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/tests/test_corrected_entries_thermo.py +17 -14
  32. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/tests/test_magnetism.py +4 -5
  33. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/tests/test_oxidation.py +1 -1
  34. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/tests/test_piezoelectric.py +1 -0
  35. emmet_builders-0.84.10rc1/emmet/builders/materials/ml.py +0 -101
  36. emmet_builders-0.84.10rc1/emmet/builders/molecules/atomic.py +0 -592
  37. emmet_builders-0.84.10rc1/emmet/builders/molecules/bonds.py +0 -329
  38. emmet_builders-0.84.10rc1/emmet/builders/molecules/electric.py +0 -287
  39. emmet_builders-0.84.10rc1/emmet/builders/molecules/metal_binding.py +0 -528
  40. emmet_builders-0.84.10rc1/emmet/builders/molecules/orbitals.py +0 -292
  41. emmet_builders-0.84.10rc1/emmet/builders/molecules/redox.py +0 -502
  42. emmet_builders-0.84.10rc1/emmet/builders/molecules/summary.py +0 -406
  43. emmet_builders-0.84.10rc1/emmet/builders/molecules/thermo.py +0 -505
  44. emmet_builders-0.84.10rc1/emmet/builders/molecules/trajectory.py +0 -530
  45. emmet_builders-0.84.10rc1/emmet/builders/molecules/vibration.py +0 -282
  46. emmet_builders-0.84.10rc1/emmet/builders/qchem/molecules.py +0 -745
  47. emmet_builders-0.84.10rc1/emmet_builders.egg-info/not-zip-safe +0 -1
  48. emmet_builders-0.84.10rc1/setup.py +0 -55
  49. emmet_builders-0.84.10rc1/tests/__init__.py +0 -0
  50. emmet_builders-0.84.10rc1/tests/conftest.py +0 -8
  51. emmet_builders-0.84.10rc1/tests/molecules/__init__.py +0 -0
  52. emmet_builders-0.84.10rc1/tests/molecules/test_atomic.py +0 -59
  53. emmet_builders-0.84.10rc1/tests/molecules/test_bonds.py +0 -44
  54. emmet_builders-0.84.10rc1/tests/molecules/test_electric.py +0 -39
  55. emmet_builders-0.84.10rc1/tests/molecules/test_metal_binding.py +0 -75
  56. emmet_builders-0.84.10rc1/tests/molecules/test_orbitals.py +0 -70
  57. emmet_builders-0.84.10rc1/tests/molecules/test_redox.py +0 -48
  58. emmet_builders-0.84.10rc1/tests/molecules/test_summary.py +0 -222
  59. emmet_builders-0.84.10rc1/tests/molecules/test_thermo.py +0 -39
  60. emmet_builders-0.84.10rc1/tests/molecules/test_trajectory.py +0 -50
  61. emmet_builders-0.84.10rc1/tests/molecules/test_vibration.py +0 -39
  62. emmet_builders-0.84.10rc1/tests/test_ml.py +0 -45
  63. emmet_builders-0.84.10rc1/tests/test_qchem.py +0 -37
  64. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/MANIFEST.in +0 -0
  65. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/__init__.py +0 -0
  66. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/abinit/__init__.py +0 -0
  67. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/feff/__init__.py +0 -0
  68. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/feff/xas.py +0 -0
  69. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/materials/__init__.py +0 -0
  70. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/materials/alloys.py +0 -0
  71. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/materials/basic_descriptors.py +0 -0
  72. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/materials/bonds.py +0 -0
  73. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/materials/chemenv.py +0 -0
  74. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/materials/corrected_entries.py +0 -0
  75. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/materials/optimade.py +0 -0
  76. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/materials/oxidation_states.py +0 -0
  77. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/materials/robocrys.py +0 -0
  78. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/materials/similarity.py +0 -0
  79. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/materials/thermo.py +0 -0
  80. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/matscholar/missing_compositions.py +0 -0
  81. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/mobility/__init__.py +0 -0
  82. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/mobility/migration_graph.py +0 -0
  83. /emmet_builders-0.84.10rc1/emmet/builders/molecules/__init__.py → /emmet_builders-0.85.0rc0/emmet/builders/py.typed +0 -0
  84. {emmet_builders-0.84.10rc1/emmet/builders/qchem → emmet_builders-0.85.0rc0/emmet/builders/vasp}/__init__.py +0 -0
  85. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet/builders/vasp/mp_potcar_stats.json.gz +0 -0
  86. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet_builders.egg-info/dependency_links.txt +0 -0
  87. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/emmet_builders.egg-info/top_level.txt +0 -0
  88. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/requirements/deployment.txt +0 -0
  89. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/setup.cfg +0 -0
  90. {emmet_builders-0.84.10rc1/emmet/builders/vasp → emmet_builders-0.85.0rc0/tests}/__init__.py +0 -0
  91. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/tests/test_basic_descriptors.py +0 -0
  92. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/tests/test_dielectric.py +0 -0
  93. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/tests/test_elasticity.py +0 -0
  94. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/tests/test_electronic_structure.py +0 -0
  95. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/tests/test_materials.py +0 -0
  96. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/tests/test_mobility.py +0 -0
  97. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/tests/test_similarity.py +0 -0
  98. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/tests/test_summary.py +0 -0
  99. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/tests/test_utils.py +0 -0
  100. {emmet_builders-0.84.10rc1 → emmet_builders-0.85.0rc0}/tests/test_vasp.py +0 -0
@@ -1,23 +1,21 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: emmet-builders
3
- Version: 0.84.10rc1
3
+ Version: 0.85.0rc0
4
4
  Summary: Builders for the Emmet Library
5
- Home-page: https://github.com/materialsproject/emmet
6
- Author: The Materials Project
7
- Author-email: feedback@materialsproject.org
8
- License: modified BSD
5
+ Author-email: The Materials Project <feedback@materialsproject.org>
6
+ License: Modified BSD
7
+ Project-URL: Homepage, https://github.com/materialsproject/emmet/tree/main/emmet-builders/
8
+ Project-URL: Documentation, https://materialsproject.github.io/emmet/
9
9
  Requires-Python: >=3.10
10
- Description-Content-Type: text/markdown
11
10
  Requires-Dist: emmet-core[all]
12
11
  Requires-Dist: maggma>=0.57.6
13
12
  Requires-Dist: matminer>=0.9.1
14
- Requires-Dist: solvation-analysis>=0.4.0
15
- Requires-Dist: MDAnalysis>=2.7.0
16
- Requires-Dist: pymatgen-io-validation>=0.1.0
13
+ Requires-Dist: pymatgen-io-validation>=0.1.1
17
14
  Provides-Extra: test
18
15
  Requires-Dist: pre-commit; extra == "test"
19
16
  Requires-Dist: pytest; extra == "test"
20
17
  Requires-Dist: pytest-cov; extra == "test"
18
+ Requires-Dist: pytest-xdist; extra == "test"
21
19
  Requires-Dist: pycodestyle; extra == "test"
22
20
  Requires-Dist: pydocstyle; extra == "test"
23
21
  Requires-Dist: flake8; extra == "test"
@@ -37,24 +35,3 @@ Requires-Dist: mkdocs-markdownextradata-plugin; extra == "docs"
37
35
  Requires-Dist: mkdocstrings[python]; extra == "docs"
38
36
  Requires-Dist: livereload; extra == "docs"
39
37
  Requires-Dist: jinja2; extra == "docs"
40
- Provides-Extra: ml
41
- Requires-Dist: emmet-core[ml]; extra == "ml"
42
- Provides-Extra: openmm
43
- Requires-Dist: transport-analysis>=0.1.0; extra == "openmm"
44
- Dynamic: author
45
- Dynamic: author-email
46
- Dynamic: description
47
- Dynamic: description-content-type
48
- Dynamic: home-page
49
- Dynamic: license
50
- Dynamic: provides-extra
51
- Dynamic: requires-dist
52
- Dynamic: requires-python
53
- Dynamic: summary
54
-
55
- # ![Emmet](docs/images/logo_w_text.svg)
56
-
57
- [![Pytest Status](https://github.com/materialsproject/emmet/workflows/testing/badge.svg)](https://github.com/materialsproject/emmet/actions?query=workflow%3Atesting)
58
- [![Code Coverage](https://codecov.io/gh/materialsproject/emmet/branch/main/graph/badge.svg)](https://codecov.io/gh/materialsproject/emmet)
59
-
60
- The Materials API Toolkit for the Materials Project. Emmet defines the core models, data pipelines, the API server, and the convenience CLI.
@@ -24,8 +24,8 @@ from emmet.builders.settings import EmmetBuildSettings
24
24
  from emmet.core.phonon import (
25
25
  AbinitPhonon,
26
26
  Ddb,
27
- PhononBandStructure,
28
- PhononDos,
27
+ PhononBS,
28
+ PhononDOS,
29
29
  PhononWarnings,
30
30
  PhononWebsiteBS,
31
31
  ThermalDisplacement,
@@ -223,7 +223,6 @@ class PhononBuilder(Builder):
223
223
  becs = None
224
224
  if phonon_properties["becs"] is not None:
225
225
  becs = BornEffectiveCharges(
226
- material_id=item["mp_id"],
227
226
  symmetrized_value=phonon_properties["becs"],
228
227
  value=sr_break["becs_nosymm"],
229
228
  cnsr_break=sr_break["cnsr"],
@@ -245,25 +244,24 @@ class PhononBuilder(Builder):
245
244
  abinit_input_vars=abinit_input_vars,
246
245
  )
247
246
 
248
- phbs = PhononBandStructure(
249
- material_id=item["mp_id"],
250
- band_structure=phonon_properties["ph_bs"].as_dict(),
247
+ phbs = PhononBS(
248
+ identifier=item["mp_id"],
249
+ **phonon_properties["ph_bs"].as_dict(),
251
250
  )
252
251
 
253
- phws = PhononWebsiteBS(
252
+ phws = PhononWebsiteBS( # type: ignore[call-arg]
254
253
  material_id=item["mp_id"],
255
254
  phononwebsite=phonon_properties["ph_bs"].as_phononwebsite(),
256
255
  )
257
256
 
258
- phdos = PhononDos(
259
- material_id=item["mp_id"],
260
- dos=phonon_properties["ph_dos"].as_dict(),
261
- dos_method=phonon_properties["ph_dos_method"],
257
+ phdos = PhononDOS(
258
+ identifier=item["mp_id"],
259
+ **phonon_properties["ph_dos"].as_dict(),
262
260
  )
263
261
 
264
- ddb = Ddb(material_id=item["mp_id"], ddb=item["ddb_str"])
262
+ ddb = Ddb(material_id=item["mp_id"], ddb=item["ddb_str"]) # type: ignore[call-arg]
265
263
 
266
- th_disp = ThermalDisplacement(
264
+ th_disp = ThermalDisplacement( # type: ignore[call-arg]
267
265
  material_id=item["mp_id"],
268
266
  structure=structure,
269
267
  nsites=len(structure),
@@ -843,7 +841,7 @@ def get_thermodynamic_properties(
843
841
  zpe = ph_dos.zero_point_energy(ph_dos.structure)
844
842
 
845
843
  temperatures = temp.tolist()
846
- tp = ThermodynamicProperties(temperatures=temperatures, cv=cv, entropy=entropy)
844
+ tp = ThermodynamicProperties(temperatures=temperatures, cv=cv, entropy=entropy) # type: ignore[call-arg]
847
845
 
848
846
  ve = VibrationalEnergy(
849
847
  temperatures=temperatures,
@@ -136,7 +136,7 @@ class SoundVelocityBuilder(Builder):
136
136
  try:
137
137
  sound_vel_data = self.get_sound_vel(item)
138
138
 
139
- sv = SoundVelocity(
139
+ sv = SoundVelocity( # type: ignore[call-arg]
140
140
  material_id=item["mp_id"],
141
141
  structure=sound_vel_data["structure"],
142
142
  directions=sound_vel_data["directions"],
@@ -144,23 +144,25 @@ class AbsorptionBuilder(Builder):
144
144
  task_query = self.tasks.query_one(
145
145
  properties=[
146
146
  "orig_inputs.kpoints",
147
- "orig_inputs.poscar.structure",
147
+ "orig_inputs.structure",
148
148
  "input.parameters",
149
149
  "input.structure",
150
150
  "output.dielectric.energy",
151
151
  "output.dielectric.real",
152
152
  "output.dielectric.imag",
153
- "output.optical_absorption_coeff",
153
+ "calcs_reversed",
154
154
  "output.bandgap",
155
155
  ],
156
156
  criteria={self.tasks.key: task_id},
157
157
  )
158
158
 
159
- if task_query["output"]["optical_absorption_coeff"] is not None:
159
+ if (cr := task_query.get("calcs_reversed", [])) and (
160
+ oac := cr[0]["output"]["optical_absorption_coeff"]
161
+ ):
160
162
  try:
161
- structure = task_query["orig_inputs"]["poscar"]["structure"]
162
- except KeyError:
163
163
  structure = task_query["input"]["structure"]
164
+ except KeyError:
165
+ structure = task_query["orig_inputs"]["structure"]
164
166
 
165
167
  if (
166
168
  task_query["orig_inputs"]["kpoints"]["generation_style"]
@@ -181,12 +183,16 @@ class AbsorptionBuilder(Builder):
181
183
  {
182
184
  "task_id": task_id,
183
185
  "nkpoints": int(nkpoints),
184
- "energies": task_query["output"]["dielectric"]["energy"],
185
- "real_dielectric": task_query["output"]["dielectric"]["real"],
186
- "imag_dielectric": task_query["output"]["dielectric"]["imag"],
187
- "optical_absorption_coeff": task_query["output"][
188
- "optical_absorption_coeff"
186
+ "energies": cr[0]["output"]["frequency_dependent_dielectric"][
187
+ "energy"
189
188
  ],
189
+ "real_dielectric": cr[0]["output"][
190
+ "frequency_dependent_dielectric"
191
+ ]["real"],
192
+ "imag_dielectric": cr[0]["output"][
193
+ "frequency_dependent_dielectric"
194
+ ]["imaginary"],
195
+ "optical_absorption_coeff": oac,
190
196
  "bandgap": task_query["output"]["bandgap"],
191
197
  "structure": structure,
192
198
  "updated_on": lu_dt,
@@ -148,11 +148,10 @@ class DielectricBuilder(Builder):
148
148
  "last_updated",
149
149
  "input.is_hubbard",
150
150
  "orig_inputs.kpoints",
151
- "orig_inputs.poscar.structure",
151
+ "orig_inputs.structure",
152
152
  "input.parameters",
153
153
  "input.structure",
154
- "output.epsilon_static",
155
- "output.epsilon_ionic",
154
+ "calcs_reversed",
156
155
  "output.bandgap",
157
156
  ],
158
157
  criteria={self.tasks.key: str(task_id)},
@@ -160,9 +159,9 @@ class DielectricBuilder(Builder):
160
159
 
161
160
  if task_query["output"]["bandgap"] > 0:
162
161
  try:
163
- structure = task_query["orig_inputs"]["poscar"]["structure"]
164
- except KeyError:
165
162
  structure = task_query["input"]["structure"]
163
+ except KeyError:
164
+ structure = task_query["orig_inputs"]["structure"]
166
165
 
167
166
  is_hubbard = task_query["input"]["is_hubbard"]
168
167
 
@@ -187,8 +186,12 @@ class DielectricBuilder(Builder):
187
186
  "task_id": task_id,
188
187
  "is_hubbard": int(is_hubbard),
189
188
  "nkpoints": int(nkpoints),
190
- "epsilon_static": task_query["output"]["epsilon_static"],
191
- "epsilon_ionic": task_query["output"]["epsilon_ionic"],
189
+ "epsilon_static": task_query["calcs_reversed"][0]["output"][
190
+ "epsilon_static"
191
+ ],
192
+ "epsilon_ionic": task_query["calcs_reversed"][0]["output"][
193
+ "epsilon_ionic"
194
+ ],
192
195
  "structure": structure,
193
196
  "updated_on": lu_dt,
194
197
  "task_updated": task_updated,
@@ -30,7 +30,7 @@ from pymatgen.core import Structure
30
30
  from pymatgen.core.tensors import TensorMapping
31
31
 
32
32
  from emmet.core.elasticity import ElasticityDoc
33
- from emmet.core.mpid import MPID
33
+ from emmet.core.mpid import AlphaID
34
34
  from emmet.core.utils import jsanitize
35
35
  from emmet.core.vasp.calc_types import CalcType
36
36
 
@@ -40,6 +40,8 @@ if TYPE_CHECKING:
40
40
  from collections.abc import Generator
41
41
  from typing import Any
42
42
 
43
+ from emmet.core.types.typing import IdentifierType
44
+
43
45
 
44
46
  class ElasticityBuilder(Builder):
45
47
  def __init__(
@@ -136,7 +138,7 @@ class ElasticityBuilder(Builder):
136
138
  yield material_id, calc_types, tasks
137
139
 
138
140
  def process_item(
139
- self, item: tuple[MPID, dict[str, str], list[dict]]
141
+ self, item: tuple[IdentifierType, dict[str, str], list[dict]]
140
142
  ) -> dict | None:
141
143
  """
142
144
  Process all tasks belong to the same material into an elasticity doc.
@@ -198,7 +200,7 @@ class ElasticityBuilder(Builder):
198
200
 
199
201
  # convert to elasticity doc
200
202
  deforms = []
201
- stresses = []
203
+ stresses: list[Stress] = [] # TODO: mypy misfires on `Stress`
202
204
  deform_task_ids = []
203
205
  deform_dir_names = []
204
206
  for doc in final_deform:
@@ -207,7 +209,7 @@ class ElasticityBuilder(Builder):
207
209
  )
208
210
  # 0.1 to convert to GPa from kBar, and the minus sign to flip the stress
209
211
  # direction from compressive as positive (in vasp) to tensile as positive
210
- stresses.append(-0.1 * Stress(doc["output"]["stress"]))
212
+ stresses.append(-0.1 * Stress(doc["output"]["stress"])) # type: ignore[arg-type]
211
213
  deform_task_ids.append(doc["task_id"])
212
214
  deform_dir_names.append(doc["dir_name"])
213
215
 
@@ -215,10 +217,10 @@ class ElasticityBuilder(Builder):
215
217
  structure=Structure.from_dict(final_opt["output"]["structure"]),
216
218
  material_id=material_id,
217
219
  deformations=deforms,
218
- stresses=stresses,
220
+ stresses=stresses, # type: ignore[arg-type]
219
221
  deformation_task_ids=deform_task_ids,
220
222
  deformation_dir_names=deform_dir_names,
221
- equilibrium_stress=-0.1 * Stress(final_opt["output"]["stress"]),
223
+ equilibrium_stress=-0.1 * Stress(final_opt["output"]["stress"]), # type: ignore[arg-type]
222
224
  optimization_task_id=final_opt["task_id"],
223
225
  optimization_dir_name=final_opt["dir_name"],
224
226
  fitting_method="finite_difference",
@@ -242,13 +244,15 @@ class ElasticityBuilder(Builder):
242
244
  def filter_opt_tasks(
243
245
  tasks: list[dict],
244
246
  calc_types: dict[str, str],
245
- target_calc_type: str = CalcType.GGA_Structure_Optimization,
247
+ target_calc_type: str | CalcType = CalcType.GGA_Structure_Optimization,
246
248
  ) -> list[dict]:
247
249
  """
248
250
  Filter optimization tasks, by
249
251
  - calculation type
250
252
  """
251
- opt_tasks = [t for t in tasks if calc_types[str(t["task_id"])] == target_calc_type]
253
+ opt_tasks = [
254
+ t for t in tasks if calc_types[str(AlphaID(t["task_id"]))] == target_calc_type
255
+ ]
252
256
 
253
257
  return opt_tasks
254
258
 
@@ -256,7 +260,7 @@ def filter_opt_tasks(
256
260
  def filter_deform_tasks(
257
261
  tasks: list[dict],
258
262
  calc_types: dict[str, str],
259
- target_calc_type: str = CalcType.GGA_Deformation,
263
+ target_calc_type: str | CalcType = CalcType.GGA_Deformation,
260
264
  ) -> list[dict]:
261
265
  """
262
266
  Filter deformation tasks, by
@@ -578,7 +578,7 @@ class ConversionElectrodeBuilder(Builder):
578
578
  for e in pd.entries
579
579
  ]
580
580
  material_ids = list(filter(None, material_ids))
581
- lowest_id = min(material_ids, key=_get_id_lexi)
581
+ lowest_id = min(material_ids, key=_get_id_lexi) # type: ignore[arg-type]
582
582
  conversion_electrode_doc = (
583
583
  ConversionElectrodeDoc.from_composition_and_pd(
584
584
  comp=v[1],
@@ -23,7 +23,7 @@ from emmet.core.electronic_structure import ElectronicStructureDoc
23
23
  from emmet.core.settings import EmmetSettings
24
24
  from emmet.core.utils import jsanitize
25
25
 
26
- SETTINGS = EmmetSettings()
26
+ SETTINGS = EmmetSettings() # type: ignore[call-arg]
27
27
 
28
28
 
29
29
  class ElectronicStructureBuilder(Builder):
@@ -8,6 +8,7 @@ from maggma.utils import grouper
8
8
  from pymatgen.core.structure import Structure
9
9
 
10
10
  from emmet.core.magnetism import MagnetismDoc
11
+ from emmet.core.mpid import AlphaID
11
12
  from emmet.core.utils import jsanitize
12
13
 
13
14
  from typing import TYPE_CHECKING
@@ -137,7 +138,7 @@ class MagneticBuilder(Builder):
137
138
 
138
139
  for origin in mat_doc["origins"]:
139
140
  if origin["name"] == "structure":
140
- task_id = origin["task_id"]
141
+ task_id = str(AlphaID(origin["task_id"]))
141
142
 
142
143
  task_query = self.tasks.query_one(
143
144
  properties=["last_updated", "calcs_reversed"],
@@ -7,6 +7,7 @@ from maggma.utils import grouper
7
7
  from pymatgen.core.structure import Structure
8
8
 
9
9
  from emmet.core.polar import PiezoelectricDoc
10
+ from emmet.core.mpid import AlphaID
10
11
  from emmet.core.utils import jsanitize
11
12
 
12
13
 
@@ -189,20 +190,19 @@ class PiezoelectricBuilder(Builder):
189
190
  "last_updated",
190
191
  "input.is_hubbard",
191
192
  "orig_inputs.kpoints",
192
- "orig_inputs.poscar.structure",
193
+ "orig_inputs.structure",
193
194
  "input.parameters",
194
195
  "input.structure",
195
- "output.piezo_tensor",
196
- "output.piezo_ionic_tensor",
196
+ "calcs_reversed",
197
197
  "output.bandgap",
198
198
  ],
199
- criteria={self.tasks.key: str(task_id)},
199
+ criteria={self.tasks.key: str(AlphaID(task_id))},
200
200
  )
201
201
  if task_query["output"]["bandgap"] > 0:
202
202
  try:
203
- structure = task_query["orig_inputs"]["poscar"]["structure"]
204
- except KeyError:
205
203
  structure = task_query["input"]["structure"]
204
+ except KeyError:
205
+ structure = task_query["orig_inputs"]["structure"]
206
206
 
207
207
  is_hubbard = task_query["input"]["is_hubbard"]
208
208
 
@@ -222,19 +222,23 @@ class PiezoelectricBuilder(Builder):
222
222
  lu_dt = mat_doc["last_updated"]
223
223
  task_updated = task_query["last_updated"]
224
224
 
225
- final_docs.append(
226
- {
227
- "task_id": task_id,
228
- "is_hubbard": int(is_hubbard),
229
- "nkpoints": int(nkpoints),
230
- "piezo_static": task_query["output"]["piezo_tensor"],
231
- "piezo_ionic": task_query["output"]["piezo_ionic_tensor"],
232
- "structure": structure,
233
- "updated_on": lu_dt,
234
- "task_updated": task_updated,
235
- self.materials.key: mat_doc[self.materials.key],
236
- }
237
- )
225
+ if (cr := task_query.get("calcs_reversed", [])) and (
226
+ outcar := cr[0].get("output", {}).get("outcar", {})
227
+ ):
228
+
229
+ final_docs.append(
230
+ {
231
+ "task_id": task_id,
232
+ "is_hubbard": int(is_hubbard),
233
+ "nkpoints": int(nkpoints),
234
+ "piezo_static": outcar.get("piezo_tensor"),
235
+ "piezo_ionic": outcar.get("piezo_ionic_tensor"),
236
+ "structure": structure,
237
+ "updated_on": lu_dt,
238
+ "task_updated": task_updated,
239
+ self.materials.key: mat_doc[self.materials.key],
240
+ }
241
+ )
238
242
 
239
243
  if len(final_docs) > 0:
240
244
  sorted_final_docs = sorted(
@@ -1,5 +1,4 @@
1
1
  from collections import defaultdict
2
- from datetime import datetime
3
2
  from math import ceil
4
3
 
5
4
  from maggma.core import Builder, Store
@@ -9,7 +8,7 @@ from pymatgen.core.structure import Structure
9
8
 
10
9
  from emmet.builders.settings import EmmetBuildSettings
11
10
  from emmet.core.provenance import ProvenanceDoc, SNLDict
12
- from emmet.core.utils import get_sg, jsanitize
11
+ from emmet.core.utils import get_sg, jsanitize, utcnow
13
12
 
14
13
  from typing import TYPE_CHECKING
15
14
 
@@ -207,11 +206,11 @@ class ProvenanceBuilder(Builder):
207
206
  deprecated=mat["deprecated"],
208
207
  )
209
208
  else:
210
- doc = ProvenanceDoc(
209
+ doc = ProvenanceDoc( # type: ignore[call-arg]
211
210
  material_id=mat["material_id"],
212
211
  structure=Structure.from_dict(mat["structure"]),
213
212
  deprecated=mat["deprecated"],
214
- created_at=datetime.utcnow(),
213
+ created_at=utcnow(),
215
214
  )
216
215
 
217
216
  doc.authors.append(self.settings.DEFAULT_AUTHOR)
@@ -7,7 +7,7 @@ from pymatgen.analysis.elasticity.elastic import ElasticTensor
7
7
  from pymatgen.core.structure import Structure
8
8
  from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
9
9
 
10
- from emmet.core.mpid import MPID
10
+ from emmet.core.mpid import AlphaID
11
11
  from emmet.core.substrates import SubstratesDoc
12
12
  from emmet.core.utils import jsanitize
13
13
 
@@ -108,7 +108,7 @@ class SubstratesBuilder(Builder):
108
108
  dict: a diffraction dict
109
109
  """
110
110
 
111
- mpid = MPID(item["material_id"])
111
+ mpid = AlphaID(item["material_id"])
112
112
  elastic_tensor = item.get("elastic_tensor", None)
113
113
  elastic_tensor = (
114
114
  ElasticTensor.from_voigt(elastic_tensor) if elastic_tensor else None
@@ -3,7 +3,7 @@ from math import ceil
3
3
  from maggma.builders import Builder
4
4
  from maggma.utils import grouper
5
5
 
6
- from emmet.core.mpid import MPID
6
+ from emmet.core.mpid import AlphaID
7
7
  from emmet.core.summary import SummaryDoc, HasProps
8
8
  from emmet.core.utils import jsanitize
9
9
  from emmet.core.thermo import ThermoType
@@ -214,7 +214,7 @@ class SummaryBuilder(Builder):
214
214
  yield {"query": {self.materials.key: {"$in": list(split)}}}
215
215
 
216
216
  def process_item(self, item):
217
- material_id = MPID(item[HasProps.materials.value]["material_id"])
217
+ material_id = AlphaID(item[HasProps.materials.value]["material_id"])
218
218
  doc = SummaryDoc.from_docs(material_id=material_id, **item)
219
219
  return jsanitize(doc.model_dump(exclude_none=False), allow_bson=True)
220
220
 
@@ -34,18 +34,23 @@ class EmmetBuildSettings(EmmetSettings):
34
34
  )
35
35
 
36
36
  VASP_ALLOWED_VASP_TYPES: list[VaspTaskType] = Field(
37
- [t.value for t in VaspTaskType],
37
+ list(VaspTaskType),
38
38
  description="Allowed task_types to build materials from",
39
39
  )
40
40
 
41
41
  QCHEM_ALLOWED_TASK_TYPES: list[QChemTaskType] = Field(
42
- [
43
- "Single Point",
44
- "Force",
45
- "Geometry Optimization",
46
- "Frequency Analysis",
47
- "Frequency Flattening Geometry Optimization",
48
- ],
42
+ list(
43
+ map(
44
+ QChemTaskType,
45
+ [
46
+ "Single Point",
47
+ "Force",
48
+ "Geometry Optimization",
49
+ "Frequency Analysis",
50
+ "Frequency Flattening Geometry Optimization",
51
+ ],
52
+ )
53
+ ),
49
54
  description="Allowed task_types to build molecules from",
50
55
  )
51
56
 
@@ -70,7 +75,7 @@ class EmmetBuildSettings(EmmetSettings):
70
75
  )
71
76
 
72
77
  DEFAULT_HISTORY: History = Field(
73
- History(
78
+ History( # type: ignore[call-arg]
74
79
  name="Materials Project Optimized Structure",
75
80
  url="http://www.materialsproject.org",
76
81
  ),
@@ -6,7 +6,6 @@ import sys
6
6
  from gzip import GzipFile
7
7
  from io import BytesIO
8
8
  from itertools import chain, combinations
9
- from pathlib import Path
10
9
 
11
10
  import orjson
12
11
  from botocore.exceptions import ClientError
@@ -15,6 +14,8 @@ from pymatgen.analysis.diffusion.neb.full_path_mapper import MigrationGraph
15
14
  from pymatgen.core import Structure
16
15
  from pymatgen.io.vasp.inputs import PotcarSingle
17
16
 
17
+ from emmet.core.types.typing import FSPathType
18
+
18
19
  from emmet.builders.settings import EmmetBuildSettings
19
20
 
20
21
  from typing import TYPE_CHECKING
@@ -226,7 +227,7 @@ class HiddenPrints:
226
227
 
227
228
  def get_potcar_stats(
228
229
  method: Literal["potcar", "pymatgen", "stored"] = "potcar",
229
- path_to_stored_stats: str | os.PathLike | Path | None = None,
230
+ path_to_stored_stats: FSPathType | None = None,
230
231
  ) -> dict[str, Any]:
231
232
  """
232
233
  Get the POTCAR stats used in MP calculations to validate POTCARs.
@@ -241,8 +242,8 @@ def get_potcar_stats(
241
242
  releases. As of 25 March, 2024, it does not appear that the
242
243
  MP POTCARs have duplicates
243
244
  - "stored": load a stored dict of POTCAR stats.
244
- path_to_stored_stats : str, os.Pathlike, Path, or None
245
- If a str, the path to the stored summary stats file.
245
+ path_to_stored_stats : FSPathType or None
246
+ If FSPathType, the path to the stored summary stats file.
246
247
  If None, defaults to
247
248
  `importlib.resources.file("emmet.builders.vasp") / "mp_potcar_stats.json.gz"`
248
249
  Returns:
@@ -326,18 +326,25 @@ class MaterialsBuilder(Builder):
326
326
  if task.task_type == TaskType.Deformation:
327
327
  if (
328
328
  transformations is None
329
+ or not task.input
330
+ or not task.input.structure
329
331
  ): # Do not include deformed tasks without transformation information
330
332
  self.logger.debug(
331
- "Cannot find transformation for deformation task {}. Excluding task.".format(
332
- task.task_id
333
- )
333
+ "Cannot find transformation or original structure "
334
+ f"for deformation task {task.task_id}. Excluding task."
334
335
  )
335
336
  continue
336
337
  else:
337
338
  s = undeform_structure(task.input.structure, transformations)
338
339
 
340
+ elif task.output and task.output.structure:
341
+ s = task.output.structure # type: ignore[assignment]
339
342
  else:
340
- s = task.output.structure
343
+ self.logger.debug(
344
+ f"Skipping task {task.task_id}, missing output structure."
345
+ )
346
+ continue
347
+
341
348
  s.index: int = idx # type: ignore
342
349
  structures.append(s)
343
350
 
@@ -75,7 +75,9 @@ class TaskValidator(MapBuilder):
75
75
  potcar_stats=self.potcar_stats,
76
76
  )
77
77
 
78
- bad_tags = list(set(task_doc.tags).intersection(self.settings.DEPRECATED_TAGS))
78
+ bad_tags = list(
79
+ set(task_doc.tags or []).intersection(self.settings.DEPRECATED_TAGS)
80
+ )
79
81
  if len(bad_tags) > 0:
80
82
  validation_doc.warnings.append(f"Manual Deprecation by tags: {bad_tags}")
81
83
  validation_doc.valid = False