PATH: //opt/cloudlinux/venv/lib/python3.11/site-packages/numpy/lib/tests
FILE_BARU
CREATE
FOLDER_BARU
MKDIR
UPLOAD_FILE
GO
[ .. KEMBALI ]
📄 __init__.py
↓
X
📁 __pycache__/
X
📁 data/
X
📄 test__datasource.py
↓
X
📄 test__iotools.py
↓
X
📄 test__version.py
↓
X
📄 test_arraypad.py
↓
X
📄 test_arraysetops.py
↓
X
📄 test_arrayterator.py
↓
X
📄 test_financial_expired.py
↓
X
📄 test_format.py
↓
X
📄 test_function_base.py
↓
X
📄 test_histograms.py
↓
X
📄 test_index_tricks.py
↓
X
📄 test_io.py
↓
X
📄 test_loadtxt.py
↓
X
📄 test_mixins.py
↓
X
📄 test_nanfunctions.py
↓
X
📄 test_packbits.py
↓
X
📄 test_polynomial.py
↓
X
📄 test_recfunctions.py
↓
X
📄 test_regression.py
↓
X
📄 test_shape_base.py
↓
X
📄 test_stride_tricks.py
↓
X
📄 test_twodim_base.py
↓
X
📄 test_type_check.py
↓
X
📄 test_ufunclike.py
↓
X
📄 test_utils.py
↓
X
SAVING...
BERHASIL DIUBAH!
EDITING: test_arrayterator.py
from operator import mul from functools import reduce import numpy as np from numpy.random import randint from numpy.lib import Arrayterator from numpy.testing import assert_ def test(): np.random.seed(np.arange(10)) # Create a random array ndims = randint(5)+1 shape = tuple(randint(10)+1 for dim in range(ndims)) els = reduce(mul, shape) a = np.arange(els) a.shape = shape buf_size = randint(2*els) b = Arrayterator(a, buf_size) # Check that each block has at most ``buf_size`` elements for block in b: assert_(len(block.flat) <= (buf_size or els)) # Check that all elements are iterated correctly assert_(list(b.flat) == list(a.flat)) # Slice arrayterator start = [randint(dim) for dim in shape] stop = [randint(dim)+1 for dim in shape] step = [randint(dim)+1 for dim in shape] slice_ = tuple(slice(*t) for t in zip(start, stop, step)) c = b[slice_] d = a[slice_] # Check that each block has at most ``buf_size`` elements for block in c: assert_(len(block.flat) <= (buf_size or els)) # Check that the arrayterator is sliced correctly assert_(np.all(c.__array__() == d)) # Check that all elements are iterated correctly assert_(list(c.flat) == list(d.flat))
SIMPAN PERUBAHAN