Skip to content
Open
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 on lines 121 to 125
)

Expand Down
6 changes: 3 additions & 3 deletions simpeg_drivers/utils/tile_estimate.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def get_results(self, max_tiles: int = 13) -> dict:
padding_cells=self.driver.params.padding_cells,
)

# Estimate total size in Gb
# Estimate total size in GB
results[count] = float(sim.survey.nD) * mapping.shape[0] * count * 8 * 1e-9

Comment on lines +111 to 113
return results
Expand All @@ -122,7 +122,7 @@ def run(self) -> SimPEGGroup:

logger.info(
"Estimates:\n%s\n%s",
"Tiling \t Total size (Gb) ",
"Tiling \t Total size (GB) ",
"\n".join(f"{key} \t {value:.2e}" for key, value in results.items()),
)

Expand Down Expand Up @@ -247,7 +247,7 @@ def plot(results: dict, data: InversionData, optimal: int):
ax.plot(optimal, fun(optimal), "ro")
ax.set_xlabel("Number of tiles")
ax.set_aspect(tile_counts.max() / problem_sizes.max())
ax.set_ylabel("Est. total size (Gb)")
ax.set_ylabel("Est. total size (GB)")

ax2 = plt.subplot(2, 1, 2)
tiles = tile_locations(
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,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.11130699043982, "phi_d": 193000, "phi_m": 439}
target_run = {"data_norm": 1.0474e01, "phi_d": 2.0890e05, "phi_m": 3.9450e02}


def test_dc_rotated_2d_fwr_run(
Expand Down Expand Up @@ -162,7 +162,7 @@ def test_dc_rotated_gradient_2d_run(
if geoh5.open():
output["data"] = potential.values
if pytest:
check_target(output, target_run)
check_target(output, target_run, tolerance=0.2)


if __name__ == "__main__":
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