summaryrefslogtreecommitdiff
path: root/numpy/core/numeric.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-10-17 23:53:52 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-10-17 23:53:52 +0000
commit0e70085a1e01b853739ab7c8160ae05f6560db03 (patch)
treec1627cba93c6b8b8b803e7ed0545aeba5a1013f5 /numpy/core/numeric.py
parent8a142f7dafd5a820190e61e7173de1fde8acee7a (diff)
downloadnumpy-0e70085a1e01b853739ab7c8160ae05f6560db03.tar.gz
Increase the C-API and allow ufuncs to be given keyword arguments. Re-compile extension modules after updating to this revision number. extobj= and dtype= keywords are possible, but only extobj= is implemented in this revision.
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r--numpy/core/numeric.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py
index 2bb8013b9..8356227de 100644
--- a/numpy/core/numeric.py
+++ b/numpy/core/numeric.py
@@ -156,16 +156,11 @@ def require(a, dtype=None, requirements=None):
return asanyarray(a, dtype=dtype)
if 'ENSUREARRAY' in requirements or 'E' in requirements:
- func = asarray
+ subok = 0
else:
- func = asanyarray
+ subok = 1
- if 'FORCECAST' in requirements or 'FORCE' in requirements:
- arr = func(a)
- if dtype is not None and arr.dtype != dtype:
- arr = arr.astype(dtype)
- else:
- arr = func(a, dtype=dtype)
+ arr = array(a, dtype=dtype, copy=False, subok=subok)
copychar = 'A'
if 'FORTRAN' in requirements or 'F' in requirements:
@@ -180,7 +175,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.
+ """Returns True if 'a' is laid out in Fortran-order in memory (and a.ndim > 1)
"""
return a.flags.fnc