diff options
| author | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2024-07-02 17:50:08 +0000 |
|---|---|---|
| committer | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2024-07-02 17:50:08 +0000 |
| commit | 0c48f2d6d7cdcb7ac8d20ea518b911d8c6ffe231 (patch) | |
| tree | b2b3e63ac34b0d5b22fe75d1e860e3e113795539 /dev-python/mpmath/files | |
| parent | 92f138c6c660a6a68a843c8c394a93999455bee7 (diff) | |
| download | baldeagleos-repo-0c48f2d6d7cdcb7ac8d20ea518b911d8c6ffe231.tar.gz baldeagleos-repo-0c48f2d6d7cdcb7ac8d20ea518b911d8c6ffe231.tar.xz baldeagleos-repo-0c48f2d6d7cdcb7ac8d20ea518b911d8c6ffe231.zip | |
Adding metadata
Diffstat (limited to 'dev-python/mpmath/files')
| -rw-r--r-- | dev-python/mpmath/files/mpmath-1.4.0_alpha1-numpy-2.patch | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/dev-python/mpmath/files/mpmath-1.4.0_alpha1-numpy-2.patch b/dev-python/mpmath/files/mpmath-1.4.0_alpha1-numpy-2.patch new file mode 100644 index 000000000000..13b6ffc9a94f --- /dev/null +++ b/dev-python/mpmath/files/mpmath-1.4.0_alpha1-numpy-2.patch @@ -0,0 +1,32 @@ +From b80b0e08b75f41730a1116aebe34361e5d63d58c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> +Date: Tue, 2 Jul 2024 08:11:58 +0200 +Subject: [PATCH] Fix the comparison in test_compatibility for NumPy 2.0.0 + +The comparison in `mpmath/tests/test_convert.py::test_compatibility` +failed for `np.float16` in NumPy 2.0.0 since `2.0**-53` cannot be +represented in half-precision floating point type. Convert the LHS +to `np.float64` to ensure that the comparison is done in sufficiently +precise type. + +This fixes the actual test failure from #815 but the deprecation warning +remains. +--- + mpmath/tests/test_convert.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/mpmath/tests/test_convert.py b/mpmath/tests/test_convert.py +index 5578b245..c6ef2187 100644 +--- a/mpmath/tests/test_convert.py ++++ b/mpmath/tests/test_convert.py +@@ -254,7 +254,9 @@ def test_compatibility(): + # Handle the weird types + try: diff = np.abs(type(np.sqrt(x))(sqrt(x)) - np.sqrt(x)) + except: continue +- assert diff < 2.0**-53 ++ # numpy-2 does the comparison on LHS type, so we need to convert ++ # it to a type that can actually represent 2.0**-53 ++ assert np.float64(diff) < 2.0**-53 + assert mpf(np.float64('inf')) == inf + assert isnan(mp.npconvert(np.float64('nan'))) + if hasattr(np, "float128"): |
