Skip to content

Commit dcc49eb

Browse files
committed
Bulk save
1 parent 09d0367 commit dcc49eb

10 files changed

Lines changed: 34 additions & 9 deletions

File tree

simpeg_drivers/components/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def save_data(self):
242242
data_dict[component] = data_entity
243243
uncert_dict[component] = uncert_entity
244244

245-
data_types[component][ind] = data_entity.entity_type
245+
data_types[component][channel] = data_entity.entity_type
246246

247247
self._observed_data_types = data_types
248248
self.update_params(data_dict, uncert_dict)

simpeg_drivers/components/factories/directives_factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ def reshape(values):
674674
for comp in components
675675
]
676676
),
677-
"channels": np.arange(len(channels)),
677+
"channels": channels,
678678
"components": components,
679679
"sorting": sorting,
680680
"_reshape": reshape,

simpeg_drivers/electricals/induced_polarization/three_dimensions/options.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@
2525
)
2626

2727

28+
class IP3DModelOptions(ConductivityModelOptions):
29+
"""
30+
ModelOptions class with defaulted lower bound.
31+
"""
32+
33+
lower_bound: float | FloatData | None = 0
34+
35+
2836
class IP3DForwardOptions(BaseForwardOptions):
2937
"""
3038
Induced Polarization 3D forward options.

simpeg_drivers/joint/joint_petrophysics/options.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ class JointPetrophysicsOptions(BaseJointOptions):
4646
)
4747

4848
title: str = "Joint Petrophysically Guided Inversion (PGI)"
49-
physical_property: list[str] = [""]
50-
5149
inversion_type: str = "joint petrophysics"
5250

5351
group_b_multiplier: float | None = None

simpeg_drivers/joint/options.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ class BaseJointOptions(CoreOptions):
3838

3939
model_config = ConfigDict(frozen=False)
4040

41+
forward_only: bool = False
42+
physical_property: str = ""
43+
4144
group_a: SimPEGGroup
4245
group_a_multiplier: float = 1.0
4346
group_b: SimPEGGroup

simpeg_drivers/potential_fields/magnetic_scalar/options.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,19 @@
1717
from geoh5py.data import FloatData
1818

1919
from simpeg_drivers import assets_path
20-
from simpeg_drivers.options import BaseForwardOptions, BaseInversionOptions
20+
from simpeg_drivers.options import (
21+
BaseForwardOptions,
22+
BaseInversionOptions,
23+
ModelOptions,
24+
)
25+
26+
27+
class MagneticModelOptions(ModelOptions):
28+
"""
29+
ModelOptions class with defaulted lower bound.
30+
"""
31+
32+
lower_bound: float | FloatData | None = 0
2133

2234

2335
class MagneticForwardOptions(BaseForwardOptions):
@@ -59,6 +71,8 @@ class MagneticForwardOptions(BaseForwardOptions):
5971
inducing_field_inclination: float | FloatData
6072
inducing_field_declination: float | FloatData
6173

74+
models: MagneticModelOptions
75+
6276

6377
class MagneticInversionOptions(BaseInversionOptions):
6478
"""
@@ -121,3 +135,5 @@ class MagneticInversionOptions(BaseInversionOptions):
121135
inducing_field_strength: float | FloatData
122136
inducing_field_inclination: float | FloatData
123137
inducing_field_declination: float | FloatData
138+
139+
models: MagneticModelOptions

tests/run_tests/driver_joint_cross_gradient_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def test_joint_cross_gradient_inv_run(
239239
drivers.append(MVIInversionDriver(params))
240240

241241
# Run the inverse
242-
joint_params = JointCrossGradientOptions(
242+
joint_params = JointCrossGradientOptions.build(
243243
geoh5=geoh5,
244244
topography_object=topography,
245245
group_a=drivers[0].params.out_group,

tests/run_tests/driver_joint_pgi_homogeneous_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def test_homogeneous_run(
229229
)
230230
drivers.append(MagneticInversionDriver(params))
231231

232-
params = JointPetrophysicsOptions(
232+
params = JointPetrophysicsOptions.build(
233233
topography_object=topography,
234234
geoh5=geoh5,
235235
group_a=drivers[0].params.out_group,

tests/run_tests/driver_joint_surveys_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def test_joint_surveys_inv_run(
139139

140140
active_model = drivers[0].params.mesh.get_entity("active_cells")[0]
141141
# Run the inverse
142-
joint_params = JointSurveysOptions(
142+
joint_params = JointSurveysOptions.build(
143143
geoh5=geoh5,
144144
active_cells=ActiveCellsOptions(active_model=active_model),
145145
mesh=drivers[0].params.mesh,

tests/run_tests/driver_mag_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def test_susceptibility_run(
116116
)
117117
params.write_ui_json(path=tmp_path / "Inv_run.ui.json")
118118

119-
assert params.lower_bound == 0.0
119+
assert params.models.lower_bound == 0.0
120120
driver = MagneticInversionDriver.start(str(tmp_path / "Inv_run.ui.json"))
121121

122122
with Workspace(driver.params.geoh5.h5file) as run_ws:

0 commit comments

Comments
 (0)