diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/__init__.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..081e0b98996f6ba301416fd050fa15950f902557 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/__init__.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_array_object.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_array_object.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b2d7d5c8b4be3f317a9f5c2a1fef5228a6642561 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_array_object.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_constants.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_constants.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dc8d225379af7b4c0c3c5ca17be33ed01bb44b1c Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_constants.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_creation_functions.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_creation_functions.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..59fb848ff73bbe973361cb93d57172d406774713 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_creation_functions.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_data_type_functions.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_data_type_functions.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4aea9a2520981c7ce15942c9662bf63b9d8554f4 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_data_type_functions.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_dtypes.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_dtypes.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..62659b5e98f5134cc803f98f8072224cb87a82cf Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_dtypes.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_elementwise_functions.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_elementwise_functions.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..81c567c7dc798c252bb3cda92c2d725f7ac27503 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_elementwise_functions.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_indexing_functions.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_indexing_functions.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dc61e84036266234d32cd42ef91c5c2857e28408 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_indexing_functions.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_manipulation_functions.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_manipulation_functions.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c71b036cf4734ff9fd9f7b413aee0cefcb6d708b Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_manipulation_functions.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_searching_functions.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_searching_functions.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..01db7666ecf2634280263223b3a4249ce771c24a Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_searching_functions.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_set_functions.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_set_functions.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9aee717e5fa8b32c4a87ff69acda774d7ddefd4f Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_set_functions.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_sorting_functions.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_sorting_functions.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b88ac717040ebdb07202146080b9cd2108eaba01 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_sorting_functions.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_statistical_functions.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_statistical_functions.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ae53294a0df6cb892731e8061dcfd6ea493f6365 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_statistical_functions.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_typing.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_typing.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c8c2b477582b1951c5922576677b3b0db467368e Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_typing.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_utility_functions.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_utility_functions.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..12d23c2522980a66508574f52ef529a9bc828173 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/_utility_functions.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/linalg.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/linalg.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..473b2c0c9036e9b6d3c00d872734c8ac412c548d Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/linalg.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/setup.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/setup.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9ad0b3dd58d533ef1ad2f4064feb75b45573e728 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/__pycache__/setup.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__init__.py b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..536062e3827921df637105680ea9e8ea879b8f3e --- /dev/null +++ b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__init__.py @@ -0,0 +1,7 @@ +""" +Tests for the array API namespace. + +Note, full compliance with the array API can be tested with the official array API test +suite https://github.com/data-apis/array-api-tests. This test suite primarily +focuses on those things that are not tested by the official test suite. +""" diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/__init__.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..887c97bda05abd9f8b7a619b47e7f02ed9070f8c Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/__init__.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/test_array_object.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/test_array_object.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f7d6dc7d96bc3a0545b6da55dd0ed8279e6162b7 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/test_array_object.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/test_creation_functions.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/test_creation_functions.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..02a7d35e4c9835e2b34f17962bcfeeaf6c1e2c83 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/test_creation_functions.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/test_data_type_functions.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/test_data_type_functions.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f82b650d886a1001bd673c96af8445139c91492e Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/test_data_type_functions.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/test_elementwise_functions.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/test_elementwise_functions.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2cc28f3a5860dee664e123c91ad541e1e1ba6ef1 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/test_elementwise_functions.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/test_indexing_functions.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/test_indexing_functions.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ad5f1442f553160f225ea3e0e105186491e248d7 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/test_indexing_functions.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/test_manipulation_functions.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/test_manipulation_functions.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ac6d1afe63e1d32bfdf64a2149e869218488034f Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/test_manipulation_functions.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/test_set_functions.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/test_set_functions.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eba95a4ce088eefeb5b746341ebdb7448bd3bf88 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/test_set_functions.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/test_sorting_functions.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/test_sorting_functions.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d829af04505cc98fbd033854185ede015606a364 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/test_sorting_functions.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/test_validation.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/test_validation.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9385e8c4ac27fdd19c77adbbf85083a5d2778bfc Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/__pycache__/test_validation.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/test_array_object.py b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/test_array_object.py new file mode 100644 index 0000000000000000000000000000000000000000..0feb72c4ea33a632545e6329854644ac9b817a4a --- /dev/null +++ b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/test_array_object.py @@ -0,0 +1,395 @@ +import operator + +from numpy.testing import assert_raises, suppress_warnings +import numpy as np +import pytest + +from .. import ones, asarray, reshape, result_type, all, equal +from .._array_object import Array +from .._dtypes import ( + _all_dtypes, + _boolean_dtypes, + _real_floating_dtypes, + _floating_dtypes, + _complex_floating_dtypes, + _integer_dtypes, + _integer_or_boolean_dtypes, + _real_numeric_dtypes, + _numeric_dtypes, + int8, + int16, + int32, + int64, + uint64, + bool as bool_, +) + + +def test_validate_index(): + # The indexing tests in the official array API test suite test that the + # array object correctly handles the subset of indices that are required + # by the spec. But the NumPy array API implementation specifically + # disallows any index not required by the spec, via Array._validate_index. + # This test focuses on testing that non-valid indices are correctly + # rejected. See + # https://data-apis.org/array-api/latest/API_specification/indexing.html + # and the docstring of Array._validate_index for the exact indexing + # behavior that should be allowed. This does not test indices that are + # already invalid in NumPy itself because Array will generally just pass + # such indices directly to the underlying np.ndarray. + + a = ones((3, 4)) + + # Out of bounds slices are not allowed + assert_raises(IndexError, lambda: a[:4]) + assert_raises(IndexError, lambda: a[:-4]) + assert_raises(IndexError, lambda: a[:3:-1]) + assert_raises(IndexError, lambda: a[:-5:-1]) + assert_raises(IndexError, lambda: a[4:]) + assert_raises(IndexError, lambda: a[-4:]) + assert_raises(IndexError, lambda: a[4::-1]) + assert_raises(IndexError, lambda: a[-4::-1]) + + assert_raises(IndexError, lambda: a[...,:5]) + assert_raises(IndexError, lambda: a[...,:-5]) + assert_raises(IndexError, lambda: a[...,:5:-1]) + assert_raises(IndexError, lambda: a[...,:-6:-1]) + assert_raises(IndexError, lambda: a[...,5:]) + assert_raises(IndexError, lambda: a[...,-5:]) + assert_raises(IndexError, lambda: a[...,5::-1]) + assert_raises(IndexError, lambda: a[...,-5::-1]) + + # Boolean indices cannot be part of a larger tuple index + assert_raises(IndexError, lambda: a[a[:,0]==1,0]) + assert_raises(IndexError, lambda: a[a[:,0]==1,...]) + assert_raises(IndexError, lambda: a[..., a[0]==1]) + assert_raises(IndexError, lambda: a[[True, True, True]]) + assert_raises(IndexError, lambda: a[(True, True, True),]) + + # Integer array indices are not allowed (except for 0-D) + idx = asarray([[0, 1]]) + assert_raises(IndexError, lambda: a[idx]) + assert_raises(IndexError, lambda: a[idx,]) + assert_raises(IndexError, lambda: a[[0, 1]]) + assert_raises(IndexError, lambda: a[(0, 1), (0, 1)]) + assert_raises(IndexError, lambda: a[[0, 1]]) + assert_raises(IndexError, lambda: a[np.array([[0, 1]])]) + + # Multiaxis indices must contain exactly as many indices as dimensions + assert_raises(IndexError, lambda: a[()]) + assert_raises(IndexError, lambda: a[0,]) + assert_raises(IndexError, lambda: a[0]) + assert_raises(IndexError, lambda: a[:]) + +def test_operators(): + # For every operator, we test that it works for the required type + # combinations and raises TypeError otherwise + binary_op_dtypes = { + "__add__": "numeric", + "__and__": "integer_or_boolean", + "__eq__": "all", + "__floordiv__": "real numeric", + "__ge__": "real numeric", + "__gt__": "real numeric", + "__le__": "real numeric", + "__lshift__": "integer", + "__lt__": "real numeric", + "__mod__": "real numeric", + "__mul__": "numeric", + "__ne__": "all", + "__or__": "integer_or_boolean", + "__pow__": "numeric", + "__rshift__": "integer", + "__sub__": "numeric", + "__truediv__": "floating", + "__xor__": "integer_or_boolean", + } + # Recompute each time because of in-place ops + def _array_vals(): + for d in _integer_dtypes: + yield asarray(1, dtype=d) + for d in _boolean_dtypes: + yield asarray(False, dtype=d) + for d in _floating_dtypes: + yield asarray(1.0, dtype=d) + + + BIG_INT = int(1e30) + for op, dtypes in binary_op_dtypes.items(): + ops = [op] + if op not in ["__eq__", "__ne__", "__le__", "__ge__", "__lt__", "__gt__"]: + rop = "__r" + op[2:] + iop = "__i" + op[2:] + ops += [rop, iop] + for s in [1, 1.0, 1j, BIG_INT, False]: + for _op in ops: + for a in _array_vals(): + # Test array op scalar. From the spec, the following combinations + # are supported: + + # - Python bool for a bool array dtype, + # - a Python int within the bounds of the given dtype for integer array dtypes, + # - a Python int or float for real floating-point array dtypes + # - a Python int, float, or complex for complex floating-point array dtypes + + if ((dtypes == "all" + or dtypes == "numeric" and a.dtype in _numeric_dtypes + or dtypes == "real numeric" and a.dtype in _real_numeric_dtypes + or dtypes == "integer" and a.dtype in _integer_dtypes + or dtypes == "integer_or_boolean" and a.dtype in _integer_or_boolean_dtypes + or dtypes == "boolean" and a.dtype in _boolean_dtypes + or dtypes == "floating" and a.dtype in _floating_dtypes + ) + # bool is a subtype of int, which is why we avoid + # isinstance here. + and (a.dtype in _boolean_dtypes and type(s) == bool + or a.dtype in _integer_dtypes and type(s) == int + or a.dtype in _real_floating_dtypes and type(s) in [float, int] + or a.dtype in _complex_floating_dtypes and type(s) in [complex, float, int] + )): + if a.dtype in _integer_dtypes and s == BIG_INT: + assert_raises(OverflowError, lambda: getattr(a, _op)(s)) + else: + # Only test for no error + with suppress_warnings() as sup: + # ignore warnings from pow(BIG_INT) + sup.filter(RuntimeWarning, + "invalid value encountered in power") + getattr(a, _op)(s) + else: + assert_raises(TypeError, lambda: getattr(a, _op)(s)) + + # Test array op array. + for _op in ops: + for x in _array_vals(): + for y in _array_vals(): + # See the promotion table in NEP 47 or the array + # API spec page on type promotion. Mixed kind + # promotion is not defined. + if (x.dtype == uint64 and y.dtype in [int8, int16, int32, int64] + or y.dtype == uint64 and x.dtype in [int8, int16, int32, int64] + or x.dtype in _integer_dtypes and y.dtype not in _integer_dtypes + or y.dtype in _integer_dtypes and x.dtype not in _integer_dtypes + or x.dtype in _boolean_dtypes and y.dtype not in _boolean_dtypes + or y.dtype in _boolean_dtypes and x.dtype not in _boolean_dtypes + or x.dtype in _floating_dtypes and y.dtype not in _floating_dtypes + or y.dtype in _floating_dtypes and x.dtype not in _floating_dtypes + ): + assert_raises(TypeError, lambda: getattr(x, _op)(y)) + # Ensure in-place operators only promote to the same dtype as the left operand. + elif ( + _op.startswith("__i") + and result_type(x.dtype, y.dtype) != x.dtype + ): + assert_raises(TypeError, lambda: getattr(x, _op)(y)) + # Ensure only those dtypes that are required for every operator are allowed. + elif (dtypes == "all" and (x.dtype in _boolean_dtypes and y.dtype in _boolean_dtypes + or x.dtype in _numeric_dtypes and y.dtype in _numeric_dtypes) + or (dtypes == "real numeric" and x.dtype in _real_numeric_dtypes and y.dtype in _real_numeric_dtypes) + or (dtypes == "numeric" and x.dtype in _numeric_dtypes and y.dtype in _numeric_dtypes) + or dtypes == "integer" and x.dtype in _integer_dtypes and y.dtype in _integer_dtypes + or dtypes == "integer_or_boolean" and (x.dtype in _integer_dtypes and y.dtype in _integer_dtypes + or x.dtype in _boolean_dtypes and y.dtype in _boolean_dtypes) + or dtypes == "boolean" and x.dtype in _boolean_dtypes and y.dtype in _boolean_dtypes + or dtypes == "floating" and x.dtype in _floating_dtypes and y.dtype in _floating_dtypes + ): + getattr(x, _op)(y) + else: + assert_raises(TypeError, lambda: getattr(x, _op)(y)) + + unary_op_dtypes = { + "__abs__": "numeric", + "__invert__": "integer_or_boolean", + "__neg__": "numeric", + "__pos__": "numeric", + } + for op, dtypes in unary_op_dtypes.items(): + for a in _array_vals(): + if ( + dtypes == "numeric" + and a.dtype in _numeric_dtypes + or dtypes == "integer_or_boolean" + and a.dtype in _integer_or_boolean_dtypes + ): + # Only test for no error + getattr(a, op)() + else: + assert_raises(TypeError, lambda: getattr(a, op)()) + + # Finally, matmul() must be tested separately, because it works a bit + # different from the other operations. + def _matmul_array_vals(): + for a in _array_vals(): + yield a + for d in _all_dtypes: + yield ones((3, 4), dtype=d) + yield ones((4, 2), dtype=d) + yield ones((4, 4), dtype=d) + + # Scalars always error + for _op in ["__matmul__", "__rmatmul__", "__imatmul__"]: + for s in [1, 1.0, False]: + for a in _matmul_array_vals(): + if (type(s) in [float, int] and a.dtype in _floating_dtypes + or type(s) == int and a.dtype in _integer_dtypes): + # Type promotion is valid, but @ is not allowed on 0-D + # inputs, so the error is a ValueError + assert_raises(ValueError, lambda: getattr(a, _op)(s)) + else: + assert_raises(TypeError, lambda: getattr(a, _op)(s)) + + for x in _matmul_array_vals(): + for y in _matmul_array_vals(): + if (x.dtype == uint64 and y.dtype in [int8, int16, int32, int64] + or y.dtype == uint64 and x.dtype in [int8, int16, int32, int64] + or x.dtype in _integer_dtypes and y.dtype not in _integer_dtypes + or y.dtype in _integer_dtypes and x.dtype not in _integer_dtypes + or x.dtype in _floating_dtypes and y.dtype not in _floating_dtypes + or y.dtype in _floating_dtypes and x.dtype not in _floating_dtypes + or x.dtype in _boolean_dtypes + or y.dtype in _boolean_dtypes + ): + assert_raises(TypeError, lambda: x.__matmul__(y)) + assert_raises(TypeError, lambda: y.__rmatmul__(x)) + assert_raises(TypeError, lambda: x.__imatmul__(y)) + elif x.shape == () or y.shape == () or x.shape[1] != y.shape[0]: + assert_raises(ValueError, lambda: x.__matmul__(y)) + assert_raises(ValueError, lambda: y.__rmatmul__(x)) + if result_type(x.dtype, y.dtype) != x.dtype: + assert_raises(TypeError, lambda: x.__imatmul__(y)) + else: + assert_raises(ValueError, lambda: x.__imatmul__(y)) + else: + x.__matmul__(y) + y.__rmatmul__(x) + if result_type(x.dtype, y.dtype) != x.dtype: + assert_raises(TypeError, lambda: x.__imatmul__(y)) + elif y.shape[0] != y.shape[1]: + # This one fails because x @ y has a different shape from x + assert_raises(ValueError, lambda: x.__imatmul__(y)) + else: + x.__imatmul__(y) + + +def test_python_scalar_construtors(): + b = asarray(False) + i = asarray(0) + f = asarray(0.0) + c = asarray(0j) + + assert bool(b) == False + assert int(i) == 0 + assert float(f) == 0.0 + assert operator.index(i) == 0 + + # bool/int/float/complex should only be allowed on 0-D arrays. + assert_raises(TypeError, lambda: bool(asarray([False]))) + assert_raises(TypeError, lambda: int(asarray([0]))) + assert_raises(TypeError, lambda: float(asarray([0.0]))) + assert_raises(TypeError, lambda: complex(asarray([0j]))) + assert_raises(TypeError, lambda: operator.index(asarray([0]))) + + # bool should work on all types of arrays + assert bool(b) is bool(i) is bool(f) is bool(c) is False + + # int should fail on complex arrays + assert int(b) == int(i) == int(f) == 0 + assert_raises(TypeError, lambda: int(c)) + + # float should fail on complex arrays + assert float(b) == float(i) == float(f) == 0.0 + assert_raises(TypeError, lambda: float(c)) + + # complex should work on all types of arrays + assert complex(b) == complex(i) == complex(f) == complex(c) == 0j + + # index should only work on integer arrays + assert operator.index(i) == 0 + assert_raises(TypeError, lambda: operator.index(b)) + assert_raises(TypeError, lambda: operator.index(f)) + assert_raises(TypeError, lambda: operator.index(c)) + + +def test_device_property(): + a = ones((3, 4)) + assert a.device == 'cpu' + + assert all(equal(a.to_device('cpu'), a)) + assert_raises(ValueError, lambda: a.to_device('gpu')) + + assert all(equal(asarray(a, device='cpu'), a)) + assert_raises(ValueError, lambda: asarray(a, device='gpu')) + +def test_array_properties(): + a = ones((1, 2, 3)) + b = ones((2, 3)) + assert_raises(ValueError, lambda: a.T) + + assert isinstance(b.T, Array) + assert b.T.shape == (3, 2) + + assert isinstance(a.mT, Array) + assert a.mT.shape == (1, 3, 2) + assert isinstance(b.mT, Array) + assert b.mT.shape == (3, 2) + +def test___array__(): + a = ones((2, 3), dtype=int16) + assert np.asarray(a) is a._array + b = np.asarray(a, dtype=np.float64) + assert np.all(np.equal(b, np.ones((2, 3), dtype=np.float64))) + assert b.dtype == np.float64 + +def test_allow_newaxis(): + a = ones(5) + indexed_a = a[None, :] + assert indexed_a.shape == (1, 5) + +def test_disallow_flat_indexing_with_newaxis(): + a = ones((3, 3, 3)) + with pytest.raises(IndexError): + a[None, 0, 0] + +def test_disallow_mask_with_newaxis(): + a = ones((3, 3, 3)) + with pytest.raises(IndexError): + a[None, asarray(True)] + +@pytest.mark.parametrize("shape", [(), (5,), (3, 3, 3)]) +@pytest.mark.parametrize("index", ["string", False, True]) +def test_error_on_invalid_index(shape, index): + a = ones(shape) + with pytest.raises(IndexError): + a[index] + +def test_mask_0d_array_without_errors(): + a = ones(()) + a[asarray(True)] + +@pytest.mark.parametrize( + "i", [slice(5), slice(5, 0), asarray(True), asarray([0, 1])] +) +def test_error_on_invalid_index_with_ellipsis(i): + a = ones((3, 3, 3)) + with pytest.raises(IndexError): + a[..., i] + with pytest.raises(IndexError): + a[i, ...] + +def test_array_keys_use_private_array(): + """ + Indexing operations convert array keys before indexing the internal array + + Fails when array_api array keys are not converted into NumPy-proper arrays + in __getitem__(). This is achieved by passing array_api arrays with 0-sized + dimensions, which NumPy-proper treats erroneously - not sure why! + + TODO: Find and use appropriate __setitem__() case. + """ + a = ones((0, 0), dtype=bool_) + assert a[a].shape == (0,) + + a = ones((0,), dtype=bool_) + key = ones((0, 0), dtype=bool_) + with pytest.raises(IndexError): + a[key] diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/test_creation_functions.py b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/test_creation_functions.py new file mode 100644 index 0000000000000000000000000000000000000000..be9eaa38378cb19f4c445ec4138245564c13b28a --- /dev/null +++ b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/test_creation_functions.py @@ -0,0 +1,142 @@ +from numpy.testing import assert_raises +import numpy as np + +from .. import all +from .._creation_functions import ( + asarray, + arange, + empty, + empty_like, + eye, + full, + full_like, + linspace, + meshgrid, + ones, + ones_like, + zeros, + zeros_like, +) +from .._dtypes import float32, float64 +from .._array_object import Array + + +def test_asarray_errors(): + # Test various protections against incorrect usage + assert_raises(TypeError, lambda: Array([1])) + assert_raises(TypeError, lambda: asarray(["a"])) + assert_raises(ValueError, lambda: asarray([1.0], dtype=np.float16)) + assert_raises(OverflowError, lambda: asarray(2**100)) + # Preferably this would be OverflowError + # assert_raises(OverflowError, lambda: asarray([2**100])) + assert_raises(TypeError, lambda: asarray([2**100])) + asarray([1], device="cpu") # Doesn't error + assert_raises(ValueError, lambda: asarray([1], device="gpu")) + + assert_raises(ValueError, lambda: asarray([1], dtype=int)) + assert_raises(ValueError, lambda: asarray([1], dtype="i")) + + +def test_asarray_copy(): + a = asarray([1]) + b = asarray(a, copy=True) + a[0] = 0 + assert all(b[0] == 1) + assert all(a[0] == 0) + a = asarray([1]) + b = asarray(a, copy=np._CopyMode.ALWAYS) + a[0] = 0 + assert all(b[0] == 1) + assert all(a[0] == 0) + a = asarray([1]) + b = asarray(a, copy=np._CopyMode.NEVER) + a[0] = 0 + assert all(b[0] == 0) + assert_raises(NotImplementedError, lambda: asarray(a, copy=False)) + assert_raises(NotImplementedError, + lambda: asarray(a, copy=np._CopyMode.IF_NEEDED)) + + +def test_arange_errors(): + arange(1, device="cpu") # Doesn't error + assert_raises(ValueError, lambda: arange(1, device="gpu")) + assert_raises(ValueError, lambda: arange(1, dtype=int)) + assert_raises(ValueError, lambda: arange(1, dtype="i")) + + +def test_empty_errors(): + empty((1,), device="cpu") # Doesn't error + assert_raises(ValueError, lambda: empty((1,), device="gpu")) + assert_raises(ValueError, lambda: empty((1,), dtype=int)) + assert_raises(ValueError, lambda: empty((1,), dtype="i")) + + +def test_empty_like_errors(): + empty_like(asarray(1), device="cpu") # Doesn't error + assert_raises(ValueError, lambda: empty_like(asarray(1), device="gpu")) + assert_raises(ValueError, lambda: empty_like(asarray(1), dtype=int)) + assert_raises(ValueError, lambda: empty_like(asarray(1), dtype="i")) + + +def test_eye_errors(): + eye(1, device="cpu") # Doesn't error + assert_raises(ValueError, lambda: eye(1, device="gpu")) + assert_raises(ValueError, lambda: eye(1, dtype=int)) + assert_raises(ValueError, lambda: eye(1, dtype="i")) + + +def test_full_errors(): + full((1,), 0, device="cpu") # Doesn't error + assert_raises(ValueError, lambda: full((1,), 0, device="gpu")) + assert_raises(ValueError, lambda: full((1,), 0, dtype=int)) + assert_raises(ValueError, lambda: full((1,), 0, dtype="i")) + + +def test_full_like_errors(): + full_like(asarray(1), 0, device="cpu") # Doesn't error + assert_raises(ValueError, lambda: full_like(asarray(1), 0, device="gpu")) + assert_raises(ValueError, lambda: full_like(asarray(1), 0, dtype=int)) + assert_raises(ValueError, lambda: full_like(asarray(1), 0, dtype="i")) + + +def test_linspace_errors(): + linspace(0, 1, 10, device="cpu") # Doesn't error + assert_raises(ValueError, lambda: linspace(0, 1, 10, device="gpu")) + assert_raises(ValueError, lambda: linspace(0, 1, 10, dtype=float)) + assert_raises(ValueError, lambda: linspace(0, 1, 10, dtype="f")) + + +def test_ones_errors(): + ones((1,), device="cpu") # Doesn't error + assert_raises(ValueError, lambda: ones((1,), device="gpu")) + assert_raises(ValueError, lambda: ones((1,), dtype=int)) + assert_raises(ValueError, lambda: ones((1,), dtype="i")) + + +def test_ones_like_errors(): + ones_like(asarray(1), device="cpu") # Doesn't error + assert_raises(ValueError, lambda: ones_like(asarray(1), device="gpu")) + assert_raises(ValueError, lambda: ones_like(asarray(1), dtype=int)) + assert_raises(ValueError, lambda: ones_like(asarray(1), dtype="i")) + + +def test_zeros_errors(): + zeros((1,), device="cpu") # Doesn't error + assert_raises(ValueError, lambda: zeros((1,), device="gpu")) + assert_raises(ValueError, lambda: zeros((1,), dtype=int)) + assert_raises(ValueError, lambda: zeros((1,), dtype="i")) + + +def test_zeros_like_errors(): + zeros_like(asarray(1), device="cpu") # Doesn't error + assert_raises(ValueError, lambda: zeros_like(asarray(1), device="gpu")) + assert_raises(ValueError, lambda: zeros_like(asarray(1), dtype=int)) + assert_raises(ValueError, lambda: zeros_like(asarray(1), dtype="i")) + +def test_meshgrid_dtype_errors(): + # Doesn't raise + meshgrid() + meshgrid(asarray([1.], dtype=float32)) + meshgrid(asarray([1.], dtype=float32), asarray([1.], dtype=float32)) + + assert_raises(ValueError, lambda: meshgrid(asarray([1.], dtype=float32), asarray([1.], dtype=float64))) diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/test_data_type_functions.py b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/test_data_type_functions.py new file mode 100644 index 0000000000000000000000000000000000000000..61d56ca45b1edf9a6dbc4681d1f5ac52448f96c4 --- /dev/null +++ b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/test_data_type_functions.py @@ -0,0 +1,31 @@ +import pytest + +from numpy.testing import assert_raises +from numpy import array_api as xp +import numpy as np + +@pytest.mark.parametrize( + "from_, to, expected", + [ + (xp.int8, xp.int16, True), + (xp.int16, xp.int8, False), + (xp.bool, xp.int8, False), + (xp.asarray(0, dtype=xp.uint8), xp.int8, False), + ], +) +def test_can_cast(from_, to, expected): + """ + can_cast() returns correct result + """ + assert xp.can_cast(from_, to) == expected + +def test_isdtype_strictness(): + assert_raises(TypeError, lambda: xp.isdtype(xp.float64, 64)) + assert_raises(ValueError, lambda: xp.isdtype(xp.float64, 'f8')) + + assert_raises(TypeError, lambda: xp.isdtype(xp.float64, (('integral',),))) + assert_raises(TypeError, lambda: xp.isdtype(xp.float64, np.object_)) + + # TODO: These will require https://github.com/numpy/numpy/issues/23883 + # assert_raises(TypeError, lambda: xp.isdtype(xp.float64, None)) + # assert_raises(TypeError, lambda: xp.isdtype(xp.float64, np.float64)) diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/test_elementwise_functions.py b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/test_elementwise_functions.py new file mode 100644 index 0000000000000000000000000000000000000000..1228d0af2e6a6a8ae504297c7562d3beb5ba9516 --- /dev/null +++ b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/test_elementwise_functions.py @@ -0,0 +1,114 @@ +from inspect import getfullargspec + +from numpy.testing import assert_raises + +from .. import asarray, _elementwise_functions +from .._elementwise_functions import bitwise_left_shift, bitwise_right_shift +from .._dtypes import ( + _dtype_categories, + _boolean_dtypes, + _floating_dtypes, + _integer_dtypes, +) + + +def nargs(func): + return len(getfullargspec(func).args) + + +def test_function_types(): + # Test that every function accepts only the required input types. We only + # test the negative cases here (error). The positive cases are tested in + # the array API test suite. + + elementwise_function_input_types = { + "abs": "numeric", + "acos": "floating-point", + "acosh": "floating-point", + "add": "numeric", + "asin": "floating-point", + "asinh": "floating-point", + "atan": "floating-point", + "atan2": "real floating-point", + "atanh": "floating-point", + "bitwise_and": "integer or boolean", + "bitwise_invert": "integer or boolean", + "bitwise_left_shift": "integer", + "bitwise_or": "integer or boolean", + "bitwise_right_shift": "integer", + "bitwise_xor": "integer or boolean", + "ceil": "real numeric", + "conj": "complex floating-point", + "cos": "floating-point", + "cosh": "floating-point", + "divide": "floating-point", + "equal": "all", + "exp": "floating-point", + "expm1": "floating-point", + "floor": "real numeric", + "floor_divide": "real numeric", + "greater": "real numeric", + "greater_equal": "real numeric", + "imag": "complex floating-point", + "isfinite": "numeric", + "isinf": "numeric", + "isnan": "numeric", + "less": "real numeric", + "less_equal": "real numeric", + "log": "floating-point", + "logaddexp": "real floating-point", + "log10": "floating-point", + "log1p": "floating-point", + "log2": "floating-point", + "logical_and": "boolean", + "logical_not": "boolean", + "logical_or": "boolean", + "logical_xor": "boolean", + "multiply": "numeric", + "negative": "numeric", + "not_equal": "all", + "positive": "numeric", + "pow": "numeric", + "real": "complex floating-point", + "remainder": "real numeric", + "round": "numeric", + "sign": "numeric", + "sin": "floating-point", + "sinh": "floating-point", + "sqrt": "floating-point", + "square": "numeric", + "subtract": "numeric", + "tan": "floating-point", + "tanh": "floating-point", + "trunc": "real numeric", + } + + def _array_vals(): + for d in _integer_dtypes: + yield asarray(1, dtype=d) + for d in _boolean_dtypes: + yield asarray(False, dtype=d) + for d in _floating_dtypes: + yield asarray(1.0, dtype=d) + + for x in _array_vals(): + for func_name, types in elementwise_function_input_types.items(): + dtypes = _dtype_categories[types] + func = getattr(_elementwise_functions, func_name) + if nargs(func) == 2: + for y in _array_vals(): + if x.dtype not in dtypes or y.dtype not in dtypes: + assert_raises(TypeError, lambda: func(x, y)) + else: + if x.dtype not in dtypes: + assert_raises(TypeError, lambda: func(x)) + + +def test_bitwise_shift_error(): + # bitwise shift functions should raise when the second argument is negative + assert_raises( + ValueError, lambda: bitwise_left_shift(asarray([1, 1]), asarray([1, -1])) + ) + assert_raises( + ValueError, lambda: bitwise_right_shift(asarray([1, 1]), asarray([1, -1])) + ) diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/test_indexing_functions.py b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/test_indexing_functions.py new file mode 100644 index 0000000000000000000000000000000000000000..9e05c63863a6fca5a24dfaa26e1fd9569dea9580 --- /dev/null +++ b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/test_indexing_functions.py @@ -0,0 +1,24 @@ +import pytest + +from numpy import array_api as xp + + +@pytest.mark.parametrize( + "x, indices, axis, expected", + [ + ([2, 3], [1, 1, 0], 0, [3, 3, 2]), + ([2, 3], [1, 1, 0], -1, [3, 3, 2]), + ([[2, 3]], [1], -1, [[3]]), + ([[2, 3]], [0, 0], 0, [[2, 3], [2, 3]]), + ], +) +def test_take_function(x, indices, axis, expected): + """ + Indices respect relative order of a descending stable-sort + + See https://github.com/numpy/numpy/issues/20778 + """ + x = xp.asarray(x) + indices = xp.asarray(indices) + out = xp.take(x, indices, axis=axis) + assert xp.all(out == xp.asarray(expected)) diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/test_manipulation_functions.py b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/test_manipulation_functions.py new file mode 100644 index 0000000000000000000000000000000000000000..aec57c38ba6a60f3e8dbf3e9b8e8241182f788de --- /dev/null +++ b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/test_manipulation_functions.py @@ -0,0 +1,37 @@ +from numpy.testing import assert_raises +import numpy as np + +from .. import all +from .._creation_functions import asarray +from .._dtypes import float64, int8 +from .._manipulation_functions import ( + concat, + reshape, + stack +) + + +def test_concat_errors(): + assert_raises(TypeError, lambda: concat((1, 1), axis=None)) + assert_raises(TypeError, lambda: concat([asarray([1], dtype=int8), + asarray([1], dtype=float64)])) + + +def test_stack_errors(): + assert_raises(TypeError, lambda: stack([asarray([1, 1], dtype=int8), + asarray([2, 2], dtype=float64)])) + + +def test_reshape_copy(): + a = asarray(np.ones((2, 3))) + b = reshape(a, (3, 2), copy=True) + assert not np.shares_memory(a._array, b._array) + + a = asarray(np.ones((2, 3))) + b = reshape(a, (3, 2), copy=False) + assert np.shares_memory(a._array, b._array) + + a = asarray(np.ones((2, 3)).T) + b = reshape(a, (3, 2), copy=True) + assert_raises(AttributeError, lambda: reshape(a, (2, 3), copy=False)) + diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/test_set_functions.py b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/test_set_functions.py new file mode 100644 index 0000000000000000000000000000000000000000..b8eb65d430dc4f03e2ff662c61823adf17f2d502 --- /dev/null +++ b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/test_set_functions.py @@ -0,0 +1,19 @@ +import pytest +from hypothesis import given +from hypothesis.extra.array_api import make_strategies_namespace + +from numpy import array_api as xp + +xps = make_strategies_namespace(xp) + + +@pytest.mark.parametrize("func", [xp.unique_all, xp.unique_inverse]) +@given(xps.arrays(dtype=xps.scalar_dtypes(), shape=xps.array_shapes())) +def test_inverse_indices_shape(func, x): + """ + Inverse indices share shape of input array + + See https://github.com/numpy/numpy/issues/20638 + """ + out = func(x) + assert out.inverse_indices.shape == x.shape diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/test_sorting_functions.py b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/test_sorting_functions.py new file mode 100644 index 0000000000000000000000000000000000000000..9848bbfeb7bdee1a7183a6bda641e0611c756ee6 --- /dev/null +++ b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/test_sorting_functions.py @@ -0,0 +1,23 @@ +import pytest + +from numpy import array_api as xp + + +@pytest.mark.parametrize( + "obj, axis, expected", + [ + ([0, 0], -1, [0, 1]), + ([0, 1, 0], -1, [1, 0, 2]), + ([[0, 1], [1, 1]], 0, [[1, 0], [0, 1]]), + ([[0, 1], [1, 1]], 1, [[1, 0], [0, 1]]), + ], +) +def test_stable_desc_argsort(obj, axis, expected): + """ + Indices respect relative order of a descending stable-sort + + See https://github.com/numpy/numpy/issues/20778 + """ + x = xp.asarray(obj) + out = xp.argsort(x, axis=axis, stable=True, descending=True) + assert xp.all(out == xp.asarray(expected)) diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/test_validation.py b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/test_validation.py new file mode 100644 index 0000000000000000000000000000000000000000..0dd100d159242a1dcd0da5277dd655625c602fad --- /dev/null +++ b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/array_api/tests/test_validation.py @@ -0,0 +1,27 @@ +from typing import Callable + +import pytest + +from numpy import array_api as xp + + +def p(func: Callable, *args, **kwargs): + f_sig = ", ".join( + [str(a) for a in args] + [f"{k}={v}" for k, v in kwargs.items()] + ) + id_ = f"{func.__name__}({f_sig})" + return pytest.param(func, args, kwargs, id=id_) + + +@pytest.mark.parametrize( + "func, args, kwargs", + [ + p(xp.can_cast, 42, xp.int8), + p(xp.can_cast, xp.int8, 42), + p(xp.result_type, 42), + ], +) +def test_raises_on_invalid_types(func, args, kwargs): + """Function raises TypeError when passed invalidly-typed inputs""" + with pytest.raises(TypeError): + func(*args, **kwargs) diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/__init__.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..70939195133c519246807778ffa8ed73718d61c1 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/__init__.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_add_newdocs_scalars.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_add_newdocs_scalars.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..65c3246d2ec8e34df2d5640426457bd37920881e Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_add_newdocs_scalars.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_asarray.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_asarray.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a366bcfa9399e14259eb2f4f1a6358e008f53f76 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_asarray.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_dtype.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_dtype.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2db5d64be20d8e720c3148031e0e0e98afdb16be Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_dtype.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_dtype_ctypes.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_dtype_ctypes.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..31de26c9e48011407a115bdbcf5279e0db704908 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_dtype_ctypes.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_exceptions.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_exceptions.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c119134504c95ce144db89a2e7edb5f6a9041952 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_exceptions.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_internal.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_internal.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f8528ab6e7c9d451f67036082fdcbf0b427fdf09 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_internal.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_machar.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_machar.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0c808be2a4e35c80f5323249b4bfd351291f5ca2 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_machar.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_methods.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_methods.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..807948da9fc39e750cef72c1eb33810ae19dfd13 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_methods.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_string_helpers.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_string_helpers.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f893bd4da94e7e1941c51b217fda7ebf2ad6737d Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_string_helpers.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_type_aliases.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_type_aliases.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4897be90283d4133f852ad633a0f95fbef88204c Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/_type_aliases.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/arrayprint.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/arrayprint.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8debacbe8dd1c5929fa062b7b58ae0ebe603e6e2 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/arrayprint.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/cversions.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/cversions.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a08a71e4964abcd1fb979a30b80257ec063457c7 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/cversions.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/defchararray.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/defchararray.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..89f0c6782fb08229644d5c5a52053cb9ae001e3c Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/defchararray.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/einsumfunc.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/einsumfunc.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4c4bb3d9f2069baee1b9c238647d4709639e0915 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/einsumfunc.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/function_base.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/function_base.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..11ff114de9c9e946cdc0758f285c5b8ac78d0cbe Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/function_base.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/getlimits.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/getlimits.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ef1ecfc6b53160d80f1e47d0f6be7244d626ef60 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/getlimits.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/memmap.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/memmap.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f9b25d9b78d6ab828621b0fc6c1b8f99b2871b34 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/memmap.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/multiarray.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/multiarray.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a1c55dce08ba5cfe6cd7f3d51c1a3dfea131a68b Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/multiarray.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/numeric.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/numeric.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b6daef347dc4cb257041f2749cbc35bf6e06f783 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/numeric.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/numerictypes.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/numerictypes.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f52bfd4187d1f795114ba15df9123fc1395c9186 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/numerictypes.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/overrides.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/overrides.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..95f3846f5fd265eb56d10c6b131471b04397d2d8 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/overrides.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/records.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/records.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7907bc717af6b420ff27260d86f982e855bd5838 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/records.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/shape_base.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/shape_base.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9e0ff29f5e3b9595897875dc910917f0087c2501 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/shape_base.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/umath.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/umath.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e5dc883cb1480bb03078388d0d6e1a52ccd9124c Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/umath.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/umath_tests.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/umath_tests.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6361039cd0e11c531178f4b51ae710d0e42a4dfa Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/__pycache__/umath_tests.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/lib/libnpymath.a b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/lib/libnpymath.a new file mode 100644 index 0000000000000000000000000000000000000000..96a955e032495a2f05c094967ca015d489ea6457 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/core/lib/libnpymath.a differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/fft/__pycache__/__init__.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/fft/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..470fac665829624fbf63b078b9a62af7a33f38d2 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/fft/__pycache__/__init__.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/fft/__pycache__/_pocketfft.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/fft/__pycache__/_pocketfft.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..813fbebcaa20d96abb757bbc7d03862c34a40098 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/fft/__pycache__/_pocketfft.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/fft/__pycache__/helper.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/fft/__pycache__/helper.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..543a4d068b47614ebcd578fd147aa11b6744a890 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/fft/__pycache__/helper.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/fft/tests/__init__.py b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/fft/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/fft/tests/__pycache__/__init__.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/fft/tests/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..20efc92b033b5502a7eb73b3e12bc9c7ed70a21a Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/fft/tests/__pycache__/__init__.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/fft/tests/__pycache__/test_helper.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/fft/tests/__pycache__/test_helper.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1c5591656a828db16bebe4bacde9ff0a6ca1d30f Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/fft/tests/__pycache__/test_helper.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/fft/tests/__pycache__/test_pocketfft.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/fft/tests/__pycache__/test_pocketfft.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..59b943c723ad4a88b0a62d281627c90efc02c559 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/fft/tests/__pycache__/test_pocketfft.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/fft/tests/test_helper.py b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/fft/tests/test_helper.py new file mode 100644 index 0000000000000000000000000000000000000000..3fb700bb3d00760b0dd0020b52f1c60549d7706e --- /dev/null +++ b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/fft/tests/test_helper.py @@ -0,0 +1,167 @@ +"""Test functions for fftpack.helper module + +Copied from fftpack.helper by Pearu Peterson, October 2005 + +""" +import numpy as np +from numpy.testing import assert_array_almost_equal +from numpy import fft, pi + + +class TestFFTShift: + + def test_definition(self): + x = [0, 1, 2, 3, 4, -4, -3, -2, -1] + y = [-4, -3, -2, -1, 0, 1, 2, 3, 4] + assert_array_almost_equal(fft.fftshift(x), y) + assert_array_almost_equal(fft.ifftshift(y), x) + x = [0, 1, 2, 3, 4, -5, -4, -3, -2, -1] + y = [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4] + assert_array_almost_equal(fft.fftshift(x), y) + assert_array_almost_equal(fft.ifftshift(y), x) + + def test_inverse(self): + for n in [1, 4, 9, 100, 211]: + x = np.random.random((n,)) + assert_array_almost_equal(fft.ifftshift(fft.fftshift(x)), x) + + def test_axes_keyword(self): + freqs = [[0, 1, 2], [3, 4, -4], [-3, -2, -1]] + shifted = [[-1, -3, -2], [2, 0, 1], [-4, 3, 4]] + assert_array_almost_equal(fft.fftshift(freqs, axes=(0, 1)), shifted) + assert_array_almost_equal(fft.fftshift(freqs, axes=0), + fft.fftshift(freqs, axes=(0,))) + assert_array_almost_equal(fft.ifftshift(shifted, axes=(0, 1)), freqs) + assert_array_almost_equal(fft.ifftshift(shifted, axes=0), + fft.ifftshift(shifted, axes=(0,))) + + assert_array_almost_equal(fft.fftshift(freqs), shifted) + assert_array_almost_equal(fft.ifftshift(shifted), freqs) + + def test_uneven_dims(self): + """ Test 2D input, which has uneven dimension sizes """ + freqs = [ + [0, 1], + [2, 3], + [4, 5] + ] + + # shift in dimension 0 + shift_dim0 = [ + [4, 5], + [0, 1], + [2, 3] + ] + assert_array_almost_equal(fft.fftshift(freqs, axes=0), shift_dim0) + assert_array_almost_equal(fft.ifftshift(shift_dim0, axes=0), freqs) + assert_array_almost_equal(fft.fftshift(freqs, axes=(0,)), shift_dim0) + assert_array_almost_equal(fft.ifftshift(shift_dim0, axes=[0]), freqs) + + # shift in dimension 1 + shift_dim1 = [ + [1, 0], + [3, 2], + [5, 4] + ] + assert_array_almost_equal(fft.fftshift(freqs, axes=1), shift_dim1) + assert_array_almost_equal(fft.ifftshift(shift_dim1, axes=1), freqs) + + # shift in both dimensions + shift_dim_both = [ + [5, 4], + [1, 0], + [3, 2] + ] + assert_array_almost_equal(fft.fftshift(freqs, axes=(0, 1)), shift_dim_both) + assert_array_almost_equal(fft.ifftshift(shift_dim_both, axes=(0, 1)), freqs) + assert_array_almost_equal(fft.fftshift(freqs, axes=[0, 1]), shift_dim_both) + assert_array_almost_equal(fft.ifftshift(shift_dim_both, axes=[0, 1]), freqs) + + # axes=None (default) shift in all dimensions + assert_array_almost_equal(fft.fftshift(freqs, axes=None), shift_dim_both) + assert_array_almost_equal(fft.ifftshift(shift_dim_both, axes=None), freqs) + assert_array_almost_equal(fft.fftshift(freqs), shift_dim_both) + assert_array_almost_equal(fft.ifftshift(shift_dim_both), freqs) + + def test_equal_to_original(self): + """ Test that the new (>=v1.15) implementation (see #10073) is equal to the original (<=v1.14) """ + from numpy.core import asarray, concatenate, arange, take + + def original_fftshift(x, axes=None): + """ How fftshift was implemented in v1.14""" + tmp = asarray(x) + ndim = tmp.ndim + if axes is None: + axes = list(range(ndim)) + elif isinstance(axes, int): + axes = (axes,) + y = tmp + for k in axes: + n = tmp.shape[k] + p2 = (n + 1) // 2 + mylist = concatenate((arange(p2, n), arange(p2))) + y = take(y, mylist, k) + return y + + def original_ifftshift(x, axes=None): + """ How ifftshift was implemented in v1.14 """ + tmp = asarray(x) + ndim = tmp.ndim + if axes is None: + axes = list(range(ndim)) + elif isinstance(axes, int): + axes = (axes,) + y = tmp + for k in axes: + n = tmp.shape[k] + p2 = n - (n + 1) // 2 + mylist = concatenate((arange(p2, n), arange(p2))) + y = take(y, mylist, k) + return y + + # create possible 2d array combinations and try all possible keywords + # compare output to original functions + for i in range(16): + for j in range(16): + for axes_keyword in [0, 1, None, (0,), (0, 1)]: + inp = np.random.rand(i, j) + + assert_array_almost_equal(fft.fftshift(inp, axes_keyword), + original_fftshift(inp, axes_keyword)) + + assert_array_almost_equal(fft.ifftshift(inp, axes_keyword), + original_ifftshift(inp, axes_keyword)) + + +class TestFFTFreq: + + def test_definition(self): + x = [0, 1, 2, 3, 4, -4, -3, -2, -1] + assert_array_almost_equal(9*fft.fftfreq(9), x) + assert_array_almost_equal(9*pi*fft.fftfreq(9, pi), x) + x = [0, 1, 2, 3, 4, -5, -4, -3, -2, -1] + assert_array_almost_equal(10*fft.fftfreq(10), x) + assert_array_almost_equal(10*pi*fft.fftfreq(10, pi), x) + + +class TestRFFTFreq: + + def test_definition(self): + x = [0, 1, 2, 3, 4] + assert_array_almost_equal(9*fft.rfftfreq(9), x) + assert_array_almost_equal(9*pi*fft.rfftfreq(9, pi), x) + x = [0, 1, 2, 3, 4, 5] + assert_array_almost_equal(10*fft.rfftfreq(10), x) + assert_array_almost_equal(10*pi*fft.rfftfreq(10, pi), x) + + +class TestIRFFTN: + + def test_not_last_axis_success(self): + ar, ai = np.random.random((2, 16, 8, 32)) + a = ar + 1j*ai + + axes = (-2,) + + # Should not raise error + fft.irfftn(a, axes=axes) diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/fft/tests/test_pocketfft.py b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/fft/tests/test_pocketfft.py new file mode 100644 index 0000000000000000000000000000000000000000..122a9fac93ec9006e36660c5fa4b446d384b1c3e --- /dev/null +++ b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/fft/tests/test_pocketfft.py @@ -0,0 +1,308 @@ +import numpy as np +import pytest +from numpy.random import random +from numpy.testing import ( + assert_array_equal, assert_raises, assert_allclose, IS_WASM + ) +import threading +import queue + + +def fft1(x): + L = len(x) + phase = -2j * np.pi * (np.arange(L) / L) + phase = np.arange(L).reshape(-1, 1) * phase + return np.sum(x*np.exp(phase), axis=1) + + +class TestFFTShift: + + def test_fft_n(self): + assert_raises(ValueError, np.fft.fft, [1, 2, 3], 0) + + +class TestFFT1D: + + def test_identity(self): + maxlen = 512 + x = random(maxlen) + 1j*random(maxlen) + xr = random(maxlen) + for i in range(1, maxlen): + assert_allclose(np.fft.ifft(np.fft.fft(x[0:i])), x[0:i], + atol=1e-12) + assert_allclose(np.fft.irfft(np.fft.rfft(xr[0:i]), i), + xr[0:i], atol=1e-12) + + def test_fft(self): + x = random(30) + 1j*random(30) + assert_allclose(fft1(x), np.fft.fft(x), atol=1e-6) + assert_allclose(fft1(x), np.fft.fft(x, norm="backward"), atol=1e-6) + assert_allclose(fft1(x) / np.sqrt(30), + np.fft.fft(x, norm="ortho"), atol=1e-6) + assert_allclose(fft1(x) / 30., + np.fft.fft(x, norm="forward"), atol=1e-6) + + @pytest.mark.parametrize('norm', (None, 'backward', 'ortho', 'forward')) + def test_ifft(self, norm): + x = random(30) + 1j*random(30) + assert_allclose( + x, np.fft.ifft(np.fft.fft(x, norm=norm), norm=norm), + atol=1e-6) + # Ensure we get the correct error message + with pytest.raises(ValueError, + match='Invalid number of FFT data points'): + np.fft.ifft([], norm=norm) + + def test_fft2(self): + x = random((30, 20)) + 1j*random((30, 20)) + assert_allclose(np.fft.fft(np.fft.fft(x, axis=1), axis=0), + np.fft.fft2(x), atol=1e-6) + assert_allclose(np.fft.fft2(x), + np.fft.fft2(x, norm="backward"), atol=1e-6) + assert_allclose(np.fft.fft2(x) / np.sqrt(30 * 20), + np.fft.fft2(x, norm="ortho"), atol=1e-6) + assert_allclose(np.fft.fft2(x) / (30. * 20.), + np.fft.fft2(x, norm="forward"), atol=1e-6) + + def test_ifft2(self): + x = random((30, 20)) + 1j*random((30, 20)) + assert_allclose(np.fft.ifft(np.fft.ifft(x, axis=1), axis=0), + np.fft.ifft2(x), atol=1e-6) + assert_allclose(np.fft.ifft2(x), + np.fft.ifft2(x, norm="backward"), atol=1e-6) + assert_allclose(np.fft.ifft2(x) * np.sqrt(30 * 20), + np.fft.ifft2(x, norm="ortho"), atol=1e-6) + assert_allclose(np.fft.ifft2(x) * (30. * 20.), + np.fft.ifft2(x, norm="forward"), atol=1e-6) + + def test_fftn(self): + x = random((30, 20, 10)) + 1j*random((30, 20, 10)) + assert_allclose( + np.fft.fft(np.fft.fft(np.fft.fft(x, axis=2), axis=1), axis=0), + np.fft.fftn(x), atol=1e-6) + assert_allclose(np.fft.fftn(x), + np.fft.fftn(x, norm="backward"), atol=1e-6) + assert_allclose(np.fft.fftn(x) / np.sqrt(30 * 20 * 10), + np.fft.fftn(x, norm="ortho"), atol=1e-6) + assert_allclose(np.fft.fftn(x) / (30. * 20. * 10.), + np.fft.fftn(x, norm="forward"), atol=1e-6) + + def test_ifftn(self): + x = random((30, 20, 10)) + 1j*random((30, 20, 10)) + assert_allclose( + np.fft.ifft(np.fft.ifft(np.fft.ifft(x, axis=2), axis=1), axis=0), + np.fft.ifftn(x), atol=1e-6) + assert_allclose(np.fft.ifftn(x), + np.fft.ifftn(x, norm="backward"), atol=1e-6) + assert_allclose(np.fft.ifftn(x) * np.sqrt(30 * 20 * 10), + np.fft.ifftn(x, norm="ortho"), atol=1e-6) + assert_allclose(np.fft.ifftn(x) * (30. * 20. * 10.), + np.fft.ifftn(x, norm="forward"), atol=1e-6) + + def test_rfft(self): + x = random(30) + for n in [x.size, 2*x.size]: + for norm in [None, 'backward', 'ortho', 'forward']: + assert_allclose( + np.fft.fft(x, n=n, norm=norm)[:(n//2 + 1)], + np.fft.rfft(x, n=n, norm=norm), atol=1e-6) + assert_allclose( + np.fft.rfft(x, n=n), + np.fft.rfft(x, n=n, norm="backward"), atol=1e-6) + assert_allclose( + np.fft.rfft(x, n=n) / np.sqrt(n), + np.fft.rfft(x, n=n, norm="ortho"), atol=1e-6) + assert_allclose( + np.fft.rfft(x, n=n) / n, + np.fft.rfft(x, n=n, norm="forward"), atol=1e-6) + + def test_irfft(self): + x = random(30) + assert_allclose(x, np.fft.irfft(np.fft.rfft(x)), atol=1e-6) + assert_allclose(x, np.fft.irfft(np.fft.rfft(x, norm="backward"), + norm="backward"), atol=1e-6) + assert_allclose(x, np.fft.irfft(np.fft.rfft(x, norm="ortho"), + norm="ortho"), atol=1e-6) + assert_allclose(x, np.fft.irfft(np.fft.rfft(x, norm="forward"), + norm="forward"), atol=1e-6) + + def test_rfft2(self): + x = random((30, 20)) + assert_allclose(np.fft.fft2(x)[:, :11], np.fft.rfft2(x), atol=1e-6) + assert_allclose(np.fft.rfft2(x), + np.fft.rfft2(x, norm="backward"), atol=1e-6) + assert_allclose(np.fft.rfft2(x) / np.sqrt(30 * 20), + np.fft.rfft2(x, norm="ortho"), atol=1e-6) + assert_allclose(np.fft.rfft2(x) / (30. * 20.), + np.fft.rfft2(x, norm="forward"), atol=1e-6) + + def test_irfft2(self): + x = random((30, 20)) + assert_allclose(x, np.fft.irfft2(np.fft.rfft2(x)), atol=1e-6) + assert_allclose(x, np.fft.irfft2(np.fft.rfft2(x, norm="backward"), + norm="backward"), atol=1e-6) + assert_allclose(x, np.fft.irfft2(np.fft.rfft2(x, norm="ortho"), + norm="ortho"), atol=1e-6) + assert_allclose(x, np.fft.irfft2(np.fft.rfft2(x, norm="forward"), + norm="forward"), atol=1e-6) + + def test_rfftn(self): + x = random((30, 20, 10)) + assert_allclose(np.fft.fftn(x)[:, :, :6], np.fft.rfftn(x), atol=1e-6) + assert_allclose(np.fft.rfftn(x), + np.fft.rfftn(x, norm="backward"), atol=1e-6) + assert_allclose(np.fft.rfftn(x) / np.sqrt(30 * 20 * 10), + np.fft.rfftn(x, norm="ortho"), atol=1e-6) + assert_allclose(np.fft.rfftn(x) / (30. * 20. * 10.), + np.fft.rfftn(x, norm="forward"), atol=1e-6) + + def test_irfftn(self): + x = random((30, 20, 10)) + assert_allclose(x, np.fft.irfftn(np.fft.rfftn(x)), atol=1e-6) + assert_allclose(x, np.fft.irfftn(np.fft.rfftn(x, norm="backward"), + norm="backward"), atol=1e-6) + assert_allclose(x, np.fft.irfftn(np.fft.rfftn(x, norm="ortho"), + norm="ortho"), atol=1e-6) + assert_allclose(x, np.fft.irfftn(np.fft.rfftn(x, norm="forward"), + norm="forward"), atol=1e-6) + + def test_hfft(self): + x = random(14) + 1j*random(14) + x_herm = np.concatenate((random(1), x, random(1))) + x = np.concatenate((x_herm, x[::-1].conj())) + assert_allclose(np.fft.fft(x), np.fft.hfft(x_herm), atol=1e-6) + assert_allclose(np.fft.hfft(x_herm), + np.fft.hfft(x_herm, norm="backward"), atol=1e-6) + assert_allclose(np.fft.hfft(x_herm) / np.sqrt(30), + np.fft.hfft(x_herm, norm="ortho"), atol=1e-6) + assert_allclose(np.fft.hfft(x_herm) / 30., + np.fft.hfft(x_herm, norm="forward"), atol=1e-6) + + def test_ihfft(self): + x = random(14) + 1j*random(14) + x_herm = np.concatenate((random(1), x, random(1))) + x = np.concatenate((x_herm, x[::-1].conj())) + assert_allclose(x_herm, np.fft.ihfft(np.fft.hfft(x_herm)), atol=1e-6) + assert_allclose(x_herm, np.fft.ihfft(np.fft.hfft(x_herm, + norm="backward"), norm="backward"), atol=1e-6) + assert_allclose(x_herm, np.fft.ihfft(np.fft.hfft(x_herm, + norm="ortho"), norm="ortho"), atol=1e-6) + assert_allclose(x_herm, np.fft.ihfft(np.fft.hfft(x_herm, + norm="forward"), norm="forward"), atol=1e-6) + + @pytest.mark.parametrize("op", [np.fft.fftn, np.fft.ifftn, + np.fft.rfftn, np.fft.irfftn]) + def test_axes(self, op): + x = random((30, 20, 10)) + axes = [(0, 1, 2), (0, 2, 1), (1, 0, 2), (1, 2, 0), (2, 0, 1), (2, 1, 0)] + for a in axes: + op_tr = op(np.transpose(x, a)) + tr_op = np.transpose(op(x, axes=a), a) + assert_allclose(op_tr, tr_op, atol=1e-6) + + def test_all_1d_norm_preserving(self): + # verify that round-trip transforms are norm-preserving + x = random(30) + x_norm = np.linalg.norm(x) + n = x.size * 2 + func_pairs = [(np.fft.fft, np.fft.ifft), + (np.fft.rfft, np.fft.irfft), + # hfft: order so the first function takes x.size samples + # (necessary for comparison to x_norm above) + (np.fft.ihfft, np.fft.hfft), + ] + for forw, back in func_pairs: + for n in [x.size, 2*x.size]: + for norm in [None, 'backward', 'ortho', 'forward']: + tmp = forw(x, n=n, norm=norm) + tmp = back(tmp, n=n, norm=norm) + assert_allclose(x_norm, + np.linalg.norm(tmp), atol=1e-6) + + @pytest.mark.parametrize("dtype", [np.half, np.single, np.double, + np.longdouble]) + def test_dtypes(self, dtype): + # make sure that all input precisions are accepted and internally + # converted to 64bit + x = random(30).astype(dtype) + assert_allclose(np.fft.ifft(np.fft.fft(x)), x, atol=1e-6) + assert_allclose(np.fft.irfft(np.fft.rfft(x)), x, atol=1e-6) + + +@pytest.mark.parametrize( + "dtype", + [np.float32, np.float64, np.complex64, np.complex128]) +@pytest.mark.parametrize("order", ["F", 'non-contiguous']) +@pytest.mark.parametrize( + "fft", + [np.fft.fft, np.fft.fft2, np.fft.fftn, + np.fft.ifft, np.fft.ifft2, np.fft.ifftn]) +def test_fft_with_order(dtype, order, fft): + # Check that FFT/IFFT produces identical results for C, Fortran and + # non contiguous arrays + rng = np.random.RandomState(42) + X = rng.rand(8, 7, 13).astype(dtype, copy=False) + # See discussion in pull/14178 + _tol = 8.0 * np.sqrt(np.log2(X.size)) * np.finfo(X.dtype).eps + if order == 'F': + Y = np.asfortranarray(X) + else: + # Make a non contiguous array + Y = X[::-1] + X = np.ascontiguousarray(X[::-1]) + + if fft.__name__.endswith('fft'): + for axis in range(3): + X_res = fft(X, axis=axis) + Y_res = fft(Y, axis=axis) + assert_allclose(X_res, Y_res, atol=_tol, rtol=_tol) + elif fft.__name__.endswith(('fft2', 'fftn')): + axes = [(0, 1), (1, 2), (0, 2)] + if fft.__name__.endswith('fftn'): + axes.extend([(0,), (1,), (2,), None]) + for ax in axes: + X_res = fft(X, axes=ax) + Y_res = fft(Y, axes=ax) + assert_allclose(X_res, Y_res, atol=_tol, rtol=_tol) + else: + raise ValueError() + + +@pytest.mark.skipif(IS_WASM, reason="Cannot start thread") +class TestFFTThreadSafe: + threads = 16 + input_shape = (800, 200) + + def _test_mtsame(self, func, *args): + def worker(args, q): + q.put(func(*args)) + + q = queue.Queue() + expected = func(*args) + + # Spin off a bunch of threads to call the same function simultaneously + t = [threading.Thread(target=worker, args=(args, q)) + for i in range(self.threads)] + [x.start() for x in t] + + [x.join() for x in t] + # Make sure all threads returned the correct value + for i in range(self.threads): + assert_array_equal(q.get(timeout=5), expected, + 'Function returned wrong value in multithreaded context') + + def test_fft(self): + a = np.ones(self.input_shape) * 1+0j + self._test_mtsame(np.fft.fft, a) + + def test_ifft(self): + a = np.ones(self.input_shape) * 1+0j + self._test_mtsame(np.fft.ifft, a) + + def test_rfft(self): + a = np.ones(self.input_shape) + self._test_mtsame(np.fft.rfft, a) + + def test_irfft(self): + a = np.ones(self.input_shape) * 1+0j + self._test_mtsame(np.fft.irfft, a) diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/arithmetic.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/arithmetic.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a0790f3e026c89ec0ee65c2fc331c3ea155a6478 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/arithmetic.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/array_constructors.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/array_constructors.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6132112d906103ad3bdff8cf906699f63057a14c Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/array_constructors.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/array_like.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/array_like.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f4c4ae1bf43317c17685c92c888facb5d40481db Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/array_like.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/arrayprint.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/arrayprint.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3f5b16c9da85afa470d99d9bab8ddb1df2f52c8a Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/arrayprint.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/arrayterator.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/arrayterator.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..976b3b945ec4eee8b50493fcb97482df90897b1a Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/arrayterator.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/bitwise_ops.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/bitwise_ops.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2de9d1c06cf7e419d26b4785692e8f39057071b3 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/bitwise_ops.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/comparisons.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/comparisons.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3badccaca5737aca6ac0e9c4f2b453d455b1a2a7 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/comparisons.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/dtype.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/dtype.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..62175906b0087c0b46128d19db3adf9b73febfa8 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/dtype.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/flatiter.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/flatiter.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..327d07ff29a4333b71d27eff90dd0d84e768ae2f Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/flatiter.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/fromnumeric.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/fromnumeric.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..09c7691dc0ff457d22372c0001f43d4098cc5006 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/fromnumeric.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/index_tricks.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/index_tricks.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ec26162ce455fc12c229565b3dc2444b3855652c Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/index_tricks.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/lib_utils.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/lib_utils.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7eafa2131d60f537c27e24323267848d185021ce Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/lib_utils.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/lib_version.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/lib_version.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d3d2e3bbad7cf27d09fb1f3a66607853b0c934f1 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/lib_version.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/literal.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/literal.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d6e3fc93ec5ee89c26d5cee81f53b48a3d51b720 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/literal.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/mod.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/mod.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..625dd3541d3a059f254a9c806343882a3abc6c6d Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/mod.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/modules.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/modules.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..12cbd9a87cae7673783506c1b278c7f8dba80ec1 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/modules.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/multiarray.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/multiarray.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..77dfb61bb36df70468a719ebdbb1c25ba318b4fe Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/multiarray.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/ndarray_conversion.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/ndarray_conversion.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3c0872a6f7bcbc0040b9eaf5278974e275df497a Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/ndarray_conversion.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/ndarray_shape_manipulation.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/ndarray_shape_manipulation.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4ad0ad564a3e346def54093cf0c0884d832fda44 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/ndarray_shape_manipulation.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/numerictypes.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/numerictypes.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7d8184f731baebd42d2a296dd564ba63b107d042 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/numerictypes.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/random.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/random.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..44f31b967fcfec70f435b75a5d6f8f6f2becbe20 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/random.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/scalars.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/scalars.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..40ad3cdac9a8fab187ada14fb7b687facd2c2b77 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/scalars.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/simple.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/simple.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5d018c06809979b79aa2a2669a5dc1561ebeb6fe Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/simple.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/simple_py3.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/simple_py3.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f94c14ccfd5b5f062a83966288626629ae0575e8 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/simple_py3.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/ufunc_config.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/ufunc_config.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a90d859360dcb3fa6e0f03890ca35f9c9601dc2d Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/ufunc_config.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/ufuncs.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/ufuncs.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ceeeb82a58306eab8e2f09ba8ded9f08dbf28daa Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/ufuncs.cpython-310.pyc differ diff --git a/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/warnings_and_errors.cpython-310.pyc b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/warnings_and_errors.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..92df8057c3811df752b798fd55146619ddbfaf89 Binary files /dev/null and b/data/tefig/envs/olmes-eval/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/warnings_and_errors.cpython-310.pyc differ