On Sat, Sep 22, 2012 at 7:54 AM, Gael Varoquaux <
[email protected]> wrote:

> Hi list,
>
> I am struggling with offsets on the view of a memmaped array. Consider
> the following:
>
> import numpy as np
>
> a = np.memmap('tmp.mmap', dtype=np.float64, shape=50, mode='w+')
> a[:] = np.arange(50)
> b = a[10:]
>
> Here, I have a.offset == 0 and b.offset == 0. In practice, the data in b
> is offset compared to the start of the file, given that it is a view
> computed with an offset.
>
> My goal is, given b, to find a way to open a new view on the file, e.g.
> in a different process. For this I need the offset.
>
> Any idea of how I can retrieve it? In the previous numpy versions, I
> could go from b to a using the 'base' attribute of a. This is no longer
> possible.
>
> Also, should the above behavior be considered as a bug?
>

I think this is a bug, taking a view should probably update the offset.

Chuck
_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to