Skip to content

Commit

Permalink
fix: atol for isclose
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlangrose committed Mar 15, 2024
1 parent e195c0c commit 7165790
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tests/unit/modelling/test_structural_frame.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from math import atan
from LoopStructural.modelling.features import (
StructuralFrame,
GeologicalFeature,
Expand Down Expand Up @@ -65,9 +66,16 @@ def test_create_structural_frame_pli():
"fault", 10, nelements=2000, steps=4, interpolatortype="PLI", buffer=2
)
model.update()
assert np.all(np.isclose(fault[0].evaluate_gradient(np.array([[5, 5, 5]])), [0, 0, 1]))
assert np.all(np.isclose(fault[1].evaluate_gradient(np.array([[5, 5, 5]])), [0, 1, 0]))
assert np.all(np.isclose(fault[2].evaluate_gradient(np.array([[5, 5, 5]])), [1, 0, 0]))

assert np.all(
np.isclose(fault[0].evaluate_gradient(np.array([[5, 5, 5]])), [0, 0, 1], atol=1e-4)
)
assert np.all(
np.isclose(fault[1].evaluate_gradient(np.array([[5, 5, 5]])), [0, 1, 0], atol=1e-4)
)
assert np.all(
np.isclose(fault[2].evaluate_gradient(np.array([[5, 5, 5]])), [1, 0, 0], atol=1e-4)
)


if __name__ == "__main__":
Expand Down

0 comments on commit 7165790

Please sign in to comment.