A message I've got during a pre-commit unit-test run:
_______________________ test_numpy_random_uniform_multi ________________________
def test_numpy_random_uniform_multi():
"""Test that we can many generate numbers at once from a uniform distribution."""
np_node = NumpyRandomFunc("uniform")
state = np_node.sample_parameters(num_samples=10_000)
samples = np_node.get_param(state, "function_node_result")
assert len(samples) == 10_000
assert len(np.unique(samples)) > 1_000
> assert np.abs(np.mean(samples) - 0.5) < 0.01
E AssertionError: assert 0.010174081407210656 < 0.01
E + where 0.010174081407210656 = <ufunc 'absolute'>((0.5101740814072107 - 0.5))
E + where <ufunc 'absolute'> = np.abs
E + and 0.5101740814072107 = <function mean at 0x1050a3730>(array([0.17279315, 0.81927332, 0.5092465 , ..., 0.17233423, 0.82553945,\n 0.21014224]))
E + where <function mean at 0x1050a3730> = np.mean
tests/tdastro/util_nodes/test_np_random.py:75: AssertionError
Before submitting
Please check the following:
[x] I have described the situation in which the bug arose, including what code was executed, information about my environment, and any applicable data others will need to reproduce the problem.
[x] I have included available evidence of the unexpected behavior (including error messages, screenshots, and/or plots) as well as a descriprion of what I expected instead.
[ ] If I have a solution in mind, I have provided an explanation and/or pseudocode and/or task list.
Bug report
A message I've got during a pre-commit unit-test run:
Before submitting Please check the following: