Skip to content

Commit

Permalink
Removing debugging print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanjmeade committed Jul 10, 2024
1 parent 7843ab0 commit 74bdff1
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions tests/test_western_north_america_dense.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,39 +59,27 @@ def test_western_north_america_dense():
)
celeri.post_process_estimation(estimation, operators, station, index)

# Compare with known answer
test_western_north_america_arrays = np.load("./tests/test_western_north_america_arrays.npz")

print("START - SLIP RATE TEST")
# Set digits of accuracy
# NOTE: Locally we get machine precision repeatability. On Github workflows
# we only get 2-3 digits of repeatability.
ATOL = 1e-2
print(f"{estimation.slip_rates[0]}, {test_western_north_america_arrays['estimation_slip_rates'][0]}")

# Load known solution
test_western_north_america_arrays = np.load("./tests/test_western_north_america_arrays.npz")

assert np.allclose(
estimation.slip_rates, test_western_north_america_arrays["estimation_slip_rates"], atol=ATOL
)
print("END - SLIP RATE TEST")

print("START - TDE RATE TEST")
print(f"{estimation.tde_rates[0]}, {test_western_north_america_arrays['estimation_tde_rates'][0]}")
assert np.allclose(
estimation.tde_rates, test_western_north_america_arrays["estimation_tde_rates"], atol=ATOL
)
print("END - TDE RATE TEST")

print("START - EAST RESIDUAL TEST")
print(f"{estimation.east_vel_residual[0]}, {test_western_north_america_arrays['estimation_east_vel_residual'][0]}")
assert np.allclose(
estimation.east_vel_residual,
test_western_north_america_arrays["estimation_east_vel_residual"],
atol=ATOL,
)
print("END - EAST RESIDUAL TEST")

print("START - NORTH RESIDUAL TEST")
print(f"{estimation.north_vel_residual[0]}, {test_western_north_america_arrays['estimation_north_vel_residual'][0]}")
assert np.allclose(
estimation.north_vel_residual,
test_western_north_america_arrays["estimation_north_vel_residual"],
atol=ATOL,
)
print("END - NORTH RESIDUAL TEST")

0 comments on commit 74bdff1

Please sign in to comment.