Skip to content

Commit 0cec365

Browse files
committed
Update unit test
1 parent b047cd2 commit 0cec365

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

tests/run_tests/driver_rotated_gradients_test.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
# To test the full run and validate the inversion.
3636
# Move this file out of the test directory and run.
3737

38-
target_run = {"data_norm": 0.006830937520353864, "phi_d": 0.0276, "phi_m": 0.0288}
38+
target_run = {"data_norm": 0.006830937520353864, "phi_d": 0.0309, "phi_m": 0.028}
3939

4040

4141
def test_gravity_rotated_grad_fwr_run(
@@ -142,13 +142,20 @@ def test_rotated_grad_run(
142142
inactive_ind = run_ws.get_entity("active_cells")[0].values == 0
143143
assert np.all(nan_ind == inactive_ind)
144144

145+
# Smooth functions should be zero for uniform model
146+
for obj in driver.regularization.objfcts:
147+
for smooth in obj.objfcts[1:]:
148+
np.testing.assert_allclose(
149+
smooth(np.ones(driver.models.n_active)), 0, atol=1e-6
150+
)
151+
145152

146153
if __name__ == "__main__":
147154
# Full run
148155
test_gravity_rotated_grad_fwr_run(
149156
Path("./"),
150157
n_grid_points=10,
151-
refinement=(4, 8),
158+
refinement=(6, 8),
152159
)
153160

154161
test_rotated_grad_run(

0 commit comments

Comments
 (0)