/opt/imh-python/lib/python3.9/site-packages/numpy/core/tests
NameSizeModeActions
data/-0755rm
examples/-0755rm
__pycache__/-0755rm
test_abc.py22200644editdlrm
test_api.py229950644editdlrm
test_argparse.py19690644editdlrm
test_arraymethod.py32440644editdlrm
test_arrayprint.py404620644editdlrm
test_array_coercion.py343790644editdlrm
test_array_interface.py77740644editdlrm
test_casting_floatingpoint_errors.py50630644editdlrm
test_casting_unittests.py342980644editdlrm
test_conversion_utils.py65590644editdlrm
test_cpu_dispatcher.py15210644editdlrm
test_cpu_features.py148580644editdlrm
test_custom_dtypes.py94010644editdlrm
test_cython.py34440644editdlrm
test_datetime.py1162110644editdlrm
test_defchararray.py249970644editdlrm
test_deprecations.py310760644editdlrm
test_dlpack.py35220644editdlrm
test_dtype.py754510644editdlrm
test_einsum.py537120644editdlrm
test_errstate.py22190644editdlrm
test_extint128.py56430644editdlrm
test_function_base.py155950644editdlrm
test_getlimits.py67180644editdlrm
test_half.py242260644editdlrm
test_hashtable.py10110644editdlrm
test_indexerrors.py51300644editdlrm
test_indexing.py543140644editdlrm
test_item_selection.py64580644editdlrm
test_limited_api.py11720644editdlrm
test_longdouble.py139050644editdlrm
test_machar.py10670644editdlrm
test_memmap.py74770644editdlrm
test_mem_overlap.py290860644editdlrm
test_mem_policy.py167800644editdlrm
test_multiarray.py3798270644editdlrm
test_nditer.py1308180644editdlrm
test_nep50_promotions.py88400644editdlrm
test_numeric.py1365430644editdlrm
test_numerictypes.py216870644editdlrm
test_overrides.py260800644editdlrm
test_print.py68370644editdlrm
test_protocols.py11680644editdlrm
test_records.py202690644editdlrm
test_regression.py915950644editdlrm
test_scalarbuffer.py55800644editdlrm
test_scalarinherit.py23680644editdlrm
test_scalarmath.py432470644editdlrm
test_scalarprint.py187710644editdlrm
test_scalar_ctors.py61150644editdlrm
test_scalar_methods.py75410644editdlrm
test_shape_base.py297230644editdlrm
test_simd.py486960644editdlrm
test_simd_module.py38050644editdlrm
test_strings.py38350644editdlrm
test_ufunc.py1248000644editdlrm
test_umath.py1856010644editdlrm
test_umath_accuracy.py38970644editdlrm
test_umath_complex.py232430644editdlrm
test_unicode.py127750644editdlrm
test__exceptions.py28460644editdlrm
_locales.py22060644editdlrm
__init__.py00644editdlrm
Edit: /opt/imh-python/lib/python3.9/site-packages/numpy/core/tests/test_cython.py (3444B)
import os import shutil import subprocess import sys import pytest import numpy as np from numpy.testing import IS_WASM # This import is copied from random.tests.test_extending try: import cython from Cython.Compiler.Version import version as cython_version except ImportError: cython = None else: from numpy._utils import _pep440 # Cython 0.29.30 is required for Python 3.11 and there are # other fixes in the 0.29 series that are needed even for earlier # Python versions. # Note: keep in sync with the one in pyproject.toml required_version = "0.29.30" if _pep440.parse(cython_version) < _pep440.Version(required_version): # too old or wrong cython, skip the test cython = None pytestmark = pytest.mark.skipif(cython is None, reason="requires cython") @pytest.fixture def install_temp(tmp_path): # Based in part on test_cython from random.tests.test_extending if IS_WASM: pytest.skip("No subprocess") srcdir = os.path.join(os.path.dirname(__file__), 'examples', 'cython') build_dir = tmp_path / "build" os.makedirs(build_dir, exist_ok=True) try: subprocess.check_call(["meson", "--version"]) except FileNotFoundError: pytest.skip("No usable 'meson' found") if sys.platform == "win32": subprocess.check_call(["meson", "setup", "--buildtype=release", "--vsenv", str(srcdir)], cwd=build_dir, ) else: subprocess.check_call(["meson", "setup", str(srcdir)], cwd=build_dir ) subprocess.check_call(["meson", "compile", "-vv"], cwd=build_dir) sys.path.append(str(build_dir)) def test_is_timedelta64_object(install_temp): import checks assert checks.is_td64(np.timedelta64(1234)) assert checks.is_td64(np.timedelta64(1234, "ns")) assert checks.is_td64(np.timedelta64("NaT", "ns")) assert not checks.is_td64(1) assert not checks.is_td64(None) assert not checks.is_td64("foo") assert not checks.is_td64(np.datetime64("now", "s")) def test_is_datetime64_object(install_temp): import checks assert checks.is_dt64(np.datetime64(1234, "ns")) assert checks.is_dt64(np.datetime64("NaT", "ns")) assert not checks.is_dt64(1) assert not checks.is_dt64(None) assert not checks.is_dt64("foo") assert not checks.is_dt64(np.timedelta64(1234)) def test_get_datetime64_value(install_temp): import checks dt64 = np.datetime64("2016-01-01", "ns") result = checks.get_dt64_value(dt64) expected = dt64.view("i8") assert result == expected def test_get_timedelta64_value(install_temp): import checks td64 = np.timedelta64(12345, "h") result = checks.get_td64_value(td64) expected = td64.view("i8") assert result == expected def test_get_datetime64_unit(install_temp): import checks dt64 = np.datetime64("2016-01-01", "ns") result = checks.get_dt64_unit(dt64) expected = 10 assert result == expected td64 = np.timedelta64(12345, "h") result = checks.get_dt64_unit(td64) expected = 5 assert result == expected def test_abstract_scalars(install_temp): import checks assert checks.is_integer(1) assert checks.is_integer(np.int8(1)) assert checks.is_integer(np.uint64(1))