MCPcopy Index your code
hub / github.com/numpy/numpy / test_memmap_subclass

Method test_memmap_subclass

numpy/_core/tests/test_memmap.py:190–202  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

188 assert_(fp[[0, 1]].__class__ is ndarray)
189
190 def test_memmap_subclass(self):
191 class MemmapSubClass(memmap):
192 pass
193
194 fp = MemmapSubClass(self.tmpfp, dtype=self.dtype, shape=self.shape)
195 fp[:] = self.data
196
197 # We keep previous behavior for subclasses of memmap, i.e. the
198 # ufunc and __getitem__ output is never turned into an ndarray
199 assert_(sum(fp, axis=0).__class__ is MemmapSubClass)
200 assert_(sum(fp).__class__ is MemmapSubClass)
201 assert_(fp[1:, :-1].__class__ is MemmapSubClass)
202 assert fp[[0, 1]].__class__ is MemmapSubClass
203
204 def test_mmap_offset_greater_than_allocation_granularity(self):
205 size = 5 * mmap.ALLOCATIONGRANULARITY

Callers

nothing calls this directly

Calls 3

assert_Function · 0.90
sumFunction · 0.90
MemmapSubClassClass · 0.85

Tested by

no test coverage detected