file_path stringlengths 32 153 | content stringlengths 0 3.14M |
|---|---|
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_records.py | import collections.abc
import textwrap
from io import BytesIO
from os import path
from pathlib import Path
import pytest
import numpy as np
from numpy.testing import (
assert_, assert_equal, assert_array_equal, assert_array_almost_equal,
assert_raises, temppath,
)
from numpy.compat import pickle
class Te... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_scalarmath.py | import contextlib
import sys
import warnings
import itertools
import operator
import platform
from numpy.compat import _pep440
import pytest
from hypothesis import given, settings
from hypothesis.strategies import sampled_from
from hypothesis.extra import numpy as hynp
import numpy as np
from numpy.testing import (
... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_scalarinherit.py | """ Test printing of scalar types.
"""
import pytest
import numpy as np
from numpy.testing import assert_, assert_raises
class A:
pass
class B(A, np.float64):
pass
class C(B):
pass
class D(C, B):
pass
class B0(np.float64, A):
pass
class C0(B0):
pass
class HasNew:
def __new__(cls, *arg... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_scalar_methods.py | """
Test the scalar constructors, which also do type-coercion
"""
import sys
import fractions
import platform
import types
from typing import Any, Type
import pytest
import numpy as np
from numpy.testing import assert_equal, assert_raises
class TestAsIntegerRatio:
# derived in part from the cpython test "test_f... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_argparse.py | """
Tests for the private NumPy argument parsing functionality.
They mainly exists to ensure good test coverage without having to try the
weirder cases on actual numpy functions but test them in one place.
The test function is defined in C to be equivalent to (errors may not always
match exactly, and could be adjusted... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_numeric.py | import sys
import warnings
import itertools
import platform
import pytest
import math
from decimal import Decimal
import numpy as np
from numpy.core import umath
from numpy.random import rand, randint, randn
from numpy.testing import (
assert_, assert_equal, assert_raises, assert_raises_regex,
assert_array_equ... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_einsum.py | import itertools
import pytest
import numpy as np
from numpy.testing import (
assert_, assert_equal, assert_array_equal, assert_almost_equal,
assert_raises, suppress_warnings, assert_raises_regex, assert_allclose
)
# Setup for optimize einsum
chars = 'abcdefghij'
sizes = np.array([2, 3, 4, 5, 4, 3, 2, 6,... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_deprecations.py | """
Tests related to deprecation warnings. Also a convenient place
to document how deprecations should eventually be turned into errors.
"""
import datetime
import operator
import warnings
import pytest
import tempfile
import re
import sys
import numpy as np
from numpy.testing import (
assert_raises, assert_warns... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_print.py | import sys
import pytest
import numpy as np
from numpy.testing import assert_, assert_equal
from numpy.core.tests._locales import CommaDecimalPointLocale
from io import StringIO
_REF = {np.inf: 'inf', -np.inf: '-inf', np.nan: 'nan'}
@pytest.mark.parametrize('tp', [np.float32, np.double, np.longdouble])
def test_... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_api.py | import sys
import numpy as np
from numpy.core._rational_tests import rational
import pytest
from numpy.testing import (
assert_, assert_equal, assert_array_equal, assert_raises, assert_warns,
HAS_REFCOUNT
)
def test_array_array():
tobj = type(object)
ones11 = np.ones((1, 1), np.float64)
tnd... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_memmap.py | import sys
import os
import mmap
import pytest
from pathlib import Path
from tempfile import NamedTemporaryFile, TemporaryFile
from numpy import (
memmap, sum, average, product, ndarray, isscalar, add, subtract, multiply)
from numpy import arange, allclose, asarray
from numpy.testing import (
assert_, assert_... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_regression.py | import copy
import sys
import gc
import tempfile
import pytest
from os import path
from io import BytesIO
from itertools import chain
import numpy as np
from numpy.testing import (
assert_, assert_equal, IS_PYPY, assert_almost_equal,
assert_array_equal, assert_array_almost_equal, assert_raises,
... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_hashtable.py | import pytest
import random
from numpy.core._multiarray_tests import identityhash_tester
@pytest.mark.parametrize("key_length", [1, 3, 6])
@pytest.mark.parametrize("length", [1, 16, 2000])
def test_identity_hashtable(key_length, length):
# use a 30 object pool for everything (duplicates will happen)
pool = [... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/__init__.py | |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_umath_complex.py | import sys
import platform
import pytest
import numpy as np
# import the c-extension module directly since _arg is not exported via umath
import numpy.core._multiarray_umath as ncu
from numpy.testing import (
assert_raises, assert_equal, assert_array_equal, assert_almost_equal, assert_array_max_ulp
)
# TODO: ... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_scalar_ctors.py | """
Test the scalar constructors, which also do type-coercion
"""
import pytest
import numpy as np
from numpy.testing import (
assert_equal, assert_almost_equal, assert_warns,
)
class TestFromString:
def test_floating(self):
# Ticket #640, floats from string
fsingle = np.single('1.234')
... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_mem_overlap.py | import itertools
import pytest
import numpy as np
from numpy.core._multiarray_tests import solve_diophantine, internal_overlap
from numpy.core import _umath_tests
from numpy.lib.stride_tricks import as_strided
from numpy.testing import (
assert_, assert_raises, assert_equal, assert_array_equal
)
ndims = 2
si... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_nditer.py | import sys
import pytest
import textwrap
import subprocess
import numpy as np
import numpy.core._multiarray_tests as _multiarray_tests
from numpy import array, arange, nditer, all
from numpy.testing import (
assert_, assert_equal, assert_array_equal, assert_raises,
HAS_REFCOUNT, suppress_warnings, break_cycle... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_defchararray.py |
import numpy as np
from numpy.core.multiarray import _vec_string
from numpy.testing import (
assert_, assert_equal, assert_array_equal, assert_raises,
assert_raises_regex
)
kw_unicode_true = {'unicode': True} # make 2to3 work properly
kw_unicode_false = {'unicode': False}
class TestBasic:
def test_f... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_indexerrors.py | import numpy as np
from numpy.testing import (
assert_raises, assert_raises_regex,
)
class TestIndexErrors:
'''Tests to exercise indexerrors not covered by other tests.'''
def test_arraytypes_fasttake(self):
'take from a 0-length dimension'
x = np.empty((2, 3, 0, 4))
a... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_longdouble.py | import warnings
import pytest
import numpy as np
from numpy.testing import (
assert_, assert_equal, assert_raises, assert_warns, assert_array_equal,
temppath,
)
from numpy.core.tests._locales import CommaDecimalPointLocale
LD_INFO = np.finfo(np.longdouble)
longdouble_longer_than_double = (LD_INFO.eps < n... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_mem_policy.py | import asyncio
import gc
import os
import pytest
import numpy as np
import threading
import warnings
from numpy.testing import extbuild, assert_warns
import sys
@pytest.fixture
def get_module(tmp_path):
""" Add a memory policy that returns a false pointer 64 bytes into the
actual allocation, and fill the pref... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_cython.py | import os
import shutil
import subprocess
import sys
import pytest
import numpy as np
# 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.compat import _pep440
... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_limited_api.py | import os
import shutil
import subprocess
import sys
import sysconfig
import pytest
@pytest.mark.xfail(
sysconfig.get_config_var("Py_DEBUG"),
reason=(
"Py_LIMITED_API is incompatible with Py_DEBUG, Py_TRACE_REFS, "
"and Py_REF_DEBUG"
),
)
def test_limited_api(tmp_path):
"""Test buildin... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_umath.py | import platform
import warnings
import fnmatch
import itertools
import pytest
import sys
import os
import operator
from fractions import Fraction
from functools import reduce
from collections import namedtuple
import numpy.core.umath as ncu
from numpy.core import _umath_tests as ncu_tests
import numpy as np
from numpy... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_function_base.py | from numpy import (
logspace, linspace, geomspace, dtype, array, sctypes, arange, isnan,
ndarray, sqrt, nextafter, stack, errstate
)
from numpy.testing import (
assert_, assert_equal, assert_raises, assert_array_equal, assert_allclose,
)
class PhysicalQuantity(float):
def __new__(cls, value):
... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_shape_base.py | import pytest
import numpy as np
from numpy.core import (
array, arange, atleast_1d, atleast_2d, atleast_3d, block, vstack, hstack,
newaxis, concatenate, stack
)
from numpy.core.shape_base import (_block_dispatcher, _block_setup,
_block_concatenate, _block_slicing)
from nu... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_scalarprint.py | """ Test printing of scalar types.
"""
import code
import platform
import pytest
import sys
from tempfile import TemporaryFile
import numpy as np
from numpy.testing import assert_, assert_equal, assert_raises
class TestRealScalars:
def test_str(self):
svals = [0.0, -0.0, 1, -1, np.inf, -np.inf, np.nan]
... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_abc.py | from numpy.testing import assert_
import numbers
import numpy as np
from numpy.core.numerictypes import sctypes
class TestABC:
def test_abstract(self):
assert_(issubclass(np.number, numbers.Number))
assert_(issubclass(np.inexact, numbers.Complex))
assert_(issubclass(np.complexfloating, n... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_multiarray.py | import collections.abc
import tempfile
import sys
import warnings
import operator
import io
import itertools
import functools
import ctypes
import os
import gc
import weakref
import pytest
from contextlib import contextmanager
from numpy.compat import pickle
import pathlib
import builtins
from decimal import Decimal
... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_half.py | import platform
import pytest
import numpy as np
from numpy import uint16, float16, float32, float64
from numpy.testing import assert_, assert_equal
def assert_raises_fpe(strmatch, callable, *args, **kwargs):
try:
callable(*args, **kwargs)
except FloatingPointError as exc:
assert_(str(exc).fi... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_scalarbuffer.py | """
Test scalar buffer interface adheres to PEP 3118
"""
import numpy as np
from numpy.core._rational_tests import rational
from numpy.core._multiarray_tests import get_buffer_info
import pytest
from numpy.testing import assert_, assert_equal, assert_raises
# PEP3118 format strings for native (standard alignment and ... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_umath_accuracy.py | import numpy as np
import os
from os import path
import sys
import pytest
from ctypes import c_longlong, c_double, c_float, c_int, cast, pointer, POINTER
from numpy.testing import assert_array_max_ulp
from numpy.testing._private.utils import _glibc_older_than
from numpy.core._multiarray_umath import __cpu_features__
I... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_arrayprint.py | import sys
import gc
from hypothesis import given
from hypothesis.extra import numpy as hynp
import pytest
import numpy as np
from numpy.testing import (
assert_, assert_equal, assert_raises, assert_warns, HAS_REFCOUNT,
assert_raises_regex,
)
import textwrap
class TestArrayRepr:
def test_nan_inf(self)... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_casting_unittests.py | """
The tests exercise the casting machinery in a more low-level manner.
The reason is mostly to test a new implementation of the casting machinery.
Unlike most tests in NumPy, these are closer to unit-tests rather
than integration tests.
"""
import pytest
import textwrap
import enum
import random
import numpy as np... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_arraymethod.py | """
This file tests the generic aspects of ArrayMethod. At the time of writing
this is private API, but when added, public API may be added here.
"""
from __future__ import annotations
import sys
import types
from typing import Any
import pytest
import numpy as np
from numpy.core._multiarray_umath import _get_cast... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/_locales.py | """Provide class for testing in French locale
"""
import sys
import locale
import pytest
__ALL__ = ['CommaDecimalPointLocale']
def find_comma_decimal_point_locale():
"""See if platform has a decimal point as comma locale.
Find a locale that uses a comma instead of a period as the
decimal point.
R... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_simd_module.py | import pytest
from numpy.core._simd import targets
"""
This testing unit only for checking the sanity of common functionality,
therefore all we need is just to take one submodule that represents any
of enabled SIMD extensions to run the test on it and the second submodule
required to run only one check related to the p... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_conversion_utils.py | """
Tests for numpy/core/src/multiarray/conversion_utils.c
"""
import re
import sys
import pytest
import numpy as np
import numpy.core._multiarray_tests as mt
from numpy.testing import assert_warns, IS_PYPY
class StringConverterTestCase:
allow_bytes = True
case_insensitive = True
exact_match = False
... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_getlimits.py | """ Test functions for limits module.
"""
import warnings
import numpy as np
from numpy.core import finfo, iinfo
from numpy import half, single, double, longdouble
from numpy.testing import assert_equal, assert_, assert_raises
from numpy.core.getlimits import _discovered_machar, _float_ma
############################... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_cpu_dispatcher.py | from numpy.core._multiarray_umath import __cpu_features__, __cpu_baseline__, __cpu_dispatch__
from numpy.core import _umath_tests
from numpy.testing import assert_equal
def test_dispatcher():
"""
Testing the utilities of the CPU dispatcher
"""
targets = (
"SSE2", "SSE41", "AVX2",
"VSX",... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_unicode.py | import numpy as np
from numpy.testing import assert_, assert_equal, assert_array_equal
def buffer_length(arr):
if isinstance(arr, str):
if not arr:
charmax = 0
else:
charmax = max([ord(c) for c in arr])
if charmax < 256:
size = 1
elif charmax < 65... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_custom_dtypes.py | import pytest
import numpy as np
from numpy.testing import assert_array_equal
from numpy.core._multiarray_umath import (
_discover_array_parameters as discover_array_params, _get_sfloat_dtype)
SF = _get_sfloat_dtype()
class TestSFloat:
def _get_array(self, scaling, aligned=True):
if not aligned:
... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_extint128.py | import itertools
import contextlib
import operator
import pytest
import numpy as np
import numpy.core._multiarray_tests as mt
from numpy.testing import assert_raises, assert_equal
INT64_MAX = np.iinfo(np.int64).max
INT64_MIN = np.iinfo(np.int64).min
INT64_MID = 2**32
# int128 is not two's complement, the sign bit ... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_overrides.py | import inspect
import sys
import os
import tempfile
from io import StringIO
from unittest import mock
import numpy as np
from numpy.testing import (
assert_, assert_equal, assert_raises, assert_raises_regex)
from numpy.core.overrides import (
_get_implementing_args, array_function_dispatch,
verify_matching... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_dtype.py | import sys
import operator
import pytest
import ctypes
import gc
import types
from typing import Any
import numpy as np
from numpy.core._rational_tests import rational
from numpy.core._multiarray_tests import create_custom_field_dtype
from numpy.testing import (
assert_, assert_equal, assert_array_equal, assert_ra... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_numerictypes.py | import sys
import itertools
import pytest
import numpy as np
from numpy.testing import assert_, assert_equal, assert_raises, IS_PYPY
# This is the structure of the table used for plain objects:
#
# +-+-+-+
# |x|y|z|
# +-+-+-+
# Structure of a plain array description:
Pdescr = [
('x', 'i4', (2,)),
('y', 'f8',... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_array_coercion.py | """
Tests for array coercion, mainly through testing `np.array` results directly.
Note that other such tests exist e.g. in `test_api.py` and many corner-cases
are tested (sometimes indirectly) elsewhere.
"""
import pytest
from pytest import param
from itertools import product
import numpy as np
from numpy.core._rati... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_datetime.py |
import numpy
import numpy as np
import datetime
import pytest
from numpy.testing import (
assert_, assert_equal, assert_raises, assert_warns, suppress_warnings,
assert_raises_regex, assert_array_equal,
)
from numpy.compat import pickle
# Use pytz to test out various time zones if available
try:
from p... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_dlpack.py | import sys
import pytest
import numpy as np
from numpy.testing import assert_array_equal, IS_PYPY
class TestDLPack:
@pytest.mark.skipif(IS_PYPY, reason="PyPy can't get refcounts.")
def test_dunder_dlpack_refcount(self):
x = np.arange(5)
y = x.__dlpack__()
assert sys.getrefcount(x) == ... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_machar.py | """
Test machar. Given recent changes to hardcode type data, we might want to get
rid of both MachAr and this test at some point.
"""
from numpy.core._machar import MachAr
import numpy.core.numerictypes as ntypes
from numpy import errstate, array
class TestMachAr:
def _run_machar_highprec(self):
# Instan... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_cpu_features.py | import sys, platform, re, pytest
from numpy.core._multiarray_umath import __cpu_features__
def assert_features_equal(actual, desired, fname):
__tracebackhide__ = True # Hide traceback for py.test
actual, desired = str(actual), str(desired)
if actual == desired:
return
detected = str(__cpu_feat... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_ufunc.py | import warnings
import itertools
import sys
import pytest
import numpy as np
import numpy.core._umath_tests as umt
import numpy.linalg._umath_linalg as uml
import numpy.core._operand_flag_tests as opflag_tests
import numpy.core._rational_tests as _rational_tests
from numpy.testing import (
assert_, assert_equal, ... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_array_interface.py | import sys
import pytest
import numpy as np
from numpy.testing import extbuild
@pytest.fixture
def get_module(tmp_path):
""" Some codes to generate data and manage temporary buffers use when
sharing with numpy via the array interface protocol.
"""
if not sys.platform.startswith('linux'):
pyte... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test__exceptions.py | """
Tests of the ._exceptions module. Primarily for exercising the __str__ methods.
"""
import pickle
import pytest
import numpy as np
_ArrayMemoryError = np.core._exceptions._ArrayMemoryError
_UFuncNoLoopError = np.core._exceptions._UFuncNoLoopError
class TestArrayMemoryError:
def test_pickling(self):
... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_item_selection.py | import sys
import numpy as np
from numpy.testing import (
assert_, assert_raises, assert_array_equal, HAS_REFCOUNT
)
class TestTake:
def test_simple(self):
a = [[1, 2], [3, 4]]
a_str = [[b'1', b'2'], [b'3', b'4']]
modes = ['raise', 'wrap', 'clip']
indices = [-1, 4]
... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_protocols.py | import pytest
import warnings
import numpy as np
@pytest.mark.filterwarnings("error")
def test_getattr_warning():
# issue gh-14735: make sure we clear only getattr errors, and let warnings
# through
class Wrapper:
def __init__(self, array):
self.array = array
def __len__(self)... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/test_indexing.py | import sys
import warnings
import functools
import operator
import pytest
import numpy as np
from numpy.core._multiarray_tests import array_indexing
from itertools import product
from numpy.testing import (
assert_, assert_equal, assert_raises, assert_raises_regex,
assert_array_equal, assert_warns, HAS_REFCOU... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/examples/limited_api/setup.py | """
Build an example package using the limited Python C API.
"""
import numpy as np
from setuptools import setup, Extension
import os
macros = [("NPY_NO_DEPRECATED_API", 0), ("Py_LIMITED_API", "0x03060000")]
limited_api = Extension(
"limited_api",
sources=[os.path.join('.', "limited_api.c")],
include_dir... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/examples/limited_api/limited_api.c | #define Py_LIMITED_API 0x03060000
#include <Python.h>
#include <numpy/arrayobject.h>
#include <numpy/ufuncobject.h>
static PyModuleDef moduledef = {
.m_base = PyModuleDef_HEAD_INIT,
.m_name = "limited_api"
};
PyMODINIT_FUNC PyInit_limited_api(void)
{
import_array();
import_umath();
return PyModul... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/examples/cython/setup.py | """
Provide python-space access to the functions exposed in numpy/__init__.pxd
for testing.
"""
import numpy as np
from distutils.core import setup
from Cython.Build import cythonize
from setuptools.extension import Extension
import os
macros = [("NPY_NO_DEPRECATED_API", 0)]
checks = Extension(
"checks",
sou... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/data/umath-validation-set-README.txt | Steps to validate transcendental functions:
1) Add a file 'umath-validation-set-<ufuncname>.txt', where ufuncname is name of
the function in NumPy you want to validate
2) The file should contain 4 columns: dtype,input,expected output,ulperror
a. dtype: one of np.float16, np.float32, np.float64
b. input: floa... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/core/tests/data/generate_umath_validation_data.cpp | #include <algorithm>
#include <fstream>
#include <iostream>
#include <cmath>
#include <random>
#include <cstdio>
#include <ctime>
#include <vector>
struct ufunc {
std::string name;
double (*f32func)(double);
long double (*f64func)(long double);
float f32ulp;
float f64ulp;
};
template <typename T>
... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/compat/__init__.py | """
Compatibility module.
This module contains duplicated code from Python itself or 3rd party
extensions, which may be included for the following reasons:
* compatibility
* we may only need a small subset of the copied library/module
"""
from . import _inspect
from . import _pep440
from . import py3k
from ._ins... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/compat/setup.py | def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('compat', parent_package, top_path)
config.add_subpackage('tests')
return config
if __name__ == '__main__':
from numpy.distutils.core import setup
setup(configuration=... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/compat/_pep440.py | """Utility to compare pep440 compatible version strings.
The LooseVersion and StrictVersion classes that distutils provides don't
work; they don't recognize anything like alpha/beta/rc/dev versions.
"""
# Copyright (c) Donald Stufft and individual contributors.
# All rights reserved.
# Redistribution and use in sour... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/compat/_inspect.py | """Subset of inspect module from upstream python
We use this instead of upstream because upstream inspect is slow to import, and
significantly contributes to numpy import times. Importing this copy has almost
no overhead.
"""
import types
__all__ = ['getargspec', 'formatargspec']
# ---------------------------------... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/compat/py3k.py | """
Python 3.X compatibility tools.
While this file was originally intended for Python 2 -> 3 transition,
it is now used to create a compatibility layer between different
minor versions of Python 3.
While the active version of numpy may not support a given version of python, we
allow downstream libraries to continue ... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/compat/tests/__init__.py | |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/compat/tests/test_compat.py | from os.path import join
from numpy.compat import isfileobj
from numpy.testing import assert_
from numpy.testing import tempdir
def test_isfileobj():
with tempdir(prefix="numpy_test_compat_") as folder:
filename = join(folder, 'a.bin')
with open(filename, 'wb') as f:
assert_(isfileob... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/fft/helper.pyi | from typing import Any, TypeVar, overload
from numpy import generic, integer, floating, complexfloating
from numpy._typing import (
NDArray,
ArrayLike,
_ShapeLike,
_ArrayLike,
_ArrayLikeFloat_co,
_ArrayLikeComplex_co,
)
_SCT = TypeVar("_SCT", bound=generic)
__all__: list[str]
@overload
def f... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/fft/__init__.py | """
Discrete Fourier Transform (:mod:`numpy.fft`)
=============================================
.. currentmodule:: numpy.fft
The SciPy module `scipy.fft` is a more comprehensive superset
of ``numpy.fft``, which includes only a basic set of routines.
Standard FFTs
-------------
.. autosummary::
:toctree: generate... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/fft/setup.py | import sys
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('fft', parent_package, top_path)
config.add_subpackage('tests')
# AIX needs to be told to use large file support - at all times
defs = [('_LARGE_FILES', None)]... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/fft/_pocketfft.py | """
Discrete Fourier Transforms
Routines in this module:
fft(a, n=None, axis=-1, norm="backward")
ifft(a, n=None, axis=-1, norm="backward")
rfft(a, n=None, axis=-1, norm="backward")
irfft(a, n=None, axis=-1, norm="backward")
hfft(a, n=None, axis=-1, norm="backward")
ihfft(a, n=None, axis=-1, norm="backward")
fftn(a, ... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/fft/_pocketfft.pyi | from collections.abc import Sequence
from typing import Literal as L
from numpy import complex128, float64
from numpy._typing import ArrayLike, NDArray, _ArrayLikeNumber_co
_NormKind = L[None, "backward", "ortho", "forward"]
__all__: list[str]
def fft(
a: ArrayLike,
n: None | int = ...,
axis: int = ...,... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/fft/__init__.pyi | from numpy._pytesttester import PytestTester
from numpy.fft._pocketfft import (
fft as fft,
ifft as ifft,
rfft as rfft,
irfft as irfft,
hfft as hfft,
ihfft as ihfft,
rfftn as rfftn,
irfftn as irfftn,
rfft2 as rfft2,
irfft2 as irfft2,
fft2 as fft2,
ifft2 as ifft2,
fft... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/fft/helper.py | """
Discrete Fourier Transforms - helper.py
"""
from numpy.core import integer, empty, arange, asarray, roll
from numpy.core.overrides import array_function_dispatch, set_module
# Created by Pearu Peterson, September 2002
__all__ = ['fftshift', 'ifftshift', 'fftfreq', 'rfftfreq']
integer_types = (int, integer)
de... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/fft/tests/test_pocketfft.py | import numpy as np
import pytest
from numpy.random import random
from numpy.testing import (
assert_array_equal, assert_raises, assert_allclose
)
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
r... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/fft/tests/__init__.py | |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/fft/tests/test_helper.py | """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,... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/linalg/linalg.py | """Lite version of scipy.linalg.
Notes
-----
This module is a lite version of the linalg.py module in SciPy which
contains high-level Python interface to the LAPACK library. The lite
version only accesses the following LAPACK functions: dgesv, zgesv,
dgeev, zgeev, dgesdd, zgesdd, dgelsd, zgelsd, dsyevd, zheevd, dgetr... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/linalg/linalg.pyi | from collections.abc import Iterable
from typing import (
Literal as L,
overload,
TypeVar,
Any,
SupportsIndex,
SupportsInt,
)
from numpy import (
generic,
floating,
complexfloating,
int32,
float64,
complex128,
)
from numpy.linalg import LinAlgError as LinAlgError
from ... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/linalg/__init__.py | """
``numpy.linalg``
================
The NumPy linear algebra functions rely on BLAS and LAPACK to provide efficient
low level implementations of standard linear algebra algorithms. Those
libraries may be provided by NumPy itself using C versions of a subset of their
reference implementations but, when possible, high... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/linalg/setup.py | import os
import sys
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.ccompiler_opt import NPY_CXX_FLAGS
from numpy.distutils.system_info import get_info, system_info
config = Configuration('linalg', parent_package, top_path)
... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/linalg/__init__.pyi | from numpy.linalg.linalg import (
matrix_power as matrix_power,
solve as solve,
tensorsolve as tensorsolve,
tensorinv as tensorinv,
inv as inv,
cholesky as cholesky,
eigvals as eigvals,
eigvalsh as eigvalsh,
pinv as pinv,
slogdet as slogdet,
det as det,
svd as svd,
ei... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/linalg/tests/test_deprecations.py | """Test deprecation and future warnings.
"""
import numpy as np
from numpy.testing import assert_warns
def test_qr_mode_full_future_warning():
"""Check mode='full' FutureWarning.
In numpy 1.8 the mode options 'full' and 'economic' in linalg.qr were
deprecated. The release date will probably be sometime ... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/linalg/tests/test_regression.py | """ Test functions for linalg module
"""
import warnings
import numpy as np
from numpy import linalg, arange, float64, array, dot, transpose
from numpy.testing import (
assert_, assert_raises, assert_equal, assert_array_equal,
assert_array_almost_equal, assert_array_less
)
class TestRegression:
def test... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/linalg/tests/__init__.py | |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/linalg/tests/test_linalg.py | """ Test functions for linalg module
"""
import os
import sys
import itertools
import traceback
import textwrap
import subprocess
import pytest
import numpy as np
from numpy import array, single, double, csingle, cdouble, dot, identity, matmul
from numpy.core import swapaxes
from numpy import multiply, atleast_2d, in... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/_typing/_add_docstring.py | """A module for creating docstrings for sphinx ``data`` domains."""
import re
import textwrap
from ._generic_alias import NDArray
_docstrings_list = []
def add_newdoc(name: str, value: str, doc: str) -> None:
"""Append ``_docstrings_list`` with a docstring for `name`.
Parameters
----------
name : ... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/_typing/_callable.pyi | """
A module with various ``typing.Protocol`` subclasses that implement
the ``__call__`` magic method.
See the `Mypy documentation`_ on protocols for more details.
.. _`Mypy documentation`: https://mypy.readthedocs.io/en/stable/protocols.html#callback-protocols
"""
from __future__ import annotations
from typing im... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/_typing/_nbit.py | """A module with the precisions of platform-specific `~numpy.number`s."""
from typing import Any
# To-be replaced with a `npt.NBitBase` subclass by numpy's mypy plugin
_NBitByte = Any
_NBitShort = Any
_NBitIntC = Any
_NBitIntP = Any
_NBitInt = Any
_NBitLongLong = Any
_NBitHalf = Any
_NBitSingle = Any
_NBitDouble = A... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/_typing/_dtype_like.py | from typing import (
Any,
List,
Sequence,
Tuple,
Union,
Type,
TypeVar,
Protocol,
TypedDict,
runtime_checkable,
)
import numpy as np
from ._shape import _ShapeLike
from ._generic_alias import _DType as DType
from ._char_codes import (
_BoolCodes,
_UInt8Codes,
_UInt1... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/_typing/_char_codes.py | from typing import Literal
_BoolCodes = Literal["?", "=?", "<?", ">?", "bool", "bool_", "bool8"]
_UInt8Codes = Literal["uint8", "u1", "=u1", "<u1", ">u1"]
_UInt16Codes = Literal["uint16", "u2", "=u2", "<u2", ">u2"]
_UInt32Codes = Literal["uint32", "u4", "=u4", "<u4", ">u4"]
_UInt64Codes = Literal["uint64", "u8", "=u8... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/_typing/_generic_alias.py | from __future__ import annotations
import sys
import types
from collections.abc import Generator, Iterable, Iterator
from typing import (
Any,
ClassVar,
NoReturn,
TypeVar,
TYPE_CHECKING,
)
import numpy as np
__all__ = ["_GenericAlias", "NDArray"]
_T = TypeVar("_T", bound="_GenericAlias")
def _... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/_typing/_scalars.py | from typing import Union, Tuple, Any
import numpy as np
# NOTE: `_StrLike_co` and `_BytesLike_co` are pointless, as `np.str_` and
# `np.bytes_` are already subclasses of their builtin counterpart
_CharLike_co = Union[str, bytes]
# The 6 `<X>Like_co` type-aliases below represent all scalars that can be
# coerced int... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/_typing/_ufunc.pyi | """A module with private type-check-only `numpy.ufunc` subclasses.
The signatures of the ufuncs are too varied to reasonably type
with a single class. So instead, `ufunc` has been expanded into
four private subclasses, one for each combination of
`~ufunc.nin` and `~ufunc.nout`.
"""
from typing import (
Any,
... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/_typing/__init__.py | """Private counterpart of ``numpy.typing``."""
from __future__ import annotations
from numpy import ufunc
from numpy.core.overrides import set_module
from typing import TYPE_CHECKING, final
@final # Disallow the creation of arbitrary `NBitBase` subclasses
@set_module("numpy.typing")
class NBitBase:
"""
A t... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/_typing/setup.py | def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('_typing', parent_package, top_path)
config.add_data_files('*.pyi')
return config
if __name__ == '__main__':
from numpy.distutils.core import setup
setup(configuratio... |
omniverse-code/kit/exts/omni.kit.pip_archive/pip_prebundle/numpy/_typing/_nested_sequence.py | """A module containing the `_NestedSequence` protocol."""
from __future__ import annotations
from typing import (
Any,
Iterator,
overload,
TypeVar,
Protocol,
runtime_checkable,
)
__all__ = ["_NestedSequence"]
_T_co = TypeVar("_T_co", covariant=True)
@runtime_checkable
class _NestedSequence... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.