MCPcopy Create free account
hub / github.com/numpy/numpy / test_memmap_subclass

Method test_memmap_subclass

numpy/core/tests/test_memmap.py:182–194  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

180 assert_(fp[[0, 1]].__class__ is ndarray)
181
182 def test_memmap_subclass(self):
183 class MemmapSubClass(memmap):
184 pass
185
186 fp = MemmapSubClass(self.tmpfp, dtype=self.dtype, shape=self.shape)
187 fp[:] = self.data
188
189 # We keep previous behavior for subclasses of memmap, i.e. the
190 # ufunc and __getitem__ output is never turned into a ndarray
191 assert_(sum(fp, axis=0).__class__ is MemmapSubClass)
192 assert_(sum(fp).__class__ is MemmapSubClass)
193 assert_(fp[1:, :-1].__class__ is MemmapSubClass)
194 assert(fp[[0, 1]].__class__ is MemmapSubClass)
195
196 def test_mmap_offset_greater_than_allocation_granularity(self):
197 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