Commit 26fb5448 authored by Kurt Smith's avatar Kurt Smith Committed by Mark Florisson

replacement of 'f' flag with 'fortran' in cython.array.

parent 1b9ebbbb
...@@ -301,7 +301,7 @@ cdef class array: ...@@ -301,7 +301,7 @@ cdef class array:
Py_ssize_t itemsize Py_ssize_t itemsize
str mode str mode
def __cinit__(array self, tuple shape, Py_ssize_t itemsize, char *format, str mode="c"): def __cinit__(array self, tuple shape, Py_ssize_t itemsize, char *format, mode="c"):
self.ndim = len(shape) self.ndim = len(shape)
self.itemsize = itemsize self.itemsize = itemsize
...@@ -331,7 +331,7 @@ cdef class array: ...@@ -331,7 +331,7 @@ cdef class array:
idx += 1 idx += 1
assert idx == self.ndim assert idx == self.ndim
if mode == "f": if mode == "fortran":
idx = 0; stride = 1 idx = 0; stride = 1
for dim in shape: for dim in shape:
self.strides[idx] = stride self.strides[idx] = stride
...@@ -350,7 +350,7 @@ cdef class array: ...@@ -350,7 +350,7 @@ cdef class array:
assert idx == -1 assert idx == -1
self.len = stride * self.itemsize self.len = stride * self.itemsize
else: else:
raise ValueError("Invalid mode, expected 'c' or 'f', got %s" % mode) raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
self.mode = mode self.mode = mode
...@@ -363,7 +363,7 @@ cdef class array: ...@@ -363,7 +363,7 @@ cdef class array:
cdef int bufmode = -1 cdef int bufmode = -1
if self.mode == b"c": if self.mode == b"c":
bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
elif self.mode == b"f": elif self.mode == b"fortran":
bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
if not (flags & bufmode): if not (flags & bufmode):
raise ValueError("Can only create a buffer that is contiguous in memory.") raise ValueError("Can only create a buffer that is contiguous in memory.")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment