[Numpy-discussion] np.array execution path

Nathaniel Smith njs at pobox.com
Sun Sep 23 13:54:46 EDT 2012


On Sat, Sep 22, 2012 at 10:24 PM, Sebastian Berg
<sebastian at sipsolutions.net> wrote:
> In case you are interested, the second (real odditiy), is caused by
> ISFORTRAN and IS_F_CONTIGUOUS mixup, I have found three occurances where
> I think ISFORTRAN should be replaced by the latter. Check also:
>
> https://github.com/seberg/numpy/commit/4d2713ce8f2107d225fe291f5da6c6a75436647e

So I guess we have this ISFORTRAN function (also exposed to
Python[1]). It's documented as checking the rather odd condition of an
array being in fortran-order AND having ndim > 1. Sebastian, as part
of polishing up some of our contiguity-handling code, is suggesting
changing this so that ISFORTRAN is true for an array that is (fortran
order && !C order). Off the top of my head I can't think of any
situation where *either* of these predicates is actually useful. (I
can see why you want to check if an array is in fortran order, but not
why it'd be natural to check whether it's in fortran order and also
these other conditions together in one function call.) The problem is,
this makes it hard to know whether Sebastian's change is a good idea.

Can anyone think of legitimate uses for ISFORTRAN? Or should it just
be deprecated altogether?

-n

[1] http://docs.scipy.org/doc/numpy/reference/generated/numpy.isfortran.html



More information about the NumPy-Discussion mailing list