Re: [Numpy-discussion] Masked arrays and pickle/unpickle

2008-11-07 Thread Hans Meine
On Thursday 17 July 2008 19:41:51 Anthony Floyd wrote: > > > What I need to know is how I can trick pickle or Numpy to > > > > put the old class into the new class. > > > > If you have an example data-file, send it to me off-list and I'll > > figure out what to do. Maybe it is as simple as > > > >

Re: [Numpy-discussion] Masked arrays and pickle/unpickle

2008-07-17 Thread Mark Miller
On Thu, Jul 17, 2008 at 3:18 PM, Pierre GM <[EMAIL PROTECTED]> wrote: > > Dang, forgot about that. Having a dictionary of options would be cool, but > we > can't store it inside a regular ndarray. If we write to a file, we may want > to write a header first that would store all the metadata we nee

Re: [Numpy-discussion] Masked arrays and pickle/unpickle

2008-07-17 Thread Pierre GM
On Thursday 17 July 2008 16:29:48 Stéfan van der Walt wrote: > > An other possibility is to store the MaskedArray as a record array, with > > one field for the data and one field for the mask. > > What about the other parameters, such as fill value? Dang, forgot about that. Having a dictionary of

Re: [Numpy-discussion] Masked arrays and pickle/unpickle

2008-07-17 Thread Anthony Floyd
> Further, could we rename numpy.ma.core to numpy.ma._core? I think we > should make it clear that users should not import from core directly. Just to add a bit of noise here, it's not that we were importing directly from .core, it's that pickle was telling us that the actual class associated wit

Re: [Numpy-discussion] Masked arrays and pickle/unpickle

2008-07-17 Thread Stéfan van der Walt
Hi Pierre, 2008/7/17 Pierre GM <[EMAIL PROTECTED]>: >> Otherwise, you can already >> save the array and mask separately. > > An other possibility is to store the MaskedArray as a record array, with one > field for the data and one field for the mask. What about the other parameters, such as fill

Re: [Numpy-discussion] Masked arrays and pickle/unpickle

2008-07-17 Thread Anthony Floyd
> > What I need to know is how I can trick pickle or Numpy to > put the old class into the new class. > > If you have an example data-file, send it to me off-list and I'll > figure out what to do. Maybe it is as simple as > > np.core.ma = np.oldnumeric.ma Yes, pretty much. We've put ma.py

Re: [Numpy-discussion] Masked arrays and pickle/unpickle

2008-07-17 Thread Pierre GM
On Thursday 17 July 2008 12:54:10 Stéfan van der Walt wrote: > I don't know if renaming things in np.core counts as an API change. > Pickling is notoriously unreliable for storing arrays, which is why > Robert wrote `load` and `save`. I hope that Pierre can get around to > implementing MaskedArray

Re: [Numpy-discussion] Masked arrays and pickle/unpickle

2008-07-17 Thread Stéfan van der Walt
2008/7/17 Anthony Floyd <[EMAIL PROTECTED]>: > What I need to know is how I can trick pickle or Numpy to put the old class > into the new class. If you have an example data-file, send it to me off-list and I'll figure out what to do. Maybe it is as simple as np.core.ma = np.oldnumeric.ma > It'

Re: [Numpy-discussion] Masked arrays and pickle/unpickle

2008-07-17 Thread Anthony Floyd
Hi Stéfan, > 2008/7/16 Anthony Floyd <[EMAIL PROTECTED]>: > > Unfortunately, when we try to unpickle the data saved with > Numpy 1.0.3 > > in the new code using Numpy 1.1.0, it chokes because it can't import > > numpy.core.ma for the masked arrays. A check of Numpy > 1.1.0 shows that > > this i

Re: [Numpy-discussion] Masked arrays and pickle/unpickle

2008-07-17 Thread Stéfan van der Walt
Hi Anthony 2008/7/16 Anthony Floyd <[EMAIL PROTECTED]>: > Unfortunately, when we try to unpickle the data saved with Numpy 1.0.3 > in the new code using Numpy 1.1.0, it chokes because it can't import > numpy.core.ma for the masked arrays. A check of Numpy 1.1.0 shows that > this is now numpy.ma.c

[Numpy-discussion] Masked arrays and pickle/unpickle

2008-07-16 Thread Anthony Floyd
We have an application that has previously used masked arrays from Numpy 1.0.3. Part of saving files from that application involved pickling data types that contained these masked arrays. In the latest round of library updates, we've decided to move to the most recent version of matplotlib, which