PyClaw's Controller class loses Fortran order of frames

5 views
Skip to first unread message

Aron Ahmadia

unread,
May 14, 2013, 7:49:57 PM5/14/13
to claw...@googlegroups.com
All,

I've filing a bug against this here: https://github.com/clawpack/pyclaw/issues/259

It's enough of a gotcha that I thought I would send a general warning to PyClaw developers and users.

The following clawpack controller code 'loses' the imposed Fortran order passed in from the state object when a frame gets passed in:

        if self.keep_copy:
            self.frames.append(copy.deepcopy(self.solution))

due to this bug in numpy's deepcopy semantics: https://github.com/numpy/numpy/pull/2699

This means that output frames are of default numpy type (C contiguous).

In fact, the output solution does not appear to have either C or Fortran contiguous ordering, I'm not even sure what that means.

In [80]: claw.solution.q.flags
Out[80]:
  C_CONTIGUOUS : False
  F_CONTIGUOUS : False
  OWNDATA : False
  WRITEABLE : True
  ALIGNED : True
  UPDATEIFCOPY : False

This won't affect anybody who's not interfacing into other languages, but I was quite surprised to see this behavior, especially from a library as robust as numpy.

Cheers,
Aron

Reply all
Reply to author
Forward
0 new messages