Tuesday, August 27, 2024

Re: numpy 1.26.4 (python 3.12 and cython 3 support)

On 2024/08/21 21:32, Daniel Dickman wrote:
>
>
> On Sat, 17 Aug 2024, Theo Buehler wrote:
>
> > On Tue, Aug 13, 2024 at 06:20:27PM -0400, Daniel Dickman wrote:
> > > Here's a possible update of numpy to 1.26.4.
> > >
> > > The build switches to meson in this release. And this release is the first
> > > one to support Python 3.12 and also the first to officialy support Cython
> > > 3.
> > >
> > > This should probably be put into bulks on multiple amd64 and other archs
> > > before being committed.
> >
> > After working around a debug package issue in numpy itself, this
> > completed a bulk without fallout. Further testing on other
> > architectures should probably wait until this and issues with
> > regress is sorted.
> >
>
> Thanks to feedback from tb@, new diff below with 2 changes:
>
> - add "DWZ=:" to fix the build of debug packages, this is an issue on both
> Python 3.11 and 3.12 likely due to 128 bit math.
>
> - disable tests. The regress tests work fine under Python 3.12 but fail
> under Python 3.11 due to what looks to me like incomplete refactoring
> of code after numpy.distutils was removed from numpy.
>
> Believe tb@ ran a bulk on amd64 with no issues, so !amd64 bulks would be
> very useful at this point.

Bulk builds on the archs which are most likely to have problems is
really unlikely to happen - few people have the type of machines
suitable for running them in any reasonable timeframe.

Results from building and "make test" on other archs (especially
sparc64) are easier and would be useful.

The extra patches below fix things so tests can run on 3.11 (remove
NO_TEST from Makefile too). "make test" on amd64 Py 3.11 results below
the diff (summary: 31 failed, 35649 passed, 2372 skipped, 1305
deselected, 33 xfailed, 1 xpassed, 21 warnings in 207.79s"; I'll run
it on aarch64 when my machine's free and reply if there are many
differences. Maybe i386 too when the current bulk finishes (a day or
two).


Index: patches/patch-numpy__pytesttester_py
===================================================================
RCS file: patches/patch-numpy__pytesttester_py
diff -N patches/patch-numpy__pytesttester_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-numpy__pytesttester_py 27 Aug 2024 15:50:18 -0000
@@ -0,0 +1,14 @@
+1.26.4 no longer has numpy.distutils but tests still reference it
+
+Index: numpy/_pytesttester.py
+--- numpy/_pytesttester.py.orig
++++ numpy/_pytesttester.py
+@@ -135,7 +135,7 @@ class PytestTester:
+ # offset verbosity. The "-q" cancels a "-v".
+ pytest_args += ["-q"]
+
+- if sys.version_info < (3, 12):
++ if sys.version_info < (3, 11):
+ with warnings.catch_warnings():
+ warnings.simplefilter("always")
+ # Filter out distutils cpu warnings (could be localized to
Index: patches/patch-numpy_tests_test_public_api_py
===================================================================
RCS file: patches/patch-numpy_tests_test_public_api_py
diff -N patches/patch-numpy_tests_test_public_api_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-numpy_tests_test_public_api_py 27 Aug 2024 15:50:18 -0000
@@ -0,0 +1,41 @@
+1.26.4 no longer has numpy.distutils but tests still reference it
+
+Index: numpy/tests/test_public_api.py
+--- numpy/tests/test_public_api.py.orig
++++ numpy/tests/test_public_api.py
+@@ -159,7 +159,7 @@ PUBLIC_MODULES = ['numpy.' + s for s in [
+ "typing.mypy_plugin",
+ "version" # Should be removed for NumPy 2.0
+ ]]
+-if sys.version_info < (3, 12):
++if sys.version_info < (3, 11):
+ PUBLIC_MODULES += [
+ 'numpy.' + s for s in [
+ "distutils",
+@@ -240,7 +240,7 @@ PRIVATE_BUT_PRESENT_MODULES = ['numpy.' + s for s in [
+ "random.bit_generator",
+ "testing.print_coercion_tables",
+ ]]
+-if sys.version_info < (3, 12):
++if sys.version_info < (3, 11):
+ PRIVATE_BUT_PRESENT_MODULES += [
+ 'numpy.' + s for s in [
+ "distutils.armccompiler",
+@@ -335,7 +335,7 @@ SKIP_LIST = [
+ "numpy.core.generate_numpy_api",
+ "numpy.core.umath_tests",
+ ]
+-if sys.version_info < (3, 12):
++if sys.version_info < (3, 11):
+ SKIP_LIST += ["numpy.distutils.msvc9compiler"]
+
+
+@@ -380,7 +380,7 @@ SKIP_LIST_2 = [
+ 'numpy.matlib.ctypeslib',
+ 'numpy.matlib.ma',
+ ]
+-if sys.version_info < (3, 12):
++if sys.version_info < (3, 11):
+ SKIP_LIST_2 += [
+ 'numpy.distutils.log.sys',
+ 'numpy.distutils.log.logging',
Index: patches/patch-numpy_typing_tests_test_isfile_py
===================================================================
RCS file: patches/patch-numpy_typing_tests_test_isfile_py
diff -N patches/patch-numpy_typing_tests_test_isfile_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-numpy_typing_tests_test_isfile_py 27 Aug 2024 15:50:18 -0000
@@ -0,0 +1,14 @@
+1.26.4 no longer has numpy.distutils but tests still reference it
+
+Index: numpy/typing/tests/test_isfile.py
+--- numpy/typing/tests/test_isfile.py.orig
++++ numpy/typing/tests/test_isfile.py
+@@ -21,7 +21,7 @@ FILES = [
+ ROOT / "random" / "__init__.pyi",
+ ROOT / "testing" / "__init__.pyi",
+ ]
+-if sys.version_info < (3, 12):
++if sys.version_info < (3, 11):
+ FILES += [ROOT / "distutils" / "__init__.pyi"]
+
+

$ make test
===> Regression tests for py3-numpy-1.26.4
cd /pobj/py-numpy-1.26.4-python3 && CC=cc PYTHONUSERBASE= PORTSDIR="/usr/ports" LIBTOOL="/usr/bin/libtool" CCACHE_DIR=/usr/obj/ports/.ccache CCACHE_SLOPPINESS=pch_defines,time_macros PATH='/pobj/py-numpy-1.26.4-python3/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11R6/bin' PREFIX='/usr/local' LOCALBASE='/usr/local' X11BASE='/usr/X11R6' CFLAGS='-O2 -pipe -g' TRUEPREFIX='/usr/local' DESTDIR='' HOME='/py-numpy-1.26.4_writes_to_HOME' PICFLAG="-fpic" BINGRP=bin BINOWN=root BINMODE=755 NONBINMODE=644 DIRMODE=755 INSTALL_COPY=-c INSTALL_STRIP= MANGRP=bin MANOWN=root MANMODE=644 BSD_INSTALL_PROGRAM="/pobj/py-numpy-1.26.4-python3/bin/install -c -m 755" BSD_INSTALL_SCRIPT="/pobj/py-numpy-1.26.4-python3/bin/install -c -m 755" BSD_INSTALL_DATA="/pobj/py-numpy-1.26.4-python3/bin/install -c -m 644" BSD_INSTALL_MAN="/pobj/py-numpy-1.26.4-python3/bin/install -c -m 644" BSD_INSTALL_PROGRAM_DIR="/pobj/py-numpy-1.26.4-python3/bin/install -d -m 755" BSD_INSTALL_SCRIPT_DIR="/pobj/py-numpy-1.26.4-python3/bin/install -d -m 755" BSD_INSTALL_DATA_DIR="/pobj/py-numpy-1.26.4-python3/bin/install -d -m 755" BSD_INSTALL_MAN_DIR="/pobj/py-numpy-1.26.4-python3/bin/install -d -m 755" /usr/local/bin/python3.11 -c 'import numpy ; numpy.test(verbose=2)'
NumPy version 1.26.4
NumPy relaxed strides checking option: True
NumPy CPU features: SSE SSE2 SSE3 SSSE3* SSE41* POPCNT* SSE42* AVX* F16C* FMA3* AVX2* AVX512F? AVX512CD? AVX512_KNL? AVX512_KNM? AVX512_SKX? AVX512_CLX? AVX512_CNL? AVX512_ICL?
============================= test session starts ==============================
platform openbsd7 -- Python 3.11.9, pytest-8.2.0, pluggy-1.5.0
benchmark: 4.0.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /usr/obj/ports/py-numpy-1.26.4-python3
plugins: subtests-0.12.1, benchmark-4.0.0, flaky-3.8.1, filter-subpackage-0.2.0, timeout-1.4.2, typeguard-4.3.0, hypothesis-6.47.1, anyio-3.7.1, cov-5.0.0, mock-3.14.0, doctestplus-1.2.1
collected 39391 items / 1305 deselected / 38086 selected

array_api/tests/test_array_object.py ........................ [ 0%]
array_api/tests/test_creation_functions.py .............. [ 0%]
array_api/tests/test_data_type_functions.py ..... [ 0%]
array_api/tests/test_elementwise_functions.py .. [ 0%]
array_api/tests/test_indexing_functions.py .... [ 0%]
array_api/tests/test_manipulation_functions.py ... [ 0%]
array_api/tests/test_set_functions.py .. [ 0%]
array_api/tests/test_sorting_functions.py .... [ 0%]
array_api/tests/test_validation.py ... [ 0%]
compat/tests/test_compat.py . [ 0%]
core/tests/test__exceptions.py ........... [ 0%]
core/tests/test_abc.py ..... [ 0%]
core/tests/test_api.py ................................................. [ 0%]
........... [ 0%]
core/tests/test_argparse.py ..... [ 0%]
core/tests/test_array_coercion.py ...................................... [ 0%]
.......................x................................................ [ 0%]
........................................................................ [ 0%]
.......................... [ 0%]
core/tests/test_arraymethod.py ........................................ [ 1%]
core/tests/test_arrayprint.py ..x....................................... [ 1%]
..................... [ 1%]
core/tests/test_casting_floatingpoint_errors.py ........................ [ 1%]
........................................................................ [ 1%]
........................................................................ [ 1%]
............... [ 1%]
core/tests/test_casting_unittests.py ................................... [ 1%]
........................................................................ [ 1%]
........................................................................ [ 2%]
........................................................................ [ 2%]
................................................................ [ 2%]
core/tests/test_conversion_utils.py ........................... [ 2%]
core/tests/test_cpu_dispatcher.py . [ 2%]
core/tests/test_cpu_features.py .......ssss [ 2%]
core/tests/test_custom_dtypes.py ................................... [ 2%]
core/tests/test_cython.py ....... [ 2%]
core/tests/test_datetime.py ............................................ [ 2%]
........................................................................ [ 3%]
........................................................................ [ 3%]
...........................................x..........x..x..........x... [ 3%]
. [ 3%]
core/tests/test_defchararray.py ........................................ [ 3%]
................................................. [ 3%]
core/tests/test_deprecations.py ........................................ [ 3%]
........................................................................ [ 3%]
........... [ 3%]
core/tests/test_dlpack.py .............................................. [ 4%]
............. [ 4%]
core/tests/test_dtype.py ............................................... [ 4%]
................................................ssss.................... [ 4%]
........................................................................ [ 4%]
........................................................................ [ 4%]
........................................................................ [ 4%]
........................................................................ [ 5%]
........................................................................ [ 5%]
........................................................................ [ 5%]
........................................................................ [ 5%]
........................................................................ [ 5%]
........................................................................ [ 6%]
........................................................................ [ 6%]
........................................................................ [ 6%]
........................................................................ [ 6%]
................................................. [ 6%]
core/tests/test_einsum.py .............................................. [ 6%]
..................... [ 6%]
core/tests/test_errstate.py .... [ 7%]
core/tests/test_extint128.py ............ [ 7%]
core/tests/test_function_base.py ..................................... [ 7%]
core/tests/test_getlimits.py ................ [ 7%]
core/tests/test_half.py ..................................... [ 7%]
core/tests/test_hashtable.py ......... [ 7%]
core/tests/test_indexerrors.py ........ [ 7%]
core/tests/test_indexing.py ............................................ [ 7%]
....................................... [ 7%]
core/tests/test_item_selection.py ...................................... [ 7%]
........................................................................ [ 7%]
........................................................................ [ 8%]
........................................................................ [ 8%]
............ [ 8%]
core/tests/test_limited_api.py . [ 8%]
core/tests/test_longdouble.py .Fsssss.s......ssss.sss...........s. [ 8%]
core/tests/test_machar.py . [ 8%]
core/tests/test_mem_overlap.py .................. [ 8%]
core/tests/test_mem_policy.py .....s.... [ 8%]
core/tests/test_memmap.py ................... [ 8%]
core/tests/test_multiarray.py .......................................... [ 8%]
........................................................................ [ 8%]
.......................xx............................................... [ 8%]
........................................................................ [ 9%]
........................................................................ [ 9%]
...........................................s............................ [ 9%]
........................................................................ [ 9%]
........................................................................ [ 9%]
........................................................................ [ 10%]
........................................................................ [ 10%]
........................................................................ [ 10%]
........................................................................ [ 10%]
........................................................................ [ 10%]
........................................................................ [ 11%]
........................................................................ [ 11%]
........................................................................ [ 11%]
........................................................................ [ 11%]
........................................................................ [ 11%]
........................................................................ [ 11%]
........................................................................ [ 12%]
........................................................................ [ 12%]
........................................................................ [ 12%]
........................................................................ [ 12%]
........................................................................ [ 12%]
........................................................................ [ 13%]
........................................................................ [ 13%]
........................................................................ [ 13%]
........................................................................ [ 13%]
........................................................................ [ 13%]
........................................................................ [ 14%]
........................................................................ [ 14%]
........................................................................ [ 14%]
........................................................................ [ 14%]
........................................................................ [ 14%]
........................................................................ [ 14%]
........................................................................ [ 15%]
........................................................................ [ 15%]
........................................................................ [ 15%]
........................................................................ [ 15%]
........................................................................ [ 15%]
........................................................................ [ 16%]
........................................................................ [ 16%]
........................................................................ [ 16%]
........................................................................ [ 16%]
........................................................................ [ 16%]
........................................................................ [ 17%]
........................................................................ [ 17%]
........................................................................ [ 17%]
........................................................................ [ 17%]
........................................................................ [ 17%]
........................................................................ [ 18%]
........................................................................ [ 18%]
........................................................................ [ 18%]
........................................................................ [ 18%]
........................................................................ [ 18%]
........................................................................ [ 18%]
........................................................................ [ 19%]
........................................................................ [ 19%]
........................................................................ [ 19%]
........................................................................ [ 19%]
........................................................................ [ 19%]
........................................................................ [ 20%]
........................................................................ [ 20%]
........................................................................ [ 20%]
........................................................................ [ 20%]
........................................................................ [ 20%]
........................................................................ [ 21%]
........................................................................ [ 21%]
........................................................................ [ 21%]
........................................................................ [ 21%]
........................................................................ [ 21%]
........................................................................ [ 21%]
........................................................................ [ 22%]
........................................................................ [ 22%]
........................................................................ [ 22%]
........................................................................ [ 22%]
........................................................................ [ 22%]
........................................................................ [ 23%]
........................................................................ [ 23%]
........................................................................ [ 23%]
........................................................................ [ 23%]
........................................................................ [ 23%]
........................................................................ [ 24%]
........................................................................ [ 24%]
........................................................................ [ 24%]
........................................................................ [ 24%]
........................................................................ [ 24%]
........................................................................ [ 25%]
........................................................................ [ 25%]
........................................................................ [ 25%]
........................................................................ [ 25%]
........................................................................ [ 25%]
........................................................................ [ 25%]
........................................................................ [ 26%]
........................................................................ [ 26%]
........................................................................ [ 26%]
........................................................................ [ 26%]
........................................................................ [ 26%]
........................................................................ [ 27%]
........................................................................ [ 27%]
........................................................................ [ 27%]
........................................................................ [ 27%]
........................................................................ [ 27%]
........................................................................ [ 28%]
........................................................................ [ 28%]
........................................................................ [ 28%]
........................................................................ [ 28%]
........................................................................ [ 28%]
........................................................................ [ 28%]
........................................................................ [ 29%]
........................................................................ [ 29%]
........................................................................ [ 29%]
........................................................................ [ 29%]
........................................................................ [ 29%]
........................................................................ [ 30%]
........................................................................ [ 30%]
........................................................................ [ 30%]
........................................................................ [ 30%]
........................................................................ [ 30%]
........................................................................ [ 31%]
........................................................................ [ 31%]
........................................................................ [ 31%]
........................................................................ [ 31%]
........................................................................ [ 31%]
........................................................................ [ 32%]
........................................................................ [ 32%]
........................................................................ [ 32%]
........................................................................ [ 32%]
................................ [ 32%]
core/tests/test_nditer.py .............................................. [ 32%]
........................................................................ [ 32%]
........................................................................ [ 33%]
........................................................................ [ 33%]
........................................................................ [ 33%]
........................................................................ [ 33%]
........................................................................ [ 33%]
........................................................................ [ 34%]
........................................................................ [ 34%]
........................................................................ [ 34%]
........................................................................ [ 34%]
.................................... [ 34%]
core/tests/test_nep50_promotions.py ................s............... [ 34%]
core/tests/test_numeric.py ..............................x...x.......... [ 34%]
..................s..s.................................................. [ 35%]
........................................................................ [ 35%]
...........................................................X............ [ 35%]
........................................................................ [ 35%]
.................... [ 35%]
core/tests/test_numerictypes.py ........................................ [ 35%]
........................................................................ [ 36%]
...... [ 36%]
core/tests/test_numpy_2_0_compat.py ... [ 36%]
core/tests/test_overrides.py ........................................... [ 36%]
........................................................................ [ 36%]
....................... [ 36%]
core/tests/test_print.py .....................F [ 36%]
core/tests/test_protocols.py .. [ 36%]
core/tests/test_records.py ......................................... [ 36%]
core/tests/test_regression.py .......................................... [ 36%]
........................................................................ [ 36%]
........................................................................ [ 37%]
........................................................................ [ 37%]
.........s.............................................................. [ 37%]
........................................................................ [ 37%]
............. [ 37%]
core/tests/test_scalar_ctors.py ........................................ [ 37%]
........................................................................ [ 38%]
.................................................. [ 38%]
core/tests/test_scalar_methods.py ............................s......... [ 38%]
........................................................................ [ 38%]
. [ 38%]
core/tests/test_scalarbuffer.py ........................................ [ 38%]
...................................... [ 38%]
core/tests/test_scalarinherit.py ..... [ 38%]
core/tests/test_scalarmath.py .........................s................ [ 38%]
........................................................................ [ 38%]
........................................................................ [ 39%]
......................ssssss............................................ [ 39%]
........................................................................ [ 39%]
...... [ 39%]
core/tests/test_scalarprint.py ....Fs [ 39%]
core/tests/test_shape_base.py .......................................... [ 39%]
........................................................................ [ 39%]
........................................................................ [ 40%]
........................ [ 40%]
core/tests/test_simd.py ................................................ [ 40%]
........................................................................ [ 40%]
........................................................................ [ 40%]
........................................................................ [ 40%]
........................................................................ [ 40%]
........................................................................ [ 41%]
........................................................................ [ 41%]
........................................................................ [ 41%]
........................................................................ [ 41%]
........................................................................ [ 41%]
........................................................................ [ 42%]
........................................................................ [ 42%]
........................................................................ [ 42%]
........................................................................ [ 42%]
........................................................................ [ 42%]
........................................................................ [ 43%]
........................................................................ [ 43%]
........................................................................ [ 43%]
........................................................................ [ 43%]
........................................................................ [ 43%]
........................................................................ [ 44%]
........................................................................ [ 44%]
........................................................................ [ 44%]
........................................................................ [ 44%]
........................................................................ [ 44%]
........................................................................ [ 44%]
........................................................................ [ 45%]
........................................................................ [ 45%]
........................................................................ [ 45%]
........................................................................ [ 45%]
........................................................................ [ 45%]
........................................................................ [ 46%]
........................................................................ [ 46%]
........................................................................ [ 46%]
........................................................................ [ 46%]
........................................................................ [ 46%]
........................................................................ [ 47%]
........................................................................ [ 47%]
........................................................................ [ 47%]
................................ssssssssssssssssssssssssssssssssssssssss [ 47%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 47%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 47%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 48%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 48%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 48%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 48%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 48%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 49%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 49%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 49%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 49%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 49%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 50%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 50%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 50%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 50%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 50%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 51%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 51%]
........................................................................ [ 51%]
........................................................................ [ 51%]
........................................................................ [ 51%]
........................................................................ [ 51%]
........................................................................ [ 52%]
........................................................................ [ 52%]
........................................................................ [ 52%]
........................................................................ [ 52%]
........................................................................ [ 52%]
........................................................ [ 53%]
core/tests/test_simd_module.py .................................... [ 53%]
core/tests/test_strings.py ............................................. [ 53%]
........................................................................ [ 53%]
................. [ 53%]
core/tests/test_ufunc.py ............................................... [ 53%]
........................................................................ [ 53%]
.........................s.............................................. [ 53%]
........................................................................ [ 54%]
........................................................................ [ 54%]
........................................................................ [ 54%]
........................................................................ [ 54%]
........................................................................ [ 54%]
........................................................................ [ 55%]
.......................................................................x [ 55%]
xxxxxx.............. [ 55%]
core/tests/test_umath.py ............................................... [ 55%]
........................................................................ [ 55%]
........................................................................ [ 55%]
........................................................................ [ 56%]
........................................................................ [ 56%]
........................................................................ [ 56%]
........................................................................ [ 56%]
.F............F................................................s...FF... [ 56%]
........................................................................ [ 56%]
........................................................................ [ 57%]
........................................................................ [ 57%]
........................................................................ [ 57%]
........................................................................ [ 57%]
........................................................................ [ 57%]
........................................................................ [ 58%]
........................................................................ [ 58%]
........................................................................ [ 58%]
........................................................................ [ 58%]
........................................................................ [ 58%]
........................................................................ [ 59%]
........................................................................ [ 59%]
........................................................................ [ 59%]
........................................................................ [ 59%]
........................................................................ [ 59%]
...................................................................F.... [ 60%]
...................................F.................................... [ 60%]
...F.......................................F............................ [ 60%]
...........F.......................................F.................... [ 60%]
...................F.......................................F............ [ 60%]
...........................F.......................................F.... [ 60%]
...................................F.................................... [ 61%]
...F.......................................F............................ [ 61%]
...........F.......................................F.................... [ 61%]
...................F.......................................F............ [ 61%]
...........................F............................................ [ 61%]
........................................................................ [ 62%]
........................................................................ [ 62%]
........................................................................ [ 62%]
........................................................................ [ 62%]
........................................................................ [ 62%]
........................................................................ [ 63%]
........................................................................ [ 63%]
........................................................................ [ 63%]
........................................................................ [ 63%]
........................................................................ [ 63%]
........................................................................ [ 63%]
........................................................................ [ 64%]
........................................................................ [ 64%]
........................................................................ [ 64%]
........................................................................ [ 64%]
........................................................................ [ 64%]
........................................................................ [ 65%]
........................................................................ [ 65%]
........................................................................ [ 65%]
........................................................................ [ 65%]
.....ssssssssssss...F................................................... [ 65%]
........................................................................ [ 66%]
........FF.FFF.......................................................... [ 66%]
........................................................................ [ 66%]
............................s........................................... [ 66%]
........................................................................ [ 66%]
.................................................................sssssss [ 67%]
sssssss................................................................. [ 67%]
............................................................... [ 67%]
core/tests/test_umath_accuracy.py s..................................... [ 67%]
... [ 67%]
core/tests/test_umath_complex.py .ss.s..s.......s....................... [ 67%]
........................................................................ [ 67%]
........................................................................ [ 67%]
........................................................................ [ 68%]
........................................................................ [ 68%]
...... [ 68%]
core/tests/test_unicode.py ............................................. [ 68%]
............................... [ 68%]
f2py/tests/test_abstract_interface.py ss [ 68%]
f2py/tests/test_array_from_pyobj.py ssssssssssssssssssssssssssssssssssss [ 68%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 68%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 69%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 69%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 69%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 69%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 69%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 69%]
sssssssssssssssssssssssssssssssssssssssss [ 70%]
f2py/tests/test_block_docstring.py s [ 70%]
f2py/tests/test_callback.py sssssssssssssssss [ 70%]
f2py/tests/test_character.py sssssssssssssssssssssssssssssssssssssssssss [ 70%]
ssss [ 70%]
f2py/tests/test_common.py ss [ 70%]
f2py/tests/test_compile_function.py sssssss [ 70%]
f2py/tests/test_crackfortran.py s......sss....ssssssssssssssssss.ssssss. [ 70%]
..ss. [ 70%]
f2py/tests/test_data.py ssssss [ 70%]
f2py/tests/test_docs.py sss [ 70%]
f2py/tests/test_f2cmap.py s [ 70%]
f2py/tests/test_f2py2e.py ......ssx..............x.........x............ [ 70%]
...... [ 70%]
f2py/tests/test_isoc.py ssss. [ 70%]
f2py/tests/test_kind.py sss [ 70%]
f2py/tests/test_mixed.py ss [ 70%]
f2py/tests/test_module_doc.py s [ 70%]
f2py/tests/test_pyf_src.py . [ 70%]
f2py/tests/test_quoted_character.py s [ 70%]
f2py/tests/test_regression.py . [ 70%]
f2py/tests/test_return_character.py sssssssssssssss [ 70%]
f2py/tests/test_return_complex.py ssssssssssssssss [ 70%]
f2py/tests/test_return_integer.py ssssssssssssssssssss [ 70%]
f2py/tests/test_return_real.py ssssssssssssssssssss [ 70%]
f2py/tests/test_semicolon_split.py ss [ 70%]
f2py/tests/test_string.py sss [ 70%]
f2py/tests/test_symbolic.py sssssssssss [ 70%]
f2py/tests/test_value_attrspec.py s [ 70%]
fft/tests/test_helper.py ........ [ 70%]
fft/tests/test_pocketfft.py ............................................ [ 70%]
.................................... [ 71%]
lib/tests/test__datasource.py .......................... [ 71%]
lib/tests/test__iotools.py ........................ [ 71%]
lib/tests/test__version.py ........ [ 71%]
lib/tests/test_arraypad.py ............................................. [ 71%]
..................................x..................................... [ 71%]
........................................................................ [ 71%]
........................................................................ [ 71%]
........................................................................ [ 72%]
........................................................................ [ 72%]
........................................................................ [ 72%]
........................................................................ [ 72%]
.................................... [ 72%]
lib/tests/test_arraysetops.py .......................................... [ 72%]
................................ [ 72%]
lib/tests/test_arrayterator.py . [ 72%]
lib/tests/test_financial_expired.py . [ 72%]
lib/tests/test_format.py .................................s....... [ 73%]
lib/tests/test_function_base.py ........................................ [ 73%]
........................................................................ [ 73%]
......................................................x................. [ 73%]
........................................................................ [ 73%]
........................................................................ [ 73%]
........................................................................ [ 74%]
........................................................................ [ 74%]
........................................................................ [ 74%]
........................................................................ [ 74%]
........................................................................ [ 74%]
........................................................................ [ 75%]
........................................................................ [ 75%]
........................................................................ [ 75%]
...................... [ 75%]
lib/tests/test_histograms.py .........................s................. [ 75%]
................ [ 75%]
lib/tests/test_index_tricks.py ......................................... [ 75%]
...... [ 75%]
lib/tests/test_io.py ................................................... [ 75%]
........................................................................ [ 76%]
........................................................................ [ 76%]
............... [ 76%]
lib/tests/test_loadtxt.py .............................................. [ 76%]
........................................................................ [ 76%]
........................................................................ [ 76%]
........................x...x.............s.....x....................... [ 77%]
................... [ 77%]
lib/tests/test_mixins.py ........... [ 77%]
lib/tests/test_nanfunctions.py .....................ss.ss.ss.ss.ss.ss.ss [ 77%]
..........................................ss.ss.ss.ss.ss.ss.ss.......... [ 77%]
........................................................................ [ 77%]
........................................................................ [ 77%]
........................................................................ [ 77%]
........................................................................ [ 78%]
........................................................................ [ 78%]
........................................................................ [ 78%]
........................................................................ [ 78%]
........................................................................ [ 78%]
........................................................................ [ 79%]
..............................ss.ss.ss.ss.ss.ss.ss...................... [ 79%]
.....................ss.ss.ss.ss.ss.ss.ss............................... [ 79%]
........ss.ss.ss.ss.ss.ss.ss............................................ [ 79%]
........................................................................ [ 79%]
...ss.ss.ss.ss.....................ss.ss.ss.ss................. [ 80%]
lib/tests/test_packbits.py ............................................. [ 80%]
........................................................................ [ 80%]
........................................................................ [ 80%]
........................................................................ [ 80%]
................... [ 80%]
lib/tests/test_polynomial.py ..................................... [ 80%]
lib/tests/test_recfunctions.py ......................................... [ 80%]
.......... [ 80%]
lib/tests/test_regression.py ........................... [ 81%]
lib/tests/test_shape_base.py ........................................... [ 81%]
................................. [ 81%]
lib/tests/test_stride_tricks.py .......................... [ 81%]
lib/tests/test_twodim_base.py ..................................... [ 81%]
lib/tests/test_type_check.py ........................................... [ 81%]
......... [ 81%]
lib/tests/test_ufunclike.py ..... [ 81%]
lib/tests/test_utils.py ..................... [ 81%]
linalg/tests/test_deprecations.py . [ 81%]
linalg/tests/test_linalg.py ............................................ [ 81%]
..x..................................................................... [ 81%]
........................................................................ [ 82%]
........................................................................ [ 82%]
........................................................................ [ 82%]
..............................................sx [ 82%]
linalg/tests/test_regression.py ......... [ 82%]
ma/tests/test_core.py .................................................. [ 82%]
........................................................................ [ 82%]
........................................................................ [ 83%]
........................................................................ [ 83%]
........................................................................ [ 83%]
........................................................................ [ 83%]
........................................................................ [ 83%]
........................................................................ [ 84%]
........................................................................ [ 84%]
........................................................................ [ 84%]
........................................................................ [ 84%]
........................................................................ [ 84%]
........................................................................ [ 85%]
........................................................................ [ 85%]
........................................................................ [ 85%]
........................................................................ [ 85%]
........................................................................ [ 85%]
........................................................................ [ 85%]
........................................................................ [ 86%]
........................................................................ [ 86%]
........................................................................ [ 86%]
........................................................................ [ 86%]
........................................................................ [ 86%]
........................................................................ [ 87%]
........................................................................ [ 87%]
........................................................................ [ 87%]
........................................................................ [ 87%]
........................................................................ [ 87%]
........................................................................ [ 88%]
........................................................................ [ 88%]
........................................................................ [ 88%]
........................................................................ [ 88%]
........................................................................ [ 88%]
........................................................................ [ 89%]
........................................................................ [ 89%]
........................................................................ [ 89%]
........................................................................ [ 89%]
........................................................................ [ 89%]
........................................................................ [ 89%]
........................................................................ [ 90%]
........................................................................ [ 90%]
........................................................................ [ 90%]
........................................................................ [ 90%]
........................................................................ [ 90%]
........................................................................ [ 91%]
........................................................................ [ 91%]
........................................................................ [ 91%]
........................................................................ [ 91%]
........................................................................ [ 91%]
........................................................................ [ 92%]
........................................................................ [ 92%]
........................................................................ [ 92%]
..........................................................xx............ [ 92%]
........................................................................ [ 92%]
........................................................................ [ 92%]
........................................................................ [ 93%]
........................................................................ [ 93%]
....... [ 93%]
ma/tests/test_deprecations.py ..... [ 93%]
ma/tests/test_extras.py ................................................ [ 93%]
................................................... [ 93%]
ma/tests/test_mrecords.py ........................ [ 93%]
ma/tests/test_old_ma.py ......................................... [ 93%]
ma/tests/test_regression.py .............. [ 93%]
ma/tests/test_subclassing.py ................ [ 93%]
matrixlib/tests/test_defmatrix.py ...................................... [ 93%]
..... [ 94%]
matrixlib/tests/test_interaction.py ....................... [ 94%]
matrixlib/tests/test_masked_matrix.py .............. [ 94%]
matrixlib/tests/test_matrix_linalg.py .................................. [ 94%]
.................................................................... [ 94%]
matrixlib/tests/test_multiarray.py .. [ 94%]
matrixlib/tests/test_numeric.py .. [ 94%]
matrixlib/tests/test_regression.py .... [ 94%]
polynomial/tests/test_chebyshev.py ..................................... [ 94%]
.... [ 94%]
polynomial/tests/test_classes.py ....................................... [ 94%]
........................................................................ [ 94%]
........................................................................ [ 94%]
...................................................... [ 95%]
polynomial/tests/test_hermite.py .................................. [ 95%]
polynomial/tests/test_hermite_e.py .................................. [ 95%]
polynomial/tests/test_laguerre.py .................................. [ 95%]
polynomial/tests/test_legendre.py ...................................... [ 95%]
[ 95%]
polynomial/tests/test_polynomial.py ................................... [ 95%]
polynomial/tests/test_polyutils.py ......... [ 95%]
polynomial/tests/test_printing.py ...................................... [ 95%]
..................................... [ 95%]
polynomial/tests/test_symbol.py ........................................ [ 95%]
............ [ 95%]
random/tests/test_direct.py ............................................ [ 96%]
................................................ [ 96%]
random/tests/test_extending.py s. [ 96%]
random/tests/test_generator_mt19937.py ................................. [ 96%]
........................................................................ [ 96%]
........................................................................ [ 96%]
........................................................................ [ 96%]
.............................................................. [ 97%]
random/tests/test_generator_mt19937_regressions.py ............... [ 97%]
random/tests/test_random.py ............................................ [ 97%]
........................................................................ [ 97%]
.......................... [ 97%]
random/tests/test_randomstate.py ....................................... [ 97%]
........................................................................ [ 97%]
..................................................................... [ 97%]
random/tests/test_randomstate_regression.py ................... [ 97%]
random/tests/test_regression.py ........... [ 97%]
random/tests/test_seed_sequence.py .. [ 97%]
random/tests/test_smoke.py .s........................................... [ 98%]
........................................................................ [ 98%]
........................................................................ [ 98%]
........................................................................ [ 98%]
...............................ss....................................... [ 98%]
........................................................................ [ 99%]
........................................................................ [ 99%]
....................................................................... [ 99%]
testing/tests/test_utils.py ............................................ [ 99%]
........................................................................ [ 99%]
...................... [ 99%]
tests/test__all__.py . [ 99%]
tests/test_ctypeslib.py ....................... [ 99%]
tests/test_lazyloading.py . [ 99%]
tests/test_matlib.py ........ [ 99%]
tests/test_numpy_config.py .... [ 99%]
tests/test_numpy_version.py .. [ 99%]
tests/test_public_api.py ............... [ 99%]
tests/test_reloading.py ... [ 99%]
tests/test_scripts.py xxx. [ 99%]
typing/tests/test_isfile.py . [ 99%]
typing/tests/test_runtime.py .....................x... [100%]

=================================== FAILURES ===================================
_____________________________ test_repr_roundtrip ______________________________

@pytest.mark.skipif(IS_MUSL,
reason="test flaky on musllinux")
@pytest.mark.skipif(LD_INFO.precision + 2 >= repr_precision,
reason="repr precision not enough to show eps")
def test_repr_roundtrip():
# We will only see eps in repr if within printing precision.
o = 1 + LD_INFO.eps
> assert_equal(np.longdouble(repr(o)), o, "repr was %s" % repr(o))
E AssertionError:
E Items are not equal: repr was 1.0000000000000000001
E ACTUAL: 1.0
E DESIRED: 1.0000000000000000001

o = 1.0000000000000000001

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_longdouble.py:43: AssertionError
______________ TestCommaDecimalPointLocale.test_locale_longdouble ______________

self = <numpy.core.tests.test_print.TestCommaDecimalPointLocale object at 0x790959be50>

@pytest.mark.skipif(IS_MUSL,
reason="test flaky on musllinux")
def test_locale_longdouble(self):
> assert_equal(str(np.longdouble('1.2')), str(float(1.2)))
E AssertionError:
E Items are not equal:
E ACTUAL: '1.1999999999999999556'
E DESIRED: '1.2'

self = <numpy.core.tests.test_print.TestCommaDecimalPointLocale object at 0x790959be50>

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_print.py:202: AssertionError
____________________ TestRealScalars.test_dragon4_interface ____________________

self = <numpy.core.tests.test_scalarprint.TestRealScalars object at 0x784729cbd0>

def test_dragon4_interface(self):
tps = [np.float16, np.float32, np.float64]
# test is flaky for musllinux on np.float128
if hasattr(np, 'float128') and not IS_MUSL:
tps.append(np.float128)

fpos = np.format_float_positional
fsci = np.format_float_scientific

for tp in tps:
# test padding
assert_equal(fpos(tp('1.0'), pad_left=4, pad_right=4), " 1. ")
assert_equal(fpos(tp('-1.0'), pad_left=4, pad_right=4), " -1. ")
> assert_equal(fpos(tp('-10.2'),
pad_left=4, pad_right=4), " -10.2 ")
E AssertionError:
E Items are not equal:
E ACTUAL: ' -10.1999999999999992895'
E DESIRED: ' -10.2 '

fpos = <function format_float_positional at 0x793aa4e700>
fsci = <function format_float_scientific at 0x793aa4e660>
self = <numpy.core.tests.test_scalarprint.TestRealScalars object at 0x784729cbd0>
tp = <class 'numpy.longdouble'>
tps = [<class 'numpy.float16'>, <class 'numpy.float32'>, <class 'numpy.float64'>, <class 'numpy.longdouble'>]

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_scalarprint.py:276: AssertionError
__________________________ TestLog2.test_log2_special __________________________

self = <numpy.core.tests.test_umath.TestLog2 object at 0x784fcbbf10>

@pytest.mark.skipif(IS_WASM, reason="fp errors don't work in wasm")
def test_log2_special(self):
assert_equal(np.log2(1.), 0.)
assert_equal(np.log2(np.inf), np.inf)
assert_(np.isnan(np.log2(np.nan)))

with warnings.catch_warnings(record=True) as w:
warnings.filterwarnings('always', '', RuntimeWarning)
assert_(np.isnan(np.log2(-1.)))
assert_(np.isnan(np.log2(-np.inf)))
assert_equal(np.log2(0.), -np.inf)
assert_(w[0].category is RuntimeWarning)
assert_(w[1].category is RuntimeWarning)
> assert_(w[2].category is RuntimeWarning)
E IndexError: list index out of range

self = <numpy.core.tests.test_umath.TestLog2 object at 0x784fcbbf10>
w = [<warnings.WarningMessage object at 0x784ebe0290>, <warnings.WarningMessage object at 0x784ebe0490>]

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:1280: IndexError
______________________ TestSpecialFloats.test_log_values _______________________

self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x784fd01f10>

@pytest.mark.skipif(IS_WASM, reason="fp errors don't work in wasm")
def test_log_values(self):
with np.errstate(all='ignore'):
x = [np.nan, np.nan, np.inf, np.nan, -np.inf, np.nan]
y = [np.nan, -np.nan, np.inf, -np.inf, 0.0, -1.0]
y1p = [np.nan, -np.nan, np.inf, -np.inf, -1.0, -2.0]
for dt in ['e', 'f', 'd', 'g']:
xf = np.array(x, dtype=dt)
yf = np.array(y, dtype=dt)
yf1p = np.array(y1p, dtype=dt)
assert_equal(np.log(yf), xf)
assert_equal(np.log2(yf), xf)
assert_equal(np.log10(yf), xf)
assert_equal(np.log1p(yf1p), xf)

with np.errstate(divide='raise'):
for dt in ['e', 'f', 'd']:
> assert_raises(FloatingPointError, np.log,
np.array(0.0, dtype=dt))

dt = 'e'
self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x784fd01f10>
x = [nan, nan, inf, nan, -inf, nan]
xf = array([ nan, nan, inf, nan, -inf, nan], dtype=float128)
y = [nan, nan, inf, -inf, 0.0, -1.0]
y1p = [nan, nan, inf, -inf, -1.0, -2.0]
yf = array([ nan, nan, inf, -inf, 0., -1.], dtype=float128)
yf1p = array([ nan, nan, inf, -inf, -1., -2.], dtype=float128)

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:1454:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.11/unittest/case.py:766: in assertRaises
return context.handle('assertRaises', args, kwargs)
args = (<ufunc 'log'>, array(0., dtype=float16))
context = None
expected_exception = <class 'FloatingPointError'>
kwargs = {}
self = <numpy.testing._private.utils._Dummy testMethod=nop>
/usr/local/lib/python3.11/unittest/case.py:236: in handle
with self:
args = [array(0., dtype=float16)]
callable_obj = <ufunc 'log'>
kwargs = {}
name = 'assertRaises'
self = None
/usr/local/lib/python3.11/unittest/case.py:259: in __exit__
self._raiseFailure("{} not raised by {}".format(exc_name,
exc_name = 'FloatingPointError'
exc_type = None
exc_value = None
self = <unittest.case._AssertRaisesContext object at 0x78ee667a90>
tb = None
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <unittest.case._AssertRaisesContext object at 0x78ee667a90>
standardMsg = 'FloatingPointError not raised by log'

def _raiseFailure(self, standardMsg):
msg = self.test_case._formatMessage(self.msg, standardMsg)
> raise self.test_case.failureException(msg)
E AssertionError: FloatingPointError not raised by log

msg = 'FloatingPointError not raised by log'
self = <unittest.case._AssertRaisesContext object at 0x78ee667a90>
standardMsg = 'FloatingPointError not raised by log'

/usr/local/lib/python3.11/unittest/case.py:199: AssertionError
________________________ TestSpecialFloats.test_arctanh ________________________

self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x784fd1a8d0>

@pytest.mark.skipif(IS_WASM, reason="fp errors don't work in wasm")
def test_arctanh(self):
with np.errstate(all='ignore'):
in_ = [np.nan, -np.nan, np.inf, -np.inf, 1.0, -1.0, 2.0]
out = [np.nan, np.nan, np.nan, np.nan, np.inf, -np.inf, np.nan]
for dt in ['e', 'f', 'd']:
in_arr = np.array(in_, dtype=dt)
out_arr = np.array(out, dtype=dt)
assert_equal(np.arctanh(in_arr), out_arr)

for value in [1.01, np.inf, -np.inf, 1.0, -1.0]:
with np.errstate(invalid='raise', divide='raise'):
for dt in ['e', 'f', 'd']:
assert_raises(FloatingPointError, np.arctanh,
np.array(value, dtype=dt))

# Make sure glibc < 2.18 atanh is not used, issue 25087
> assert np.signbit(np.arctanh(-1j).real)
E AssertionError: assert False
E + where False = <ufunc 'signbit'>(1e+308)
E + where <ufunc 'signbit'> = np.signbit
E + and 1e+308 = (1e+308-1e+308j).real
E + where (1e+308-1e+308j) = <ufunc 'arctanh'>(-1j)
E + where <ufunc 'arctanh'> = np.arctanh

dt = 'd'
in_ = [nan, nan, inf, -inf, 1.0, -1.0, ...]
in_arr = array([ nan, nan, inf, -inf, 1., -1., 2.])
out = [nan, nan, nan, nan, inf, -inf, ...]
out_arr = array([ nan, nan, nan, nan, inf, -inf, nan])
self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x784fd1a8d0>
value = -1.0

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:1717: AssertionError
_________________________ TestSpecialFloats.test_exp2 __________________________

self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x784fd18b50>

@pytest.mark.xfail(
_glibc_older_than("2.17"),
reason="Older glibc versions may not raise appropriate FP exceptions"
)
def test_exp2(self):
with np.errstate(all='ignore'):
in_ = [np.nan, -np.nan, np.inf, -np.inf]
out = [np.nan, np.nan, np.inf, 0.0]
for dt in ['e', 'f', 'd']:
in_arr = np.array(in_, dtype=dt)
out_arr = np.array(out, dtype=dt)
assert_equal(np.exp2(in_arr), out_arr)

for value in [2000.0, -2000.0]:
with np.errstate(over='raise', under='raise'):
for dt in ['e', 'f', 'd']:
> assert_raises(FloatingPointError, np.exp2,
np.array(value, dtype=dt))

dt = 'e'
in_ = [nan, nan, inf, -inf]
in_arr = array([ nan, nan, inf, -inf])
out = [nan, nan, inf, 0.0]
out_arr = array([nan, nan, inf, 0.])
self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x784fd18b50>
value = 2000.0

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:1736:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.11/unittest/case.py:766: in assertRaises
return context.handle('assertRaises', args, kwargs)
args = (<ufunc 'exp2'>, array(2000., dtype=float16))
context = None
expected_exception = <class 'FloatingPointError'>
kwargs = {}
self = <numpy.testing._private.utils._Dummy testMethod=nop>
/usr/local/lib/python3.11/unittest/case.py:236: in handle
with self:
args = [array(2000., dtype=float16)]
callable_obj = <ufunc 'exp2'>
kwargs = {}
name = 'assertRaises'
self = None
/usr/local/lib/python3.11/unittest/case.py:259: in __exit__
self._raiseFailure("{} not raised by {}".format(exc_name,
exc_name = 'FloatingPointError'
exc_type = None
exc_value = None
self = <unittest.case._AssertRaisesContext object at 0x7919a32890>
tb = None
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <unittest.case._AssertRaisesContext object at 0x7919a32890>
standardMsg = 'FloatingPointError not raised by exp2'

def _raiseFailure(self, standardMsg):
msg = self.test_case._formatMessage(self.msg, standardMsg)
> raise self.test_case.failureException(msg)
E AssertionError: FloatingPointError not raised by exp2

msg = 'FloatingPointError not raised by exp2'
self = <unittest.case._AssertRaisesContext object at 0x7919a32890>
standardMsg = 'FloatingPointError not raised by exp2'

/usr/local/lib/python3.11/unittest/case.py:199: AssertionError
__ TestSpecialFloats.test_unary_spurious_fpexception[data10-escape10-e-log1p] __

self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x78f75cd0d0>
ufunc = <ufunc 'log1p'>, dtype = 'e', data = [0.5, 0.5, 0.5, nan]
escape = [<ufunc 'arccosh'>]

@pytest.mark.skipif(sys.platform == "win32" and sys.maxsize < 2**31 + 1,
reason='failures on 32-bit Python, see FIXME below')
@pytest.mark.parametrize("ufunc", UFUNCS_UNARY_FP)
@pytest.mark.parametrize("dtype", ('e', 'f', 'd'))
@pytest.mark.parametrize("data, escape", (
([0.03], LTONE_INVALID_ERR),
([0.03]*32, LTONE_INVALID_ERR),
# neg
([-1.0], NEG_INVALID_ERR),
([-1.0]*32, NEG_INVALID_ERR),
# flat
([1.0], ONE_INVALID_ERR),
([1.0]*32, ONE_INVALID_ERR),
# zero
([0.0], BYZERO_ERR),
([0.0]*32, BYZERO_ERR),
([-0.0], BYZERO_ERR),
([-0.0]*32, BYZERO_ERR),
# nan
([0.5, 0.5, 0.5, np.nan], LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.nan]*32, LTONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0], ONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0]*32, ONE_INVALID_ERR),
([np.nan], []),
([np.nan]*32, []),
# inf
([0.5, 0.5, 0.5, np.inf], INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.inf]*32, INF_INVALID_ERR + LTONE_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0], INF_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0]*32, INF_INVALID_ERR),
([np.inf], INF_INVALID_ERR),
([np.inf]*32, INF_INVALID_ERR),
# ninf
([0.5, 0.5, 0.5, -np.inf],
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, -np.inf]*32,
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
))
def test_unary_spurious_fpexception(self, ufunc, dtype, data, escape):
if escape and ufunc in escape:
return
# FIXME: NAN raises FP invalid exception:
# - ceil/float16 on MSVC:32-bit
# - spacing/float16 on almost all platforms
# FIXME: skipped on MSVC:32-bit during switch to Meson, 10 cases fail
# when SIMD support not present / disabled
if ufunc in (np.spacing, np.ceil) and dtype == 'e':
return
array = np.array(data, dtype=dtype)
> with assert_no_warnings():

array = array([0.5, 0.5, 0.5, nan], dtype=float16)
data = [0.5, 0.5, 0.5, nan]
dtype = 'e'
escape = [<ufunc 'arccosh'>]
self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x78f75cd0d0>
ufunc = <ufunc 'log1p'>

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:1826:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <contextlib._GeneratorContextManager object at 0x78cbee7210>, typ = None
value = None, traceback = None

def __exit__(self, typ, value, traceback):
if typ is None:
try:
> next(self.gen)
E AssertionError: Got warnings: [<warnings.WarningMessage object at 0x78cbee72d0>]

self = <contextlib._GeneratorContextManager object at 0x78cbee7210>
traceback = None
typ = None
value = None

/usr/local/lib/python3.11/contextlib.py:144: AssertionError
__ TestSpecialFloats.test_unary_spurious_fpexception[data10-escape10-f-log1p] __

self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x78f75e0a10>
ufunc = <ufunc 'log1p'>, dtype = 'f', data = [0.5, 0.5, 0.5, nan]
escape = [<ufunc 'arccosh'>]

@pytest.mark.skipif(sys.platform == "win32" and sys.maxsize < 2**31 + 1,
reason='failures on 32-bit Python, see FIXME below')
@pytest.mark.parametrize("ufunc", UFUNCS_UNARY_FP)
@pytest.mark.parametrize("dtype", ('e', 'f', 'd'))
@pytest.mark.parametrize("data, escape", (
([0.03], LTONE_INVALID_ERR),
([0.03]*32, LTONE_INVALID_ERR),
# neg
([-1.0], NEG_INVALID_ERR),
([-1.0]*32, NEG_INVALID_ERR),
# flat
([1.0], ONE_INVALID_ERR),
([1.0]*32, ONE_INVALID_ERR),
# zero
([0.0], BYZERO_ERR),
([0.0]*32, BYZERO_ERR),
([-0.0], BYZERO_ERR),
([-0.0]*32, BYZERO_ERR),
# nan
([0.5, 0.5, 0.5, np.nan], LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.nan]*32, LTONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0], ONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0]*32, ONE_INVALID_ERR),
([np.nan], []),
([np.nan]*32, []),
# inf
([0.5, 0.5, 0.5, np.inf], INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.inf]*32, INF_INVALID_ERR + LTONE_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0], INF_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0]*32, INF_INVALID_ERR),
([np.inf], INF_INVALID_ERR),
([np.inf]*32, INF_INVALID_ERR),
# ninf
([0.5, 0.5, 0.5, -np.inf],
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, -np.inf]*32,
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
))
def test_unary_spurious_fpexception(self, ufunc, dtype, data, escape):
if escape and ufunc in escape:
return
# FIXME: NAN raises FP invalid exception:
# - ceil/float16 on MSVC:32-bit
# - spacing/float16 on almost all platforms
# FIXME: skipped on MSVC:32-bit during switch to Meson, 10 cases fail
# when SIMD support not present / disabled
if ufunc in (np.spacing, np.ceil) and dtype == 'e':
return
array = np.array(data, dtype=dtype)
> with assert_no_warnings():

array = array([0.5, 0.5, 0.5, nan], dtype=float32)
data = [0.5, 0.5, 0.5, nan]
dtype = 'f'
escape = [<ufunc 'arccosh'>]
self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x78f75e0a10>
ufunc = <ufunc 'log1p'>

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:1826:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <contextlib._GeneratorContextManager object at 0x78cbf0e550>, typ = None
value = None, traceback = None

def __exit__(self, typ, value, traceback):
if typ is None:
try:
> next(self.gen)
E AssertionError: Got warnings: [<warnings.WarningMessage object at 0x78cbf0ead0>]

self = <contextlib._GeneratorContextManager object at 0x78cbf0e550>
traceback = None
typ = None
value = None

/usr/local/lib/python3.11/contextlib.py:144: AssertionError
__ TestSpecialFloats.test_unary_spurious_fpexception[data10-escape10-d-log1p] __

self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x78f75f0310>
ufunc = <ufunc 'log1p'>, dtype = 'd', data = [0.5, 0.5, 0.5, nan]
escape = [<ufunc 'arccosh'>]

@pytest.mark.skipif(sys.platform == "win32" and sys.maxsize < 2**31 + 1,
reason='failures on 32-bit Python, see FIXME below')
@pytest.mark.parametrize("ufunc", UFUNCS_UNARY_FP)
@pytest.mark.parametrize("dtype", ('e', 'f', 'd'))
@pytest.mark.parametrize("data, escape", (
([0.03], LTONE_INVALID_ERR),
([0.03]*32, LTONE_INVALID_ERR),
# neg
([-1.0], NEG_INVALID_ERR),
([-1.0]*32, NEG_INVALID_ERR),
# flat
([1.0], ONE_INVALID_ERR),
([1.0]*32, ONE_INVALID_ERR),
# zero
([0.0], BYZERO_ERR),
([0.0]*32, BYZERO_ERR),
([-0.0], BYZERO_ERR),
([-0.0]*32, BYZERO_ERR),
# nan
([0.5, 0.5, 0.5, np.nan], LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.nan]*32, LTONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0], ONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0]*32, ONE_INVALID_ERR),
([np.nan], []),
([np.nan]*32, []),
# inf
([0.5, 0.5, 0.5, np.inf], INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.inf]*32, INF_INVALID_ERR + LTONE_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0], INF_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0]*32, INF_INVALID_ERR),
([np.inf], INF_INVALID_ERR),
([np.inf]*32, INF_INVALID_ERR),
# ninf
([0.5, 0.5, 0.5, -np.inf],
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, -np.inf]*32,
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
))
def test_unary_spurious_fpexception(self, ufunc, dtype, data, escape):
if escape and ufunc in escape:
return
# FIXME: NAN raises FP invalid exception:
# - ceil/float16 on MSVC:32-bit
# - spacing/float16 on almost all platforms
# FIXME: skipped on MSVC:32-bit during switch to Meson, 10 cases fail
# when SIMD support not present / disabled
if ufunc in (np.spacing, np.ceil) and dtype == 'e':
return
array = np.array(data, dtype=dtype)
> with assert_no_warnings():

array = array([0.5, 0.5, 0.5, nan])
data = [0.5, 0.5, 0.5, nan]
dtype = 'd'
escape = [<ufunc 'arccosh'>]
self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x78f75f0310>
ufunc = <ufunc 'log1p'>

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:1826:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <contextlib._GeneratorContextManager object at 0x78cbf00e90>, typ = None
value = None, traceback = None

def __exit__(self, typ, value, traceback):
if typ is None:
try:
> next(self.gen)
E AssertionError: Got warnings: [<warnings.WarningMessage object at 0x78cbf00f50>]

self = <contextlib._GeneratorContextManager object at 0x78cbf00e90>
traceback = None
typ = None
value = None

/usr/local/lib/python3.11/contextlib.py:144: AssertionError
__ TestSpecialFloats.test_unary_spurious_fpexception[data11-escape11-e-log1p] __

self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x78f764ba10>
ufunc = <ufunc 'log1p'>, dtype = 'e', data = [0.5, 0.5, 0.5, nan, 0.5, 0.5, ...]
escape = [<ufunc 'arccosh'>]

@pytest.mark.skipif(sys.platform == "win32" and sys.maxsize < 2**31 + 1,
reason='failures on 32-bit Python, see FIXME below')
@pytest.mark.parametrize("ufunc", UFUNCS_UNARY_FP)
@pytest.mark.parametrize("dtype", ('e', 'f', 'd'))
@pytest.mark.parametrize("data, escape", (
([0.03], LTONE_INVALID_ERR),
([0.03]*32, LTONE_INVALID_ERR),
# neg
([-1.0], NEG_INVALID_ERR),
([-1.0]*32, NEG_INVALID_ERR),
# flat
([1.0], ONE_INVALID_ERR),
([1.0]*32, ONE_INVALID_ERR),
# zero
([0.0], BYZERO_ERR),
([0.0]*32, BYZERO_ERR),
([-0.0], BYZERO_ERR),
([-0.0]*32, BYZERO_ERR),
# nan
([0.5, 0.5, 0.5, np.nan], LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.nan]*32, LTONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0], ONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0]*32, ONE_INVALID_ERR),
([np.nan], []),
([np.nan]*32, []),
# inf
([0.5, 0.5, 0.5, np.inf], INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.inf]*32, INF_INVALID_ERR + LTONE_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0], INF_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0]*32, INF_INVALID_ERR),
([np.inf], INF_INVALID_ERR),
([np.inf]*32, INF_INVALID_ERR),
# ninf
([0.5, 0.5, 0.5, -np.inf],
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, -np.inf]*32,
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
))
def test_unary_spurious_fpexception(self, ufunc, dtype, data, escape):
if escape and ufunc in escape:
return
# FIXME: NAN raises FP invalid exception:
# - ceil/float16 on MSVC:32-bit
# - spacing/float16 on almost all platforms
# FIXME: skipped on MSVC:32-bit during switch to Meson, 10 cases fail
# when SIMD support not present / disabled
if ufunc in (np.spacing, np.ceil) and dtype == 'e':
return
array = np.array(data, dtype=dtype)
> with assert_no_warnings():

array = array([0.5, 0.5, 0.5, nan, 0.5, 0.5, 0.5, nan, 0.5, 0.5, 0.5, nan, 0.5,
0.5, 0.5, nan, 0.5, 0.5, 0.5, nan, 0.5,... 0.5, nan, 0.5, 0.5, 0.5, nan, 0.5,
0.5, 0.5, nan, 0.5, 0.5, 0.5, nan, 0.5, 0.5, 0.5, nan],
dtype=float16)
data = [0.5, 0.5, 0.5, nan, 0.5, 0.5, ...]
dtype = 'e'
escape = [<ufunc 'arccosh'>]
self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x78f764ba10>
ufunc = <ufunc 'log1p'>

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:1826:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <contextlib._GeneratorContextManager object at 0x78cbf73790>, typ = None
value = None, traceback = None

def __exit__(self, typ, value, traceback):
if typ is None:
try:
> next(self.gen)
E AssertionError: Got warnings: [<warnings.WarningMessage object at 0x78cbf73850>]

self = <contextlib._GeneratorContextManager object at 0x78cbf73790>
traceback = None
typ = None
value = None

/usr/local/lib/python3.11/contextlib.py:144: AssertionError
__ TestSpecialFloats.test_unary_spurious_fpexception[data11-escape11-f-log1p] __

self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x78f761b290>
ufunc = <ufunc 'log1p'>, dtype = 'f', data = [0.5, 0.5, 0.5, nan, 0.5, 0.5, ...]
escape = [<ufunc 'arccosh'>]

@pytest.mark.skipif(sys.platform == "win32" and sys.maxsize < 2**31 + 1,
reason='failures on 32-bit Python, see FIXME below')
@pytest.mark.parametrize("ufunc", UFUNCS_UNARY_FP)
@pytest.mark.parametrize("dtype", ('e', 'f', 'd'))
@pytest.mark.parametrize("data, escape", (
([0.03], LTONE_INVALID_ERR),
([0.03]*32, LTONE_INVALID_ERR),
# neg
([-1.0], NEG_INVALID_ERR),
([-1.0]*32, NEG_INVALID_ERR),
# flat
([1.0], ONE_INVALID_ERR),
([1.0]*32, ONE_INVALID_ERR),
# zero
([0.0], BYZERO_ERR),
([0.0]*32, BYZERO_ERR),
([-0.0], BYZERO_ERR),
([-0.0]*32, BYZERO_ERR),
# nan
([0.5, 0.5, 0.5, np.nan], LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.nan]*32, LTONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0], ONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0]*32, ONE_INVALID_ERR),
([np.nan], []),
([np.nan]*32, []),
# inf
([0.5, 0.5, 0.5, np.inf], INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.inf]*32, INF_INVALID_ERR + LTONE_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0], INF_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0]*32, INF_INVALID_ERR),
([np.inf], INF_INVALID_ERR),
([np.inf]*32, INF_INVALID_ERR),
# ninf
([0.5, 0.5, 0.5, -np.inf],
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, -np.inf]*32,
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
))
def test_unary_spurious_fpexception(self, ufunc, dtype, data, escape):
if escape and ufunc in escape:
return
# FIXME: NAN raises FP invalid exception:
# - ceil/float16 on MSVC:32-bit
# - spacing/float16 on almost all platforms
# FIXME: skipped on MSVC:32-bit during switch to Meson, 10 cases fail
# when SIMD support not present / disabled
if ufunc in (np.spacing, np.ceil) and dtype == 'e':
return
array = np.array(data, dtype=dtype)
> with assert_no_warnings():

array = array([0.5, 0.5, 0.5, nan, 0.5, 0.5, 0.5, nan, 0.5, 0.5, 0.5, nan, 0.5,
0.5, 0.5, nan, 0.5, 0.5, 0.5, nan, 0.5,... 0.5, nan, 0.5, 0.5, 0.5, nan, 0.5,
0.5, 0.5, nan, 0.5, 0.5, 0.5, nan, 0.5, 0.5, 0.5, nan],
dtype=float32)
data = [0.5, 0.5, 0.5, nan, 0.5, 0.5, ...]
dtype = 'f'
escape = [<ufunc 'arccosh'>]
self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x78f761b290>
ufunc = <ufunc 'log1p'>

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:1826:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <contextlib._GeneratorContextManager object at 0x78cbf223d0>, typ = None
value = None, traceback = None

def __exit__(self, typ, value, traceback):
if typ is None:
try:
> next(self.gen)
E AssertionError: Got warnings: [<warnings.WarningMessage object at 0x78cbf22490>]

self = <contextlib._GeneratorContextManager object at 0x78cbf223d0>
traceback = None
typ = None
value = None

/usr/local/lib/python3.11/contextlib.py:144: AssertionError
__ TestSpecialFloats.test_unary_spurious_fpexception[data11-escape11-d-log1p] __

self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x78f7646b10>
ufunc = <ufunc 'log1p'>, dtype = 'd', data = [0.5, 0.5, 0.5, nan, 0.5, 0.5, ...]
escape = [<ufunc 'arccosh'>]

@pytest.mark.skipif(sys.platform == "win32" and sys.maxsize < 2**31 + 1,
reason='failures on 32-bit Python, see FIXME below')
@pytest.mark.parametrize("ufunc", UFUNCS_UNARY_FP)
@pytest.mark.parametrize("dtype", ('e', 'f', 'd'))
@pytest.mark.parametrize("data, escape", (
([0.03], LTONE_INVALID_ERR),
([0.03]*32, LTONE_INVALID_ERR),
# neg
([-1.0], NEG_INVALID_ERR),
([-1.0]*32, NEG_INVALID_ERR),
# flat
([1.0], ONE_INVALID_ERR),
([1.0]*32, ONE_INVALID_ERR),
# zero
([0.0], BYZERO_ERR),
([0.0]*32, BYZERO_ERR),
([-0.0], BYZERO_ERR),
([-0.0]*32, BYZERO_ERR),
# nan
([0.5, 0.5, 0.5, np.nan], LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.nan]*32, LTONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0], ONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0]*32, ONE_INVALID_ERR),
([np.nan], []),
([np.nan]*32, []),
# inf
([0.5, 0.5, 0.5, np.inf], INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.inf]*32, INF_INVALID_ERR + LTONE_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0], INF_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0]*32, INF_INVALID_ERR),
([np.inf], INF_INVALID_ERR),
([np.inf]*32, INF_INVALID_ERR),
# ninf
([0.5, 0.5, 0.5, -np.inf],
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, -np.inf]*32,
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
))
def test_unary_spurious_fpexception(self, ufunc, dtype, data, escape):
if escape and ufunc in escape:
return
# FIXME: NAN raises FP invalid exception:
# - ceil/float16 on MSVC:32-bit
# - spacing/float16 on almost all platforms
# FIXME: skipped on MSVC:32-bit during switch to Meson, 10 cases fail
# when SIMD support not present / disabled
if ufunc in (np.spacing, np.ceil) and dtype == 'e':
return
array = np.array(data, dtype=dtype)
> with assert_no_warnings():

array = array([0.5, 0.5, 0.5, nan, 0.5, 0.5, 0.5, nan, 0.5, 0.5, 0.5, nan, 0.5,
0.5, 0.5, nan, 0.5, 0.5, 0.5, nan, 0.5,..., 0.5, nan, 0.5, 0.5, 0.5, nan, 0.5, 0.5, 0.5, nan, 0.5,
0.5, 0.5, nan, 0.5, 0.5, 0.5, nan, 0.5, 0.5, 0.5, nan])
data = [0.5, 0.5, 0.5, nan, 0.5, 0.5, ...]
dtype = 'd'
escape = [<ufunc 'arccosh'>]
self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x78f7646b10>
ufunc = <ufunc 'log1p'>

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:1826:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <contextlib._GeneratorContextManager object at 0x78cbf9ce50>, typ = None
value = None, traceback = None

def __exit__(self, typ, value, traceback):
if typ is None:
try:
> next(self.gen)
E AssertionError: Got warnings: [<warnings.WarningMessage object at 0x78cbf9cf10>]

self = <contextlib._GeneratorContextManager object at 0x78cbf9ce50>
traceback = None
typ = None
value = None

/usr/local/lib/python3.11/contextlib.py:144: AssertionError
__ TestSpecialFloats.test_unary_spurious_fpexception[data12-escape12-e-log1p] __

self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x78f7652390>
ufunc = <ufunc 'log1p'>, dtype = 'e', data = [nan, 1.0, 1.0, 1.0]
escape = [<ufunc 'arctanh'>]

@pytest.mark.skipif(sys.platform == "win32" and sys.maxsize < 2**31 + 1,
reason='failures on 32-bit Python, see FIXME below')
@pytest.mark.parametrize("ufunc", UFUNCS_UNARY_FP)
@pytest.mark.parametrize("dtype", ('e', 'f', 'd'))
@pytest.mark.parametrize("data, escape", (
([0.03], LTONE_INVALID_ERR),
([0.03]*32, LTONE_INVALID_ERR),
# neg
([-1.0], NEG_INVALID_ERR),
([-1.0]*32, NEG_INVALID_ERR),
# flat
([1.0], ONE_INVALID_ERR),
([1.0]*32, ONE_INVALID_ERR),
# zero
([0.0], BYZERO_ERR),
([0.0]*32, BYZERO_ERR),
([-0.0], BYZERO_ERR),
([-0.0]*32, BYZERO_ERR),
# nan
([0.5, 0.5, 0.5, np.nan], LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.nan]*32, LTONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0], ONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0]*32, ONE_INVALID_ERR),
([np.nan], []),
([np.nan]*32, []),
# inf
([0.5, 0.5, 0.5, np.inf], INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.inf]*32, INF_INVALID_ERR + LTONE_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0], INF_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0]*32, INF_INVALID_ERR),
([np.inf], INF_INVALID_ERR),
([np.inf]*32, INF_INVALID_ERR),
# ninf
([0.5, 0.5, 0.5, -np.inf],
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, -np.inf]*32,
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
))
def test_unary_spurious_fpexception(self, ufunc, dtype, data, escape):
if escape and ufunc in escape:
return
# FIXME: NAN raises FP invalid exception:
# - ceil/float16 on MSVC:32-bit
# - spacing/float16 on almost all platforms
# FIXME: skipped on MSVC:32-bit during switch to Meson, 10 cases fail
# when SIMD support not present / disabled
if ufunc in (np.spacing, np.ceil) and dtype == 'e':
return
array = np.array(data, dtype=dtype)
> with assert_no_warnings():

array = array([nan, 1., 1., 1.], dtype=float16)
data = [nan, 1.0, 1.0, 1.0]
dtype = 'e'
escape = [<ufunc 'arctanh'>]
self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x78f7652390>
ufunc = <ufunc 'log1p'>

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:1826:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <contextlib._GeneratorContextManager object at 0x79141fedd0>, typ = None
value = None, traceback = None

def __exit__(self, typ, value, traceback):
if typ is None:
try:
> next(self.gen)
E AssertionError: Got warnings: [<warnings.WarningMessage object at 0x79141feed0>]

self = <contextlib._GeneratorContextManager object at 0x79141fedd0>
traceback = None
typ = None
value = None

/usr/local/lib/python3.11/contextlib.py:144: AssertionError
__ TestSpecialFloats.test_unary_spurious_fpexception[data12-escape12-f-log1p] __

self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x78f7685c10>
ufunc = <ufunc 'log1p'>, dtype = 'f', data = [nan, 1.0, 1.0, 1.0]
escape = [<ufunc 'arctanh'>]

@pytest.mark.skipif(sys.platform == "win32" and sys.maxsize < 2**31 + 1,
reason='failures on 32-bit Python, see FIXME below')
@pytest.mark.parametrize("ufunc", UFUNCS_UNARY_FP)
@pytest.mark.parametrize("dtype", ('e', 'f', 'd'))
@pytest.mark.parametrize("data, escape", (
([0.03], LTONE_INVALID_ERR),
([0.03]*32, LTONE_INVALID_ERR),
# neg
([-1.0], NEG_INVALID_ERR),
([-1.0]*32, NEG_INVALID_ERR),
# flat
([1.0], ONE_INVALID_ERR),
([1.0]*32, ONE_INVALID_ERR),
# zero
([0.0], BYZERO_ERR),
([0.0]*32, BYZERO_ERR),
([-0.0], BYZERO_ERR),
([-0.0]*32, BYZERO_ERR),
# nan
([0.5, 0.5, 0.5, np.nan], LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.nan]*32, LTONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0], ONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0]*32, ONE_INVALID_ERR),
([np.nan], []),
([np.nan]*32, []),
# inf
([0.5, 0.5, 0.5, np.inf], INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.inf]*32, INF_INVALID_ERR + LTONE_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0], INF_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0]*32, INF_INVALID_ERR),
([np.inf], INF_INVALID_ERR),
([np.inf]*32, INF_INVALID_ERR),
# ninf
([0.5, 0.5, 0.5, -np.inf],
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, -np.inf]*32,
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
))
def test_unary_spurious_fpexception(self, ufunc, dtype, data, escape):
if escape and ufunc in escape:
return
# FIXME: NAN raises FP invalid exception:
# - ceil/float16 on MSVC:32-bit
# - spacing/float16 on almost all platforms
# FIXME: skipped on MSVC:32-bit during switch to Meson, 10 cases fail
# when SIMD support not present / disabled
if ufunc in (np.spacing, np.ceil) and dtype == 'e':
return
array = np.array(data, dtype=dtype)
> with assert_no_warnings():

array = array([nan, 1., 1., 1.], dtype=float32)
data = [nan, 1.0, 1.0, 1.0]
dtype = 'f'
escape = [<ufunc 'arctanh'>]
self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x78f7685c10>
ufunc = <ufunc 'log1p'>

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:1826:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <contextlib._GeneratorContextManager object at 0x791420a0d0>, typ = None
value = None, traceback = None

def __exit__(self, typ, value, traceback):
if typ is None:
try:
> next(self.gen)
E AssertionError: Got warnings: [<warnings.WarningMessage object at 0x791420a190>]

self = <contextlib._GeneratorContextManager object at 0x791420a0d0>
traceback = None
typ = None
value = None

/usr/local/lib/python3.11/contextlib.py:144: AssertionError
__ TestSpecialFloats.test_unary_spurious_fpexception[data12-escape12-d-log1p] __

self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x78f76a9490>
ufunc = <ufunc 'log1p'>, dtype = 'd', data = [nan, 1.0, 1.0, 1.0]
escape = [<ufunc 'arctanh'>]

@pytest.mark.skipif(sys.platform == "win32" and sys.maxsize < 2**31 + 1,
reason='failures on 32-bit Python, see FIXME below')
@pytest.mark.parametrize("ufunc", UFUNCS_UNARY_FP)
@pytest.mark.parametrize("dtype", ('e', 'f', 'd'))
@pytest.mark.parametrize("data, escape", (
([0.03], LTONE_INVALID_ERR),
([0.03]*32, LTONE_INVALID_ERR),
# neg
([-1.0], NEG_INVALID_ERR),
([-1.0]*32, NEG_INVALID_ERR),
# flat
([1.0], ONE_INVALID_ERR),
([1.0]*32, ONE_INVALID_ERR),
# zero
([0.0], BYZERO_ERR),
([0.0]*32, BYZERO_ERR),
([-0.0], BYZERO_ERR),
([-0.0]*32, BYZERO_ERR),
# nan
([0.5, 0.5, 0.5, np.nan], LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.nan]*32, LTONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0], ONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0]*32, ONE_INVALID_ERR),
([np.nan], []),
([np.nan]*32, []),
# inf
([0.5, 0.5, 0.5, np.inf], INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.inf]*32, INF_INVALID_ERR + LTONE_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0], INF_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0]*32, INF_INVALID_ERR),
([np.inf], INF_INVALID_ERR),
([np.inf]*32, INF_INVALID_ERR),
# ninf
([0.5, 0.5, 0.5, -np.inf],
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, -np.inf]*32,
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
))
def test_unary_spurious_fpexception(self, ufunc, dtype, data, escape):
if escape and ufunc in escape:
return
# FIXME: NAN raises FP invalid exception:
# - ceil/float16 on MSVC:32-bit
# - spacing/float16 on almost all platforms
# FIXME: skipped on MSVC:32-bit during switch to Meson, 10 cases fail
# when SIMD support not present / disabled
if ufunc in (np.spacing, np.ceil) and dtype == 'e':
return
array = np.array(data, dtype=dtype)
> with assert_no_warnings():

array = array([nan, 1., 1., 1.])
data = [nan, 1.0, 1.0, 1.0]
dtype = 'd'
escape = [<ufunc 'arctanh'>]
self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x78f76a9490>
ufunc = <ufunc 'log1p'>

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:1826:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <contextlib._GeneratorContextManager object at 0x79141e0850>, typ = None
value = None, traceback = None

def __exit__(self, typ, value, traceback):
if typ is None:
try:
> next(self.gen)
E AssertionError: Got warnings: [<warnings.WarningMessage object at 0x79141e0710>]

self = <contextlib._GeneratorContextManager object at 0x79141e0850>
traceback = None
typ = None
value = None

/usr/local/lib/python3.11/contextlib.py:144: AssertionError
__ TestSpecialFloats.test_unary_spurious_fpexception[data13-escape13-e-log1p] __

self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x78f769cd10>
ufunc = <ufunc 'log1p'>, dtype = 'e', data = [nan, 1.0, 1.0, 1.0, nan, 1.0, ...]
escape = [<ufunc 'arctanh'>]

@pytest.mark.skipif(sys.platform == "win32" and sys.maxsize < 2**31 + 1,
reason='failures on 32-bit Python, see FIXME below')
@pytest.mark.parametrize("ufunc", UFUNCS_UNARY_FP)
@pytest.mark.parametrize("dtype", ('e', 'f', 'd'))
@pytest.mark.parametrize("data, escape", (
([0.03], LTONE_INVALID_ERR),
([0.03]*32, LTONE_INVALID_ERR),
# neg
([-1.0], NEG_INVALID_ERR),
([-1.0]*32, NEG_INVALID_ERR),
# flat
([1.0], ONE_INVALID_ERR),
([1.0]*32, ONE_INVALID_ERR),
# zero
([0.0], BYZERO_ERR),
([0.0]*32, BYZERO_ERR),
([-0.0], BYZERO_ERR),
([-0.0]*32, BYZERO_ERR),
# nan
([0.5, 0.5, 0.5, np.nan], LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.nan]*32, LTONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0], ONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0]*32, ONE_INVALID_ERR),
([np.nan], []),
([np.nan]*32, []),
# inf
([0.5, 0.5, 0.5, np.inf], INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.inf]*32, INF_INVALID_ERR + LTONE_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0], INF_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0]*32, INF_INVALID_ERR),
([np.inf], INF_INVALID_ERR),
([np.inf]*32, INF_INVALID_ERR),
# ninf
([0.5, 0.5, 0.5, -np.inf],
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, -np.inf]*32,
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
))
def test_unary_spurious_fpexception(self, ufunc, dtype, data, escape):
if escape and ufunc in escape:
return
# FIXME: NAN raises FP invalid exception:
# - ceil/float16 on MSVC:32-bit
# - spacing/float16 on almost all platforms
# FIXME: skipped on MSVC:32-bit during switch to Meson, 10 cases fail
# when SIMD support not present / disabled
if ufunc in (np.spacing, np.ceil) and dtype == 'e':
return
array = np.array(data, dtype=dtype)
> with assert_no_warnings():

array = array([nan, 1., 1., 1., nan, 1., 1., 1., nan, 1., 1., 1., nan,
1., 1., 1., nan, 1., 1., 1., nan,... 1., 1., nan, 1., 1., 1., nan,
1., 1., 1., nan, 1., 1., 1., nan, 1., 1., 1.],
dtype=float16)
data = [nan, 1.0, 1.0, 1.0, nan, 1.0, ...]
dtype = 'e'
escape = [<ufunc 'arctanh'>]
self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x78f769cd10>
ufunc = <ufunc 'log1p'>

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:1826:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <contextlib._GeneratorContextManager object at 0x7914273010>, typ = None
value = None, traceback = None

def __exit__(self, typ, value, traceback):
if typ is None:
try:
> next(self.gen)
E AssertionError: Got warnings: [<warnings.WarningMessage object at 0x79142730d0>]

self = <contextlib._GeneratorContextManager object at 0x7914273010>
traceback = None
typ = None
value = None

/usr/local/lib/python3.11/contextlib.py:144: AssertionError
__ TestSpecialFloats.test_unary_spurious_fpexception[data13-escape13-f-log1p] __

self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x78f76bc590>
ufunc = <ufunc 'log1p'>, dtype = 'f', data = [nan, 1.0, 1.0, 1.0, nan, 1.0, ...]
escape = [<ufunc 'arctanh'>]

@pytest.mark.skipif(sys.platform == "win32" and sys.maxsize < 2**31 + 1,
reason='failures on 32-bit Python, see FIXME below')
@pytest.mark.parametrize("ufunc", UFUNCS_UNARY_FP)
@pytest.mark.parametrize("dtype", ('e', 'f', 'd'))
@pytest.mark.parametrize("data, escape", (
([0.03], LTONE_INVALID_ERR),
([0.03]*32, LTONE_INVALID_ERR),
# neg
([-1.0], NEG_INVALID_ERR),
([-1.0]*32, NEG_INVALID_ERR),
# flat
([1.0], ONE_INVALID_ERR),
([1.0]*32, ONE_INVALID_ERR),
# zero
([0.0], BYZERO_ERR),
([0.0]*32, BYZERO_ERR),
([-0.0], BYZERO_ERR),
([-0.0]*32, BYZERO_ERR),
# nan
([0.5, 0.5, 0.5, np.nan], LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.nan]*32, LTONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0], ONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0]*32, ONE_INVALID_ERR),
([np.nan], []),
([np.nan]*32, []),
# inf
([0.5, 0.5, 0.5, np.inf], INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.inf]*32, INF_INVALID_ERR + LTONE_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0], INF_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0]*32, INF_INVALID_ERR),
([np.inf], INF_INVALID_ERR),
([np.inf]*32, INF_INVALID_ERR),
# ninf
([0.5, 0.5, 0.5, -np.inf],
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, -np.inf]*32,
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
))
def test_unary_spurious_fpexception(self, ufunc, dtype, data, escape):
if escape and ufunc in escape:
return
# FIXME: NAN raises FP invalid exception:
# - ceil/float16 on MSVC:32-bit
# - spacing/float16 on almost all platforms
# FIXME: skipped on MSVC:32-bit during switch to Meson, 10 cases fail
# when SIMD support not present / disabled
if ufunc in (np.spacing, np.ceil) and dtype == 'e':
return
array = np.array(data, dtype=dtype)
> with assert_no_warnings():

array = array([nan, 1., 1., 1., nan, 1., 1., 1., nan, 1., 1., 1., nan,
1., 1., 1., nan, 1., 1., 1., nan,... 1., 1., nan, 1., 1., 1., nan,
1., 1., 1., nan, 1., 1., 1., nan, 1., 1., 1.],
dtype=float32)
data = [nan, 1.0, 1.0, 1.0, nan, 1.0, ...]
dtype = 'f'
escape = [<ufunc 'arctanh'>]
self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x78f76bc590>
ufunc = <ufunc 'log1p'>

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:1826:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <contextlib._GeneratorContextManager object at 0x79142899d0>, typ = None
value = None, traceback = None

def __exit__(self, typ, value, traceback):
if typ is None:
try:
> next(self.gen)
E AssertionError: Got warnings: [<warnings.WarningMessage object at 0x7914289b90>]

self = <contextlib._GeneratorContextManager object at 0x79142899d0>
traceback = None
typ = None
value = None

/usr/local/lib/python3.11/contextlib.py:144: AssertionError
__ TestSpecialFloats.test_unary_spurious_fpexception[data13-escape13-d-log1p] __

self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x7899a77dd0>
ufunc = <ufunc 'log1p'>, dtype = 'd', data = [nan, 1.0, 1.0, 1.0, nan, 1.0, ...]
escape = [<ufunc 'arctanh'>]

@pytest.mark.skipif(sys.platform == "win32" and sys.maxsize < 2**31 + 1,
reason='failures on 32-bit Python, see FIXME below')
@pytest.mark.parametrize("ufunc", UFUNCS_UNARY_FP)
@pytest.mark.parametrize("dtype", ('e', 'f', 'd'))
@pytest.mark.parametrize("data, escape", (
([0.03], LTONE_INVALID_ERR),
([0.03]*32, LTONE_INVALID_ERR),
# neg
([-1.0], NEG_INVALID_ERR),
([-1.0]*32, NEG_INVALID_ERR),
# flat
([1.0], ONE_INVALID_ERR),
([1.0]*32, ONE_INVALID_ERR),
# zero
([0.0], BYZERO_ERR),
([0.0]*32, BYZERO_ERR),
([-0.0], BYZERO_ERR),
([-0.0]*32, BYZERO_ERR),
# nan
([0.5, 0.5, 0.5, np.nan], LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.nan]*32, LTONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0], ONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0]*32, ONE_INVALID_ERR),
([np.nan], []),
([np.nan]*32, []),
# inf
([0.5, 0.5, 0.5, np.inf], INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.inf]*32, INF_INVALID_ERR + LTONE_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0], INF_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0]*32, INF_INVALID_ERR),
([np.inf], INF_INVALID_ERR),
([np.inf]*32, INF_INVALID_ERR),
# ninf
([0.5, 0.5, 0.5, -np.inf],
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, -np.inf]*32,
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
))
def test_unary_spurious_fpexception(self, ufunc, dtype, data, escape):
if escape and ufunc in escape:
return
# FIXME: NAN raises FP invalid exception:
# - ceil/float16 on MSVC:32-bit
# - spacing/float16 on almost all platforms
# FIXME: skipped on MSVC:32-bit during switch to Meson, 10 cases fail
# when SIMD support not present / disabled
if ufunc in (np.spacing, np.ceil) and dtype == 'e':
return
array = np.array(data, dtype=dtype)
> with assert_no_warnings():

array = array([nan, 1., 1., 1., nan, 1., 1., 1., nan, 1., 1., 1., nan,
1., 1., 1., nan, 1., 1., 1., nan,..., 1., 1., nan, 1., 1., 1., nan, 1., 1., 1., nan,
1., 1., 1., nan, 1., 1., 1., nan, 1., 1., 1.])
data = [nan, 1.0, 1.0, 1.0, nan, 1.0, ...]
dtype = 'd'
escape = [<ufunc 'arctanh'>]
self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x7899a77dd0>
ufunc = <ufunc 'log1p'>

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:1826:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <contextlib._GeneratorContextManager object at 0x7913a47c50>, typ = None
value = None, traceback = None

def __exit__(self, typ, value, traceback):
if typ is None:
try:
> next(self.gen)
E AssertionError: Got warnings: [<warnings.WarningMessage object at 0x7913a44850>]

self = <contextlib._GeneratorContextManager object at 0x7913a47c50>
traceback = None
typ = None
value = None

/usr/local/lib/python3.11/contextlib.py:144: AssertionError
__ TestSpecialFloats.test_unary_spurious_fpexception[data14-escape14-e-log1p] __

self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x7899a5f650>
ufunc = <ufunc 'log1p'>, dtype = 'e', data = [nan], escape = []

@pytest.mark.skipif(sys.platform == "win32" and sys.maxsize < 2**31 + 1,
reason='failures on 32-bit Python, see FIXME below')
@pytest.mark.parametrize("ufunc", UFUNCS_UNARY_FP)
@pytest.mark.parametrize("dtype", ('e', 'f', 'd'))
@pytest.mark.parametrize("data, escape", (
([0.03], LTONE_INVALID_ERR),
([0.03]*32, LTONE_INVALID_ERR),
# neg
([-1.0], NEG_INVALID_ERR),
([-1.0]*32, NEG_INVALID_ERR),
# flat
([1.0], ONE_INVALID_ERR),
([1.0]*32, ONE_INVALID_ERR),
# zero
([0.0], BYZERO_ERR),
([0.0]*32, BYZERO_ERR),
([-0.0], BYZERO_ERR),
([-0.0]*32, BYZERO_ERR),
# nan
([0.5, 0.5, 0.5, np.nan], LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.nan]*32, LTONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0], ONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0]*32, ONE_INVALID_ERR),
([np.nan], []),
([np.nan]*32, []),
# inf
([0.5, 0.5, 0.5, np.inf], INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.inf]*32, INF_INVALID_ERR + LTONE_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0], INF_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0]*32, INF_INVALID_ERR),
([np.inf], INF_INVALID_ERR),
([np.inf]*32, INF_INVALID_ERR),
# ninf
([0.5, 0.5, 0.5, -np.inf],
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, -np.inf]*32,
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
))
def test_unary_spurious_fpexception(self, ufunc, dtype, data, escape):
if escape and ufunc in escape:
return
# FIXME: NAN raises FP invalid exception:
# - ceil/float16 on MSVC:32-bit
# - spacing/float16 on almost all platforms
# FIXME: skipped on MSVC:32-bit during switch to Meson, 10 cases fail
# when SIMD support not present / disabled
if ufunc in (np.spacing, np.ceil) and dtype == 'e':
return
array = np.array(data, dtype=dtype)
> with assert_no_warnings():

array = array([nan], dtype=float16)
data = [nan]
dtype = 'e'
escape = []
self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x7899a5f650>
ufunc = <ufunc 'log1p'>

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:1826:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <contextlib._GeneratorContextManager object at 0x79141eac90>, typ = None
value = None, traceback = None

def __exit__(self, typ, value, traceback):
if typ is None:
try:
> next(self.gen)
E AssertionError: Got warnings: [<warnings.WarningMessage object at 0x79141ead50>]

self = <contextlib._GeneratorContextManager object at 0x79141eac90>
traceback = None
typ = None
value = None

/usr/local/lib/python3.11/contextlib.py:144: AssertionError
__ TestSpecialFloats.test_unary_spurious_fpexception[data14-escape14-f-log1p] __

self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x7899a72c50>
ufunc = <ufunc 'log1p'>, dtype = 'f', data = [nan], escape = []

@pytest.mark.skipif(sys.platform == "win32" and sys.maxsize < 2**31 + 1,
reason='failures on 32-bit Python, see FIXME below')
@pytest.mark.parametrize("ufunc", UFUNCS_UNARY_FP)
@pytest.mark.parametrize("dtype", ('e', 'f', 'd'))
@pytest.mark.parametrize("data, escape", (
([0.03], LTONE_INVALID_ERR),
([0.03]*32, LTONE_INVALID_ERR),
# neg
([-1.0], NEG_INVALID_ERR),
([-1.0]*32, NEG_INVALID_ERR),
# flat
([1.0], ONE_INVALID_ERR),
([1.0]*32, ONE_INVALID_ERR),
# zero
([0.0], BYZERO_ERR),
([0.0]*32, BYZERO_ERR),
([-0.0], BYZERO_ERR),
([-0.0]*32, BYZERO_ERR),
# nan
([0.5, 0.5, 0.5, np.nan], LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.nan]*32, LTONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0], ONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0]*32, ONE_INVALID_ERR),
([np.nan], []),
([np.nan]*32, []),
# inf
([0.5, 0.5, 0.5, np.inf], INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.inf]*32, INF_INVALID_ERR + LTONE_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0], INF_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0]*32, INF_INVALID_ERR),
([np.inf], INF_INVALID_ERR),
([np.inf]*32, INF_INVALID_ERR),
# ninf
([0.5, 0.5, 0.5, -np.inf],
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, -np.inf]*32,
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
))
def test_unary_spurious_fpexception(self, ufunc, dtype, data, escape):
if escape and ufunc in escape:
return
# FIXME: NAN raises FP invalid exception:
# - ceil/float16 on MSVC:32-bit
# - spacing/float16 on almost all platforms
# FIXME: skipped on MSVC:32-bit during switch to Meson, 10 cases fail
# when SIMD support not present / disabled
if ufunc in (np.spacing, np.ceil) and dtype == 'e':
return
array = np.array(data, dtype=dtype)
> with assert_no_warnings():

array = array([nan], dtype=float32)
data = [nan]
dtype = 'f'
escape = []
self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x7899a72c50>
ufunc = <ufunc 'log1p'>

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:1826:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <contextlib._GeneratorContextManager object at 0x7913a0e450>, typ = None
value = None, traceback = None

def __exit__(self, typ, value, traceback):
if typ is None:
try:
> next(self.gen)
E AssertionError: Got warnings: [<warnings.WarningMessage object at 0x7913a0e310>]

self = <contextlib._GeneratorContextManager object at 0x7913a0e450>
traceback = None
typ = None
value = None

/usr/local/lib/python3.11/contextlib.py:144: AssertionError
__ TestSpecialFloats.test_unary_spurious_fpexception[data14-escape14-d-log1p] __

self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x7899a6e750>
ufunc = <ufunc 'log1p'>, dtype = 'd', data = [nan], escape = []

@pytest.mark.skipif(sys.platform == "win32" and sys.maxsize < 2**31 + 1,
reason='failures on 32-bit Python, see FIXME below')
@pytest.mark.parametrize("ufunc", UFUNCS_UNARY_FP)
@pytest.mark.parametrize("dtype", ('e', 'f', 'd'))
@pytest.mark.parametrize("data, escape", (
([0.03], LTONE_INVALID_ERR),
([0.03]*32, LTONE_INVALID_ERR),
# neg
([-1.0], NEG_INVALID_ERR),
([-1.0]*32, NEG_INVALID_ERR),
# flat
([1.0], ONE_INVALID_ERR),
([1.0]*32, ONE_INVALID_ERR),
# zero
([0.0], BYZERO_ERR),
([0.0]*32, BYZERO_ERR),
([-0.0], BYZERO_ERR),
([-0.0]*32, BYZERO_ERR),
# nan
([0.5, 0.5, 0.5, np.nan], LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.nan]*32, LTONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0], ONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0]*32, ONE_INVALID_ERR),
([np.nan], []),
([np.nan]*32, []),
# inf
([0.5, 0.5, 0.5, np.inf], INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.inf]*32, INF_INVALID_ERR + LTONE_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0], INF_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0]*32, INF_INVALID_ERR),
([np.inf], INF_INVALID_ERR),
([np.inf]*32, INF_INVALID_ERR),
# ninf
([0.5, 0.5, 0.5, -np.inf],
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, -np.inf]*32,
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
))
def test_unary_spurious_fpexception(self, ufunc, dtype, data, escape):
if escape and ufunc in escape:
return
# FIXME: NAN raises FP invalid exception:
# - ceil/float16 on MSVC:32-bit
# - spacing/float16 on almost all platforms
# FIXME: skipped on MSVC:32-bit during switch to Meson, 10 cases fail
# when SIMD support not present / disabled
if ufunc in (np.spacing, np.ceil) and dtype == 'e':
return
array = np.array(data, dtype=dtype)
> with assert_no_warnings():

array = array([nan])
data = [nan]
dtype = 'd'
escape = []
self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x7899a6e750>
ufunc = <ufunc 'log1p'>

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:1826:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <contextlib._GeneratorContextManager object at 0x7913a23c50>, typ = None
value = None, traceback = None

def __exit__(self, typ, value, traceback):
if typ is None:
try:
> next(self.gen)
E AssertionError: Got warnings: [<warnings.WarningMessage object at 0x7913a23d10>]

self = <contextlib._GeneratorContextManager object at 0x7913a23c50>
traceback = None
typ = None
value = None

/usr/local/lib/python3.11/contextlib.py:144: AssertionError
__ TestSpecialFloats.test_unary_spurious_fpexception[data15-escape15-e-log1p] __

self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x7899a99fd0>
ufunc = <ufunc 'log1p'>, dtype = 'e', data = [nan, nan, nan, nan, nan, nan, ...]
escape = []

@pytest.mark.skipif(sys.platform == "win32" and sys.maxsize < 2**31 + 1,
reason='failures on 32-bit Python, see FIXME below')
@pytest.mark.parametrize("ufunc", UFUNCS_UNARY_FP)
@pytest.mark.parametrize("dtype", ('e', 'f', 'd'))
@pytest.mark.parametrize("data, escape", (
([0.03], LTONE_INVALID_ERR),
([0.03]*32, LTONE_INVALID_ERR),
# neg
([-1.0], NEG_INVALID_ERR),
([-1.0]*32, NEG_INVALID_ERR),
# flat
([1.0], ONE_INVALID_ERR),
([1.0]*32, ONE_INVALID_ERR),
# zero
([0.0], BYZERO_ERR),
([0.0]*32, BYZERO_ERR),
([-0.0], BYZERO_ERR),
([-0.0]*32, BYZERO_ERR),
# nan
([0.5, 0.5, 0.5, np.nan], LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.nan]*32, LTONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0], ONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0]*32, ONE_INVALID_ERR),
([np.nan], []),
([np.nan]*32, []),
# inf
([0.5, 0.5, 0.5, np.inf], INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.inf]*32, INF_INVALID_ERR + LTONE_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0], INF_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0]*32, INF_INVALID_ERR),
([np.inf], INF_INVALID_ERR),
([np.inf]*32, INF_INVALID_ERR),
# ninf
([0.5, 0.5, 0.5, -np.inf],
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, -np.inf]*32,
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
))
def test_unary_spurious_fpexception(self, ufunc, dtype, data, escape):
if escape and ufunc in escape:
return
# FIXME: NAN raises FP invalid exception:
# - ceil/float16 on MSVC:32-bit
# - spacing/float16 on almost all platforms
# FIXME: skipped on MSVC:32-bit during switch to Meson, 10 cases fail
# when SIMD support not present / disabled
if ufunc in (np.spacing, np.ceil) and dtype == 'e':
return
array = np.array(data, dtype=dtype)
> with assert_no_warnings():

array = array([nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
nan, nan, nan, nan, nan, nan], dtype=float16)
data = [nan, nan, nan, nan, nan, nan, ...]
dtype = 'e'
escape = []
self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x7899a99fd0>
ufunc = <ufunc 'log1p'>

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:1826:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <contextlib._GeneratorContextManager object at 0x7913a8a410>, typ = None
value = None, traceback = None

def __exit__(self, typ, value, traceback):
if typ is None:
try:
> next(self.gen)
E AssertionError: Got warnings: [<warnings.WarningMessage object at 0x7913a8a4d0>]

self = <contextlib._GeneratorContextManager object at 0x7913a8a410>
traceback = None
typ = None
value = None

/usr/local/lib/python3.11/contextlib.py:144: AssertionError
__ TestSpecialFloats.test_unary_spurious_fpexception[data15-escape15-f-log1p] __

self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x7899acd850>
ufunc = <ufunc 'log1p'>, dtype = 'f', data = [nan, nan, nan, nan, nan, nan, ...]
escape = []

@pytest.mark.skipif(sys.platform == "win32" and sys.maxsize < 2**31 + 1,
reason='failures on 32-bit Python, see FIXME below')
@pytest.mark.parametrize("ufunc", UFUNCS_UNARY_FP)
@pytest.mark.parametrize("dtype", ('e', 'f', 'd'))
@pytest.mark.parametrize("data, escape", (
([0.03], LTONE_INVALID_ERR),
([0.03]*32, LTONE_INVALID_ERR),
# neg
([-1.0], NEG_INVALID_ERR),
([-1.0]*32, NEG_INVALID_ERR),
# flat
([1.0], ONE_INVALID_ERR),
([1.0]*32, ONE_INVALID_ERR),
# zero
([0.0], BYZERO_ERR),
([0.0]*32, BYZERO_ERR),
([-0.0], BYZERO_ERR),
([-0.0]*32, BYZERO_ERR),
# nan
([0.5, 0.5, 0.5, np.nan], LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.nan]*32, LTONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0], ONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0]*32, ONE_INVALID_ERR),
([np.nan], []),
([np.nan]*32, []),
# inf
([0.5, 0.5, 0.5, np.inf], INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.inf]*32, INF_INVALID_ERR + LTONE_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0], INF_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0]*32, INF_INVALID_ERR),
([np.inf], INF_INVALID_ERR),
([np.inf]*32, INF_INVALID_ERR),
# ninf
([0.5, 0.5, 0.5, -np.inf],
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, -np.inf]*32,
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
))
def test_unary_spurious_fpexception(self, ufunc, dtype, data, escape):
if escape and ufunc in escape:
return
# FIXME: NAN raises FP invalid exception:
# - ceil/float16 on MSVC:32-bit
# - spacing/float16 on almost all platforms
# FIXME: skipped on MSVC:32-bit during switch to Meson, 10 cases fail
# when SIMD support not present / disabled
if ufunc in (np.spacing, np.ceil) and dtype == 'e':
return
array = np.array(data, dtype=dtype)
> with assert_no_warnings():

array = array([nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
nan, nan, nan, nan, nan, nan], dtype=float32)
data = [nan, nan, nan, nan, nan, nan, ...]
dtype = 'f'
escape = []
self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x7899acd850>
ufunc = <ufunc 'log1p'>

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:1826:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <contextlib._GeneratorContextManager object at 0x7913a2ccd0>, typ = None
value = None, traceback = None

def __exit__(self, typ, value, traceback):
if typ is None:
try:
> next(self.gen)
E AssertionError: Got warnings: [<warnings.WarningMessage object at 0x7913a2cd90>]

self = <contextlib._GeneratorContextManager object at 0x7913a2ccd0>
traceback = None
typ = None
value = None

/usr/local/lib/python3.11/contextlib.py:144: AssertionError
__ TestSpecialFloats.test_unary_spurious_fpexception[data15-escape15-d-log1p] __

self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x7899ab50d0>
ufunc = <ufunc 'log1p'>, dtype = 'd', data = [nan, nan, nan, nan, nan, nan, ...]
escape = []

@pytest.mark.skipif(sys.platform == "win32" and sys.maxsize < 2**31 + 1,
reason='failures on 32-bit Python, see FIXME below')
@pytest.mark.parametrize("ufunc", UFUNCS_UNARY_FP)
@pytest.mark.parametrize("dtype", ('e', 'f', 'd'))
@pytest.mark.parametrize("data, escape", (
([0.03], LTONE_INVALID_ERR),
([0.03]*32, LTONE_INVALID_ERR),
# neg
([-1.0], NEG_INVALID_ERR),
([-1.0]*32, NEG_INVALID_ERR),
# flat
([1.0], ONE_INVALID_ERR),
([1.0]*32, ONE_INVALID_ERR),
# zero
([0.0], BYZERO_ERR),
([0.0]*32, BYZERO_ERR),
([-0.0], BYZERO_ERR),
([-0.0]*32, BYZERO_ERR),
# nan
([0.5, 0.5, 0.5, np.nan], LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.nan]*32, LTONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0], ONE_INVALID_ERR),
([np.nan, 1.0, 1.0, 1.0]*32, ONE_INVALID_ERR),
([np.nan], []),
([np.nan]*32, []),
# inf
([0.5, 0.5, 0.5, np.inf], INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, np.inf]*32, INF_INVALID_ERR + LTONE_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0], INF_INVALID_ERR),
([np.inf, 1.0, 1.0, 1.0]*32, INF_INVALID_ERR),
([np.inf], INF_INVALID_ERR),
([np.inf]*32, INF_INVALID_ERR),
# ninf
([0.5, 0.5, 0.5, -np.inf],
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([0.5, 0.5, 0.5, -np.inf]*32,
NEG_INVALID_ERR + INF_INVALID_ERR + LTONE_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf, 1.0, 1.0, 1.0]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf], NEG_INVALID_ERR + INF_INVALID_ERR),
([-np.inf]*32, NEG_INVALID_ERR + INF_INVALID_ERR),
))
def test_unary_spurious_fpexception(self, ufunc, dtype, data, escape):
if escape and ufunc in escape:
return
# FIXME: NAN raises FP invalid exception:
# - ceil/float16 on MSVC:32-bit
# - spacing/float16 on almost all platforms
# FIXME: skipped on MSVC:32-bit during switch to Meson, 10 cases fail
# when SIMD support not present / disabled
if ufunc in (np.spacing, np.ceil) and dtype == 'e':
return
array = np.array(data, dtype=dtype)
> with assert_no_warnings():

array = array([nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
nan, nan, nan, nan, nan, nan])
data = [nan, nan, nan, nan, nan, nan, ...]
dtype = 'd'
escape = []
self = <numpy.core.tests.test_umath.TestSpecialFloats object at 0x7899ab50d0>
ufunc = <ufunc 'log1p'>

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:1826:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <contextlib._GeneratorContextManager object at 0x7913a4f5d0>, typ = None
value = None, traceback = None

def __exit__(self, typ, value, traceback):
if typ is None:
try:
> next(self.gen)
E AssertionError: Got warnings: [<warnings.WarningMessage object at 0x7913a4f690>]

self = <contextlib._GeneratorContextManager object at 0x7913a4f5d0>
traceback = None
typ = None
value = None

/usr/local/lib/python3.11/contextlib.py:144: AssertionError
_______________ TestAVXFloat32Transcendental.test_sincos_float32 _______________

self = <numpy.core.tests.test_umath.TestAVXFloat32Transcendental object at 0x789b698fd0>

def test_sincos_float32(self):
np.random.seed(42)
N = 1000000
M = np.int_(N/20)
index = np.random.randint(low=0, high=N, size=M)
x_f32 = np.float32(np.random.uniform(low=-100.,high=100.,size=N))
if not _glibc_older_than("2.17"):
# test coverage for elements > 117435.992f for which glibc is used
# this is known to be problematic on old glibc, so skip it there
x_f32[index] = np.float32(10E+10*np.random.rand(M))
x_f64 = np.float64(x_f32)
> assert_array_max_ulp(np.sin(x_f32), np.float32(np.sin(x_f64)), maxulp=2)
E AssertionError: Arrays are not almost equal up to 2 ULP (max difference is 67 ULP)

M = 50000
N = 1000000
index = array([121958, 671155, 131932, ..., 738271, 310195, 233966])
self = <numpy.core.tests.test_umath.TestAVXFloat32Transcendental object at 0x789b698fd0>
x_f32 = array([-10.577719, -35.353283, -97.29114 , ..., -80.99214 , -42.875526,
-87.8052 ], dtype=float32)
x_f64 = array([-10.57771873, -35.35328293, -97.2911377 , ..., -80.99214172,
-42.87552643, -87.80519867])

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:2000: AssertionError
____________________ TestComplexFunctions.test_branch_cuts _____________________

self = <numpy.core.tests.test_umath.TestComplexFunctions object at 0x793f3efd90>

@pytest.mark.xfail(IS_MUSL, reason="gh23049")
@pytest.mark.xfail(IS_WASM, reason="doesn't work")
def test_branch_cuts(self):
# check branch cuts and continuity on them
_check_branch_cut(np.log, -0.5, 1j, 1, -1, True)
_check_branch_cut(np.log2, -0.5, 1j, 1, -1, True)
_check_branch_cut(np.log10, -0.5, 1j, 1, -1, True)
_check_branch_cut(np.log1p, -1.5, 1j, 1, -1, True)
_check_branch_cut(np.sqrt, -0.5, 1j, 1, -1, True)

_check_branch_cut(np.arcsin, [ -2, 2], [1j, 1j], 1, -1, True)
_check_branch_cut(np.arccos, [ -2, 2], [1j, 1j], 1, -1, True)
> _check_branch_cut(np.arctan, [0-2j, 2j], [1, 1], -1, 1, True)

self = <numpy.core.tests.test_umath.TestComplexFunctions object at 0x793f3efd90>

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:4137:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

f = <ufunc 'arctan'>, x0 = array([0.-2.j, 0.+2.j]), dx = array([1.+0.j, 1.+0.j])
re_sign = -1, im_sign = 1, sig_zero_ok = True, dtype = <class 'complex'>

def _check_branch_cut(f, x0, dx, re_sign=1, im_sign=-1, sig_zero_ok=False,
dtype=complex):
"""
Check for a branch cut in a function.

Assert that `x0` lies on a branch cut of function `f` and `f` is
continuous from the direction `dx`.

Parameters
----------
f : func
Function to check
x0 : array-like
Point on branch cut
dx : array-like
Direction to check continuity in
re_sign, im_sign : {1, -1}
Change of sign of the real or imaginary part expected
sig_zero_ok : bool
Whether to check if the branch cut respects signed zero (if applicable)
dtype : dtype
Dtype to check (should be complex)

"""
x0 = np.atleast_1d(x0).astype(dtype)
dx = np.atleast_1d(dx).astype(dtype)

if np.dtype(dtype).char == 'F':
scale = np.finfo(dtype).eps * 1e2
atol = np.float32(1e-2)
else:
scale = np.finfo(dtype).eps * 1e3
atol = 1e-4

y0 = f(x0)
yp = f(x0 + dx*scale*np.absolute(x0)/np.absolute(dx))
ym = f(x0 - dx*scale*np.absolute(x0)/np.absolute(dx))

> assert_(np.all(np.absolute(y0.real - yp.real) < atol), (y0, yp))
E AssertionError: (array([-1.57079633e+000-5.49306144e-001j,
E 1.00000000e+308+1.00000000e+308j]), array([1.57079633-0.54930614j, 1.57079633+0.54930614j]))

atol = 0.0001
dtype = <class 'complex'>
dx = array([1.+0.j, 1.+0.j])
f = <ufunc 'arctan'>
im_sign = 1
re_sign = -1
scale = 2.220446049250313e-13
sig_zero_ok = True
x0 = array([0.-2.j, 0.+2.j])
y0 = array([-1.57079633e+000-5.49306144e-001j,
1.00000000e+308+1.00000000e+308j])
ym = array([-1.57079633-0.54930614j, -1.57079633+0.54930614j])
yp = array([1.57079633-0.54930614j, 1.57079633+0.54930614j])

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:4403: AssertionError
_______________ TestComplexFunctions.test_branch_cuts_complex64 ________________

self = <numpy.core.tests.test_umath.TestComplexFunctions object at 0x793f3f0450>

@pytest.mark.xfail(IS_MUSL, reason="gh23049")
@pytest.mark.xfail(IS_WASM, reason="doesn't work")
def test_branch_cuts_complex64(self):
# check branch cuts and continuity on them
_check_branch_cut(np.log, -0.5, 1j, 1, -1, True, np.complex64)
_check_branch_cut(np.log2, -0.5, 1j, 1, -1, True, np.complex64)
_check_branch_cut(np.log10, -0.5, 1j, 1, -1, True, np.complex64)
_check_branch_cut(np.log1p, -1.5, 1j, 1, -1, True, np.complex64)
_check_branch_cut(np.sqrt, -0.5, 1j, 1, -1, True, np.complex64)

_check_branch_cut(np.arcsin, [ -2, 2], [1j, 1j], 1, -1, True, np.complex64)
_check_branch_cut(np.arccos, [ -2, 2], [1j, 1j], 1, -1, True, np.complex64)
> _check_branch_cut(np.arctan, [0-2j, 2j], [1, 1], -1, 1, True, np.complex64)

self = <numpy.core.tests.test_umath.TestComplexFunctions object at 0x793f3f0450>

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:4164:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

f = <ufunc 'arctan'>, x0 = array([0.-2.j, 0.+2.j], dtype=complex64)
dx = array([1.+0.j, 1.+0.j], dtype=complex64), re_sign = -1, im_sign = 1
sig_zero_ok = True, dtype = <class 'numpy.complex64'>

def _check_branch_cut(f, x0, dx, re_sign=1, im_sign=-1, sig_zero_ok=False,
dtype=complex):
"""
Check for a branch cut in a function.

Assert that `x0` lies on a branch cut of function `f` and `f` is
continuous from the direction `dx`.

Parameters
----------
f : func
Function to check
x0 : array-like
Point on branch cut
dx : array-like
Direction to check continuity in
re_sign, im_sign : {1, -1}
Change of sign of the real or imaginary part expected
sig_zero_ok : bool
Whether to check if the branch cut respects signed zero (if applicable)
dtype : dtype
Dtype to check (should be complex)

"""
x0 = np.atleast_1d(x0).astype(dtype)
dx = np.atleast_1d(dx).astype(dtype)

if np.dtype(dtype).char == 'F':
scale = np.finfo(dtype).eps * 1e2
atol = np.float32(1e-2)
else:
scale = np.finfo(dtype).eps * 1e3
atol = 1e-4

y0 = f(x0)
yp = f(x0 + dx*scale*np.absolute(x0)/np.absolute(dx))
ym = f(x0 - dx*scale*np.absolute(x0)/np.absolute(dx))

> assert_(np.all(np.absolute(y0.real - yp.real) < atol), (y0, yp))
E AssertionError: (array([-1.5707964e+00-5.4930615e-01j, 9.9999997e+37+9.9999997e+37j],
E dtype=complex64), array([1.5707884-0.54930615j, 1.5707884+0.54930615j], dtype=complex64))

atol = 0.01
dtype = <class 'numpy.complex64'>
dx = array([1.+0.j, 1.+0.j], dtype=complex64)
f = <ufunc 'arctan'>
im_sign = 1
re_sign = -1
scale = 1.1920928955078125e-05
sig_zero_ok = True
x0 = array([0.-2.j, 0.+2.j], dtype=complex64)
y0 = array([-1.5707964e+00-5.4930615e-01j, 9.9999997e+37+9.9999997e+37j],
dtype=complex64)
ym = array([-1.5707884-0.54930615j, -1.5707884+0.54930615j], dtype=complex64)
yp = array([1.5707884-0.54930615j, 1.5707884+0.54930615j], dtype=complex64)

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:4403: AssertionError
____________ TestComplexFunctions.test_loss_of_precision[complex64] ____________

self = <numpy.core.tests.test_umath.TestComplexFunctions object at 0x793f3f1750>
dtype = <class 'numpy.complex64'>

@pytest.mark.xfail(
# manylinux2014 uses glibc2.17
_glibc_older_than("2.18"),
reason="Older glibc versions are imprecise (maybe passes with SIMD?)"
)
@pytest.mark.xfail(IS_MUSL, reason="gh23049")
@pytest.mark.xfail(IS_WASM, reason="doesn't work")
@pytest.mark.parametrize('dtype', [np.complex64, np.complex_, np.longcomplex])
def test_loss_of_precision(self, dtype):
"""Check loss of precision in complex arc* functions"""

# Check against known-good functions

info = np.finfo(dtype)
real_dtype = dtype(0.).real.dtype
eps = info.eps

def check(x, rtol):
x = x.astype(real_dtype)

z = x.astype(dtype)
d = np.absolute(np.arcsinh(x)/np.arcsinh(z).real - 1)
assert_(np.all(d < rtol), (np.argmax(d), x[np.argmax(d)], d.max(),
'arcsinh'))

z = (1j*x).astype(dtype)
d = np.absolute(np.arcsinh(x)/np.arcsin(z).imag - 1)
assert_(np.all(d < rtol), (np.argmax(d), x[np.argmax(d)], d.max(),
'arcsin'))

z = x.astype(dtype)
d = np.absolute(np.arctanh(x)/np.arctanh(z).real - 1)
assert_(np.all(d < rtol), (np.argmax(d), x[np.argmax(d)], d.max(),
'arctanh'))

z = (1j*x).astype(dtype)
d = np.absolute(np.arctanh(x)/np.arctan(z).imag - 1)
assert_(np.all(d < rtol), (np.argmax(d), x[np.argmax(d)], d.max(),
'arctan'))

# The switchover was chosen as 1e-3; hence there can be up to
# ~eps/1e-3 of relative cancellation error before it

x_series = np.logspace(-20, -3.001, 200)
x_basic = np.logspace(-2.999, 0, 10, endpoint=False)

if dtype is np.longcomplex:
if bad_arcsinh():
pytest.skip("Trig functions of np.longcomplex values known "
"to be inaccurate on aarch64 and PPC for some "
"compilation configurations.")
# It's not guaranteed that the system-provided arc functions
# are accurate down to a few epsilons. (Eg. on Linux 64-bit)
# So, give more leeway for long complex tests here:
check(x_series, 50.0*eps)
else:
> check(x_series, 2.1*eps)

check = <function TestComplexFunctions.test_loss_of_precision.<locals>.check at 0x791ecd7e20>
dtype = <class 'numpy.complex64'>
eps = 1.1920929e-07
info = finfo(resolution=1e-06, min=-3.4028235e+38, max=3.4028235e+38, dtype=float32)
real_dtype = dtype('float32')
self = <numpy.core.tests.test_umath.TestComplexFunctions object at 0x793f3f1750>
x_basic = array([0.00100231, 0.0019994 , 0.00398841, 0.0079561 , 0.01587084,
0.0316592 , 0.06315387, 0.12597953, 0.25130435, 0.50130265])
x_series = array([1.00000000e-20, 1.21736864e-20, 1.48198641e-20, 1.80412378e-20,
2.19628372e-20, 2.67368693e-20, 3.254862...3.06526013e-04, 3.73155156e-04, 4.54267386e-04,
5.53010871e-04, 6.73218092e-04, 8.19554595e-04, 9.97700064e-04])

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:4257:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

x = array([9.99999968e-21, 1.21736865e-20, 1.48198648e-20, 1.80412373e-20,
2.19628376e-20, 2.67368701e-20, 3.254862...55170e-04, 4.54267400e-04,
5.53010846e-04, 6.73218106e-04, 8.19554611e-04, 9.97700030e-04],
dtype=float32)
rtol = 2.5033950805664064e-07

def check(x, rtol):
x = x.astype(real_dtype)

z = x.astype(dtype)
d = np.absolute(np.arcsinh(x)/np.arcsinh(z).real - 1)
> assert_(np.all(d < rtol), (np.argmax(d), x[np.argmax(d)], d.max(),
'arcsinh'))
E AssertionError: (0, 1e-20, inf, 'arcsinh')

d = array([ inf, inf, inf, inf,
inf, inf, ...17506e-04, 8.02278519e-05,
6.28232956e-05, 6.73532486e-06, 1.53779984e-05, 4.31537628e-05],
dtype=float32)
dtype = <class 'numpy.complex64'>
real_dtype = dtype('float32')
rtol = 2.5033950805664064e-07
x = array([9.99999968e-21, 1.21736865e-20, 1.48198648e-20, 1.80412373e-20,
2.19628376e-20, 2.67368701e-20, 3.254862...55170e-04, 4.54267400e-04,
5.53010846e-04, 6.73218106e-04, 8.19554611e-04, 9.97700030e-04],
dtype=float32)
z = array([9.99999968e-21+0.j, 1.21736865e-20+0.j, 1.48198648e-20+0.j,
1.80412373e-20+0.j, 2.19628376e-20+0.j, 2.67...67400e-04+0.j, 5.53010846e-04+0.j, 6.73218106e-04+0.j,
8.19554611e-04+0.j, 9.97700030e-04+0.j], dtype=complex64)

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:4223: AssertionError
___________ TestComplexFunctions.test_loss_of_precision[complex128] ____________

self = <numpy.core.tests.test_umath.TestComplexFunctions object at 0x793f3f19d0>
dtype = <class 'numpy.complex128'>

@pytest.mark.xfail(
# manylinux2014 uses glibc2.17
_glibc_older_than("2.18"),
reason="Older glibc versions are imprecise (maybe passes with SIMD?)"
)
@pytest.mark.xfail(IS_MUSL, reason="gh23049")
@pytest.mark.xfail(IS_WASM, reason="doesn't work")
@pytest.mark.parametrize('dtype', [np.complex64, np.complex_, np.longcomplex])
def test_loss_of_precision(self, dtype):
"""Check loss of precision in complex arc* functions"""

# Check against known-good functions

info = np.finfo(dtype)
real_dtype = dtype(0.).real.dtype
eps = info.eps

def check(x, rtol):
x = x.astype(real_dtype)

z = x.astype(dtype)
d = np.absolute(np.arcsinh(x)/np.arcsinh(z).real - 1)
assert_(np.all(d < rtol), (np.argmax(d), x[np.argmax(d)], d.max(),
'arcsinh'))

z = (1j*x).astype(dtype)
d = np.absolute(np.arcsinh(x)/np.arcsin(z).imag - 1)
assert_(np.all(d < rtol), (np.argmax(d), x[np.argmax(d)], d.max(),
'arcsin'))

z = x.astype(dtype)
d = np.absolute(np.arctanh(x)/np.arctanh(z).real - 1)
assert_(np.all(d < rtol), (np.argmax(d), x[np.argmax(d)], d.max(),
'arctanh'))

z = (1j*x).astype(dtype)
d = np.absolute(np.arctanh(x)/np.arctan(z).imag - 1)
assert_(np.all(d < rtol), (np.argmax(d), x[np.argmax(d)], d.max(),
'arctan'))

# The switchover was chosen as 1e-3; hence there can be up to
# ~eps/1e-3 of relative cancellation error before it

x_series = np.logspace(-20, -3.001, 200)
x_basic = np.logspace(-2.999, 0, 10, endpoint=False)

if dtype is np.longcomplex:
if bad_arcsinh():
pytest.skip("Trig functions of np.longcomplex values known "
"to be inaccurate on aarch64 and PPC for some "
"compilation configurations.")
# It's not guaranteed that the system-provided arc functions
# are accurate down to a few epsilons. (Eg. on Linux 64-bit)
# So, give more leeway for long complex tests here:
check(x_series, 50.0*eps)
else:
> check(x_series, 2.1*eps)

check = <function TestComplexFunctions.test_loss_of_precision.<locals>.check at 0x791ec48040>
dtype = <class 'numpy.complex128'>
eps = 2.220446049250313e-16
info = finfo(resolution=1e-15, min=-1.7976931348623157e+308, max=1.7976931348623157e+308, dtype=float64)
real_dtype = dtype('float64')
self = <numpy.core.tests.test_umath.TestComplexFunctions object at 0x793f3f19d0>
x_basic = array([0.00100231, 0.0019994 , 0.00398841, 0.0079561 , 0.01587084,
0.0316592 , 0.06315387, 0.12597953, 0.25130435, 0.50130265])
x_series = array([1.00000000e-20, 1.21736864e-20, 1.48198641e-20, 1.80412378e-20,
2.19628372e-20, 2.67368693e-20, 3.254862...3.06526013e-04, 3.73155156e-04, 4.54267386e-04,
5.53010871e-04, 6.73218092e-04, 8.19554595e-04, 9.97700064e-04])

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:4257:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

x = array([1.00000000e-20, 1.21736864e-20, 1.48198641e-20, 1.80412378e-20,
2.19628372e-20, 2.67368693e-20, 3.254862...3.06526013e-04, 3.73155156e-04, 4.54267386e-04,
5.53010871e-04, 6.73218092e-04, 8.19554595e-04, 9.97700064e-04])
rtol = 4.662936703425658e-16

def check(x, rtol):
x = x.astype(real_dtype)

z = x.astype(dtype)
d = np.absolute(np.arcsinh(x)/np.arcsinh(z).real - 1)
> assert_(np.all(d < rtol), (np.argmax(d), x[np.argmax(d)], d.max(),
'arcsinh'))
E AssertionError: (0, 1.0000000000000001e-20, inf, 'arcsinh')

d = array([ inf, inf, inf, inf,
inf, inf, ...1.10356169e-13, 5.87307980e-14, 9.10382880e-14,
9.85878046e-14, 1.76303416e-13, 2.36699549e-13, 5.06261699e-14])
dtype = <class 'numpy.complex128'>
real_dtype = dtype('float64')
rtol = 4.662936703425658e-16
x = array([1.00000000e-20, 1.21736864e-20, 1.48198641e-20, 1.80412378e-20,
2.19628372e-20, 2.67368693e-20, 3.254862...3.06526013e-04, 3.73155156e-04, 4.54267386e-04,
5.53010871e-04, 6.73218092e-04, 8.19554595e-04, 9.97700064e-04])
z = array([1.00000000e-20+0.j, 1.21736864e-20+0.j, 1.48198641e-20+0.j,
1.80412378e-20+0.j, 2.19628372e-20+0.j, 2.67...0.j,
4.54267386e-04+0.j, 5.53010871e-04+0.j, 6.73218092e-04+0.j,
8.19554595e-04+0.j, 9.97700064e-04+0.j])

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:4223: AssertionError
___________ TestComplexFunctions.test_loss_of_precision[clongdouble] ___________

self = <numpy.core.tests.test_umath.TestComplexFunctions object at 0x793f3f1c50>
dtype = <class 'numpy.clongdouble'>

@pytest.mark.xfail(
# manylinux2014 uses glibc2.17
_glibc_older_than("2.18"),
reason="Older glibc versions are imprecise (maybe passes with SIMD?)"
)
@pytest.mark.xfail(IS_MUSL, reason="gh23049")
@pytest.mark.xfail(IS_WASM, reason="doesn't work")
@pytest.mark.parametrize('dtype', [np.complex64, np.complex_, np.longcomplex])
def test_loss_of_precision(self, dtype):
"""Check loss of precision in complex arc* functions"""

# Check against known-good functions

info = np.finfo(dtype)
real_dtype = dtype(0.).real.dtype
eps = info.eps

def check(x, rtol):
x = x.astype(real_dtype)

z = x.astype(dtype)
d = np.absolute(np.arcsinh(x)/np.arcsinh(z).real - 1)
assert_(np.all(d < rtol), (np.argmax(d), x[np.argmax(d)], d.max(),
'arcsinh'))

z = (1j*x).astype(dtype)
d = np.absolute(np.arcsinh(x)/np.arcsin(z).imag - 1)
assert_(np.all(d < rtol), (np.argmax(d), x[np.argmax(d)], d.max(),
'arcsin'))

z = x.astype(dtype)
d = np.absolute(np.arctanh(x)/np.arctanh(z).real - 1)
assert_(np.all(d < rtol), (np.argmax(d), x[np.argmax(d)], d.max(),
'arctanh'))

z = (1j*x).astype(dtype)
d = np.absolute(np.arctanh(x)/np.arctan(z).imag - 1)
assert_(np.all(d < rtol), (np.argmax(d), x[np.argmax(d)], d.max(),
'arctan'))

# The switchover was chosen as 1e-3; hence there can be up to
# ~eps/1e-3 of relative cancellation error before it

x_series = np.logspace(-20, -3.001, 200)
x_basic = np.logspace(-2.999, 0, 10, endpoint=False)

if dtype is np.longcomplex:
if bad_arcsinh():
pytest.skip("Trig functions of np.longcomplex values known "
"to be inaccurate on aarch64 and PPC for some "
"compilation configurations.")
# It's not guaranteed that the system-provided arc functions
# are accurate down to a few epsilons. (Eg. on Linux 64-bit)
# So, give more leeway for long complex tests here:
> check(x_series, 50.0*eps)

check = <function TestComplexFunctions.test_loss_of_precision.<locals>.check at 0x791ec48400>
dtype = <class 'numpy.clongdouble'>
eps = 1.084202172485504434e-19
info = finfo(resolution=1e-18, min=-1.189731495357231765e+4932, max=1.189731495357231765e+4932, dtype=float128)
real_dtype = dtype('float128')
self = <numpy.core.tests.test_umath.TestComplexFunctions object at 0x793f3f1c50>
x_basic = array([0.00100231, 0.0019994 , 0.00398841, 0.0079561 , 0.01587084,
0.0316592 , 0.06315387, 0.12597953, 0.25130435, 0.50130265])
x_series = array([1.00000000e-20, 1.21736864e-20, 1.48198641e-20, 1.80412378e-20,
2.19628372e-20, 2.67368693e-20, 3.254862...3.06526013e-04, 3.73155156e-04, 4.54267386e-04,
5.53010871e-04, 6.73218092e-04, 8.19554595e-04, 9.97700064e-04])

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:4255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

x = array([1.00000000e-20, 1.21736864e-20, 1.48198641e-20, 1.80412378e-20,
2.19628372e-20, 2.67368693e-20, 3.254862...5156e-04, 4.54267386e-04,
5.53010871e-04, 6.73218092e-04, 8.19554595e-04, 9.97700064e-04],
dtype=float128)
rtol = 5.42101086242752217e-18

def check(x, rtol):
x = x.astype(real_dtype)

z = x.astype(dtype)
d = np.absolute(np.arcsinh(x)/np.arcsinh(z).real - 1)
assert_(np.all(d < rtol), (np.argmax(d), x[np.argmax(d)], d.max(),
'arcsinh'))

z = (1j*x).astype(dtype)
d = np.absolute(np.arcsinh(x)/np.arcsin(z).imag - 1)
assert_(np.all(d < rtol), (np.argmax(d), x[np.argmax(d)], d.max(),
'arcsin'))

z = x.astype(dtype)
d = np.absolute(np.arctanh(x)/np.arctanh(z).real - 1)
> assert_(np.all(d < rtol), (np.argmax(d), x[np.argmax(d)], d.max(),
'arctanh'))
E AssertionError: (0, 1.0000000000000000956e-20, inf, 'arctanh')

d = array([ inf, inf, inf, inf,
inf, inf, 2.008323...1554e-17, 1.17202255e-16,
1.46367293e-17, 6.93889390e-18, 1.55040911e-17, 3.19839641e-18],
dtype=float128)
dtype = <class 'numpy.clongdouble'>
real_dtype = dtype('float128')
rtol = 5.42101086242752217e-18
x = array([1.00000000e-20, 1.21736864e-20, 1.48198641e-20, 1.80412378e-20,
2.19628372e-20, 2.67368693e-20, 3.254862...5156e-04, 4.54267386e-04,
5.53010871e-04, 6.73218092e-04, 8.19554595e-04, 9.97700064e-04],
dtype=float128)
z = array([1.00000000e-20+0.j, 1.21736864e-20+0.j, 1.48198641e-20+0.j,
1.80412378e-20+0.j, 2.19628372e-20+0.j, 2.67...7386e-04+0.j, 5.53010871e-04+0.j, 6.73218092e-04+0.j,
8.19554595e-04+0.j, 9.97700064e-04+0.j], dtype=complex256)

/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:4233: AssertionError
=============================== warnings summary ===============================
core/tests/test_numeric.py::TestNonarrayArgs::test_dunder_round_edgecases[2147483647--1]
/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_numeric.py:200: RuntimeWarning: invalid value encountered in cast
assert_equal(round(val, ndigits), round(np.int32(val), ndigits))

core/tests/test_scalar_methods.py::TestAsIntegerRatio::test_roundtrip[longdouble-frac_vals3-exp_vals3]
/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_scalar_methods.py:100: RuntimeWarning: overflow encountered in conversion from python long
df = np.longdouble(d)

core/tests/test_umath.py::TestAVXUfuncs::test_avx_based_ufunc
core/tests/test_umath.py::TestAVXUfuncs::test_avx_based_ufunc
core/tests/test_umath.py::TestAVXUfuncs::test_avx_based_ufunc
core/tests/test_umath.py::TestAVXUfuncs::test_avx_based_ufunc
core/tests/test_umath.py::TestAVXUfuncs::test_avx_based_ufunc
core/tests/test_umath.py::TestAVXUfuncs::test_avx_based_ufunc
core/tests/test_umath.py::TestAVXUfuncs::test_avx_based_ufunc
core/tests/test_umath.py::TestAVXUfuncs::test_avx_based_ufunc
/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:1957: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
x_f64 = np.float64(x_f32)

core/tests/test_umath.py::TestAVXUfuncs::test_avx_based_ufunc
core/tests/test_umath.py::TestAVXUfuncs::test_avx_based_ufunc
core/tests/test_umath.py::TestAVXUfuncs::test_avx_based_ufunc
/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:1966: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
assert_array_max_ulp(myfunc(x_f64), np.float64(y_true128),

core/tests/test_umath.py::TestAVXUfuncs::test_avx_based_ufunc
core/tests/test_umath.py::TestAVXUfuncs::test_avx_based_ufunc
core/tests/test_umath.py::TestAVXUfuncs::test_avx_based_ufunc
core/tests/test_umath.py::TestAVXUfuncs::test_avx_based_ufunc
core/tests/test_umath.py::TestAVXUfuncs::test_avx_based_ufunc
/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:1962: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
assert_equal(myfunc(x_f64), np.float64(y_true128))

core/tests/test_umath.py::TestComplexFunctions::test_loss_of_precision[complex64]
core/tests/test_umath.py::TestComplexFunctions::test_loss_of_precision[complex128]
/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:4222: RuntimeWarning: divide by zero encountered in divide
d = np.absolute(np.arcsinh(x)/np.arcsinh(z).real - 1)

core/tests/test_umath.py::TestComplexFunctions::test_loss_of_precision[clongdouble]
/usr/local/lib/python3.11/site-packages/numpy/core/tests/test_umath.py:4232: RuntimeWarning: divide by zero encountered in divide
d = np.absolute(np.arctanh(x)/np.arctanh(z).real - 1)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED core/tests/test_longdouble.py::test_repr_roundtrip - AssertionError:
FAILED core/tests/test_print.py::TestCommaDecimalPointLocale::test_locale_longdouble
FAILED core/tests/test_scalarprint.py::TestRealScalars::test_dragon4_interface
FAILED core/tests/test_umath.py::TestLog2::test_log2_special - IndexError: li...
FAILED core/tests/test_umath.py::TestSpecialFloats::test_log_values - Asserti...
FAILED core/tests/test_umath.py::TestSpecialFloats::test_arctanh - AssertionE...
FAILED core/tests/test_umath.py::TestSpecialFloats::test_exp2 - AssertionErro...
FAILED core/tests/test_umath.py::TestSpecialFloats::test_unary_spurious_fpexception[data10-escape10-e-log1p]
FAILED core/tests/test_umath.py::TestSpecialFloats::test_unary_spurious_fpexception[data10-escape10-f-log1p]
FAILED core/tests/test_umath.py::TestSpecialFloats::test_unary_spurious_fpexception[data10-escape10-d-log1p]
FAILED core/tests/test_umath.py::TestSpecialFloats::test_unary_spurious_fpexception[data11-escape11-e-log1p]
FAILED core/tests/test_umath.py::TestSpecialFloats::test_unary_spurious_fpexception[data11-escape11-f-log1p]
FAILED core/tests/test_umath.py::TestSpecialFloats::test_unary_spurious_fpexception[data11-escape11-d-log1p]
FAILED core/tests/test_umath.py::TestSpecialFloats::test_unary_spurious_fpexception[data12-escape12-e-log1p]
FAILED core/tests/test_umath.py::TestSpecialFloats::test_unary_spurious_fpexception[data12-escape12-f-log1p]
FAILED core/tests/test_umath.py::TestSpecialFloats::test_unary_spurious_fpexception[data12-escape12-d-log1p]
FAILED core/tests/test_umath.py::TestSpecialFloats::test_unary_spurious_fpexception[data13-escape13-e-log1p]
FAILED core/tests/test_umath.py::TestSpecialFloats::test_unary_spurious_fpexception[data13-escape13-f-log1p]
FAILED core/tests/test_umath.py::TestSpecialFloats::test_unary_spurious_fpexception[data13-escape13-d-log1p]
FAILED core/tests/test_umath.py::TestSpecialFloats::test_unary_spurious_fpexception[data14-escape14-e-log1p]
FAILED core/tests/test_umath.py::TestSpecialFloats::test_unary_spurious_fpexception[data14-escape14-f-log1p]
FAILED core/tests/test_umath.py::TestSpecialFloats::test_unary_spurious_fpexception[data14-escape14-d-log1p]
FAILED core/tests/test_umath.py::TestSpecialFloats::test_unary_spurious_fpexception[data15-escape15-e-log1p]
FAILED core/tests/test_umath.py::TestSpecialFloats::test_unary_spurious_fpexception[data15-escape15-f-log1p]
FAILED core/tests/test_umath.py::TestSpecialFloats::test_unary_spurious_fpexception[data15-escape15-d-log1p]
FAILED core/tests/test_umath.py::TestAVXFloat32Transcendental::test_sincos_float32
FAILED core/tests/test_umath.py::TestComplexFunctions::test_branch_cuts - Ass...
FAILED core/tests/test_umath.py::TestComplexFunctions::test_branch_cuts_complex64
FAILED core/tests/test_umath.py::TestComplexFunctions::test_loss_of_precision[complex64]
FAILED core/tests/test_umath.py::TestComplexFunctions::test_loss_of_precision[complex128]
FAILED core/tests/test_umath.py::TestComplexFunctions::test_loss_of_precision[clongdouble]
= 31 failed, 35649 passed, 2372 skipped, 1305 deselected, 33 xfailed, 1 xpassed, 21 warnings in 207.79s (0:03:27) =

No comments:

Post a Comment