ype == np.float32 else 1e-9 > compare_moments(m1, m2, thresh=thresh) skimage/measure/tests/test_moments.py:238: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ m1 = array([[-157.93326, 0. ], [ 0. , 0. ]], dtype=float32) m2 = array([[-1.5793326e+02, -1.3671875e-02], [-2.0507812e-02, 1.0946890e+06]], dtype=float32) thresh = 0.00012 def compare_moments(m1, m2, thresh=1e-8): """Compare two moments arrays. Compares only values in the upper-left triangle of m1, m2 since values below the diagonal exceed the specified order and are not computed when the analytical computation is used. Also, there the first-order central moments will be exactly zero with the analytical calculation, but will not be zero due to limited floating point precision when using a numerical computation. Here we just specify the tolerance as a fraction of the maximum absolute value in the moments array. """ m1 = m1.copy() m2 = m2.copy() # make sure location of any NaN values match and then ignore the NaN values # in the subsequent comparisons nan_idx1 = np.where(np.isnan(m1.ravel()))[0] nan_idx2 = np.where(np.isnan(m2.ravel()))[0] assert len(nan_idx1) == len(nan_idx2) assert np.all(nan_idx1 == nan_idx2) m1[np.isnan(m1)] = 0 m2[np.isnan(m2)] = 0 max_val = np.abs(m1[m1 != 0]).max() for orders in itertools.product(*((range(m1.shape[0]),) * m1.ndim)): if sum(orders) > m1.shape[0] - 1: m1[orders] = 0 m2[orders] = 0 continue abs_diff = abs(m1[orders] - m2[orders]) rel_diff = abs_diff / max_val > assert rel_diff < thresh E assert 0.00012985113 < 0.00012 skimage/measure/tests/test_moments.py:50: AssertionError =============================== warnings summary =============================== skimage/filters/tests/test_unsharp_mask.py: 480 warnings /builddir/build/BUILDROOT/python-scikit-image-0.22.0-2.fc40.riscv64/usr/lib64/python3.12/site-packages/skimage/filters/tests/test_unsharp_mask.py:26: RuntimeWarning: invalid value encountered in cast array = ((array + offset) * 128).astype(dtype) skimage/transform/tests/test_pyramids.py::test_pyramid_dtype_support[pyramid_gaussian-uint8] skimage/transform/tests/test_pyramids.py::test_pyramid_dtype_support[pyramid_laplacian-uint8] /builddir/build/BUILDROOT/python-scikit-image-0.22.0-2.fc40.riscv64/usr/lib64/python3.12/site-packages/skimage/transform/tests/test_pyramids.py:208: RuntimeWarning: invalid value encountered in cast img = np.random.randn(32, 8).astype(dtype) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =========================== short test summary info ============================ FAILED skimage/measure/tests/test_moments.py::test_analytical_moments_calculation[2-1-float32] = 1 failed, 8095 passed, 13 skipped, 10 deselected, 482 warnings in 4123.12s (1:08:43) = RPM build errors: error: Bad exit status from /var/tmp/rpm-tmp.f6fzUR (%check) Bad exit status from /var/tmp/rpm-tmp.f6fzUR (%check) Child return code was: 1 EXCEPTION: [Error('Command failed: \n # bash --login -c /usr/bin/rpmbuild -bb --noclean --target riscv64 --nodeps /builddir/build/SPECS/python-scikit-image.spec\n', 1)] Traceback (most recent call last): File "/usr/lib/python3.11/site-packages/mockbuild/trace_decorator.py", line 93, in trace result = func(*args, **kw) ^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/mockbuild/util.py", line 598, in do_with_status raise exception.Error("Command failed: \n # %s\n%s" % (command, output), child.returncode) mockbuild.exception.Error: Command failed: # bash --login -c /usr/bin/rpmbuild -bb --noclean --target riscv64 --nodeps /builddir/build/SPECS/python-scikit-image.spec