[SciPy-dev] pickling problem

Darren Dale dd55 at cornell.edu
Thu Dec 1 11:15:50 CST 2005


On Thursday 01 December 2005 11:29, Travis Oliphant wrote:
> >>What is the result of b.flags on your system?  To find out insert print
> >>b.flags right before you call Numeric.array.
> >>
> >>Mine is
> >>
> >>{'WRITEABLE': True, 'UPDATEIFCOPY': False, 'NOTSWAPPED': True,
> >>'CONTIGUOUS': True, 'FORTRAN': True, 'ALIGNED': True, 'OWNDATA': False}
> >>
> >>In particular you are looking for WRITEABLE and ALIGNED to both be True.
> >
> >mine is
> >
> >{'WRITEABLE': True, 'UPDATEIFCOPY': False, 'NOTSWAPPED': True,
> > 'CONTIGUOUS': True, 'FORTRAN': True, 'ALIGNED': False, 'OWNDATA': False}
>
> That's why you are getting the error, right there.  Your unpickled array
> is flagged as misaligned.  Numeric doesn't deal with misaligned or not
> writeable data.
>
> That means either that it's pointer is not on a boundary for the type or
> the strides are not.   I'm sure this is a 64-bit issue but don't know
> exactly the cause.
>
> Can you give me the result of
>
> b.strides
> b.__array_data__
>
> and
>
> b.flags.aligned = True ?

b.strides:  (8,)
b.__array_data__:  ('0x5d3f44', False)
b.flags.aligned=True
Traceback (most recent call last):
  File "pickletest.py", line 11, in ?
    b.flags.aligned=True
  File "/usr/lib64/python2.4/site-packages/scipy/base/_internal.py", line 159, 
in set_aligned
    self._arr.setflags(align=val)
ValueError: cannot set aligned flag of mis-aligned array to True




More information about the Scipy-dev mailing list