diff options
author | Sebastian Berg <sebastianb@nvidia.com> | 2022-11-18 15:11:25 +0100 |
---|---|---|
committer | Sebastian Berg <sebastianb@nvidia.com> | 2022-11-24 17:03:42 +0100 |
commit | 7c361420b4f81713f593ebbb5c924121c1f2d19d (patch) | |
tree | 4fa5c173c3e4df5dfdb9b14b9b0988db0bc69e91 /numpy/lib | |
parent | 72af24df557802015820714aaa3d105d53216431 (diff) | |
download | numpy-7c361420b4f81713f593ebbb5c924121c1f2d19d.tar.gz |
MAINT: Move set_module to numpy.core to use without C import
Diffstat (limited to 'numpy/lib')
-rw-r--r-- | numpy/lib/_datasource.py | 2 | ||||
-rw-r--r-- | numpy/lib/function_base.py | 6 | ||||
-rw-r--r-- | numpy/lib/index_tricks.py | 2 | ||||
-rw-r--r-- | numpy/lib/polynomial.py | 3 | ||||
-rw-r--r-- | numpy/lib/type_check.py | 2 | ||||
-rw-r--r-- | numpy/lib/utils.py | 2 |
6 files changed, 9 insertions, 8 deletions
diff --git a/numpy/lib/_datasource.py b/numpy/lib/_datasource.py index b7778234e..613733fa5 100644 --- a/numpy/lib/_datasource.py +++ b/numpy/lib/_datasource.py @@ -37,7 +37,7 @@ Example:: import os import io -from numpy.core.overrides import set_module +from .._utils import set_module _open = open diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index 5f59254b6..0ab49fa11 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -4,6 +4,7 @@ import re import sys import warnings +from .._utils import set_module import numpy as np import numpy.core.numeric as _nx from numpy.core import transpose @@ -19,7 +20,6 @@ from numpy.core.fromnumeric import ( ravel, nonzero, partition, mean, any, sum ) from numpy.core.numerictypes import typecodes -from numpy.core.overrides import set_module from numpy.core import overrides from numpy.core.function_base import add_newdoc from numpy.lib.twodim_base import diag @@ -4017,7 +4017,7 @@ def percentile(a, since Python uses 0-based indexing, the code subtracts another 1 from the index internally. - The following formula determines the virtual index ``i + g``, the location + The following formula determines the virtual index ``i + g``, the location of the percentile in the sorted sample: .. math:: @@ -4306,7 +4306,7 @@ def quantile(a, since Python uses 0-based indexing, the code subtracts another 1 from the index internally. - The following formula determines the virtual index ``i + g``, the location + The following formula determines the virtual index ``i + g``, the location of the quantile in the sorted sample: .. math:: diff --git a/numpy/lib/index_tricks.py b/numpy/lib/index_tricks.py index 95d5e3ede..58dd394e1 100644 --- a/numpy/lib/index_tricks.py +++ b/numpy/lib/index_tricks.py @@ -3,6 +3,7 @@ import sys import math import warnings +from .._utils import set_module import numpy.core.numeric as _nx from numpy.core.numeric import ( asarray, ScalarType, array, alltrue, cumprod, arange, ndim @@ -12,7 +13,6 @@ from numpy.core.numerictypes import find_common_type, issubdtype import numpy.matrixlib as matrixlib from .function_base import diff from numpy.core.multiarray import ravel_multi_index, unravel_index -from numpy.core.overrides import set_module from numpy.core import overrides, linspace from numpy.lib.stride_tricks import as_strided diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py index 6aa708861..0f7ab0334 100644 --- a/numpy/lib/polynomial.py +++ b/numpy/lib/polynomial.py @@ -9,12 +9,13 @@ __all__ = ['poly', 'roots', 'polyint', 'polyder', 'polyadd', import functools import re import warnings + +from .._utils import set_module import numpy.core.numeric as NX from numpy.core import (isscalar, abs, finfo, atleast_1d, hstack, dot, array, ones) from numpy.core import overrides -from numpy.core.overrides import set_module from numpy.lib.twodim_base import diag, vander from numpy.lib.function_base import trim_zeros from numpy.lib.type_check import iscomplex, real, imag, mintypecode diff --git a/numpy/lib/type_check.py b/numpy/lib/type_check.py index 94d525f51..0dc014d76 100644 --- a/numpy/lib/type_check.py +++ b/numpy/lib/type_check.py @@ -9,9 +9,9 @@ __all__ = ['iscomplexobj', 'isrealobj', 'imag', 'iscomplex', 'typename', 'asfarray', 'mintypecode', 'common_type'] +from .._utils import set_module import numpy.core.numeric as _nx from numpy.core.numeric import asarray, asanyarray, isnan, zeros -from numpy.core.overrides import set_module from numpy.core import overrides from .ufunclike import isneginf, isposinf diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py index afde8cc60..2a9d30b16 100644 --- a/numpy/lib/utils.py +++ b/numpy/lib/utils.py @@ -6,8 +6,8 @@ import re import warnings import functools +from .._utils import set_module from numpy.core.numerictypes import issubclass_, issubsctype, issubdtype -from numpy.core.overrides import set_module from numpy.core import ndarray, ufunc, asarray import numpy as np |