diff options
author | nik-bes <nik-bes@yandex-team.com> | 2025-05-19 07:20:13 +0300 |
---|---|---|
committer | nik-bes <nik-bes@yandex-team.com> | 2025-05-19 07:36:02 +0300 |
commit | 317b7368e24941ff76499f500579fd9b10f6656e (patch) | |
tree | abbcbaea595e7d2e9f23cf59a408b3082fe4340d /contrib/python/numpy | |
parent | 6b666a52d40308ab9b3532cd8d3008b9f37cfffb (diff) | |
download | ydb-317b7368e24941ff76499f500579fd9b10f6656e.tar.gz |
Update Cython to 3.0.10.
commit_hash:b43c96b868cd36d636192fd2c6024d9f0d2fb6f8
Diffstat (limited to 'contrib/python/numpy')
-rw-r--r-- | contrib/python/numpy/py2/numpy/random/__init__.py | 2 | ||||
-rw-r--r-- | contrib/python/numpy/py2/numpy/random/mtrand/mtrand.pyx | 8 | ||||
-rw-r--r-- | contrib/python/numpy/py2/patches/fix_cython_import.patch | 49 |
3 files changed, 54 insertions, 5 deletions
diff --git a/contrib/python/numpy/py2/numpy/random/__init__.py b/contrib/python/numpy/py2/numpy/random/__init__.py index 965ab5ea9b7..1458c8d8f9f 100644 --- a/contrib/python/numpy/py2/numpy/random/__init__.py +++ b/contrib/python/numpy/py2/numpy/random/__init__.py @@ -146,7 +146,7 @@ with warnings.catch_warnings(): ranf = random = sample = random_sample __all__.extend(['ranf', 'random', 'sample']) -def __RandomState_ctor(): +def _RandomState_ctor(): """Return a RandomState instance. This function exists solely to assist (un)pickling. diff --git a/contrib/python/numpy/py2/numpy/random/mtrand/mtrand.pyx b/contrib/python/numpy/py2/numpy/random/mtrand/mtrand.pyx index 08312da552f..7d82b9f8cfa 100644 --- a/contrib/python/numpy/py2/numpy/random/mtrand/mtrand.pyx +++ b/contrib/python/numpy/py2/numpy/random/mtrand/mtrand.pyx @@ -813,7 +813,7 @@ cdef class RandomState: self.set_state(state) def __reduce__(self): - return (np.random.__RandomState_ctor, (), self.get_state()) + return (np.random._RandomState_ctor, (), self.get_state()) # Basic distributions: def random_sample(self, size=None): @@ -990,7 +990,7 @@ cdef class RandomState: raise ValueError("high is out of bounds for %s" % dtype) if ilow >= ihigh and np.prod(size) != 0: raise ValueError("Range cannot be empty (low >= high) unless no samples are taken") - + with self.lock: ret = randfunc(ilow, ihigh - 1, size, self.state_address) @@ -4919,7 +4919,7 @@ cdef class RandomState: return arr arr = np.asarray(x) - + # shuffle has fast-path for 1-d if arr.ndim == 1: # Return a copy if same memory @@ -4932,7 +4932,7 @@ cdef class RandomState: idx = np.arange(arr.shape[0], dtype=np.intp) self.shuffle(idx) return arr[idx] - + _rand = RandomState() seed = _rand.seed diff --git a/contrib/python/numpy/py2/patches/fix_cython_import.patch b/contrib/python/numpy/py2/patches/fix_cython_import.patch new file mode 100644 index 00000000000..ac10dc0eabc --- /dev/null +++ b/contrib/python/numpy/py2/patches/fix_cython_import.patch @@ -0,0 +1,49 @@ +--- contrib/python/numpy/py2/numpy/random/__init__.py (index) ++++ contrib/python/numpy/py2/numpy/random/__init__.py (working tree) +@@ -146,7 +146,7 @@ with warnings.catch_warnings(): + ranf = random = sample = random_sample + __all__.extend(['ranf', 'random', 'sample']) + +-def __RandomState_ctor(): ++def _RandomState_ctor(): + """Return a RandomState instance. + + This function exists solely to assist (un)pickling. +--- contrib/python/numpy/py2/numpy/random/mtrand/mtrand.pyx (index) ++++ contrib/python/numpy/py2/numpy/random/mtrand/mtrand.pyx (working tree) +@@ -813,7 +813,7 @@ cdef class RandomState: + self.set_state(state) + + def __reduce__(self): +- return (np.random.__RandomState_ctor, (), self.get_state()) ++ return (np.random._RandomState_ctor, (), self.get_state()) + + # Basic distributions: + def random_sample(self, size=None): +@@ -990,7 +990,7 @@ cdef class RandomState: + raise ValueError("high is out of bounds for %s" % dtype) + if ilow >= ihigh and np.prod(size) != 0: + raise ValueError("Range cannot be empty (low >= high) unless no samples are taken") +- ++ + with self.lock: + ret = randfunc(ilow, ihigh - 1, size, self.state_address) + +@@ -4919,7 +4919,7 @@ cdef class RandomState: + return arr + + arr = np.asarray(x) +- ++ + # shuffle has fast-path for 1-d + if arr.ndim == 1: + # Return a copy if same memory +@@ -4932,7 +4932,7 @@ cdef class RandomState: + idx = np.arange(arr.shape[0], dtype=np.intp) + self.shuffle(idx) + return arr[idx] +- ++ + + _rand = RandomState() + seed = _rand.seed |