Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion simpeg_drivers/components/topography.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def active_cells(self, mesh: InversionMesh, data: InversionData) -> np.ndarray:
active_cells = active_from_xyz(
mesh.entity,
vertices,
grid_reference="center",
grid_reference="bottom" if forced_to_surface else "center",
triangulation=cells,
)
Comment thread
domfournier marked this conversation as resolved.

Expand Down
4 changes: 2 additions & 2 deletions tests/run_tests/driver_dc_2d_rotated_gradients_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
# To test the full run and validate the inversion.
# Move this file out of the test directory and run.

target_run = {"data_norm": 10.11130699043982, "phi_d": 193000, "phi_m": 439}
target_run = {"data_norm": 1.0864e01, "phi_d": 4.5530e04, "phi_m": 7.7120e02}


def test_dc_rotated_2d_fwr_run(
tmp_path: Path, n_electrodes=10, n_lines=3, cell_size=(5.0, 5.0)
tmp_path: Path, n_electrodes=10, n_lines=3, cell_size=(10.0, 10.0)
):
opts = SyntheticsComponentsOptions(
method="direct current 2d",
Expand Down
2 changes: 1 addition & 1 deletion tests/run_tests/driver_dc_2d_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
# To test the full run and validate the inversion.
# Move this file out of the test directory and run.

target_run = {"data_norm": 10.864162198305321, "phi_d": 5370, "phi_m": 334}
target_run = {"data_norm": 1.1186e01, "phi_d": 5.1220e03, "phi_m": 3.3940e02}


def test_dc_2d_fwr_run(
Expand Down
2 changes: 1 addition & 1 deletion tests/run_tests/driver_dc_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
# To test the full run and validate the inversion.
# Move this file out of the test directory and run.

target_run = {"data_norm": 0.14571066077648995, "phi_d": 14.4, "phi_m": 3940}
target_run = {"data_norm": 1.3680e-01, "phi_d": 1.1720e01, "phi_m": 4.6400e03}


def test_dc_3d_fwr_run(
Expand Down
2 changes: 1 addition & 1 deletion tests/run_tests/driver_ip_2d_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
# To test the full run and validate the inversion.
# Move this file out of the test directory and run.

target_run = {"data_norm": 0.1236630897188764, "phi_d": 15800, "phi_m": 0.000171}
target_run = {"data_norm": 1.2313e-01, "phi_d": 1.5580e04, "phi_m": 2.2570e-04}


def test_ip_2d_fwr_run(
Expand Down
2 changes: 1 addition & 1 deletion tests/run_tests/driver_ip_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
# To test the full run and validate the inversion.
# Move this file out of the test directory and run.

target_run = {"data_norm": 0.004782189506580897, "phi_d": 571, "phi_m": 1.55e-06}
target_run = {"data_norm": 4.6608e-03, "phi_d": 5.4190e02, "phi_m": 2.1450e-06}


def test_ip_3d_fwr_run(
Expand Down
6 changes: 3 additions & 3 deletions tests/run_tests/driver_joint_cross_gradient_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
# To test the full run and validate the inversion.
# Move this file out of the test directory and run.

target_run = {"data_norm": 53.31485005157825, "phi_d": 498.5, "phi_m": 0.2658}
target_run = {"data_norm": 5.3315e01, "phi_d": 4.9190e02, "phi_m": 2.7810e-01}
INDUCING_FIELD = (50000.0, 90.0, 0.0)


Expand Down Expand Up @@ -334,13 +334,13 @@ def test_joint_cross_gradient_inv_run(
# the scaling from its total misfit.
np.testing.assert_allclose(
driver.directives.scale_misfits.scalings,
[1.0, 0.423491, 0.125, 0.125, 0.319101],
[1.0, 0.423571, 0.125, 0.125, 0.300323],
atol=1e-3,
)
# Check that scaling * chi factor is reflected in data misfit multipliers
np.testing.assert_allclose(
driver.data_misfit.multipliers,
[0.8, 0.338793, 0.125, 0.125, 0.319101],
[0.8, 0.338857, 0.125, 0.125, 0.300323],
atol=1e-3,
)

Expand Down
2 changes: 1 addition & 1 deletion tests/run_tests/driver_mt_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
# To test the full run and validate the inversion.
# Move this file out of the test directory and run.

target_run = {"data_norm": 0.003584600661140228, "phi_d": 4.45, "phi_m": 5.56}
target_run = {"data_norm": 3.4932e-02, "phi_d": 1.4260e-01, "phi_m": 3.3270e00}


def setup_data(workspace, survey):
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def check_target(output: dict, target: dict, tolerance=0.05):
:param tolerance: Tolerance between output and target measured as: |a-b|/b
"""
print(
f"Output: 'data_norm': {np.linalg.norm(output['data'])}, 'phi_d': {output['phi_d'][-1]}, 'phi_m': {output['phi_m'][-1]}"
f"Output: 'data_norm': {np.linalg.norm(output['data']):.4e}, 'phi_d': {output['phi_d'][-1]:.4e}, 'phi_m': {output['phi_m'][-1]:.4e}"
)
print(f"Target: {target}")

Expand Down
Loading