Skip to content

Offset is not updated when slicing memmaps #471

Closed
@GaelVaroquaux

Description

@GaelVaroquaux
>>> import numpy as np
>>> a = np.ones((10, 10))
>>> np.save('a.npy', a)
>>> b = np.load('a.npy', mmap_mode='r')
>>> c = b[3:]
>>> c.offset
80
>>> b.offset
80

The offset of c is wrong: it does not take in account the fact that the slicing has changed the offset.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions