Open astrofrog opened 1 year ago
I started trying to add some full hypothesis tests such as:
# First some tests with hypothesis value generation to make sure our # implementation doesn't crash, and do basic checks of validity of the output. @given(values=arrays(dtype='<f8', shape=st.integers(0, 50), elements=st.floats(-1000, 1000, allow_subnormal=False), unique=True), nx=st.integers(1, 10), xmin=st.floats(-1e10, 1e10), xmax=st.floats(-1e10, 1e10), weights=st.booleans(), dtype=st.sampled_from(['>f4', '<f4', '>f8', '<f8'])) @settings(max_examples=1000) def test_1d_basic(values, nx, xmin, xmax, weights, dtype): size = len(values) // 2 w = values[:size] if weights else None x = values[size:] fast = histogram1d(x, bins=nx, weights=w, range=(xmin, xmax)) assert np.sum(fast) == np.sum((x < xmax) & (x >= xmin))
but this crashes with a segmentation fault currently, so need to investigate further.
I started trying to add some full hypothesis tests such as:
but this crashes with a segmentation fault currently, so need to investigate further.