Skip to content

Commit 6957562

Browse files
committed
Remove reference to TypeAlias
1 parent 20cbadb commit 6957562

4 files changed

Lines changed: 28 additions & 35 deletions

File tree

simpeg_drivers/electromagnetics/frequency_domain/options.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
from logging import getLogger
1515
from pathlib import Path
16-
from typing import ClassVar, TypeAlias
16+
from typing import ClassVar
1717

1818
from geoapps_utils.utils.importing import GeoAppsError
1919
from geoh5py.groups import PropertyGroup
@@ -22,7 +22,7 @@
2222
LargeLoopGroundFEMReceivers,
2323
MovingLoopGroundFEMReceivers,
2424
)
25-
from pydantic import AliasChoices, BaseModel, ConfigDict, Field, field_validator
25+
from pydantic import field_validator
2626

2727
from simpeg_drivers import assets_path
2828
from simpeg_drivers.options import (
@@ -34,10 +34,6 @@
3434
)
3535

3636

37-
Receivers: TypeAlias = (
38-
MovingLoopGroundFEMReceivers | LargeLoopGroundFEMReceivers | AirborneFEMReceivers
39-
)
40-
4137
logger = getLogger(__name__)
4238

4339

@@ -98,7 +94,11 @@ class FDEMForwardOptions(BaseForwardOptions, BaseFDEMOptions):
9894
physical_property: str = "conductivity"
9995
inversion_type: str = "fdem"
10096

101-
data_object: Receivers
97+
data_object: (
98+
MovingLoopGroundFEMReceivers
99+
| LargeLoopGroundFEMReceivers
100+
| AirborneFEMReceivers
101+
)
102102
z_real_channel_bool: bool
103103
z_imag_channel_bool: bool
104104
models: ConductivityModelOptions
@@ -121,7 +121,11 @@ class FDEMInversionOptions(BaseFDEMOptions, BaseInversionOptions):
121121
physical_property: str = "conductivity"
122122
inversion_type: str = "fdem"
123123

124-
data_object: Receivers
124+
data_object: (
125+
MovingLoopGroundFEMReceivers
126+
| LargeLoopGroundFEMReceivers
127+
| AirborneFEMReceivers
128+
)
125129
z_real_channel: PropertyGroup | None = None
126130
z_real_uncertainty: PropertyGroup | None = None
127131
z_imag_channel: PropertyGroup | None = None

simpeg_drivers/electromagnetics/time_domain/options.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from __future__ import annotations
1313

1414
from pathlib import Path
15-
from typing import ClassVar, TypeAlias
15+
from typing import ClassVar
1616

1717
import numpy as np
1818
from geoh5py.groups import PropertyGroup
@@ -31,11 +31,6 @@
3131
)
3232

3333

34-
Receivers: TypeAlias = (
35-
MovingLoopGroundTEMReceivers | LargeLoopGroundTEMReceivers | AirborneTEMReceivers
36-
)
37-
38-
3934
class BaseTDEMOptions(EMDataMixin):
4035
"""
4136
Base class for Time Domain Electromagnetic options.
@@ -90,7 +85,11 @@ class TDEMForwardOptions(BaseTDEMOptions, BaseForwardOptions):
9085
physical_property: str = "conductivity"
9186
inversion_type: str = "tdem"
9287

93-
data_object: Receivers
88+
data_object: (
89+
MovingLoopGroundTEMReceivers
90+
| LargeLoopGroundTEMReceivers
91+
| AirborneTEMReceivers
92+
)
9493
z_channel_bool: bool | None = None
9594
x_channel_bool: bool | None = None
9695
y_channel_bool: bool | None = None
@@ -115,7 +114,11 @@ class TDEMInversionOptions(BaseTDEMOptions, BaseInversionOptions):
115114
physical_property: str = "conductivity"
116115
inversion_type: str = "tdem"
117116

118-
data_object: Receivers
117+
data_object: (
118+
MovingLoopGroundTEMReceivers
119+
| LargeLoopGroundTEMReceivers
120+
| AirborneTEMReceivers
121+
)
119122
z_channel: PropertyGroup | None = None
120123
z_uncertainty: PropertyGroup | None = None
121124
x_channel: PropertyGroup | None = None

simpeg_drivers/electromagnetics/time_domain_1d/options.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,9 @@
1212
from __future__ import annotations
1313

1414
from pathlib import Path
15-
from typing import ClassVar, TypeAlias
15+
from typing import ClassVar
1616

1717
from geoh5py.groups import PropertyGroup
18-
from geoh5py.objects import (
19-
AirborneTEMReceivers,
20-
LargeLoopGroundTEMReceivers,
21-
MovingLoopGroundTEMReceivers,
22-
)
2318

2419
from simpeg_drivers import assets_path
2520
from simpeg_drivers.electromagnetics.base_1d_options import Base1DOptions
@@ -32,11 +27,6 @@
3227
)
3328

3429

35-
Receivers: TypeAlias = (
36-
MovingLoopGroundTEMReceivers | LargeLoopGroundTEMReceivers | AirborneTEMReceivers
37-
)
38-
39-
4030
class TDEM1DForwardOptions(TDEMForwardOptions, Base1DOptions):
4131
"""
4232
Time Domain Electromagnetic forward options.

simpeg_drivers/options.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from enum import Enum
1515
from logging import getLogger
1616
from pathlib import Path
17-
from typing import Annotated, Any, ClassVar, Literal, TypeAlias
17+
from typing import Annotated, Any, ClassVar, Literal
1818

1919
import numpy as np
2020
from geoapps_utils.base import Options
@@ -48,10 +48,6 @@
4848

4949
logger = getLogger(__name__)
5050

51-
InversionDataDict: TypeAlias = (
52-
dict[str, np.ndarray | None] | dict[str, dict[float, np.ndarray | None]]
53-
)
54-
5551

5652
def deprecate_warning(value, info):
5753
"""Issue deprecation warning."""
@@ -362,7 +358,7 @@ def active_components(self) -> list[str]:
362358
return [k for k in self.components if getattr(self, f"{k}_channel_bool")]
363359

364360
@property
365-
def data(self) -> InversionDataDict:
361+
def data(self) -> dict[str, dict[float, np.ndarray | None]]:
366362
"""Return dictionary of data components and associated values."""
367363
return dict.fromkeys(self.active_components)
368364

@@ -607,15 +603,15 @@ def active_components(self) -> list[str]:
607603
]
608604

609605
@property
610-
def data(self) -> InversionDataDict:
606+
def data(self) -> dict[str, dict[float, np.ndarray | None]]:
611607
"""Return dictionary of data components and associated values."""
612608
out = {}
613609
for k in self.active_components:
614610
out[k] = self.component_data(k)
615611
return out
616612

617613
@property
618-
def uncertainties(self) -> InversionDataDict:
614+
def uncertainties(self) -> dict[str, dict[float, np.ndarray | None]]:
619615
"""Return dictionary of unceratinty components and associated values."""
620616
out = {}
621617
for k in self.active_components:

0 commit comments

Comments
 (0)