[Debian-astro-maintainers] Bug#1094732: FTBFS with NumPy 2
Stefano Rivera
stefanor at debian.org
Thu Jan 30 14:48:50 GMT 2025
Source: fast-histogram
Version: 0.14-2
Severity: serious
Tags: ftbfs
Justification: FTBFS
Dear maintainer,
During a test rebuild, fast-histogram failed to rebuild.
-------------------------------------------------------------------------------
[...]
I: pybuild base:311: cd /build/reproducible-path/fast-histogram-0.14/.pybuild/cpython3_3.13_fast-histogram/build; python3.13 -m pytest
============================= test session starts ==============================
platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0
rootdir: /build/reproducible-path/fast-histogram-0.14/.pybuild/cpython3_3.13_fast-histogram/build
configfile: pyproject.toml
plugins: hypothesis-6.124.0, typeguard-4.4.1
collected 11 items
fast_histogram/tests/test_histogram.py F.......... [100%]
=================================== FAILURES ===================================
__________________________ test_1d_compare_with_numpy __________________________
@given(
> size=st.integers(0, 50),
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"]),
)
fast_histogram/tests/test_histogram.py:17:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fast_histogram/tests/test_histogram.py:47: in test_1d_compare_with_numpy
reference = np.histogram(x, bins=nx, weights=w, range=(xmin, xmax))[0]
/usr/lib/python3/dist-packages/numpy/lib/_histograms_impl.py:796: in histogram
bin_edges, uniform_bins = _get_bin_edges(a, bins, range, weights)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a = array([], dtype='>f4'), bins = 2, range = (-1.401298464324817e-45, 0.0)
weights = None
def _get_bin_edges(a, bins, range, weights):
"""
Computes the bins used internally by `histogram`.
Parameters
==========
a : ndarray
Ravelled data array
bins, range
Forwarded arguments from `histogram`.
weights : ndarray, optional
Ravelled weights array, or None
Returns
=======
bin_edges : ndarray
Array of bin edges
uniform_bins : (Number, Number, int):
The upper bound, lowerbound, and number of bins, used in the optimized
implementation of `histogram` that works on uniform bins.
"""
# parse the overloaded bins argument
n_equal_bins = None
bin_edges = None
if isinstance(bins, str):
bin_name = bins
# if `bins` is a string for an automatic method,
# this will replace it with the number of bins calculated
if bin_name not in _hist_bin_selectors:
raise ValueError(
"{!r} is not a valid estimator for `bins`".format(bin_name))
if weights is not None:
raise TypeError("Automated estimation of the number of "
"bins is not supported for weighted data")
first_edge, last_edge = _get_outer_edges(a, range)
# truncate the range if needed
if range is not None:
keep = (a >= first_edge)
keep &= (a <= last_edge)
if not np.logical_and.reduce(keep):
a = a[keep]
if a.size == 0:
n_equal_bins = 1
else:
# Do not call selectors on empty arrays
width = _hist_bin_selectors[bin_name](a, (first_edge, last_edge))
if width:
if np.issubdtype(a.dtype, np.integer) and width < 1:
width = 1
n_equal_bins = int(np.ceil(_unsigned_subtract(last_edge, first_edge) / width))
else:
# Width can be zero for some estimators, e.g. FD when
# the IQR of the data is zero.
n_equal_bins = 1
elif np.ndim(bins) == 0:
try:
n_equal_bins = operator.index(bins)
except TypeError as e:
raise TypeError(
'`bins` must be an integer, a string, or an array') from e
if n_equal_bins < 1:
raise ValueError('`bins` must be positive, when an integer')
first_edge, last_edge = _get_outer_edges(a, range)
elif np.ndim(bins) == 1:
bin_edges = np.asarray(bins)
if np.any(bin_edges[:-1] > bin_edges[1:]):
raise ValueError(
'`bins` must increase monotonically, when an array')
else:
raise ValueError('`bins` must be 1d, when an array')
if n_equal_bins is not None:
# gh-10322 means that type resolution rules are dependent on array
# shapes. To avoid this causing problems, we pick a type now and stick
# with it throughout.
bin_type = np.result_type(first_edge, last_edge, a)
if np.issubdtype(bin_type, np.integer):
bin_type = np.result_type(bin_type, float)
# bin edges must be computed
bin_edges = np.linspace(
first_edge, last_edge, n_equal_bins + 1,
endpoint=True, dtype=bin_type)
if np.any(bin_edges[:-1] >= bin_edges[1:]):
> raise ValueError(
f'Too many bins for data range. Cannot create {n_equal_bins} '
f'finite-sized bins.')
E ValueError: Too many bins for data range. Cannot create 2 finite-sized bins.
E Falsifying example: test_1d_compare_with_numpy(
E # The test sometimes passed when commented parts were varied together.
E size=0, # or any other generated value
E nx=2,
E xmin=-1.401298464324817e-45,
E xmax=0.0,
E weights=False, # or any other generated value
E dtype='>f4',
E )
E Explanation:
E These lines were always and only run by failing examples:
E /usr/lib/python3/dist-packages/numpy/lib/_histograms_impl.py:453
/usr/lib/python3/dist-packages/numpy/lib/_histograms_impl.py:453: ValueError
=========================== short test summary info ============================
FAILED fast_histogram/tests/test_histogram.py::test_1d_compare_with_numpy - V...
======================== 1 failed, 10 passed in 12.75s =========================
E: pybuild pybuild:389: test: plugin distutils failed with: exit code=1: cd /build/reproducible-path/fast-histogram-0.14/.pybuild/cpython3_3.13_fast-histogram/build; python3.13 -m pytest
dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p "3.12 3.13" returned exit code 13
make: *** [debian/rules:9: binary-arch] Error 25
dpkg-buildpackage: error: debian/rules binary-arch subprocess returned exit status 2
--------------------------------------------------------------------------------
Build finished at 2025-01-30T14:46:19Z
-------------------------------------------------------------------------------
The above is just how the build ends and not necessarily the most relevant part.
If required, the full build log is available here (for the next 30 days):
https://debusine.debian.net/artifact/1242087/
About the archive rebuild: The build was made on debusine.debian.net,
on arm64 using sbuild.
You can find the build task here:
https://debusine.debian.net/work-request/72029/
If this is really a bug in one of the build-depends, please use
reassign and affects, so that this is still visible in the BTS web
page for this package.
Thanks,
Stefano
More information about the Debian-astro-maintainers
mailing list