diff options
-rw-r--r-- | numpy/core/numeric.py | 12 | ||||
-rw-r--r-- | numpy/core/src/arraymethods.c | 2 |
2 files changed, 9 insertions, 5 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index 84329edbc..632a6f28c 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -159,13 +159,17 @@ def require(a, dtype=None, requirements=None): subok = 0 else: subok = 1 - + arr = array(a, dtype=dtype, copy=False, subok=subok) copychar = 'A' - if 'FORTRAN' in requirements or 'F' in requirements: + if 'FORTRAN' in requirements or \ + 'F_CONTIGUOUS' in requirements or \ + 'F' in requirements: copychar = 'F' - elif 'CONTIGUOUS' in requirements or 'C' in requirements: + elif 'CONTIGUOUS' in requirements or \ + 'C_CONTIGUOUS' in requirements or \ + 'C' in requirements: copychar = 'C' for prop in requirements: @@ -175,7 +179,7 @@ def require(a, dtype=None, requirements=None): return arr def isfortran(a): - """Returns True if 'a' is laid out in Fortran-order in memory (and a.ndim > 1) + """Returns True if 'a' is arranged in Fortran-order in memory with a.ndim > 1 """ return a.flags.fnc diff --git a/numpy/core/src/arraymethods.c b/numpy/core/src/arraymethods.c index a13da074f..0332aab70 100644 --- a/numpy/core/src/arraymethods.c +++ b/numpy/core/src/arraymethods.c @@ -1689,7 +1689,7 @@ array_setflags(PyArrayObject *self, PyObject *args, PyObject *kwds) if (PyObject_IsTrue(uic)) { self->flags = flagback; PyErr_SetString(PyExc_ValueError, - "cannot set UPDATEIFCOPY" \ + "cannot set UPDATEIFCOPY " \ "flag to True"); return NULL; } |