From 0e70085a1e01b853739ab7c8160ae05f6560db03 Mon Sep 17 00:00:00 2001 From: Travis Oliphant Date: Tue, 17 Oct 2006 23:53:52 +0000 Subject: 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. --- numpy/core/numeric.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'numpy/core/numeric.py') 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 -- cgit v1.2.1