emmet-builders 0.84.7rc3__py3-none-any.whl → 0.84.8__py3-none-any.whl

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 (41) hide show
  1. emmet/builders/abinit/phonon.py +11 -11
  2. emmet/builders/abinit/sound_velocity.py +10 -10
  3. emmet/builders/feff/xas.py +1 -2
  4. emmet/builders/materials/absorption_spectrum.py +4 -4
  5. emmet/builders/materials/alloys.py +2 -3
  6. emmet/builders/materials/chemenv.py +2 -3
  7. emmet/builders/materials/corrected_entries.py +8 -8
  8. emmet/builders/materials/dielectric.py +3 -4
  9. emmet/builders/materials/elasticity.py +25 -25
  10. emmet/builders/materials/electrodes.py +18 -18
  11. emmet/builders/materials/electronic_structure.py +16 -16
  12. emmet/builders/materials/magnetism.py +3 -3
  13. emmet/builders/materials/ml.py +9 -11
  14. emmet/builders/materials/optimade.py +3 -3
  15. emmet/builders/materials/piezoelectric.py +1 -2
  16. emmet/builders/materials/provenance.py +7 -7
  17. emmet/builders/materials/robocrys.py +2 -3
  18. emmet/builders/materials/substrates.py +8 -7
  19. emmet/builders/materials/thermo.py +10 -10
  20. emmet/builders/matscholar/missing_compositions.py +8 -8
  21. emmet/builders/mobility/migration_graph.py +5 -5
  22. emmet/builders/molecules/atomic.py +22 -23
  23. emmet/builders/molecules/bonds.py +12 -13
  24. emmet/builders/molecules/electric.py +11 -12
  25. emmet/builders/molecules/metal_binding.py +15 -17
  26. emmet/builders/molecules/orbitals.py +11 -12
  27. emmet/builders/molecules/redox.py +21 -22
  28. emmet/builders/molecules/summary.py +13 -13
  29. emmet/builders/molecules/thermo.py +14 -16
  30. emmet/builders/molecules/trajectory.py +18 -19
  31. emmet/builders/molecules/vibration.py +11 -12
  32. emmet/builders/qchem/molecules.py +29 -31
  33. emmet/builders/settings.py +7 -8
  34. emmet/builders/utils.py +5 -5
  35. emmet/builders/vasp/materials.py +11 -11
  36. emmet/builders/vasp/task_validator.py +3 -5
  37. {emmet_builders-0.84.7rc3.dist-info → emmet_builders-0.84.8.dist-info}/METADATA +1 -1
  38. emmet_builders-0.84.8.dist-info/RECORD +54 -0
  39. emmet_builders-0.84.7rc3.dist-info/RECORD +0 -54
  40. {emmet_builders-0.84.7rc3.dist-info → emmet_builders-0.84.8.dist-info}/WHEEL +0 -0
  41. {emmet_builders-0.84.7rc3.dist-info → emmet_builders-0.84.8.dist-info}/top_level.txt +0 -0
@@ -1,28 +1,28 @@
1
- from collections import defaultdict
2
- from math import ceil
3
1
  import itertools
4
2
  import re
3
+ from collections import defaultdict
4
+ from math import ceil
5
+
5
6
  import boto3
6
7
  import numpy as np
7
8
  from botocore.handlers import disable_signing
8
9
  from maggma.builders import Builder
9
10
  from maggma.utils import grouper
10
11
  from pymatgen.analysis.magnetism.analyzer import CollinearMagneticStructureAnalyzer
12
+ from pymatgen.analysis.structure_matcher import StructureMatcher
11
13
  from pymatgen.core import Structure
12
- from pymatgen.electronic_structure.core import Spin
13
14
  from pymatgen.electronic_structure.bandstructure import BandStructureSymmLine
15
+ from pymatgen.electronic_structure.core import Spin
14
16
  from pymatgen.electronic_structure.dos import CompleteDos
15
- from pymatgen.symmetry.bandstructure import HighSymmKpath
16
- from pymatgen.analysis.structure_matcher import StructureMatcher
17
- from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
18
17
  from pymatgen.io.vasp.sets import MPStaticSet
18
+ from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
19
+ from pymatgen.symmetry.bandstructure import HighSymmKpath
19
20
 
20
- from emmet.core.settings import EmmetSettings
21
+ from emmet.builders.utils import query_open_data
21
22
  from emmet.core.electronic_structure import ElectronicStructureDoc
23
+ from emmet.core.settings import EmmetSettings
22
24
  from emmet.core.utils import jsanitize
23
25
 
24
- from emmet.builders.utils import query_open_data
25
-
26
26
  SETTINGS = EmmetSettings()
27
27
 
28
28
 
@@ -297,7 +297,7 @@ class ElectronicStructureBuilder(Builder):
297
297
  Inserts electronic structure documents into the electronic_structure collection
298
298
 
299
299
  Args:
300
- items ([Dict]): A list of ElectronicStructureDoc dictionaries to update
300
+ items ([dict]): A list of ElectronicStructureDoc dictionaries to update
301
301
  """
302
302
 
303
303
  items = list(filter(None, items))
@@ -577,9 +577,9 @@ class ElectronicStructureBuilder(Builder):
577
577
 
578
578
  other_calcs.append(
579
579
  {
580
- "is_static": True
581
- if "Static" in mat["task_types"][task_id]
582
- else False,
580
+ "is_static": (
581
+ True if "Static" in mat["task_types"][task_id] else False
582
+ ),
583
583
  "task_id": task_id,
584
584
  "is_hubbard": int(is_hubbard),
585
585
  "nkpoints": int(nkpoints),
@@ -640,9 +640,9 @@ class ElectronicStructureBuilder(Builder):
640
640
  bs_obj["data"] if bs_obj is not None else None
641
641
  )
642
642
 
643
- materials_doc["bandstructure"][bs_type][
644
- "output_structure"
645
- ] = sorted_bs_data[0]["output_structure"]
643
+ materials_doc["bandstructure"][bs_type]["output_structure"] = (
644
+ sorted_bs_data[0]["output_structure"]
645
+ )
646
646
 
647
647
  materials_doc["origins"].append(
648
648
  {
@@ -1,5 +1,5 @@
1
1
  from math import ceil
2
- from typing import Dict, Iterator, Optional
2
+ from typing import Iterator
3
3
 
4
4
  from maggma.builders import Builder
5
5
  from maggma.stores import Store
@@ -18,7 +18,7 @@ class MagneticBuilder(Builder):
18
18
  materials: Store,
19
19
  magnetism: Store,
20
20
  tasks: Store,
21
- query: Optional[Dict] = None,
21
+ query: dict | None = None,
22
22
  **kwargs,
23
23
  ):
24
24
  """
@@ -42,7 +42,7 @@ class MagneticBuilder(Builder):
42
42
 
43
43
  super().__init__(sources=[materials, tasks], targets=[magnetism], **kwargs)
44
44
 
45
- def prechunk(self, number_splits: int) -> Iterator[Dict]: # pragma: no cover
45
+ def prechunk(self, number_splits: int) -> Iterator[dict]: # pragma: no cover
46
46
  """
47
47
  Prechunk method to perform chunking by the key field
48
48
  """
@@ -1,5 +1,4 @@
1
1
  from importlib.metadata import version
2
- from typing import TYPE_CHECKING, Optional, Union
3
2
 
4
3
  from maggma.builders.map_builder import MapBuilder
5
4
  from maggma.core import Store
@@ -16,13 +15,12 @@ from pymatgen.core import Structure
16
15
  from emmet.core.ml import MLDoc
17
16
  from emmet.core.utils import jsanitize
18
17
 
19
- if TYPE_CHECKING:
20
- try:
21
- from ase.calculators.calculator import Calculator
18
+ try:
19
+ from ase.calculators.calculator import Calculator
22
20
 
23
- ase_installed = True
24
- except ImportError:
25
- ase_installed = False
21
+ ase_installed = True
22
+ except ImportError:
23
+ ase_installed = False
26
24
 
27
25
 
28
26
  class MLBuilder(MapBuilder):
@@ -30,10 +28,10 @@ class MLBuilder(MapBuilder):
30
28
  self,
31
29
  materials: Store,
32
30
  ml_potential: Store,
33
- model: Union[str, "Calculator"],
34
- model_kwargs: Optional[dict] = None,
35
- prop_kwargs: Optional[dict] = None,
36
- provenance: Optional[dict] = None,
31
+ model: str | Calculator,
32
+ model_kwargs: dict | None = None,
33
+ prop_kwargs: dict | None = None,
34
+ provenance: dict | None = None,
37
35
  **kwargs,
38
36
  ):
39
37
  """Machine learning interatomic potential builder.
@@ -1,5 +1,5 @@
1
1
  from math import ceil
2
- from typing import Dict, Iterator, Optional
2
+ from typing import Iterator
3
3
 
4
4
  from maggma.builders import Builder
5
5
  from maggma.core import Store
@@ -16,7 +16,7 @@ class OptimadeMaterialsBuilder(Builder):
16
16
  materials: Store,
17
17
  thermo: Store,
18
18
  optimade: Store,
19
- query: Optional[Dict] = None,
19
+ query: dict | None = None,
20
20
  **kwargs,
21
21
  ):
22
22
  """
@@ -42,7 +42,7 @@ class OptimadeMaterialsBuilder(Builder):
42
42
 
43
43
  super().__init__(sources=[materials, thermo], targets=optimade, **kwargs)
44
44
 
45
- def prechunk(self, number_splits: int) -> Iterator[Dict]: # pragma: no cover
45
+ def prechunk(self, number_splits: int) -> Iterator[dict]: # pragma: no cover
46
46
  """
47
47
  Prechunk method to perform chunking by the key field
48
48
  """
@@ -1,5 +1,4 @@
1
1
  from math import ceil
2
- from typing import Dict, Optional
3
2
 
4
3
  import numpy as np
5
4
  from maggma.builders import Builder
@@ -17,7 +16,7 @@ class PiezoelectricBuilder(Builder):
17
16
  materials: Store,
18
17
  tasks: Store,
19
18
  piezoelectric: Store,
20
- query: Optional[Dict] = None,
19
+ query: dict | None = None,
21
20
  **kwargs,
22
21
  ):
23
22
  self.materials = materials
@@ -1,7 +1,7 @@
1
1
  from collections import defaultdict
2
2
  from datetime import datetime
3
3
  from math import ceil
4
- from typing import Dict, Iterable, List, Optional, Tuple
4
+ from typing import Iterable
5
5
 
6
6
  from maggma.core import Builder, Store
7
7
  from maggma.utils import grouper
@@ -18,9 +18,9 @@ class ProvenanceBuilder(Builder):
18
18
  self,
19
19
  materials: Store,
20
20
  provenance: Store,
21
- source_snls: List[Store],
22
- settings: Optional[EmmetBuildSettings] = None,
23
- query: Optional[Dict] = None,
21
+ source_snls: list[Store],
22
+ settings: EmmetBuildSettings | None = None,
23
+ query: dict | None = None,
24
24
  **kwargs,
25
25
  ):
26
26
  """
@@ -59,7 +59,7 @@ class ProvenanceBuilder(Builder):
59
59
  s.ensure_index("snl_id")
60
60
  s.ensure_index("formula_pretty")
61
61
 
62
- def prechunk(self, number_splits: int) -> Iterable[Dict]: # pragma: no cover
62
+ def prechunk(self, number_splits: int) -> Iterable[dict]: # pragma: no cover
63
63
  self.ensure_indicies()
64
64
 
65
65
  # Find all formulas for materials that have been updated since this
@@ -101,7 +101,7 @@ class ProvenanceBuilder(Builder):
101
101
  for chunk in grouper(mat_ids, N):
102
102
  yield {"query": {"material_id": {"$in": chunk}}}
103
103
 
104
- def get_items(self) -> Tuple[List[Dict], List[Dict]]: # type: ignore
104
+ def get_items(self) -> tuple[list[dict], list[dict]]: # type: ignore
105
105
  """
106
106
  Gets all materials to assocaite with SNLs
107
107
  Returns:
@@ -178,7 +178,7 @@ class ProvenanceBuilder(Builder):
178
178
  self.logger.debug(f"Found {len(snl_structs)} potential snls for {mat_id}")
179
179
  yield mat, snl_structs
180
180
 
181
- def process_item(self, item) -> Dict:
181
+ def process_item(self, item) -> dict:
182
182
  """
183
183
  Matches SNLS and Materials
184
184
  Args:
@@ -1,8 +1,7 @@
1
- from typing import Dict, Optional
2
1
  from maggma.builders.map_builder import MapBuilder
3
2
  from maggma.core import Store
4
-
5
3
  from pymatgen.core.structure import Structure
4
+
6
5
  from emmet.core.robocrys import RobocrystallogapherDoc
7
6
  from emmet.core.utils import jsanitize
8
7
 
@@ -12,7 +11,7 @@ class RobocrystallographerBuilder(MapBuilder):
12
11
  self,
13
12
  oxidation_states: Store,
14
13
  robocrys: Store,
15
- query: Optional[Dict] = None,
14
+ query: dict | None = None,
16
15
  **kwargs
17
16
  ):
18
17
  self.oxidation_states = oxidation_states
@@ -1,14 +1,15 @@
1
- from typing import Optional, Dict, Iterable
2
- from emmet.core.mpid import MPID
3
- from maggma.core.store import Store
1
+ from typing import Iterable
2
+
4
3
  from maggma.core.builder import Builder
5
- from pymatgen.core.structure import Structure
4
+ from maggma.core.store import Store
5
+ from maggma.utils import grouper
6
6
  from pymatgen.analysis.elasticity.elastic import ElasticTensor
7
+ from pymatgen.core.structure import Structure
7
8
  from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
8
9
 
10
+ from emmet.core.mpid import MPID
9
11
  from emmet.core.substrates import SubstratesDoc
10
12
  from emmet.core.utils import jsanitize
11
- from maggma.utils import grouper
12
13
 
13
14
 
14
15
  class SubstratesBuilder(Builder):
@@ -17,7 +18,7 @@ class SubstratesBuilder(Builder):
17
18
  materials: Store,
18
19
  substrates: Store,
19
20
  elasticity: Store,
20
- query: Optional[Dict] = None,
21
+ query: dict | None = None,
21
22
  **kwargs,
22
23
  ):
23
24
  """
@@ -47,7 +48,7 @@ class SubstratesBuilder(Builder):
47
48
  **kwargs,
48
49
  )
49
50
 
50
- def prechunk(self, number_splits: int) -> Iterable[Dict]: # pragma: no cover
51
+ def prechunk(self, number_splits: int) -> Iterable[dict]: # pragma: no cover
51
52
  to_process_mat_ids = self._find_to_process()
52
53
 
53
54
  return [
@@ -1,8 +1,8 @@
1
- from math import ceil
2
1
  import warnings
3
- from itertools import chain
4
- from typing import Dict, Iterator, List, Optional, Set
5
2
  from datetime import datetime
3
+ from itertools import chain
4
+ from math import ceil
5
+ from typing import Iterator, Set
6
6
 
7
7
  from maggma.core import Builder, Store
8
8
  from maggma.stores import S3Store
@@ -12,7 +12,7 @@ from pymatgen.analysis.phase_diagram import PhaseDiagramError
12
12
  from pymatgen.entries.computed_entries import ComputedStructureEntry
13
13
 
14
14
  from emmet.builders.utils import HiddenPrints
15
- from emmet.core.thermo import ThermoDoc, PhaseDiagramDoc
15
+ from emmet.core.thermo import PhaseDiagramDoc, ThermoDoc
16
16
  from emmet.core.utils import jsanitize
17
17
 
18
18
 
@@ -21,9 +21,9 @@ class ThermoBuilder(Builder):
21
21
  self,
22
22
  thermo: Store,
23
23
  corrected_entries: Store,
24
- phase_diagram: Optional[Store] = None,
25
- query: Optional[Dict] = None,
26
- num_phase_diagram_eles: Optional[int] = None,
24
+ phase_diagram: Store | None = None,
25
+ query: dict | None = None,
26
+ num_phase_diagram_eles: int | None = None,
27
27
  chunk_size: int = 1000,
28
28
  **kwargs,
29
29
  ):
@@ -111,7 +111,7 @@ class ThermoBuilder(Builder):
111
111
  coll.ensure_index("chemsys")
112
112
  coll.ensure_index("phase_diagram_id")
113
113
 
114
- def prechunk(self, number_splits: int) -> Iterator[Dict]: # pragma: no cover
114
+ def prechunk(self, number_splits: int) -> Iterator[dict]: # pragma: no cover
115
115
  to_process_chemsys = self._get_chemsys_to_process()
116
116
 
117
117
  N = ceil(len(to_process_chemsys) / number_splits)
@@ -119,7 +119,7 @@ class ThermoBuilder(Builder):
119
119
  for chemsys_chunk in grouper(to_process_chemsys, N):
120
120
  yield {"query": {"chemsys": {"$in": list(chemsys_chunk)}}}
121
121
 
122
- def get_items(self) -> Iterator[List[Dict]]:
122
+ def get_items(self) -> Iterator[list[dict]]:
123
123
  """
124
124
  Gets whole chemical systems of entries to process
125
125
  """
@@ -224,7 +224,7 @@ class ThermoBuilder(Builder):
224
224
  """
225
225
  Inserts the thermo and phase diagram docs into the thermo collection
226
226
  Args:
227
- items ([[tuple(List[dict],List[dict])]]): a list of a list of thermo and phase diagram dict pairs to update
227
+ items ([[tuple(list[dict],list[dict])]]): a list of a list of thermo and phase diagram dict pairs to update
228
228
  """
229
229
 
230
230
  thermo_docs = [pair[0] for pair_list in items for pair in pair_list]
@@ -1,10 +1,10 @@
1
- from itertools import combinations
2
1
  import itertools
2
+ from itertools import combinations
3
3
  from math import ceil
4
- from typing import Dict, List, Iterator, Optional
4
+ from typing import Iterator
5
5
 
6
6
  from maggma.core import Builder
7
- from maggma.stores import S3Store, MongoURIStore, MongoStore
7
+ from maggma.stores import MongoStore, MongoURIStore, S3Store
8
8
  from maggma.utils import grouper
9
9
  from pymatgen.core import Composition, Element
10
10
 
@@ -21,7 +21,7 @@ class MissingCompositionsBuilder(Builder):
21
21
  phase_diagram: S3Store,
22
22
  mpcontribs: MongoURIStore,
23
23
  missing_compositions: MongoStore,
24
- query: Optional[Dict] = None,
24
+ query: dict | None = None,
25
25
  **kwargs,
26
26
  ):
27
27
  """
@@ -47,7 +47,7 @@ class MissingCompositionsBuilder(Builder):
47
47
  **kwargs,
48
48
  )
49
49
 
50
- def prechunk(self, number_splits: int) -> Iterator[Dict]: # pragma: no cover
50
+ def prechunk(self, number_splits: int) -> Iterator[dict]: # pragma: no cover
51
51
  """
52
52
  Prechunk method to perform chunking by the key field
53
53
  """
@@ -61,7 +61,7 @@ class MissingCompositionsBuilder(Builder):
61
61
  for split in grouper(keys, N):
62
62
  yield {"query": {self.phase_diagram.key: {"$in": list(split)}}}
63
63
 
64
- def get_items(self) -> Iterator[Dict]:
64
+ def get_items(self) -> Iterator[dict]:
65
65
  """
66
66
  Returns all chemical systems (combinations of elements)
67
67
  to process.
@@ -112,7 +112,7 @@ class MissingCompositionsBuilder(Builder):
112
112
  self.logger.error(f"Erro looking for phase diagram for {sys}: {ex}")
113
113
  continue
114
114
 
115
- def process_item(self, item: Dict) -> Dict:
115
+ def process_item(self, item: dict) -> dict:
116
116
  """
117
117
  Processes a chemical system and finds missing c
118
118
  ompositions for that system.
@@ -195,7 +195,7 @@ class MissingCompositionsBuilder(Builder):
195
195
  else:
196
196
  self.logger.info("No items to update")
197
197
 
198
- def _get_entries_in_chemsys(self, chemsys) -> List:
198
+ def _get_entries_in_chemsys(self, chemsys) -> list:
199
199
  """Queries the MPContribs Store for entries in a chemical system."""
200
200
  # get sub-systems
201
201
  chemsys_subsystems = []
@@ -1,10 +1,10 @@
1
1
  from maggma.builders.map_builder import MapBuilder
2
2
  from maggma.stores import MongoStore
3
- from typing import Tuple
4
- from emmet.core.mobility.migrationgraph import MigrationGraphDoc
5
- from emmet.builders.utils import get_hop_cutoff
6
- from pymatgen.apps.battery.insertion_battery import InsertionElectrode
7
3
  from pymatgen.analysis.diffusion.neb.full_path_mapper import MigrationGraph
4
+ from pymatgen.apps.battery.insertion_battery import InsertionElectrode
5
+
6
+ from emmet.builders.utils import get_hop_cutoff
7
+ from emmet.core.mobility.migrationgraph import MigrationGraphDoc
8
8
  from emmet.core.utils import jsanitize
9
9
 
10
10
 
@@ -18,7 +18,7 @@ class MigrationGraphBuilder(MapBuilder):
18
18
  max_hop_distance: float = 7,
19
19
  populate_sc_fields: bool = True,
20
20
  min_length_sc: float = 8,
21
- minmax_num_atoms: Tuple[int, int] = (80, 120),
21
+ minmax_num_atoms: tuple[int, int] = (80, 120),
22
22
  ltol: float = 0.2,
23
23
  stol: float = 0.3,
24
24
  angle_tol: float = 5,
@@ -2,23 +2,22 @@ from collections import defaultdict
2
2
  from datetime import datetime
3
3
  from itertools import chain
4
4
  from math import ceil
5
- from typing import Optional, Iterable, Iterator, List, Dict
5
+ from typing import Iterable, Iterator
6
6
 
7
7
  from maggma.builders import Builder
8
8
  from maggma.core import Store
9
9
  from maggma.utils import grouper
10
10
 
11
- from emmet.core.qchem.task import TaskDocument
12
- from emmet.core.qchem.molecule import MoleculeDoc, evaluate_lot
11
+ from emmet.builders.settings import EmmetBuildSettings
13
12
  from emmet.core.molecules.atomic import (
14
- PartialChargesDoc,
15
- PartialSpinsDoc,
16
13
  CHARGES_METHODS,
17
14
  SPINS_METHODS,
15
+ PartialChargesDoc,
16
+ PartialSpinsDoc,
18
17
  )
18
+ from emmet.core.qchem.molecule import MoleculeDoc, evaluate_lot
19
+ from emmet.core.qchem.task import TaskDocument
19
20
  from emmet.core.utils import jsanitize
20
- from emmet.builders.settings import EmmetBuildSettings
21
-
22
21
 
23
22
  __author__ = "Evan Spotte-Smith"
24
23
 
@@ -55,9 +54,9 @@ class PartialChargesBuilder(Builder):
55
54
  tasks: Store,
56
55
  molecules: Store,
57
56
  charges: Store,
58
- query: Optional[Dict] = None,
59
- methods: Optional[List] = None,
60
- settings: Optional[EmmetBuildSettings] = None,
57
+ query: dict | None = None,
58
+ methods: list | None = None,
59
+ settings: EmmetBuildSettings | None = None,
61
60
  **kwargs,
62
61
  ):
63
62
  self.tasks = tasks
@@ -105,7 +104,7 @@ class PartialChargesBuilder(Builder):
105
104
  self.charges.ensure_index("last_updated")
106
105
  self.charges.ensure_index("formula_alphabetical")
107
106
 
108
- def prechunk(self, number_splits: int) -> Iterable[Dict]: # pragma: no cover
107
+ def prechunk(self, number_splits: int) -> Iterable[dict]: # pragma: no cover
109
108
  """Prechunk the builder for distributed computation"""
110
109
 
111
110
  temp_query = dict(self.query)
@@ -131,7 +130,7 @@ class PartialChargesBuilder(Builder):
131
130
  query["species_hash"] = {"$in": list(hash_chunk)}
132
131
  yield {"query": query}
133
132
 
134
- def get_items(self) -> Iterator[List[Dict]]:
133
+ def get_items(self) -> Iterator[list[dict]]:
135
134
  """
136
135
  Gets all items to process into partial charges documents.
137
136
  This does no datetime checking; relying on on whether
@@ -178,12 +177,12 @@ class PartialChargesBuilder(Builder):
178
177
 
179
178
  yield molecules
180
179
 
181
- def process_item(self, items: List[Dict]) -> List[Dict]:
180
+ def process_item(self, items: list[dict]) -> list[dict]:
182
181
  """
183
182
  Process the tasks into PartialChargesDocs
184
183
 
185
184
  Args:
186
- tasks List[Dict] : a list of MoleculeDocs in dict form
185
+ tasks list[dict] : a list of MoleculeDocs in dict form
187
186
 
188
187
  Returns:
189
188
  [dict] : a list of new partial charges docs
@@ -275,7 +274,7 @@ class PartialChargesBuilder(Builder):
275
274
 
276
275
  return jsanitize([doc.model_dump() for doc in charges_docs], allow_bson=True)
277
276
 
278
- def update_targets(self, items: List[List[Dict]]):
277
+ def update_targets(self, items: list[list[dict]]):
279
278
  """
280
279
  Inserts the new documents into the charges collection
281
280
 
@@ -334,9 +333,9 @@ class PartialSpinsBuilder(Builder):
334
333
  tasks: Store,
335
334
  molecules: Store,
336
335
  spins: Store,
337
- query: Optional[Dict] = None,
338
- methods: Optional[List] = None,
339
- settings: Optional[EmmetBuildSettings] = None,
336
+ query: dict | None = None,
337
+ methods: list | None = None,
338
+ settings: EmmetBuildSettings | None = None,
340
339
  **kwargs,
341
340
  ):
342
341
  self.tasks = tasks
@@ -384,7 +383,7 @@ class PartialSpinsBuilder(Builder):
384
383
  self.spins.ensure_index("last_updated")
385
384
  self.spins.ensure_index("formula_alphabetical")
386
385
 
387
- def prechunk(self, number_splits: int) -> Iterable[Dict]: # pragma: no cover
386
+ def prechunk(self, number_splits: int) -> Iterable[dict]: # pragma: no cover
388
387
  """Prechunk the builder for distributed computation"""
389
388
 
390
389
  temp_query = dict(self.query)
@@ -410,7 +409,7 @@ class PartialSpinsBuilder(Builder):
410
409
  query["species_hash"] = {"$in": list(hash_chunk)}
411
410
  yield {"query": query}
412
411
 
413
- def get_items(self) -> Iterator[List[Dict]]:
412
+ def get_items(self) -> Iterator[list[dict]]:
414
413
  """
415
414
  Gets all items to process into partial spins documents.
416
415
  This does no datetime checking; relying on on whether
@@ -457,12 +456,12 @@ class PartialSpinsBuilder(Builder):
457
456
 
458
457
  yield molecules
459
458
 
460
- def process_item(self, items: List[Dict]) -> List[Dict]:
459
+ def process_item(self, items: list[dict]) -> list[dict]:
461
460
  """
462
461
  Process the tasks into PartialSpinsDocs
463
462
 
464
463
  Args:
465
- tasks List[Dict] : a list of MoleculeDocs in dict form
464
+ tasks list[dict] : a list of MoleculeDocs in dict form
466
465
 
467
466
  Returns:
468
467
  [dict] : a list of new partial spins docs
@@ -555,7 +554,7 @@ class PartialSpinsBuilder(Builder):
555
554
 
556
555
  return jsanitize([doc.model_dump() for doc in spins_docs], allow_bson=True)
557
556
 
558
- def update_targets(self, items: List[List[Dict]]):
557
+ def update_targets(self, items: list[list[dict]]):
559
558
  """
560
559
  Inserts the new documents into the spins collection
561
560
 
@@ -2,18 +2,17 @@ from collections import defaultdict
2
2
  from datetime import datetime
3
3
  from itertools import chain
4
4
  from math import ceil
5
- from typing import Optional, Iterable, Iterator, List, Dict
5
+ from typing import Iterable, Iterator
6
6
 
7
7
  from maggma.builders import Builder
8
8
  from maggma.core import Store
9
9
  from maggma.utils import grouper
10
10
 
11
- from emmet.core.qchem.task import TaskDocument
11
+ from emmet.builders.settings import EmmetBuildSettings
12
+ from emmet.core.molecules.bonds import BOND_METHODS, MoleculeBondingDoc
12
13
  from emmet.core.qchem.molecule import MoleculeDoc, evaluate_lot
13
- from emmet.core.molecules.bonds import MoleculeBondingDoc, BOND_METHODS
14
+ from emmet.core.qchem.task import TaskDocument
14
15
  from emmet.core.utils import jsanitize
15
- from emmet.builders.settings import EmmetBuildSettings
16
-
17
16
 
18
17
  __author__ = "Evan Spotte-Smith"
19
18
 
@@ -54,9 +53,9 @@ class BondingBuilder(Builder):
54
53
  tasks: Store,
55
54
  molecules: Store,
56
55
  bonds: Store,
57
- query: Optional[Dict] = None,
58
- methods: Optional[List] = None,
59
- settings: Optional[EmmetBuildSettings] = None,
56
+ query: dict | None = None,
57
+ methods: list | None = None,
58
+ settings: EmmetBuildSettings | None = None,
60
59
  **kwargs,
61
60
  ):
62
61
  self.tasks = tasks
@@ -104,7 +103,7 @@ class BondingBuilder(Builder):
104
103
  self.bonds.ensure_index("last_updated")
105
104
  self.bonds.ensure_index("formula_alphabetical")
106
105
 
107
- def prechunk(self, number_splits: int) -> Iterable[Dict]: # pragma: no cover
106
+ def prechunk(self, number_splits: int) -> Iterable[dict]: # pragma: no cover
108
107
  """Prechunk the builder for distributed computation"""
109
108
 
110
109
  temp_query = dict(self.query)
@@ -130,7 +129,7 @@ class BondingBuilder(Builder):
130
129
  query["species_hash"] = {"$in": list(hash_chunk)}
131
130
  yield {"query": query}
132
131
 
133
- def get_items(self) -> Iterator[List[Dict]]:
132
+ def get_items(self) -> Iterator[list[dict]]:
134
133
  """
135
134
  Gets all items to process into bonding documents.
136
135
  This does no datetime checking; relying on on whether
@@ -177,12 +176,12 @@ class BondingBuilder(Builder):
177
176
 
178
177
  yield molecules
179
178
 
180
- def process_item(self, items: List[Dict]) -> List[Dict]:
179
+ def process_item(self, items: list[dict]) -> list[dict]:
181
180
  """
182
181
  Process the tasks into MoleculeBondingDocs
183
182
 
184
183
  Args:
185
- tasks List[Dict] : a list of MoleculeDocs in dict form
184
+ tasks list[dict] : a list of MoleculeDocs in dict form
186
185
 
187
186
  Returns:
188
187
  [dict] : a list of new bonding docs
@@ -292,7 +291,7 @@ class BondingBuilder(Builder):
292
291
 
293
292
  return jsanitize([doc.model_dump() for doc in bonding_docs], allow_bson=True)
294
293
 
295
- def update_targets(self, items: List[List[Dict]]):
294
+ def update_targets(self, items: list[list[dict]]):
296
295
  """
297
296
  Inserts the new documents into the bonds collection
298
297