Charles R Harris
2015-10-30 22:12:50 UTC
Hi All,
The isfortran function calls a.fnc (Fortran-Not-C), which is implemented
as F_CONTIGUOUS && !C_CONTIGUOUS. Before relaxed stride checking
contiguous multidimensional arrays could not be both and continguous 1-D
arrays were always CONTIGUOUS, but this is not longer the case.
Consequently current isfortran breaks backward compatiblity. There are two
suggested solutions
1. Return `a.flags.f_contiguous`. This differs for 1-D arrays, but is
most consistent with the name isfortran.
2. Return `a.flags.f_contiguous and a.ndim > 1`, which would be backward
compatible.
It is also possible to start with 2. but add a FutureWarning and later move
to 1, which it my preferred solution. See gh-6590
<https://github.com/numpy/numpy/issues/6590> for the issue.
Thoughts?
The isfortran function calls a.fnc (Fortran-Not-C), which is implemented
as F_CONTIGUOUS && !C_CONTIGUOUS. Before relaxed stride checking
contiguous multidimensional arrays could not be both and continguous 1-D
arrays were always CONTIGUOUS, but this is not longer the case.
Consequently current isfortran breaks backward compatiblity. There are two
suggested solutions
1. Return `a.flags.f_contiguous`. This differs for 1-D arrays, but is
most consistent with the name isfortran.
2. Return `a.flags.f_contiguous and a.ndim > 1`, which would be backward
compatible.
It is also possible to start with 2. but add a FutureWarning and later move
to 1, which it my preferred solution. See gh-6590
<https://github.com/numpy/numpy/issues/6590> for the issue.
Thoughts?