Skip to content

Commit

Permalink
Tmp testing with np assert_almost_equal print messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
gokuld committed Jun 1, 2023
1 parent fe5f30b commit 005edbe
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pymc/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,9 +728,11 @@ def check_selfconsistency_discrete_icdf(
computed_value = dist_icdf_fn(
**point, value=np.exp(dist_logcdf_fn(**point, value=value))
)
assert (
expected_value == computed_value
), f"expected_value = {expected_value}, computed_value = {computed_value}, {point}"
npt.assert_almost_equal(
expected_value,
computed_value,
err_msg=f"point: {point}, value: {value}, cdf: {np.exp(dist_logcdf_fn(**point, value=value))}",
)


def assert_moment_is_expected(model, expected, check_finite_logp=True):
Expand Down

0 comments on commit 005edbe

Please sign in to comment.