Skip to content

Commit

Permalink
fix some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
juanitorduz committed Aug 9, 2024
1 parent 07ff68a commit f0c222f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/mmm/test_transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ def test_hill_monotonicity(self, sigma, beta, lam):
)
def test_hill_zero(self, sigma, beta, lam):
y = hill_saturation(0, sigma, beta, lam).eval()
assert pytest.approx(y, 0.0)
assert y == pytest.approx(0.0)

@pytest.mark.parametrize(
"x, sigma, beta, lam",
Expand Down Expand Up @@ -537,9 +537,10 @@ def test_hill_vectorized_input(self, x, sigma, beta, lam):
def test_hill_asymptotic_behavior(self, sigma, beta, lam):
x = 1e6 # A very large value to approximate infinity
y = hill_saturation(x, sigma, beta, lam).eval()
expected = sigma * (1 - 1 / (1 + np.exp(beta * lam)))
np.testing.assert_almost_equal(
y,
sigma,
expected,
decimal=5,
err_msg="The function does not approach sigma as x approaches infinity.",
)
Expand Down

0 comments on commit f0c222f

Please sign in to comment.