Skip to content

Commit 1686234

Browse files
authored
Merge pull request #306 from MiraGeoscience/GEOPY-2568B
GEOPY-2568: MT predicted channels missing [] indices
2 parents 8d08165 + d0cb726 commit 1686234

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

simpeg_drivers/components/factories/directives_factory.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,10 @@ def assemble_keyword_arguments(
489489
name=None,
490490
):
491491
receivers = inversion_object.entity
492-
channels = getattr(receivers, "channels", [None])
492+
channels = [
493+
float(val) if val else None
494+
for val in getattr(receivers, "channels", [None])
495+
]
493496
components = list(inversion_object.observed)
494497
ordering = inversion_object.survey.ordering
495498
n_locations = len(np.unique(ordering[:, 2]))

tests/run_tests/driver_mt_test.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ def test_magnetotellurics_fwr_run(
106106
)
107107
with get_workspace(tmp_path / "inversion_test.ui.geoh5") as geoh5:
108108
components = SyntheticsComponents(geoh5, options=opts)
109+
110+
# Test for label index supporting ints - bypass setter
111+
components.survey.edit_em_metadata({"Channels": [10, 100, 1000]})
112+
109113
params = MTForwardOptions.build(
110114
geoh5=geoh5,
111115
mesh=components.mesh,
@@ -127,6 +131,9 @@ def test_magnetotellurics_fwr_run(
127131
fwr_driver = MTForwardDriver(params)
128132
fwr_driver.run()
129133

134+
with Workspace(tmp_path / "inversion_test.ui.geoh5") as geoh5:
135+
assert geoh5.get_entity("Iteration_0_zyy_real_[0]")[0] is not None
136+
130137

131138
def test_magnetotellurics_run(tmp_path: Path, max_iterations=1, pytest=True):
132139
# pass

0 commit comments

Comments
 (0)