Skip to content

Commit 56840ac

Browse files
TaskDoc fixes, continuing PEP585 support, PropertyDoc schema (#1253)
* Add oszicar to discoverable files for TaskDoc * pep-0585 * the present is unannotated Co-authored-by: Max Gallant <mcgallant72@gmail.com>
1 parent 4933a4f commit 56840ac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+427
-207
lines changed

emmet-api/tests/materials/summary/test_query_operators.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@
1212
SearchESQuery,
1313
)
1414

15-
from emmet.core.summary import SummaryStats
15+
from emmet.core.summary import SummaryDoc, SummaryStats
1616

1717
from pymatgen.analysis.magnetism import Ordering
18-
from emmet.core.summary import SummaryDoc
1918

2019

2120
def test_has_props_query():

emmet-builders/emmet/builders/abinit/phonon.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import os
22
import tempfile
33
from math import ceil
4-
from typing import Iterator
54

65
import numpy as np
76
from abipy.abio.inputs import AnaddbInput
@@ -36,6 +35,11 @@
3635
from emmet.core.polar import BornEffectiveCharges, DielectricDoc, IRDielectric
3736
from emmet.core.utils import jsanitize
3837

38+
from typing import TYPE_CHECKING
39+
40+
if TYPE_CHECKING:
41+
from collections.abc import Iterator
42+
3943
SETTINGS = EmmetBuildSettings()
4044

4145

emmet-builders/emmet/builders/abinit/sound_velocity.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import tempfile
22
import traceback
33
from math import ceil
4-
from typing import Iterator
54

65
from abipy.dfpt.ddb import DdbFile
76
from abipy.dfpt.vsound import SoundVelocity as AbiSoundVelocity
@@ -13,6 +12,11 @@
1312
from emmet.core.phonon import SoundVelocity
1413
from emmet.core.utils import jsanitize
1514

15+
from typing import TYPE_CHECKING
16+
17+
if TYPE_CHECKING:
18+
from collections.abc import Iterator
19+
1620

1721
class SoundVelocityBuilder(Builder):
1822
def __init__(

emmet-builders/emmet/builders/materials/absorption_spectrum.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
from __future__ import annotations
12
from math import ceil
2-
from typing import Iterator
33

44
import numpy as np
55
from maggma.builders import Builder
@@ -10,6 +10,11 @@
1010
from emmet.core.absorption import AbsorptionDoc
1111
from emmet.core.utils import jsanitize
1212

13+
from typing import TYPE_CHECKING
14+
15+
if TYPE_CHECKING:
16+
from collections.abc import Iterator
17+
1318

1419
class AbsorptionBuilder(Builder):
1520
def __init__(

emmet-builders/emmet/builders/materials/corrected_entries.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
from __future__ import annotations
2+
13
import copy
24
import warnings
35
from collections import defaultdict
46
from datetime import datetime
57
from itertools import chain
68
from math import ceil
7-
from typing import Iterable, Iterator
89

910
from maggma.core import Builder, Store
1011
from maggma.utils import grouper
@@ -16,6 +17,11 @@
1617
from emmet.core.thermo import ThermoType
1718
from emmet.core.utils import jsanitize
1819

20+
from typing import TYPE_CHECKING
21+
22+
if TYPE_CHECKING:
23+
from collections.abc import Iterable, Iterator
24+
1925

2026
class CorrectedEntriesBuilder(Builder):
2127
def __init__(

emmet-builders/emmet/builders/materials/dielectric.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
from __future__ import annotations
2+
13
from math import ceil
2-
from typing import Iterator
34

45
import numpy as np
56
from maggma.builders import Builder
@@ -10,6 +11,11 @@
1011
from emmet.core.polar import DielectricDoc
1112
from emmet.core.utils import jsanitize
1213

14+
from typing import TYPE_CHECKING
15+
16+
if TYPE_CHECKING:
17+
from collections.abc import Iterator
18+
1319

1420
class DielectricBuilder(Builder):
1521
def __init__(

emmet-builders/emmet/builders/materials/elasticity.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
7. Fit the elastic tensor.
1818
"""
1919

20+
from __future__ import annotations
21+
2022
from datetime import datetime
21-
from typing import Any, Generator
2223

2324
import numpy as np
2425
from maggma.core import Builder, Store
@@ -33,6 +34,12 @@
3334
from emmet.core.utils import jsanitize
3435
from emmet.core.vasp.calc_types import CalcType
3536

37+
from typing import TYPE_CHECKING
38+
39+
if TYPE_CHECKING:
40+
from collections.abc import Generator
41+
from typing import Any
42+
3643

3744
class ElasticityBuilder(Builder):
3845
def __init__(

emmet-builders/emmet/builders/materials/electrodes.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from functools import lru_cache
55
from itertools import chain
66
from math import ceil
7-
from typing import Any, Iterator
87

98
from maggma.builders import Builder
109
from maggma.stores import MongoStore
@@ -18,6 +17,12 @@
1817
from emmet.core.structure_group import StructureGroupDoc, _get_id_lexi
1918
from emmet.core.utils import jsanitize
2019

20+
from typing import TYPE_CHECKING
21+
22+
if TYPE_CHECKING:
23+
from typing import Any
24+
from collections.abc import Iterator
25+
2126

2227
def s_hash(el):
2328
return el.data["comp_delith"]

emmet-builders/emmet/builders/materials/magnetism.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
from __future__ import annotations
2+
13
from math import ceil
2-
from typing import Iterator
34

45
from maggma.builders import Builder
56
from maggma.stores import Store
@@ -9,6 +10,11 @@
910
from emmet.core.magnetism import MagnetismDoc
1011
from emmet.core.utils import jsanitize
1112

13+
from typing import TYPE_CHECKING
14+
15+
if TYPE_CHECKING:
16+
from collections.abc import Iterator
17+
1218
__author__ = "Shyam Dwaraknath <shyamd@lbl.gov>, Matthew Horton <mkhorton@lbl.gov>"
1319

1420

emmet-builders/emmet/builders/materials/optimade.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from math import ceil
2-
from typing import Iterator
32

43
from maggma.builders import Builder
54
from maggma.core import Store
@@ -9,6 +8,11 @@
98
from emmet.core.optimade import OptimadeMaterialsDoc
109
from emmet.core.utils import jsanitize
1110

11+
from typing import TYPE_CHECKING
12+
13+
if TYPE_CHECKING:
14+
from collections.abc import Iterator
15+
1216

1317
class OptimadeMaterialsBuilder(Builder):
1418
def __init__(

0 commit comments

Comments
 (0)