From numpy-svn at scipy.org Mon Feb 1 05:56:51 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 1 Feb 2010 04:56:51 -0600 (CST) Subject: [Numpy-svn] r8082 - trunk/numpy/core/src/multiarray Message-ID: <20100201105651.F3AE939CAEF@scipy.org> Author: cdavid Date: 2010-02-01 04:56:51 -0600 (Mon, 01 Feb 2010) New Revision: 8082 Modified: trunk/numpy/core/src/multiarray/multiarraymodule.c Log: BUG: fix performance issue (#1308). Modified: trunk/numpy/core/src/multiarray/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarray/multiarraymodule.c 2010-01-29 22:50:54 UTC (rev 8081) +++ trunk/numpy/core/src/multiarray/multiarraymodule.c 2010-02-01 10:56:51 UTC (rev 8082) @@ -626,12 +626,12 @@ typec = PyArray_DescrFromType(typenum); Py_INCREF(typec); - ap1 = (PyArrayObject *)PyArray_FromAny(op1, typec, 0, 0, BEHAVED, NULL); + ap1 = (PyArrayObject *)PyArray_FromAny(op1, typec, 0, 0, ALIGNED, NULL); if (ap1 == NULL) { Py_DECREF(typec); return NULL; } - ap2 = (PyArrayObject *)PyArray_FromAny(op2, typec, 0, 0, BEHAVED, NULL); + ap2 = (PyArrayObject *)PyArray_FromAny(op2, typec, 0, 0, ALIGNED, NULL); if (ap2 == NULL) { goto fail; } @@ -733,12 +733,12 @@ typenum = PyArray_ObjectType(op2, typenum); typec = PyArray_DescrFromType(typenum); Py_INCREF(typec); - ap1 = (PyArrayObject *)PyArray_FromAny(op1, typec, 0, 0, BEHAVED, NULL); + ap1 = (PyArrayObject *)PyArray_FromAny(op1, typec, 0, 0, ALIGNED, NULL); if (ap1 == NULL) { Py_DECREF(typec); return NULL; } - ap2 = (PyArrayObject *)PyArray_FromAny(op2, typec, 0, 0, BEHAVED, NULL); + ap2 = (PyArrayObject *)PyArray_FromAny(op2, typec, 0, 0, ALIGNED, NULL); if (ap2 == NULL) { goto fail; } From numpy-svn at scipy.org Mon Feb 1 23:54:35 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 1 Feb 2010 22:54:35 -0600 (CST) Subject: [Numpy-svn] r8083 - trunk/numpy/lib/tests Message-ID: <20100202045435.BEBD739CAEF@scipy.org> Author: cdavid Date: 2010-02-01 22:54:35 -0600 (Mon, 01 Feb 2010) New Revision: 8083 Modified: trunk/numpy/lib/tests/test_function_base.py Log: TST: add a couple of simple unit-tests for bincount. Modified: trunk/numpy/lib/tests/test_function_base.py =================================================================== --- trunk/numpy/lib/tests/test_function_base.py 2010-02-01 10:56:51 UTC (rev 8082) +++ trunk/numpy/lib/tests/test_function_base.py 2010-02-02 04:54:35 UTC (rev 8083) @@ -6,6 +6,8 @@ from numpy.core import * from numpy import matrix, asmatrix +import numpy as np + class TestAny(TestCase): def test_basic(self): y1 = [0,0,1,0] @@ -852,6 +854,27 @@ assert y.ndim == 0 assert y == 0 +class TestBincount(TestCase): + def test_simple(self): + y = np.bincount(np.arange(4)) + assert_array_equal(y, np.ones(4)) + + def test_simple2(self): + y = np.bincount(np.array([1, 5, 2, 4, 1])) + assert_array_equal(y, np.array([0, 2, 1, 0, 1, 1])) + + def test_simple_weight(self): + x = np.arange(4) + w = np.array([0.2, 0.3, 0.5, 0.1]) + y = np.bincount(x, w) + assert_array_equal(y, w) + + def test_simple_weight2(self): + x = np.array([1, 2, 4, 5, 2]) + w = np.array([0.2, 0.3, 0.5, 0.1, 0.2]) + y = np.bincount(x, w) + assert_array_equal(y, np.array([0, 0.2, 0.5, 0, 0.5, 0.1])) + def compare_results(res,desired): for i in range(len(desired)): assert_array_equal(res[i],desired[i]) From numpy-svn at scipy.org Mon Feb 1 23:54:53 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 1 Feb 2010 22:54:53 -0600 (CST) Subject: [Numpy-svn] r8084 - in trunk/numpy/lib: src tests Message-ID: <20100202045453.33CE339CAEF@scipy.org> Author: cdavid Date: 2010-02-01 22:54:53 -0600 (Mon, 01 Feb 2010) New Revision: 8084 Modified: trunk/numpy/lib/src/_compiled_base.c trunk/numpy/lib/tests/test_regression.py Log: BUG: fix #1387. Raise ValueError for empty input to bincount. Modified: trunk/numpy/lib/src/_compiled_base.c =================================================================== --- trunk/numpy/lib/src/_compiled_base.c 2010-02-02 04:54:35 UTC (rev 8083) +++ trunk/numpy/lib/src/_compiled_base.c 2010-02-02 04:54:53 UTC (rev 8084) @@ -117,6 +117,11 @@ goto fail; } len = PyArray_SIZE(lst); + if (len < 1) { + PyErr_SetString(PyExc_ValueError, + "The first argument cannot be empty."); + goto fail; + } numbers = (intp *) PyArray_DATA(lst); mxi = mxx(numbers, len); mni = mnx(numbers, len); Modified: trunk/numpy/lib/tests/test_regression.py =================================================================== --- trunk/numpy/lib/tests/test_regression.py 2010-02-02 04:54:35 UTC (rev 8083) +++ trunk/numpy/lib/tests/test_regression.py 2010-02-02 04:54:53 UTC (rev 8084) @@ -176,6 +176,9 @@ sys.stdout = sys.__stdout__ raise AssertionError("ticket #1243") + def test_bincount_empty(self): + """Ticket #1387: empty array as input for bincount.""" + assert_raises(ValueError, lambda : np.bincount(np.array([], dtype=np.intp))) if __name__ == "__main__": run_module_suite() From numpy-svn at scipy.org Tue Feb 2 03:38:31 2010 From: numpy-svn at scipy.org (VIAGRA (c) Best E-store) Date: Tue, 2 Feb 2010 02:38:31 -0600 (CST) Subject: [Numpy-svn] User numpy-svn Unique 80% Sale Message-ID: <20100202083831.CFB65C7C02A@scipy.org> An HTML attachment was scrubbed... URL: From numpy-svn at scipy.org Thu Feb 4 09:40:55 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 4 Feb 2010 08:40:55 -0600 (CST) Subject: [Numpy-svn] r8085 - in trunk/numpy: . core/src/multiarray Message-ID: <20100204144055.6D8D639CAE9@scipy.org> Author: oliphant Date: 2010-02-04 08:40:55 -0600 (Thu, 04 Feb 2010) New Revision: 8085 Modified: trunk/numpy/core/src/multiarray/ctors.c trunk/numpy/ctypeslib.py Log: BUG: Fix #1388. Return NULL after setting error. Also simplify ctypeslib prep_simple function. Modified: trunk/numpy/core/src/multiarray/ctors.c =================================================================== --- trunk/numpy/core/src/multiarray/ctors.c 2010-02-02 04:54:53 UTC (rev 8084) +++ trunk/numpy/core/src/multiarray/ctors.c 2010-02-04 14:40:55 UTC (rev 8085) @@ -3121,8 +3121,11 @@ if ((offset < 0) || (offset >= ts)) { PyErr_Format(PyExc_ValueError, - "offset must be positive and smaller than %" - INTP_FMT, (intp)ts); + "offset must be non-negative and smaller than buffer "\ + "lenth (%" INTP_FMT ")", (intp)ts); + Py_DECREF(buf); + Py_DECREF(type); + return NULL; } data += offset; Modified: trunk/numpy/ctypeslib.py =================================================================== --- trunk/numpy/ctypeslib.py 2010-02-02 04:54:53 UTC (rev 8084) +++ trunk/numpy/ctypeslib.py 2010-02-04 14:40:55 UTC (rev 8085) @@ -294,14 +294,15 @@ # c_double. Filled in by prep_simple. _typecodes = {} - def prep_simple(simple_type, typestr): + def prep_simple(simple_type, dtype): """Given a ctypes simple type, construct and attach an __array_interface__ property to it if it does not yet have one. """ try: simple_type.__array_interface__ except AttributeError: pass else: return - + + typestr = _dtype(dtype).str _typecodes[typestr] = simple_type def __array_interface__(self): @@ -316,11 +317,6 @@ simple_type.__array_interface__ = property(__array_interface__) - if sys.byteorder == "little": - TYPESTR = "<%c%d" - else: - TYPESTR = ">%c%d" - simple_types = [ ((ct.c_byte, ct.c_short, ct.c_int, ct.c_long, ct.c_longlong), "i"), ((ct.c_ubyte, ct.c_ushort, ct.c_uint, ct.c_ulong, ct.c_ulonglong), "u"), @@ -330,7 +326,7 @@ # Prep that numerical ctypes types: for types, code in simple_types: for tp in types: - prep_simple(tp, TYPESTR % (code, ct.sizeof(tp))) + prep_simple(tp, "%c%d" % (code, ct.sizeof(tp))) ################################################################ # array types From numpy-svn at scipy.org Thu Feb 4 09:44:48 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 4 Feb 2010 08:44:48 -0600 (CST) Subject: [Numpy-svn] r8086 - trunk/numpy/core/include/numpy Message-ID: <20100204144448.DE5DD39CAE9@scipy.org> Author: oliphant Date: 2010-02-04 08:44:48 -0600 (Thu, 04 Feb 2010) New Revision: 8086 Modified: trunk/numpy/core/include/numpy/npy_cpu.h Log: BUG: Fix #1379 by applying supplied patch. Modified: trunk/numpy/core/include/numpy/npy_cpu.h =================================================================== --- trunk/numpy/core/include/numpy/npy_cpu.h 2010-02-04 14:40:55 UTC (rev 8085) +++ trunk/numpy/core/include/numpy/npy_cpu.h 2010-02-04 14:44:48 UTC (rev 8086) @@ -47,7 +47,7 @@ #define NPY_CPU_S390 #elif defined(__ia64) #define NPY_CPU_IA64 -#elif defined(__hppa__) +#elif defined(__hppa) #define NPY_CPU_HPPA #elif defined(__alpha__) #define NPY_CPU_ALPHA From numpy-svn at scipy.org Thu Feb 4 10:07:51 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 4 Feb 2010 09:07:51 -0600 (CST) Subject: [Numpy-svn] r8087 - trunk/numpy/distutils/fcompiler Message-ID: <20100204150751.DEBC439CAE9@scipy.org> Author: oliphant Date: 2010-02-04 09:07:51 -0600 (Thu, 04 Feb 2010) New Revision: 8087 Modified: trunk/numpy/distutils/fcompiler/gnu.py Log: BUG: Fix #1376, indentation problem. Modified: trunk/numpy/distutils/fcompiler/gnu.py =================================================================== --- trunk/numpy/distutils/fcompiler/gnu.py 2010-02-04 14:44:48 UTC (rev 8086) +++ trunk/numpy/distutils/fcompiler/gnu.py 2010-02-04 15:07:51 UTC (rev 8087) @@ -304,8 +304,8 @@ c_compiler = self.c_compiler if c_compiler and c_compiler.compiler_type == "msvc": return [] - else: - raise NotImplementedError("Only MS compiler supported with gfortran on win64") + else: + raise NotImplementedError("Only MS compiler supported with gfortran on win64") return opt def get_target(self): From numpy-svn at scipy.org Thu Feb 4 16:23:10 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 4 Feb 2010 15:23:10 -0600 (CST) Subject: [Numpy-svn] r8088 - trunk/numpy Message-ID: <20100204212310.3F14D39CAE9@scipy.org> Author: ptvirtan Date: 2010-02-04 15:23:10 -0600 (Thu, 04 Feb 2010) New Revision: 8088 Modified: trunk/numpy/ctypeslib.py Log: ctypeslib: Correct tabs to spaces Modified: trunk/numpy/ctypeslib.py =================================================================== --- trunk/numpy/ctypeslib.py 2010-02-04 15:07:51 UTC (rev 8087) +++ trunk/numpy/ctypeslib.py 2010-02-04 21:23:10 UTC (rev 8088) @@ -301,8 +301,8 @@ try: simple_type.__array_interface__ except AttributeError: pass else: return - - typestr = _dtype(dtype).str + + typestr = _dtype(dtype).str _typecodes[typestr] = simple_type def __array_interface__(self): From numpy-svn at scipy.org Sun Feb 7 15:36:32 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 7 Feb 2010 14:36:32 -0600 (CST) Subject: [Numpy-svn] r8089 - branches/1.4.x/numpy/polynomial Message-ID: <20100207203632.34A75C7C01F@scipy.org> Author: charris Date: 2010-02-07 14:36:31 -0600 (Sun, 07 Feb 2010) New Revision: 8089 Modified: branches/1.4.x/numpy/polynomial/chebyshev.py branches/1.4.x/numpy/polynomial/polynomial.py Log: BUG: Add needed imports of warnings. Modified: branches/1.4.x/numpy/polynomial/chebyshev.py =================================================================== --- branches/1.4.x/numpy/polynomial/chebyshev.py 2010-02-04 21:23:10 UTC (rev 8088) +++ branches/1.4.x/numpy/polynomial/chebyshev.py 2010-02-07 20:36:31 UTC (rev 8089) @@ -69,8 +69,8 @@ import numpy as np import numpy.linalg as la import polyutils as pu +import warnings from polytemplate import polytemplate -from polyutils import RankWarning, PolyError, PolyDomainError chebtrim = pu.trimcoef Modified: branches/1.4.x/numpy/polynomial/polynomial.py =================================================================== --- branches/1.4.x/numpy/polynomial/polynomial.py 2010-02-04 21:23:10 UTC (rev 8088) +++ branches/1.4.x/numpy/polynomial/polynomial.py 2010-02-07 20:36:31 UTC (rev 8089) @@ -50,6 +50,7 @@ import numpy as np import numpy.linalg as la import polyutils as pu +import warnings from polytemplate import polytemplate polytrim = pu.trimcoef From numpy-svn at scipy.org Sun Feb 7 15:45:59 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 7 Feb 2010 14:45:59 -0600 (CST) Subject: [Numpy-svn] r8090 - branches/1.4.x/numpy/distutils/fcompiler Message-ID: <20100207204559.EF1F2C7C01F@scipy.org> Author: charris Date: 2010-02-07 14:45:59 -0600 (Sun, 07 Feb 2010) New Revision: 8090 Modified: branches/1.4.x/numpy/distutils/fcompiler/gnu.py Log: BUG: Backport r8087. Modified: branches/1.4.x/numpy/distutils/fcompiler/gnu.py =================================================================== --- branches/1.4.x/numpy/distutils/fcompiler/gnu.py 2010-02-07 20:36:31 UTC (rev 8089) +++ branches/1.4.x/numpy/distutils/fcompiler/gnu.py 2010-02-07 20:45:59 UTC (rev 8090) @@ -302,8 +302,8 @@ c_compiler = self.c_compiler if c_compiler and c_compiler.compiler_type == "msvc": return [] - else: - raise NotImplementedError("Only MS compiler supported with gfortran on win64") + else: + raise NotImplementedError("Only MS compiler supported with gfortran on win64") return opt def get_target(self): From numpy-svn at scipy.org Sun Feb 7 15:53:39 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 7 Feb 2010 14:53:39 -0600 (CST) Subject: [Numpy-svn] r8091 - branches/1.4.x/numpy/core/include/numpy Message-ID: <20100207205339.8F282C7C01F@scipy.org> Author: charris Date: 2010-02-07 14:53:39 -0600 (Sun, 07 Feb 2010) New Revision: 8091 Modified: branches/1.4.x/numpy/core/include/numpy/npy_cpu.h Log: BUG: Backport r8086 to fix ticket #1379. Modified: branches/1.4.x/numpy/core/include/numpy/npy_cpu.h =================================================================== --- branches/1.4.x/numpy/core/include/numpy/npy_cpu.h 2010-02-07 20:45:59 UTC (rev 8090) +++ branches/1.4.x/numpy/core/include/numpy/npy_cpu.h 2010-02-07 20:53:39 UTC (rev 8091) @@ -47,7 +47,7 @@ #define NPY_CPU_S390 #elif defined(__ia64) #define NPY_CPU_IA64 -#elif defined(__hppa__) +#elif defined(__hppa) #define NPY_CPU_HPPA #elif defined(__alpha__) #define NPY_CPU_ALPHA From numpy-svn at scipy.org Sun Feb 7 16:13:40 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 7 Feb 2010 15:13:40 -0600 (CST) Subject: [Numpy-svn] r8092 - branches/1.4.x/numpy/core/src/multiarray Message-ID: <20100207211340.BF52DC7C01F@scipy.org> Author: charris Date: 2010-02-07 15:13:40 -0600 (Sun, 07 Feb 2010) New Revision: 8092 Modified: branches/1.4.x/numpy/core/src/multiarray/ctors.c Log: BUG: Partial backport of r8085 to fix ticket #1388. Modified: branches/1.4.x/numpy/core/src/multiarray/ctors.c =================================================================== --- branches/1.4.x/numpy/core/src/multiarray/ctors.c 2010-02-07 20:53:39 UTC (rev 8091) +++ branches/1.4.x/numpy/core/src/multiarray/ctors.c 2010-02-07 21:13:40 UTC (rev 8092) @@ -3104,6 +3104,9 @@ PyErr_Format(PyExc_ValueError, "offset must be positive and smaller than %" INTP_FMT, (intp)ts); + Py_DECREF(buf); + Py_DECREF(type); + return NULL; } data += offset; From numpy-svn at scipy.org Sun Feb 7 17:26:04 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 7 Feb 2010 16:26:04 -0600 (CST) Subject: [Numpy-svn] r8093 - in trunk/numpy/ma: . tests Message-ID: <20100207222604.D478039C674@scipy.org> Author: pierregm Date: 2010-02-07 16:26:04 -0600 (Sun, 07 Feb 2010) New Revision: 8093 Modified: trunk/numpy/ma/core.py trunk/numpy/ma/tests/test_core.py Log: * Force the fill_value of a structured masked array to be defined (bug #1332) Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2010-02-07 21:13:40 UTC (rev 8092) +++ trunk/numpy/ma/core.py 2010-02-07 22:26:04 UTC (rev 8093) @@ -2733,6 +2733,9 @@ # But don't run the check unless we have something to check.... if fill_value is not None: _data._fill_value = _check_fill_value(fill_value, _data.dtype) + elif names_: + # Named fields: make sure _fill_value is initialized + _data._fill_value = _check_fill_value(None, _data.dtype) # Process extra options .. if hard_mask is None: _data._hardmask = getattr(data, '_hardmask', False) Modified: trunk/numpy/ma/tests/test_core.py =================================================================== --- trunk/numpy/ma/tests/test_core.py 2010-02-07 21:13:40 UTC (rev 8092) +++ trunk/numpy/ma/tests/test_core.py 2010-02-07 22:26:04 UTC (rev 8093) @@ -1440,6 +1440,7 @@ def test_fillvalue_individual_fields(self): "Test setting fill_value on individual fields" ndtype = [('a', int), ('b', int)] + # Explicit fill_value a = array(zip([1, 2, 3], [4, 5, 6]), fill_value=(-999, -999), dtype=ndtype) f = a._fill_value @@ -1449,6 +1450,12 @@ assert_equal(tuple(a.fill_value), (10, -999)) a.fill_value['b'] = -10 assert_equal(tuple(a.fill_value), (10, -10)) + # Implicit fill_value + t = array(zip([1, 2, 3], [4, 5, 6]), dtype=[('a', int), ('b', int)]) + tt = t['a'] + tt.set_fill_value(10) + assert_equal(tt._fill_value, np.array(10)) + assert_equal(tuple(t.fill_value), (10, default_fill_value(0))) #------------------------------------------------------------------------------ From numpy-svn at scipy.org Mon Feb 8 01:21:33 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 8 Feb 2010 00:21:33 -0600 (CST) Subject: [Numpy-svn] r8094 - in trunk/numpy/ma: . tests Message-ID: <20100208062133.BBA4D39C674@scipy.org> Author: pierregm Date: 2010-02-08 00:21:33 -0600 (Mon, 08 Feb 2010) New Revision: 8094 Modified: trunk/numpy/ma/core.py trunk/numpy/ma/tests/test_core.py Log: * Make sure _fill_value is never None for structured masked arrays Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2010-02-07 22:26:04 UTC (rev 8093) +++ trunk/numpy/ma/core.py 2010-02-08 06:21:33 UTC (rev 8094) @@ -2792,6 +2792,10 @@ except AttributeError: # When _mask.shape is not writable (because it's a void) pass + # Finalize the fill_value for structured arrays + if self.dtype.names: + if self._fill_value is None: + self._fill_value = _check_fill_value(None, self.dtype) return @@ -3569,7 +3573,8 @@ elif n <= 1: return _print_templates['short'] % parameters return _print_templates['long'] % parameters - #............................................ + + def __eq__(self, other): "Check whether other equals self elementwise" if self is masked: @@ -5432,7 +5437,9 @@ # def __new__(self, data, mask=nomask, dtype=None, fill_value=None): dtype = dtype or data.dtype - _data = ndarray.__new__(self, (), dtype=dtype, buffer=data.data) + _data = ndarray((), dtype=dtype) + _data[()] = data + _data = _data.view(self) if mask is not nomask: try: # Mask is already a 0D array @@ -5463,17 +5470,29 @@ return self._data.__str__() m = tuple(m) if (not any(m)): - return self._data.__repr__() + return self._data.__str__() r = self._data.tolist() p = masked_print_option if not p.enabled(): p = 'N/A' else: p = str(p) - r = [(str(_), p)[_m] for (_, _m) in zip(self._data.tolist(), tuple(m))] + r = [(str(_), p)[_m] for (_, _m) in zip(r, m)] return "(%s)" % ", ".join(r) - __repr__ = __str__ + def __repr__(self): + m = self._mask + if (m is nomask): + return self._data.__repr__() + m = tuple(m) + if not any(m): + return self._data.__repr__() + p = masked_print_option + if not p.enabled(): + return self.filled(self.fill_value).__repr__() + p = str(p) + r = [(str(_), p)[_m] for (_, _m) in zip(r, m)] + return "(%s)" % ", ".join(r) def __iter__(self): "Defines an iterator for mvoid" Modified: trunk/numpy/ma/tests/test_core.py =================================================================== --- trunk/numpy/ma/tests/test_core.py 2010-02-07 22:26:04 UTC (rev 8093) +++ trunk/numpy/ma/tests/test_core.py 2010-02-08 06:21:33 UTC (rev 8094) @@ -503,7 +503,7 @@ def test_filled_w_mvoid(self): "Test filled w/ mvoid" ndtype = [('a', int), ('b', float)] - a = mvoid(np.array((1, 2)), mask=[(0, 1)], dtype=ndtype) + a = mvoid((1, 2.), mask=[(0, 1)], dtype=ndtype) # Filled using default test = a.filled() assert_equal(tuple(test), (1, default_fill_value(1.))) @@ -1457,6 +1457,19 @@ assert_equal(tt._fill_value, np.array(10)) assert_equal(tuple(t.fill_value), (10, default_fill_value(0))) + def test_fillvalue_implicit_structured_array(self): + "Check that fill_value is always defined for structured arrays" + ndtype = ('b', float) + adtype = ('a', float) + a = array([(1.,), (2.,)], mask=[(False,), (False,)], + fill_value=(np.nan,), dtype=np.dtype([adtype])) + b = empty(a.shape, dtype=[adtype, ndtype]) + b['a'] = a['a'] + b['a'].set_fill_value(a['a'].fill_value) + f = b._fill_value[()] + assert(np.isnan(f[0])) + assert_equal(f[-1], default_fill_value(1.)) + #------------------------------------------------------------------------------ class TestUfuncs(TestCase): From numpy-svn at scipy.org Mon Feb 8 02:35:34 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 8 Feb 2010 01:35:34 -0600 (CST) Subject: [Numpy-svn] r8095 - trunk/numpy/ma Message-ID: <20100208073534.3129D39C674@scipy.org> Author: pierregm Date: 2010-02-08 01:35:34 -0600 (Mon, 08 Feb 2010) New Revision: 8095 Modified: trunk/numpy/ma/core.py Log: * allow fill_value to be np.void Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2010-02-08 06:21:33 UTC (rev 8094) +++ trunk/numpy/ma/core.py 2010-02-08 07:35:34 UTC (rev 8095) @@ -394,7 +394,7 @@ fill_value = default_fill_value(ndtype) elif fields: fdtype = [(_[0], _[1]) for _ in ndtype.descr] - if isinstance(fill_value, ndarray): + if isinstance(fill_value, (ndarray, np.void)): try: fill_value = np.array(fill_value, copy=False, dtype=fdtype) except ValueError: @@ -2733,9 +2733,6 @@ # But don't run the check unless we have something to check.... if fill_value is not None: _data._fill_value = _check_fill_value(fill_value, _data.dtype) - elif names_: - # Named fields: make sure _fill_value is initialized - _data._fill_value = _check_fill_value(None, _data.dtype) # Process extra options .. if hard_mask is None: _data._hardmask = getattr(data, '_hardmask', False) From numpy-svn at scipy.org Mon Feb 8 08:13:28 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 8 Feb 2010 07:13:28 -0600 (CST) Subject: [Numpy-svn] r8096 - in trunk/numpy/lib: . tests Message-ID: <20100208131328.D824CC7C018@scipy.org> Author: stefan Date: 2010-02-08 07:13:28 -0600 (Mon, 08 Feb 2010) New Revision: 8096 Modified: trunk/numpy/lib/polynomial.py trunk/numpy/lib/tests/test_polynomial.py Log: BUG: Check input to poly for zero-dimensional arrays. Modified: trunk/numpy/lib/polynomial.py =================================================================== --- trunk/numpy/lib/polynomial.py 2010-02-08 07:35:34 UTC (rev 8095) +++ trunk/numpy/lib/polynomial.py 2010-02-08 13:13:28 UTC (rev 8096) @@ -120,9 +120,9 @@ """ seq_of_zeros = atleast_1d(seq_of_zeros) sh = seq_of_zeros.shape - if len(sh) == 2 and sh[0] == sh[1]: + if len(sh) == 2 and sh[0] == sh[1] and sh[0] != 0: seq_of_zeros = eigvals(seq_of_zeros) - elif len(sh) ==1: + elif len(sh) == 1: pass else: raise ValueError, "input must be 1d or square 2d array." Modified: trunk/numpy/lib/tests/test_polynomial.py =================================================================== --- trunk/numpy/lib/tests/test_polynomial.py 2010-02-08 07:35:34 UTC (rev 8095) +++ trunk/numpy/lib/tests/test_polynomial.py 2010-02-08 13:13:28 UTC (rev 8096) @@ -143,5 +143,11 @@ p2 = p.integ(3, k=[9,7,6]) assert (p2.coeffs == [1/4./5.,1/3./4.,1/2./3.,9/1./2.,7,6]).all() + def test_zero_dims(self): + try: + np.poly(np.zeros((0, 0))) + except ValueError: + pass + if __name__ == "__main__": run_module_suite() From numpy-svn at scipy.org Tue Feb 9 01:10:41 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 9 Feb 2010 00:10:41 -0600 (CST) Subject: [Numpy-svn] r8097 - branches/1.4.x/numpy/core/code_generators Message-ID: <20100209061041.5F3E439CAE7@scipy.org> Author: cdavid Date: 2010-02-09 00:10:41 -0600 (Tue, 09 Feb 2010) New Revision: 8097 Modified: branches/1.4.x/numpy/core/code_generators/generate_umath.py Log: REF: replace literal dtypes by category in umath code generator. Modified: branches/1.4.x/numpy/core/code_generators/generate_umath.py =================================================================== --- branches/1.4.x/numpy/core/code_generators/generate_umath.py 2010-02-08 13:13:28 UTC (rev 8096) +++ branches/1.4.x/numpy/core/code_generators/generate_umath.py 2010-02-09 06:10:41 UTC (rev 8097) @@ -301,7 +301,7 @@ 'absolute' : Ufunc(1, 1, None, docstrings.get('numpy.core.umath.absolute'), - TD(bints+flts+times), + TD(nocmplx), TD(cmplx, out=('f', 'd', 'g')), TD(O, f='PyNumber_Absolute'), ), @@ -313,7 +313,7 @@ 'negative' : Ufunc(1, 1, None, docstrings.get('numpy.core.umath.negative'), - TD(bints+flts+times), + TD(nocmplx), TD(cmplx, f='neg'), TD(O, f='PyNumber_Negative'), ), From numpy-svn at scipy.org Tue Feb 9 01:11:19 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 9 Feb 2010 00:11:19 -0600 (CST) Subject: [Numpy-svn] r8098 - in branches/1.4.x/numpy/core: . code_generators include/numpy src/multiarray src/umath tests Message-ID: <20100209061119.F2C2339CAE7@scipy.org> Author: cdavid Date: 2010-02-09 00:11:19 -0600 (Tue, 09 Feb 2010) New Revision: 8098 Removed: branches/1.4.x/numpy/core/src/multiarray/datetime.c branches/1.4.x/numpy/core/tests/test_datetime.py Modified: branches/1.4.x/numpy/core/SConscript branches/1.4.x/numpy/core/code_generators/genapi.py branches/1.4.x/numpy/core/code_generators/generate_umath.py branches/1.4.x/numpy/core/include/numpy/arrayscalars.h branches/1.4.x/numpy/core/include/numpy/ndarrayobject.h branches/1.4.x/numpy/core/setup.py branches/1.4.x/numpy/core/src/multiarray/arraytypes.c.src branches/1.4.x/numpy/core/src/multiarray/convert_datatype.c branches/1.4.x/numpy/core/src/multiarray/descriptor.c branches/1.4.x/numpy/core/src/multiarray/multiarraymodule.c branches/1.4.x/numpy/core/src/multiarray/scalarapi.c branches/1.4.x/numpy/core/src/multiarray/scalartypes.c.src branches/1.4.x/numpy/core/src/multiarray/scalartypes.h branches/1.4.x/numpy/core/src/umath/loops.h branches/1.4.x/numpy/core/src/umath/loops.h.src branches/1.4.x/numpy/core/src/umath/ufunc_object.c Log: REF: remove datetime support at the C level. Modified: branches/1.4.x/numpy/core/SConscript =================================================================== --- branches/1.4.x/numpy/core/SConscript 2010-02-09 06:10:41 UTC (rev 8097) +++ branches/1.4.x/numpy/core/SConscript 2010-02-09 06:11:19 UTC (rev 8098) @@ -427,7 +427,6 @@ multiarray_src = [pjoin('src', 'multiarray', 'multiarraymodule.c'), pjoin('src', 'multiarray', 'hashdescr.c'), pjoin('src', 'multiarray', 'arrayobject.c'), - pjoin('src', 'multiarray', 'datetime.c'), pjoin('src', 'multiarray', 'numpyos.c'), pjoin('src', 'multiarray', 'flagsobject.c'), pjoin('src', 'multiarray', 'descriptor.c'), Modified: branches/1.4.x/numpy/core/code_generators/genapi.py =================================================================== --- branches/1.4.x/numpy/core/code_generators/genapi.py 2010-02-09 06:10:41 UTC (rev 8097) +++ branches/1.4.x/numpy/core/code_generators/genapi.py 2010-02-09 06:11:19 UTC (rev 8098) @@ -44,7 +44,6 @@ join('multiarray', 'refcount.c'), join('multiarray', 'conversion_utils.c'), join('multiarray', 'buffer.c'), - join('multiarray', 'datetime.c'), join('umath', 'ufunc_object.c'), join('umath', 'loops.c.src'), ] Modified: branches/1.4.x/numpy/core/code_generators/generate_umath.py =================================================================== --- branches/1.4.x/numpy/core/code_generators/generate_umath.py 2010-02-09 06:10:41 UTC (rev 8097) +++ branches/1.4.x/numpy/core/code_generators/generate_umath.py 2010-02-09 06:11:19 UTC (rev 8098) @@ -168,19 +168,16 @@ 'F': 'cfloat', 'D': 'cdouble', 'G': 'clongdouble', - 'M': 'datetime', - 'm': 'timedelta', 'O': 'OBJECT', # '.' is like 'O', but calls a method of the object instead # of a function 'P': 'OBJECT', } -all = '?bBhHiIlLqQfdgFDGOMm' +all = '?bBhHiIlLqQfdgFDGO' O = 'O' P = 'P' ints = 'bBhHiIlLqQ' -times = 'Mm' intsO = ints + O bints = '?' + ints bintsO = bints + O @@ -193,13 +190,13 @@ inexact = flts + cmplx noint = inexact+O nointP = inexact+P -allP = bints+times+flts+cmplxP +allP = bints+flts+cmplxP nobool = all[1:] -noobj = all[:-3]+all[-2:] -nobool_or_obj = all[1:-3]+all[-2:] +noobj = all[:-2] +nobool_or_obj = all[1:-2] intflt = ints+flts intfltcmplx = ints+flts+cmplx -nocmplx = bints+times+flts +nocmplx = bints+flts nocmplxO = nocmplx+O nocmplxP = nocmplx+P notimes_or_obj = bints + inexact @@ -218,20 +215,20 @@ Ufunc(2, 1, Zero, docstrings.get('numpy.core.umath.add'), TD(notimes_or_obj), - [TypeDescription('M', UsesArraysAsData, 'Mm', 'M'), - TypeDescription('m', UsesArraysAsData, 'mm', 'm'), - TypeDescription('M', UsesArraysAsData, 'mM', 'M'), - ], + #[TypeDescription('M', UsesArraysAsData, 'Mm', 'M'), + # TypeDescription('m', UsesArraysAsData, 'mm', 'm'), + # TypeDescription('M', UsesArraysAsData, 'mM', 'M'), + #], TD(O, f='PyNumber_Add'), ), 'subtract' : Ufunc(2, 1, Zero, docstrings.get('numpy.core.umath.subtract'), TD(notimes_or_obj), - [TypeDescription('M', UsesArraysAsData, 'Mm', 'M'), - TypeDescription('m', UsesArraysAsData, 'mm', 'm'), - TypeDescription('M', UsesArraysAsData, 'MM', 'm'), - ], + #[TypeDescription('M', UsesArraysAsData, 'Mm', 'M'), + # TypeDescription('m', UsesArraysAsData, 'mm', 'm'), + # TypeDescription('M', UsesArraysAsData, 'MM', 'm'), + #], TD(O, f='PyNumber_Subtract'), ), 'multiply' : Modified: branches/1.4.x/numpy/core/include/numpy/arrayscalars.h =================================================================== --- branches/1.4.x/numpy/core/include/numpy/arrayscalars.h 2010-02-09 06:10:41 UTC (rev 8097) +++ branches/1.4.x/numpy/core/include/numpy/arrayscalars.h 2010-02-09 06:11:19 UTC (rev 8098) @@ -112,19 +112,6 @@ typedef struct { PyObject_HEAD - npy_datetime obval; - PyArray_DatetimeMetaData obmeta; -} PyDatetimeScalarObject; - -typedef struct { - PyObject_HEAD - npy_timedelta obval; - PyArray_DatetimeMetaData obmeta; -} PyTimedeltaScalarObject; - - -typedef struct { - PyObject_HEAD char obval; } PyScalarObject; Modified: branches/1.4.x/numpy/core/include/numpy/ndarrayobject.h =================================================================== --- branches/1.4.x/numpy/core/include/numpy/ndarrayobject.h 2010-02-09 06:10:41 UTC (rev 8097) +++ branches/1.4.x/numpy/core/include/numpy/ndarrayobject.h 2010-02-09 06:11:19 UTC (rev 8098) @@ -78,7 +78,6 @@ NPY_OBJECT=17, NPY_STRING, NPY_UNICODE, NPY_VOID, - NPY_DATETIME, NPY_TIMEDELTA, NPY_NTYPES, NPY_NOTYPE, NPY_CHAR, /* special flag */ @@ -574,25 +573,6 @@ int flags; } PyArray_Chunk; - -typedef struct { - NPY_DATETIMEUNIT base; - int num; - int den; /* Converted to 1 on input for now -- an input-only mechanism */ - int events; -} PyArray_DatetimeMetaData; - -typedef struct { - npy_longlong year; - int month, day, hour, min, sec, us, ps, as; -} npy_datetimestruct; - -typedef struct { - npy_longlong day; - int sec, us, ps, as; -} npy_timedeltastruct; - - #define PyDataType_GetDatetimeMetaData(descr) ((descr->metadata == NULL) ? NULL : ((PyArray_DatetimeMetaData *)(PyCObject_AsVoidPtr(PyDict_GetItemString(descr->metadata, NPY_METADATA_DTSTR))))) typedef int (PyArray_FinalizeFunc)(PyArrayObject *, PyObject *); Modified: branches/1.4.x/numpy/core/setup.py =================================================================== --- branches/1.4.x/numpy/core/setup.py 2010-02-09 06:10:41 UTC (rev 8097) +++ branches/1.4.x/numpy/core/setup.py 2010-02-09 06:11:19 UTC (rev 8098) @@ -703,7 +703,6 @@ join('src', 'multiarray', 'hashdescr.c'), join('src', 'multiarray', 'arrayobject.c'), join('src', 'multiarray', 'buffer.c'), - join('src', 'multiarray', 'datetime.c'), join('src', 'multiarray', 'numpyos.c'), join('src', 'multiarray', 'conversion_utils.c'), join('src', 'multiarray', 'flagsobject.c'), Modified: branches/1.4.x/numpy/core/src/multiarray/arraytypes.c.src =================================================================== --- branches/1.4.x/numpy/core/src/multiarray/arraytypes.c.src 2010-02-09 06:10:41 UTC (rev 8097) +++ branches/1.4.x/numpy/core/src/multiarray/arraytypes.c.src 2010-02-09 06:11:19 UTC (rev 8098) @@ -1,7 +1,6 @@ /* -*- c -*- */ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "datetime.h" #include "structmember.h" #define _MULTIARRAYMODULE @@ -16,7 +15,6 @@ #include "ctors.h" #include "usertypes.h" #include "npy_config.h" -#include "_datetime.h" #include "scalartypes.h" #include "numpyos.h" @@ -705,458 +703,6 @@ } /* - * Acknowledgment: Example code contributed by Marty Fuhr sponsored by - * Google Summer of Code 2009 was used to integrate and adapt the mxDateTime - * parser - */ - -/* #include "datetime.c" --- now included in multiarray_onefile */ - - -/* DateTime Objects in Python only keep microsecond resolution. - * - * When converting from datetime objects with an event component return a - * tuple: * (baseunit, number of event) where baseunit follows is a datetime - * type and number of events is a Python integer - */ - - -/* - * Return a Python Datetime Object from a number representing the number of - * units since the epoch (1970-01-01T00:00:00Z) ignoring leap seconds. - */ - -NPY_NO_EXPORT PyObject * -PyDateTime_FromNormalized(npy_datetime val, NPY_DATETIMEUNIT base) -{ - npy_datetimestruct ydate; - - /* Must be here to use PyDateTime_FromDateAndTime */ - PyDateTime_IMPORT; - - /* We just truncate the unused variables and don't wory about overflow */ - PyArray_DatetimeToDatetimeStruct(val, base, &ydate); - - /* FIXME?: We discard ydate.ns, ydate.ps, ydate.fs, and ydate.as */ - return PyDateTime_FromDateAndTime(ydate.year, ydate.month, ydate.day, - ydate.hour, ydate.min, ydate.sec, - ydate.us); -} - -/* - * We also can lose precision and range here. Ignored. - * Don't use this function if you care. - */ - -NPY_NO_EXPORT PyObject * -PyTimeDelta_FromNormalized(npy_timedelta val, NPY_DATETIMEUNIT base) -{ - npy_timedeltastruct td; - - PyDateTime_IMPORT; - PyArray_TimedeltaToTimedeltaStruct(val, base, &td); - - /* We discard td.ps and td.as */ - return PyDelta_FromDSU(td.day, td.sec, td.us); -} - - -NPY_NO_EXPORT PyObject * -PyDateTime_FromInt64(datetime val, PyArray_Descr *descr) -{ - PyArray_DatetimeMetaData *meta; - - meta = PyDataType_GetDatetimeMetaData(descr); - if (meta == NULL) { - PyErr_SetString(PyExc_RuntimeError, - "metadata not set for descriptor"); - return NULL; - } - - if (meta->events > 1) { - int events, rem, div; - PyObject *obj; - - obj = PyTuple_New(2); - events = meta->events; - div = val/events; - rem = val % events; - PyTuple_SET_ITEM(obj, 1, PyInt_FromLong(rem)); - /* This resets meta->events for recursive call */ - meta->events = 1; - PyTuple_SET_ITEM(obj, 0, PyDateTime_FromInt64(div, descr)); - meta->events = events; - if (PyErr_Occurred()) { - Py_DECREF(obj); - return NULL; - } - return obj; - } - - /* - * We normalize the number to a base-unit and then return a - * Python Datetime Object - * - * FIXME? : We silently truncate if it doesn't fit, either too - * wide (e.g. 10 BC) or too narrow (nanoseconds) - */ - - /* Normalization and then conversion to Datetime */ - /* FIXME? : Check for Overflow... */ - return PyDateTime_FromNormalized(val*meta->num, meta->base); -} - - -NPY_NO_EXPORT PyObject * -PyTimeDelta_FromInt64(timedelta val, PyArray_Descr *descr) -{ - PyArray_DatetimeMetaData *meta; - meta = PyDataType_GetDatetimeMetaData(descr); - if (meta == NULL) { - PyErr_SetString(PyExc_RuntimeError, - "metadata not set for descriptor"); - return NULL; - } - - if (meta->events > 1) { - int events, rem, div; - PyObject *obj; - - obj = PyTuple_New(2); - events = meta->events; - div = val/events; - rem = val % events; - PyTuple_SET_ITEM(obj, 1, PyInt_FromLong(rem)); - /* This resets meta->events for recursive call */ - meta->events = 1; - PyTuple_SET_ITEM(obj, 0, PyTimeDelta_FromInt64(div, descr)); - meta->events = events; - if (PyErr_Occurred()) { - Py_DECREF(obj); - return NULL; - } - return obj; - } - - /* FIXME? : Check for Overflow */ - return PyTimeDelta_FromNormalized(val*meta->num, meta->base); -} - - - -NPY_NO_EXPORT npy_datetime -PyDateTime_AsNormalized(PyObject *obj, NPY_DATETIMEUNIT base) -{ - npy_datetimestruct ydate; - - /* Must be here to use PyDateTime_FromDateAndTime */ - PyDateTime_IMPORT; - - if (!PyDateTime_Check(obj) && !PyDate_Check(obj)) { - PyErr_SetString(PyExc_ValueError, - "Must be a datetime.date or datetime.datetime object"); - return -1; - } - - ydate.year = PyDateTime_GET_YEAR(obj); - ydate.month = PyDateTime_GET_MONTH(obj); - ydate.day = PyDateTime_GET_DAY(obj); - - if (PyDateTime_Check(obj)) { - ydate.hour = PyDateTime_DATE_GET_HOUR(obj); - ydate.min = PyDateTime_DATE_GET_MINUTE(obj); - ydate.sec = PyDateTime_DATE_GET_SECOND(obj); - ydate.us = PyDateTime_DATE_GET_MICROSECOND(obj); - } - else { - ydate.hour = 0; - ydate.min = 0; - ydate.sec = 0; - ydate.us = 0; - } - - ydate.ps = 0; - ydate.as = 0; - - /* We just truncate the unused variables and don't wory about overflow */ - return PyArray_DatetimeStructToDatetime(base, &ydate); -} - -NPY_NO_EXPORT npy_timedelta -PyTimeDelta_AsNormalized(PyObject *obj, NPY_DATETIMEUNIT base) -{ - npy_timedeltastruct td; - - PyDateTime_IMPORT; - - if (!PyDelta_Check(obj)) { - PyErr_SetString(PyExc_ValueError, - "Must be a datetime.timedelta object"); - return -1; - } - - td.day = ((PyDateTime_Delta *)obj)->days; - td.sec = ((PyDateTime_Delta *)obj)->seconds; - td.us = ((PyDateTime_Delta *)obj)->microseconds; - td.ps = 0; - td.as = 0; - - return PyArray_TimedeltaStructToTimedelta(base, &td); -} - - -/* - * These expect a 2-tuple if meta->events > 1 (baseobj, num-counts) - * where baseobj is a datetime object or a timedelta object respectively. - * - */ - -NPY_NO_EXPORT npy_datetime -PyDateTime_AsInt64(PyObject *obj, PyArray_Descr *descr) -{ - PyArray_DatetimeMetaData *meta; - npy_datetime res; - - meta = PyDataType_GetDatetimeMetaData(descr); - if (meta == NULL) { - PyErr_SetString(PyExc_RuntimeError, - "metadata not set for descriptor"); - return -1; - } - - - if (meta->events > 1) { - datetime tmp; - int events; - - if (!PyTuple_Check(obj) || PyTuple_GET_SIZE(obj) != 2) { - PyErr_SetString(PyExc_ValueError, - "need a 2-tuple on setting if events > 1"); - return -1; - } - /* Alter the dictionary and call again */ - /* FIXME: not thread safe */ - events = meta->events; - meta->events = 1; - tmp = PyDateTime_AsInt64(PyTuple_GET_ITEM(obj, 0), descr); - meta->events = events; - if (PyErr_Occurred()) { - return -1; - } - /* FIXME: Check for overflow */ - tmp *= events; - tmp += MyPyLong_AsLongLong(PyTuple_GET_ITEM(obj, 1)); - if (PyErr_Occurred()) { - return -1; - } - return tmp; - } - - res = PyDateTime_AsNormalized(obj, meta->base); - return res/meta->num; -} - - -NPY_NO_EXPORT timedelta -PyTimeDelta_AsInt64(PyObject *obj, PyArray_Descr *descr) -{ - PyArray_DatetimeMetaData *meta; - npy_timedelta res; - - meta = PyDataType_GetDatetimeMetaData(descr); - if (meta == NULL) { - PyErr_SetString(PyExc_RuntimeError, - "metadata not set for descriptor"); - return -1; - } - - if (meta->events > 1) { - timedelta tmp; - int events; - - if (!PyTuple_Check(obj) || PyTuple_GET_SIZE(obj) != 2) { - PyErr_SetString(PyExc_ValueError, - "need a 2-tuple on setting if events > 1"); - return -1; - } - /* Alter the dictionary and call again (not thread safe) */ - events = meta->events; - meta->events = 1; - tmp = PyTimeDelta_AsInt64(PyTuple_GET_ITEM(obj, 0), descr); - meta->events = events; - if (PyErr_Occurred()) { - return -1; - } - /* FIXME: Check for overflow */ - tmp *= events; - tmp += MyPyLong_AsLongLong(PyTuple_GET_ITEM(obj, 1)); - if (PyErr_Occurred()) { - return -1; - } - return tmp; - } - - res = PyTimeDelta_AsNormalized(obj, meta->base); - return res / meta->num; -} - - -/* - * Always return DateTime Object after normalizing to basic units (or a tuple - * if meta->events > 1): - * - * Problem: DateTime does not support all the resolutions (ns) nor the - * dynamic range (pre 1 AD) of NumPy Date-times. - * - * getitem is not used that much --- if losing resolution hurts, stick - * with the array scalar versions of the date-time. - * - * considered returning array scalars here just like longdouble. This has the - * problem of recursion in some cases (because in a few places the code - * expects getitem to return a Python-system object) - * - * considered returning different things depending on the resolution but this - * would make it hard to write generic code --- but do you need to write - * generic code on all the frequencies because they cover a wide range. - * - * Solution: The use-case of actually wanting a date-time object when the - * resolution and dynamic range match, make it the compelling default. When it - * does fails, there are alternatives for the programmer to use. - * - * New question: Should we change (c)longdouble at this point? to return Python Float? - */ - -static PyObject * -DATETIME_getitem(char *ip, PyArrayObject *ap) { - datetime t1; - - if ((ap == NULL) || PyArray_ISBEHAVED_RO(ap)) { - t1 = *((datetime *)ip); - return PyDateTime_FromInt64((datetime)t1, ap->descr); - } - else { - ap->descr->f->copyswap(&t1, ip, !PyArray_ISNOTSWAPPED(ap), ap); - return PyDateTime_FromInt64((datetime)t1, ap->descr); - } -} - -static PyObject * -TIMEDELTA_getitem(char *ip, PyArrayObject *ap) { - timedelta t1; - - if ((ap == NULL) || PyArray_ISBEHAVED_RO(ap)) { - t1 = *((timedelta *)ip); - return PyTimeDelta_FromInt64((timedelta)t1, ap->descr); - } - else { - ap->descr->f->copyswap(&t1, ip, !PyArray_ISNOTSWAPPED(ap), ap); - return PyTimeDelta_FromInt64((timedelta)t1, ap->descr); - } -} - -/* FIXME: - * This needs to take - * 1) Integers and Longs (anything that can be converted to an Int) - * 2) Strings (ISO-style dates) - * 3) Datetime Scalars (that it converts based on scalar dtype. - * 4) Datetime and Date objects - * Plus a tuple for meta->events > 1 - * - * 3) is partially implemented, 4) is implemented - */ - -static int -DATETIME_setitem(PyObject *op, char *ov, PyArrayObject *ap) { - /* ensure alignment */ - datetime temp; - - if (PyArray_IsScalar(op, Datetime)) { - /* This needs to convert based on type */ - temp = ((PyDatetimeScalarObject *)op)->obval; - } - else if (PyString_Check(op) || PyUnicode_Check(op)) { - /* FIXME: Converts to DateTime first and therefore does not handle extended notation */ - /* import _mx_datetime_parser - * res = _mx_datetime_parser(name) - * Convert from datetime to Int - */ - PyObject *res, *module; - - module = PyImport_ImportModule("numpy.core._mx_datetime_parser"); - if (module == NULL) { return -1; } - res = PyObject_CallMethod(module, "datetime_from_string", "O", op); - Py_DECREF(module); - if (res == NULL) { return -1; } - temp = PyDateTime_AsInt64(res, ap->descr); - Py_DECREF(res); - if (PyErr_Occurred()) return -1; - } - else if (PyInt_Check(op)) { - temp = PyInt_AS_LONG(op); - } - else if (PyLong_Check(op)) { - temp = PyLong_AsLongLong(op); - } - else { - temp = PyDateTime_AsInt64(op, ap->descr); - } - if (PyErr_Occurred()) { - if (PySequence_Check(op)) { - PyErr_Clear(); - PyErr_SetString(PyExc_ValueError, _SEQUENCE_MESSAGE); - } - return -1; - } - if (ap == NULL || PyArray_ISBEHAVED(ap)) - *((datetime *)ov)=temp; - else { - ap->descr->f->copyswap(ov, &temp, !PyArray_ISNOTSWAPPED(ap), ap); - } - return 0; -} - -/* FIXME: This needs to take - * 1) Integers and Longs (anything that can be converted to an Int) - * 2) Timedelta scalar objects (with resolution conversion) - * 3) Python Timedelta objects - * - * Plus a tuple for meta->events > 1 - */ - -static int -TIMEDELTA_setitem(PyObject *op, char *ov, PyArrayObject *ap) { - /* ensure alignment */ - timedelta temp; - - if (PyArray_IsScalar(op, Timedelta)) { - temp = ((PyTimedeltaScalarObject *)op)->obval; - } - else if (PyInt_Check(op)) { - temp = PyInt_AS_LONG(op); - } - else if (PyLong_Check(op)) { - temp = PyLong_AsLongLong(op); - } - else { - temp = PyTimeDelta_AsInt64(op, ap->descr); - } - if (PyErr_Occurred()) { - if (PySequence_Check(op)) { - PyErr_Clear(); - PyErr_SetString(PyExc_ValueError, _SEQUENCE_MESSAGE); - } - return -1; - } - if (ap == NULL || PyArray_ISBEHAVED(ap)) - *((timedelta *)ov)=temp; - else { - ap->descr->f->copyswap(ov, &temp, !PyArray_ISNOTSWAPPED(ap), ap); - } - return 0; -} - - -/* ***************************************************************************** ** TYPE TO TYPE CONVERSIONS ** ***************************************************************************** @@ -1169,21 +715,17 @@ /**begin repeat * * #TOTYPE = BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, - * LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE, DATETIME, - * TIMEDELTA# + * LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE# * #totype = byte, ubyte, short, ushort, int, uint, long, ulong, - * longlong, ulonglong, float, double, longdouble, datetime, - * timedelta# + * longlong, ulonglong, float, double, longdouble# */ /**begin repeat1 * * #FROMTYPE = BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, - * LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE, DATETIME, - * TIMEDELTA# + * LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE# * #fromtype = byte, ubyte, short, ushort, int, uint, long, ulong, - * longlong, ulonglong, float, double, longdouble, datetime, - * timedelta# + * longlong, ulonglong, float, double, longdouble# */ static void @FROMTYPE at _to_@TOTYPE@(@fromtype@ *ip, @totype@ *op, intp n, @@ -1217,11 +759,9 @@ /**begin repeat * * #FROMTYPE = BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, - * LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE, DATETIME, - * TIMEDELTA# + * LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE# * #fromtype = Bool, byte, ubyte, short, ushort, int, uint, long, ulong, - * longlong, ulonglong, float, double, longdouble, datetime, - * timedelta# + * longlong, ulonglong, float, double, longdouble# */ static void @FROMTYPE at _to_BOOL(@fromtype@ *ip, Bool *op, intp n, @@ -1252,11 +792,9 @@ /**begin repeat * #TOTYPE = BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, - * LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE, DATETIME, - * TIMEDELTA# + * LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE# * #totype = byte, ubyte, short, ushort, int, uint, long, ulong, - * longlong, ulonglong, float, double, longdouble, datetime, - * timedelta# + * longlong, ulonglong, float, double, longdouble# */ static void BOOL_to_ at TOTYPE@(Bool *ip, @totype@ *op, intp n, @@ -1276,11 +814,9 @@ /**begin repeat1 * #FROMTYPE = BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, - * LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE, DATETIME, - * TIMEDELTA# + * LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE# * #fromtype = Bool, byte, ubyte, short, ushort, int, uint, long, ulong, - * longlong, ulonglong, float, double, longdouble, datetime, - * timedelta# + * longlong, ulonglong, float, double, longdouble# */ static void @FROMTYPE at _to_@TOTYPE@(@fromtype@ *ip, @totype@ *op, intp n, @@ -1322,13 +858,11 @@ * * #FROMTYPE = BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, * LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE, - * CFLOAT, CDOUBLE, CLONGDOUBLE, STRING, UNICODE, VOID, OBJECT, - * DATETIME, TIMEDELTA# + * CFLOAT, CDOUBLE, CLONGDOUBLE, STRING, UNICODE, VOID, OBJECT# * #fromtype = Bool, byte, ubyte, short, ushort, int, uint, long, ulong, * longlong, ulonglong, float, double, longdouble, - * cfloat, cdouble, clongdouble, char, char, char, PyObject *, - * datetime, timedelta# - * #skip = 1*17, aip->descr->elsize*3, 1*3# + * cfloat, cdouble, clongdouble, char, char, char, PyObject *# + * #skip = 1*17, aip->descr->elsize*3, 1*1# */ static void @FROMTYPE at _to_OBJECT(@fromtype@ *ip, PyObject **op, intp n, PyArrayObject *aip, @@ -1370,13 +904,11 @@ * * #TOTYPE = BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, * LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE, - * CFLOAT, CDOUBLE, CLONGDOUBLE, STRING, UNICODE, VOID, DATETIME, - * TIMEDELTA# + * CFLOAT, CDOUBLE, CLONGDOUBLE, STRING, UNICODE, VOID# * #totype = Bool, byte, ubyte, short, ushort, int, uint, long, ulong, * longlong, ulonglong, float, double, longdouble, - * cfloat, cdouble, clongdouble, char, char, char, datetime, - * timedelta# - * #skip = 1*17, aop->descr->elsize*3, 1*2# + * cfloat, cdouble, clongdouble, char, char, char# + * #skip = 1*17, aop->descr->elsize*3# */ static void OBJECT_to_ at TOTYPE@(PyObject **ip, @totype@ *op, intp n, @@ -1399,13 +931,13 @@ /**begin repeat * - * #from = STRING*22, UNICODE*22, VOID*22# - * #fromtyp = char*66# - * #to = (BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE, STRING, UNICODE, VOID, DATETIME, TIMEDELTA)*3# - * #totyp = (Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, cfloat, cdouble, clongdouble, char, char, char, datetime, timedelta)*3# - * #oskip = (1*17,aop->descr->elsize*3,1*2)*3# - * #convert = 1*17, 0*3, 1*2, 1*17, 0*3, 1*2, 0*22# - * #convstr = (Int*9, Long*2, Float*3, Complex*3, Tuple*3, Long*2)*3# + * #from = STRING*20, UNICODE*20, VOID*20# + * #fromtyp = char*60# + * #to = (BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE, STRING, UNICODE, VOID)*3# + * #totyp = (Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, cfloat, cdouble, clongdouble, char, char, char)*3# + * #oskip = (1*17,aop->descr->elsize*3)*3# + * #convert = 1*17, 0*3, 1*17, 0*3, 0*20# + * #convstr = (Int*9, Long*2, Float*3, Complex*3, Tuple*3)*3# */ static void @from at _to_@to@(@fromtyp@ *ip, @totyp@ *op, intp n, PyArrayObject *aip, @@ -1444,10 +976,10 @@ /**begin repeat * - * #to = STRING*19, UNICODE*19, VOID*19# - * #totyp = char*19, char*19, char*19# - * #from = (BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE, DATETIME, TIMEDELTA)*3# - * #fromtyp = (Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, cfloat, cdouble, clongdouble, datetime, timedelta)*3# + * #to = STRING*17, UNICODE*17, VOID*17# + * #totyp = char*17, char*17, char*17# + * #from = (BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE)*3# + * #fromtyp = (Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, cfloat, cdouble, clongdouble)*3# */ static void @from at _to_@to@(@fromtyp@ *ip, @totyp@ *op, intp n, PyArrayObject *aip, @@ -1549,11 +1081,11 @@ /**begin repeat * #fname = BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, - * ULONGLONG, DATETIME, TIMEDELTA# + * ULONGLONG# * #type = byte, ubyte, short, ushort, int, uint, long, ulong, longlong, - * ulonglong, datetime, timedelta# - * #func = (l, ul)*5, l, l# - * #btype = (long, ulong)*5, long, long# + * ulonglong# + * #func = (l, ul)*5# + * #btype = (long, ulong)*5# */ static int @fname at _fromstr(char *str, @type@ *ip, char **endptr, PyArray_Descr *NPY_UNUSED(ignore)) @@ -1596,11 +1128,11 @@ /**begin repeat * * #fname = SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG, FLOAT, - * DOUBLE, LONGDOUBLE, DATETIME, TIMEDELTA# + * DOUBLE, LONGDOUBLE# * #fsize = SHORT, SHORT, INT, INT, LONG, LONG, LONGLONG, LONGLONG, FLOAT, - * DOUBLE, LONGDOUBLE, DATETIME, TIMEDELTA# + * DOUBLE, LONGDOUBLE# * #type = short, ushort, int, uint, long, ulong, longlong, ulonglong, float, - * double, longdouble, datetime, timedelta# + * double, longdouble# */ static void @fname at _copyswapn (void *dst, intp dstride, void *src, intp sstride, @@ -2090,8 +1622,8 @@ /****************** nonzero **********************************/ /**begin repeat -#fname=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,DATETIME,TIMEDELTA# -#type=Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, datetime, timedelta# +#fname=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE# +#type=Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble# */ static Bool @fname at _nonzero (char *ip, PyArrayObject *ap) @@ -2293,9 +1825,9 @@ /**begin repeat * #TYPE = BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, - * LONGLONG, ULONGLONG, DATETIME, TIMEDELTA# + * LONGLONG, ULONGLONG# * #type = byte, ubyte, short, ushort, int, uint, long, ulong, - * longlong, ulonglong, datetime, timedelta# + * longlong, ulonglong# */ static int @@ -2551,9 +2083,9 @@ /**begin repeat -#fname= BOOL,BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE, DATETIME, TIMEDELTA# -#type= Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, float, double, longdouble, datetime, timedelta# -#incr= ip++*14, ip+=2*3, ip++*2# +#fname= BOOL,BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE# +#type= Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, float, double, longdouble# +#incr= ip++*14, ip+=2*3# */ static int @@ -2641,9 +2173,9 @@ } /**begin repeat -#name=BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE, DATETIME, TIMEDELTA# -#type= byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, datetime, timedelta# -#out= long, ulong, long, ulong, long, ulong, long, ulong, longlong, ulonglong, float, double, longdouble, datetime, timedelta# +#name=BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE# +#type= byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble# +#out= long, ulong, long, ulong, long, ulong, long, ulong, longlong, ulonglong, float, double, longdouble# */ static void @name at _dot(char *ip1, intp is1, char *ip2, intp is2, char *op, intp n, @@ -2746,8 +2278,8 @@ } /**begin repeat -#NAME=BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,DATETIME,TIMEDELTA# -#typ=byte,ubyte,short,ushort,int,uint,long,ulong,longlong,ulonglong,float,double,longdouble,datetime,timedelta# +#NAME=BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE# +#typ=byte,ubyte,short,ushort,int,uint,long,ulong,longlong,ulonglong,float,double,longdouble# */ static void @NAME at _fill(@typ@ *buffer, intp length, void *NPY_UNUSED(ignored)) @@ -2812,8 +2344,8 @@ /**end repeat**/ /**begin repeat -#NAME=SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE,DATETIME,TIMEDELTA# -#typ=short,ushort,int,uint,long,ulong,longlong,ulonglong,float,double,longdouble,cfloat,cdouble,clongdouble,datetime,timedelta# +#NAME=SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE# +#typ=short,ushort,int,uint,long,ulong,longlong,ulonglong,float,double,longdouble,cfloat,cdouble,clongdouble# */ static void @NAME at _fillwithscalar(@typ@ *buffer, intp length, @typ@ *value, void *NPY_UNUSED(ignored)) @@ -2834,8 +2366,8 @@ *************************/ /**begin repeat -#name=BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE, DATETIME, TIMEDELTA# -#type= Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, datetime, timedelta# +#name=BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE# +#type= Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble# */ static void @name at _fastclip(@type@ *in, intp ni, @type@ *min, @type@ *max, @type@ *out) @@ -2933,8 +2465,8 @@ *************************/ /**begin repeat -#name=BOOL,BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE,CFLOAT, CDOUBLE, CLONGDOUBLE, DATETIME, TIMEDELTA# -#type= Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble,cfloat, cdouble, clongdouble, datetime, timedelta# +#name=BOOL,BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE,CFLOAT, CDOUBLE, CLONGDOUBLE# +#type= Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble,cfloat, cdouble, clongdouble# */ static void @name at _fastputmask(@type@ *in, Bool *mask, intp ni, @type@ *vals, intp nv) @@ -2970,8 +2502,8 @@ *************************/ /**begin repeat -#name=BOOL,BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE,CFLOAT, CDOUBLE, CLONGDOUBLE, DATETIME, TIMEDELTA# -#type= Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble,cfloat, cdouble, clongdouble, datetime, timedelta# +#name=BOOL,BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE,CFLOAT, CDOUBLE, CLONGDOUBLE# +#type= Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble,cfloat, cdouble, clongdouble# */ static int @name at _fasttake(@type@ *dest, @type@ *src, intp *indarray, @@ -3088,8 +2620,6 @@ (PyArray_VectorUnaryFunc*)@from at _to_STRING, (PyArray_VectorUnaryFunc*)@from at _to_UNICODE, (PyArray_VectorUnaryFunc*)@from at _to_VOID, - (PyArray_VectorUnaryFunc*)@from at _to_DATETIME, - (PyArray_VectorUnaryFunc*)@from at _to_TIMEDELTA }, (PyArray_GetItemFunc*)@from at _getitem, (PyArray_SetItemFunc*)@from at _setitem, @@ -3138,13 +2668,13 @@ /**begin repeat -#from= BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE,OBJECT,DATETIME,TIMEDELTA# -#num= 1*14,2*3,1*3# -#fromtyp= Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, float, double, longdouble, PyObject *, datetime, timedelta# -#NAME= Bool, Byte, UByte, Short, UShort, Int, UInt, Long, ULong, LongLong, ULongLong, Float, Double, LongDouble, CFloat, CDouble, CLongDouble, Object, Datetime, Timedelta# -#kind= GENBOOL, SIGNED, UNSIGNED, SIGNED, UNSIGNED, SIGNED, UNSIGNED, SIGNED, UNSIGNED, SIGNED, UNSIGNED, FLOATING, FLOATING, FLOATING, COMPLEX, COMPLEX, COMPLEX, OBJECT, DATETIME, TIMEDELTA# -#endian= |*3, =*14, |, =*2# -#isobject= 0*17,NPY_OBJECT_DTYPE_FLAGS,0*2# +#from= BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE,OBJECT# +#num= 1*14,2*3,1*1# +#fromtyp= Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, float, double, longdouble, PyObject *# +#NAME= Bool, Byte, UByte, Short, UShort, Int, UInt, Long, ULong, LongLong, ULongLong, Float, Double, LongDouble, CFloat, CDouble, CLongDouble, Object# +#kind= GENBOOL, SIGNED, UNSIGNED, SIGNED, UNSIGNED, SIGNED, UNSIGNED, SIGNED, UNSIGNED, SIGNED, UNSIGNED, FLOATING, FLOATING, FLOATING, COMPLEX, COMPLEX, COMPLEX, OBJECT# +#endian= |*3, =*14, |# +#isobject= 0*17,NPY_OBJECT_DTYPE_FLAGS# */ static PyArray_ArrFuncs _Py at NAME@_ArrFuncs = { @@ -3170,8 +2700,6 @@ (PyArray_VectorUnaryFunc*)@from at _to_STRING, (PyArray_VectorUnaryFunc*)@from at _to_UNICODE, (PyArray_VectorUnaryFunc*)@from at _to_VOID, - (PyArray_VectorUnaryFunc*)@from at _to_DATETIME, - (PyArray_VectorUnaryFunc*)@from at _to_TIMEDELTA }, (PyArray_GetItemFunc*)@from at _getitem, (PyArray_SetItemFunc*)@from at _setitem, @@ -3218,25 +2746,6 @@ /**end repeat**/ -static void -_init_datetime_descr(PyArray_Descr *descr) -{ - PyArray_DatetimeMetaData *dt_data; - PyObject *cobj; - - dt_data = _pya_malloc(sizeof(PyArray_DatetimeMetaData)); - dt_data->base = NPY_FR_us; - dt_data->num = 1; - dt_data->den = 1; - dt_data->events = 1; - - cobj = PyCObject_FromVoidPtr((void *)dt_data, _pya_free); - descr->metadata = PyDict_New(); - PyDict_SetItemString(descr->metadata, NPY_METADATA_DTSTR, cobj); - Py_DECREF(cobj); - -} - #define _MAX_LETTER 128 static char _letter_to_num[_MAX_LETTER]; @@ -3262,8 +2771,6 @@ &STRING_Descr, &UNICODE_Descr, &VOID_Descr, - &DATETIME_Descr, - &TIMEDELTA_Descr, }; /*NUMPY_API @@ -3318,13 +2825,6 @@ Py_INCREF(ret); } - /* Make sure dtype metadata is initialized for DATETIME */ - if (PyTypeNum_ISDATETIME(type)) { - if (ret->metadata == NULL) { - _init_datetime_descr(ret); - } - } - return ret; } @@ -3340,14 +2840,14 @@ } /**begin repeat -#name=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,INTP,UINTP,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE,OBJECT,STRING,UNICODE,VOID,DATETIME,TIMEDELTA# +#name=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,INTP,UINTP,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE,OBJECT,STRING,UNICODE,VOID# */ _letter_to_num[PyArray_ at name@LTR] = PyArray_ at name@; /**end repeat**/ _letter_to_num[PyArray_STRINGLTR2] = PyArray_STRING; /**begin repeat -#name=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE,OBJECT,STRING,UNICODE,VOID,DATETIME,TIMEDELTA# +#name=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE,OBJECT,STRING,UNICODE,VOID# */ @name at _Descr.fields = Py_None; /**end repeat**/ @@ -3429,22 +2929,6 @@ (PyObject *)\ &PyVoidArrType_Type)); Py_DECREF(s); - PyDict_SetItemString(infodict, "DATETIME", - s=Py_BuildValue("ciiiNNO", PyArray_DATETIMELTR, - PyArray_DATETIME, - sizeof(npy_datetime)*CHAR_BIT, - _ALIGN(npy_datetime), - MyPyLong_FromInt64(MAX_DATETIME), MyPyLong_FromInt64(MIN_DATETIME), - (PyObject *)&PyDatetimeArrType_Type)); - Py_DECREF(s); - PyDict_SetItemString(infodict, "TIMEDELTA", - s=Py_BuildValue("ciiiNNO", PyArray_TIMEDELTALTR, - PyArray_TIMEDELTA, - sizeof(npy_timedelta)*CHAR_BIT, - _ALIGN(npy_timedelta), - MyPyLong_FromInt64(MAX_TIMEDELTA), MyPyLong_FromInt64(MIN_TIMEDELTA), - (PyObject *)&PyTimedeltaArrType_Type)); - Py_DECREF(s); #define SETTYPE(name) \ Py_INCREF(&Py##name##ArrType_Type); \ @@ -3456,7 +2940,6 @@ SETTYPE(Integer); SETTYPE(Inexact); SETTYPE(SignedInteger); - SETTYPE(TimeInteger); SETTYPE(UnsignedInteger); SETTYPE(Floating); SETTYPE(ComplexFloating); Modified: branches/1.4.x/numpy/core/src/multiarray/convert_datatype.c =================================================================== --- branches/1.4.x/numpy/core/src/multiarray/convert_datatype.c 2010-02-09 06:10:41 UTC (rev 8097) +++ branches/1.4.x/numpy/core/src/multiarray/convert_datatype.c 2010-02-09 06:11:19 UTC (rev 8098) @@ -510,10 +510,6 @@ if (totype == PyArray_BOOL) { return 0; } - if (fromtype == PyArray_DATETIME || fromtype == PyArray_TIMEDELTA || - totype == PyArray_DATETIME || totype == PyArray_TIMEDELTA) { - return 0; - } if (totype == PyArray_OBJECT || totype == PyArray_VOID) { return 1; } Deleted: branches/1.4.x/numpy/core/src/multiarray/datetime.c =================================================================== --- branches/1.4.x/numpy/core/src/multiarray/datetime.c 2010-02-09 06:10:41 UTC (rev 8097) +++ branches/1.4.x/numpy/core/src/multiarray/datetime.c 2010-02-09 06:11:19 UTC (rev 8098) @@ -1,910 +0,0 @@ -#define PY_SSIZE_T_CLEAN -#include -#include - -#include - -#define _MULTIARRAYMODULE -#define NPY_NO_PREFIX -#include - -#include "npy_config.h" - -#include "_datetime.h" - -/* For defaults and errors */ -#define NPY_FR_ERR -1 - -/* Offset for number of days between Dec 31, 1969 and Jan 1, 0001 -* Assuming Gregorian calendar was always in effect (proleptic Gregorian calendar) -*/ - -/* Calendar Structure for Parsing Long -> Date */ -typedef struct { - int year, month, day; -} ymdstruct; - -typedef struct { - int hour, min, sec; -} hmsstruct; - - -/* - ==================================================== - == Beginning of section borrowed from mx.DateTime == - ==================================================== -*/ - -/* - * Functions in the following section are borrowed from mx.DateTime version - * 2.0.6, and hence this code is subject to the terms of the egenix public - * license version 1.0.0 - */ - -#define Py_AssertWithArg(x,errortype,errorstr,a1) {if (!(x)) {PyErr_Format(errortype,errorstr,a1);goto onError;}} - -/* Table with day offsets for each month (0-based, without and with leap) */ -static int month_offset[2][13] = { - { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }, - { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 } -}; - -/* Table of number of days in a month (0-based, without and with leap) */ -static int days_in_month[2][12] = { - { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }, - { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } -}; - -/* Return 1/0 iff year points to a leap year in calendar. */ -static int -is_leapyear(register long year) -{ - return (year % 4 == 0) && ((year % 100 != 0) || (year % 400 == 0)); -} - - -/* - * Return the day of the week for the given absolute date. - * Monday is 0 and Sunday is 6 - */ -static int -day_of_week(npy_longlong absdate) -{ - /* Add in four for the Thursday on Jan 1, 1970 (epoch offset)*/ - absdate += 4; - - if (absdate >= 0) { - return absdate % 7; - } - else { - return 6 + (absdate + 1) % 7; - } -} - -/* - * Return the year offset, that is the absolute date of the day - * 31.12.(year-1) since 31.12.1969 in the proleptic Gregorian calendar. - */ -static npy_longlong -year_offset(register npy_longlong year) -{ - /* Note that 477 == 1969/4 - 1969/100 + 1969/400 */ - year--; - if (year >= 0 || -1/4 == -1) - return (year-1969)*365 + year/4 - year/100 + year/400 - 477; - else - return (year-1969)*365 + (year-3)/4 - (year-99)/100 + (year-399)/400 - 477; -} - -/* - * Modified version of mxDateTime function - * Returns absolute number of days since Jan 1, 1970 - * assuming a proleptic Gregorian Calendar - * Raises a ValueError if out of range month or day - * day -1 is Dec 31, 1969, day 0 is Jan 1, 1970, day 1 is Jan 2, 1970 - */ -static npy_longlong -days_from_ymd(int year, int month, int day) -{ - - /* Calculate the absolute date */ - int leap; - npy_longlong yearoffset, absdate; - - /* Is it a leap year ? */ - leap = is_leapyear(year); - - /* Negative month values indicate months relative to the years end */ - if (month < 0) month += 13; - Py_AssertWithArg(month >= 1 && month <= 12, - PyExc_ValueError, - "month out of range (1-12): %i", - month); - - /* Negative values indicate days relative to the months end */ - if (day < 0) day += days_in_month[leap][month - 1] + 1; - Py_AssertWithArg(day >= 1 && day <= days_in_month[leap][month - 1], - PyExc_ValueError, - "day out of range: %i", - day); - - /* - * Number of days between Dec 31, (year - 1) and Dec 31, 1969 - * (can be negative). - */ - yearoffset = year_offset(year); - - if (PyErr_Occurred()) goto onError; - - /* - * Calculate the number of days using yearoffset - * Jan 1, 1970 is day 0 and thus Dec. 31, 1969 is day -1 - */ - absdate = day-1 + month_offset[leap][month - 1] + yearoffset; - - return absdate; - - onError: - return 0; - -} - -/* Returns absolute seconds from an hour, minute, and second - */ -#define secs_from_hms(hour, min, sec) ((hour)*3600 + (min)*60 + (sec)) - -/* - * Takes a number of days since Jan 1, 1970 (positive or negative) - * and returns the year. month, and day in the proleptic - * Gregorian calendar - * - * Examples: - * - * -1 returns 1969, 12, 31 - * 0 returns 1970, 1, 1 - * 1 returns 1970, 1, 2 - */ - -static ymdstruct -days_to_ymdstruct(npy_datetime dlong) -{ - ymdstruct ymd; - register long year; - npy_longlong yearoffset; - int leap, dayoffset; - int month = 1, day = 1; - int *monthoffset; - - dlong += 1; - - /* Approximate year */ - year = 1970 + dlong / 365.2425; - - /* Apply corrections to reach the correct year */ - while (1) { - /* Calculate the year offset */ - yearoffset = year_offset(year); - - /* - * Backward correction: absdate must be greater than the - * yearoffset - */ - if (yearoffset >= dlong) { - year--; - continue; - } - - dayoffset = dlong - yearoffset; - leap = is_leapyear(year); - - /* Forward correction: non leap years only have 365 days */ - if (dayoffset > 365 && !leap) { - year++; - continue; - } - break; - } - - /* Now iterate to find the month */ - monthoffset = month_offset[leap]; - for (month = 1; month < 13; month++) { - if (monthoffset[month] >= dayoffset) - break; - } - day = dayoffset - month_offset[leap][month-1]; - - ymd.year = year; - ymd.month = month; - ymd.day = day; - - return ymd; -} - -/* - * Converts an integer number of seconds in a day to hours minutes seconds. - * It assumes seconds is between 0 and 86399. - */ - -static hmsstruct -seconds_to_hmsstruct(npy_longlong dlong) -{ - int hour, minute, second; - hmsstruct hms; - - hour = dlong / 3600; - minute = (dlong % 3600) / 60; - second = dlong - (hour*3600 + minute*60); - - hms.hour = hour; - hms.min = minute; - hms.sec = second; - - return hms; -} - -/* - ==================================================== - == End of section adapted from mx.DateTime == - ==================================================== -*/ - - -/*================================================== -// Parsing DateTime struct and returns a date-time number -// ================================================= - - Structure is assumed to be already normalized -*/ - -/* - * Create a datetime value from a filled datetime struct and resolution unit. - */ -NPY_NO_EXPORT npy_datetime -PyArray_DatetimeStructToDatetime(NPY_DATETIMEUNIT fr, npy_datetimestruct *d) -{ - npy_datetime ret; - npy_longlong days; /* The absolute number of days since Jan 1, 1970 */ - - if (fr > NPY_FR_M) { - days = days_from_ymd(d->year, d->month, d->day); - } - if (fr == NPY_FR_Y) { - ret = d->year - 1970; - } - else if (fr == NPY_FR_M) { - ret = (d->year - 1970) * 12 + d->month - 1; - } - else if (fr == NPY_FR_W) { - /* This is just 7-days for now. */ - if (days >= 0) { - ret = days / 7; - } - else { - ret = (days - 6) / 7; - } - } - else if (fr == NPY_FR_B) { - npy_longlong x; - int dotw = day_of_week(days); - - if (dotw > 4) { - /* Invalid business day */ - ret = 0; - } - else { - if (days >= 0) { - /* offset to adjust first week */ - x = days - 4; - } - else { - x = days - 2; - } - ret = 2 + (x / 7) * 5 + x % 7; - } - } - else if (fr == NPY_FR_D) { - ret = days; - } - else if (fr == NPY_FR_h) { - ret = days * 24 + d->hour; - } - else if (fr == NPY_FR_m) { - ret = days * 1440 + d->hour * 60 + d->min; - } - else if (fr == NPY_FR_s) { - ret = days * 86400 + secs_from_hms(d->hour, d->min, d->sec); - } - else if (fr == NPY_FR_ms) { - ret = days * 86400000 + secs_from_hms(d->hour, d->min, d->sec) * 1000 - + (d->us / 1000); - } - else if (fr == NPY_FR_us) { - npy_int64 num = 86400 * 1000; - num *= 1000; - ret = days * num + secs_from_hms(d->hour, d->min, d->sec) * 1000000 - + d->us; - } - else if (fr == NPY_FR_ns) { - npy_int64 num = 86400 * 1000; - num *= 1000 * 1000; - ret = days * num + secs_from_hms(d->hour, d->min, d->sec) * 1000000000 - + d->us * 1000 + (d->ps / 1000); - } - else if (fr == NPY_FR_ps) { - npy_int64 num2 = 1000 * 1000; - npy_int64 num1; - - num2 *= 1000 * 1000; - num1 = 86400 * num2; - ret = days * num1 + secs_from_hms(d->hour, d->min, d->sec) * num2 - + d->us * 1000000 + d->ps; - } - else if (fr == NPY_FR_fs) { - /* only 2.6 hours */ - npy_int64 num2 = 1000000; - num2 *= 1000000; - num2 *= 1000; - - /* get number of seconds as a postive or negative number */ - if (days >= 0) { - ret = secs_from_hms(d->hour, d->min, d->sec); - } - else { - ret = ((d->hour - 24)*3600 + d->min*60 + d->sec); - } - ret = ret * num2 + d->us * 1000000000 + d->ps * 1000 + (d->as / 1000); - } - else if (fr == NPY_FR_as) { - /* only 9.2 secs */ - npy_int64 num1, num2; - - num1 = 1000000; - num1 *= 1000000; - num2 = num1 * 1000000; - - if (days >= 0) { - ret = d->sec; - } - else { - ret = d->sec - 60; - } - ret = ret * num2 + d->us * num1 + d->ps * 1000000 + d->as; - } - else { - /* Shouldn't get here */ - PyErr_SetString(PyExc_ValueError, "invalid internal frequency"); - ret = -1; - } - - return ret; -} - -/* Uses Average values when frequency is Y, M, or B */ - -#define _DAYS_PER_MONTH 30.436875 -#define _DAYS_PER_YEAR 365.2425 - -/* - * Create a timdelta value from a filled timedelta struct and resolution unit. - */ -NPY_NO_EXPORT npy_datetime -PyArray_TimedeltaStructToTimedelta(NPY_DATETIMEUNIT fr, npy_timedeltastruct *d) -{ - npy_datetime ret; - - if (fr == NPY_FR_Y) { - ret = d->day / _DAYS_PER_YEAR; - } - else if (fr == NPY_FR_M) { - ret = d->day / _DAYS_PER_MONTH; - } - else if (fr == NPY_FR_W) { - /* This is just 7-days for now. */ - if (d->day >= 0) { - ret = d->day / 7; - } - else { - ret = (d->day - 6) / 7; - } - } - else if (fr == NPY_FR_B) { - /* - * What is the meaning of a relative Business day? - * - * This assumes you want to take the day difference and - * convert it to business-day difference (removing 2 every 7). - */ - ret = (d->day / 7) * 5 + d->day % 7; - } - else if (fr == NPY_FR_D) { - ret = d->day; - } - else if (fr == NPY_FR_h) { - ret = d->day + d->sec / 3600; - } - else if (fr == NPY_FR_m) { - ret = d->day * 1440 + d->sec / 60; - } - else if (fr == NPY_FR_s) { - ret = d->day * 86400 + d->sec; - } - else if (fr == NPY_FR_ms) { - ret = d->day * 86400000 + d->sec * 1000 + d->us / 1000; - } - else if (fr == NPY_FR_us) { - npy_int64 num = 86400000; - num *= 1000; - ret = d->day * num + d->sec * 1000000 + d->us; - } - else if (fr == NPY_FR_ns) { - npy_int64 num = 86400000; - num *= 1000000; - ret = d->day * num + d->sec * 1000000000 + d->us * 1000 + (d->ps / 1000); - } - else if (fr == NPY_FR_ps) { - npy_int64 num2, num1; - - num2 = 1000000; - num2 *= 1000000; - num1 = 86400 * num2; - - ret = d->day * num1 + d->sec * num2 + d->us * 1000000 + d->ps; - } - else if (fr == NPY_FR_fs) { - /* only 2.6 hours */ - npy_int64 num2 = 1000000000; - num2 *= 1000000; - ret = d->sec * num2 + d->us * 1000000000 + d->ps * 1000 + (d->as / 1000); - } - else if (fr == NPY_FR_as) { - /* only 9.2 secs */ - npy_int64 num1, num2; - - num1 = 1000000; - num1 *= 1000000; - num2 = num1 * 1000000; - ret = d->sec * num2 + d->us * num1 + d->ps * 1000000 + d->as; - } - else { - /* Shouldn't get here */ - PyErr_SetString(PyExc_ValueError, "invalid internal frequency"); - ret = -1; - } - - return ret; -} - - - -/* - * Fill the datetime struct from the value and resolution unit. - */ -NPY_NO_EXPORT void -PyArray_DatetimeToDatetimeStruct(npy_datetime val, NPY_DATETIMEUNIT fr, - npy_datetimestruct *result) -{ - int year = 1970, month = 1, day = 1, - hour = 0, min = 0, sec = 0, - us = 0, ps = 0, as = 0; - - npy_int64 tmp; - ymdstruct ymd; - hmsstruct hms; - - /* - * Note that what looks like val / N and val % N for positive numbers maps to - * [val - (N-1)] / N and [N-1 + (val+1) % N] for negative numbers (with the 2nd - * value, the remainder, being positive in both cases). - */ - if (fr == NPY_FR_Y) { - year = 1970 + val; - } - else if (fr == NPY_FR_M) { - if (val >= 0) { - year = 1970 + val / 12; - month = val % 12 + 1; - } - else { - year = 1969 + (val + 1) / 12; - month = 12 + (val + 1)% 12; - } - } - else if (fr == NPY_FR_W) { - /* A week is the same as 7 days */ - ymd = days_to_ymdstruct(val * 7); - year = ymd.year; - month = ymd.month; - day = ymd.day; - } - else if (fr == NPY_FR_B) { - /* Number of business days since Thursday, 1-1-70 */ - npy_longlong absdays; - /* - * A buisness day is M T W Th F (i.e. all but Sat and Sun.) - * Convert the business day to the number of actual days. - * - * Must convert [0,1,2,3,4,5,6,7,...] to - * [0,1,4,5,6,7,8,11,...] - * and [...,-9,-8,-7,-6,-5,-4,-3,-2,-1,0] to - * [...,-13,-10,-9,-8,-7,-6,-3,-2,-1,0] - */ - if (val >= 0) { - absdays = 7 * ((val + 3) / 5) + ((val + 3) % 5) - 3; - } - else { - /* Recall how C computes / and % with negative numbers */ - absdays = 7 * ((val - 1) / 5) + ((val - 1) % 5) + 1; - } - ymd = days_to_ymdstruct(absdays); - year = ymd.year; - month = ymd.month; - day = ymd.day; - } - else if (fr == NPY_FR_D) { - ymd = days_to_ymdstruct(val); - year = ymd.year; - month = ymd.month; - day = ymd.day; - } - else if (fr == NPY_FR_h) { - if (val >= 0) { - ymd = days_to_ymdstruct(val / 24); - hour = val % 24; - } - else { - ymd = days_to_ymdstruct((val - 23) / 24); - hour = 23 + (val + 1) % 24; - } - year = ymd.year; - month = ymd.month; - day = ymd.day; - } - else if (fr == NPY_FR_m) { - if (val >= 0) { - ymd = days_to_ymdstruct(val / 1440); - min = val % 1440; - } - else { - ymd = days_to_ymdstruct((val - 1439) / 1440); - min = 1439 + (val + 1) % 1440; - } - hms = seconds_to_hmsstruct(min * 60); - year = ymd.year; - month = ymd.month; - day = ymd.day; - hour = hms.hour; - min = hms.min; - } - else if (fr == NPY_FR_s) { - if (val >= 0) { - ymd = days_to_ymdstruct(val / 86400); - sec = val % 86400; - } - else { - ymd = days_to_ymdstruct((val - 86399) / 86400); - sec = 86399 + (val + 1) % 86400; - } - hms = seconds_to_hmsstruct(val); - year = ymd.year; - month = ymd.month; - day = ymd.day; - hour = hms.hour; - min = hms.min; - sec = hms.sec; - } - else if (fr == NPY_FR_ms) { - if (val >= 0) { - ymd = days_to_ymdstruct(val / 86400000); - tmp = val % 86400000; - } - else { - ymd = days_to_ymdstruct((val - 86399999) / 86400000); - tmp = 86399999 + (val + 1) % 86399999; - } - hms = seconds_to_hmsstruct(tmp / 1000); - us = (tmp % 1000)*1000; - year = ymd.year; - month = ymd.month; - day = ymd.day; - hour = hms.hour; - min = hms.min; - sec = hms.sec; - } - else if (fr == NPY_FR_us) { - npy_int64 num1, num2; - num1 = 86400000; - num1 *= 1000; - num2 = num1 - 1; - if (val >= 0) { - ymd = days_to_ymdstruct(val / num1); - tmp = val % num1; - } - else { - ymd = days_to_ymdstruct((val - num2)/ num1); - tmp = num2 + (val + 1) % num1; - } - hms = seconds_to_hmsstruct(tmp / 1000000); - us = tmp % 1000000; - year = ymd.year; - month = ymd.month; - day = ymd.day; - hour = hms.hour; - min = hms.min; - sec = hms.sec; - } - else if (fr == NPY_FR_ns) { - npy_int64 num1, num2, num3; - num1 = 86400000; - num1 *= 1000000000; - num2 = num1 - 1; - num3 = 1000000; - num3 *= 1000000; - if (val >= 0) { - ymd = days_to_ymdstruct(val / num1); - tmp = val % num1; - } - else { - ymd = days_to_ymdstruct((val - num2)/ num1); - tmp = num2 + (val + 1) % num1; - } - hms = seconds_to_hmsstruct(tmp / 1000000000); - tmp = tmp % 1000000000; - us = tmp / 1000; - ps = (tmp % 1000) * 1000; - year = ymd.year; - month = ymd.month; - day = ymd.day; - hour = hms.hour; - min = hms.min; - sec = hms.sec; - } - else if (fr == NPY_FR_ps) { - npy_int64 num1, num2, num3; - num3 = 1000000000; - num3 *= 1000; - num1 = 86400 * num3; - num2 = num1 - 1; - - if (val >= 0) { - ymd = days_to_ymdstruct(val / num1); - tmp = val % num1; - } - else { - ymd = days_to_ymdstruct((val - num2)/ num1); - tmp = num2 + (val + 1) % num1; - } - hms = seconds_to_hmsstruct(tmp / num3); - tmp = tmp % num3; - us = tmp / 1000000; - ps = tmp % 1000000; - year = ymd.year; - month = ymd.month; - day = ymd.day; - hour = hms.hour; - min = hms.min; - sec = hms.sec; - } - else if (fr == NPY_FR_fs) { - /* entire range is only += 2.6 hours */ - npy_int64 num1, num2; - num1 = 1000000000; - num1 *= 1000; - num2 = num1 * 1000; - - if (val >= 0) { - sec = val / num2; - tmp = val % num2; - hms = seconds_to_hmsstruct(sec); - hour = hms.hour; - min = hms.min; - sec = hms.sec; - } - else { - /* tmp (number of fs) will be positive after this segment */ - year = 1969; - day = 31; - month = 12; - sec = (val - (num2-1))/num2; - tmp = (num2-1) + (val + 1) % num2; - if (sec == 0) { - /* we are at the last second */ - hour = 23; - min = 59; - sec = 59; - } - else { - hour = 24 + (sec - 3599)/3600; - sec = 3599 + (sec+1)%3600; - min = sec / 60; - sec = sec % 60; - } - } - us = tmp / 1000000000; - tmp = tmp % 1000000000; - ps = tmp / 1000; - as = (tmp % 1000) * 1000; - } - else if (fr == NPY_FR_as) { - /* entire range is only += 9.2 seconds */ - npy_int64 num1, num2, num3; - num1 = 1000000; - num2 = num1 * 1000000; - num3 = num2 * 1000000; - if (val >= 0) { - hour = 0; - min = 0; - sec = val / num3; - tmp = val % num3; - } - else { - year = 1969; - day = 31; - month = 12; - hour = 23; - min = 59; - sec = 60 + (val - (num3-1)) / num3; - tmp = (num3-1) + (val+1) % num3; - } - us = tmp / num2; - tmp = tmp % num2; - ps = tmp / num1; - as = tmp % num1; - } - else { - PyErr_SetString(PyExc_RuntimeError, "invalid internal time resolution"); - } - - result->year = year; - result->month = month; - result->day = day; - result->hour = hour; - result->min = min; - result->sec = sec; - result->us = us; - result->ps = ps; - result->as = as; - - return; -} - -/* - * FIXME: Overflow is not handled at all - * To convert from Years, Months, and Business Days, multiplication by the average is done - */ - -/* - * Fill the timedelta struct from the timedelta value and resolution unit. - */ -NPY_NO_EXPORT void -PyArray_TimedeltaToTimedeltaStruct(npy_timedelta val, NPY_DATETIMEUNIT fr, - npy_timedeltastruct *result) -{ - npy_longlong day=0; - int sec=0, us=0, ps=0, as=0; - npy_bool negative=0; - - /* - * Note that what looks like val / N and val % N for positive numbers maps to - * [val - (N-1)] / N and [N-1 + (val+1) % N] for negative numbers (with the 2nd - * value, the remainder, being positive in both cases). - */ - - if (val < 0) { - val = -val; - negative = 1; - } - if (fr == NPY_FR_Y) { - day = val * _DAYS_PER_YEAR; - } - else if (fr == NPY_FR_M) { - day = val * _DAYS_PER_MONTH; - } - else if (fr == NPY_FR_W) { - day = val * 7; - } - else if (fr == NPY_FR_B) { - /* Number of business days since Thursday, 1-1-70 */ - day = (val * 7) / 5; - } - else if (fr == NPY_FR_D) { - day = val; - } - else if (fr == NPY_FR_h) { - day = val / 24; - sec = (val % 24)*3600; - } - else if (fr == NPY_FR_m) { - day = val / 1440; - sec = (val % 1440)*60; - } - else if (fr == NPY_FR_s) { - day = val / 86400; - sec = val % 86400; - } - else if (fr == NPY_FR_ms) { - day = val / 86400000; - val = val % 86400000; - sec = val / 1000; - us = (val % 1000)*1000; - } - else if (fr == NPY_FR_us) { - npy_int64 num1; - num1 = 86400000; - num1 *= 1000; - day = val / num1; - us = val % num1; - sec = us / 1000000; - us = us % 1000000; - } - else if (fr == NPY_FR_ns) { - npy_int64 num1; - num1 = 86400000; - num1 *= 1000000; - day = val / num1; - val = val % num1; - sec = val / 1000000000; - val = val % 1000000000; - us = val / 1000; - ps = (val % 1000) * 1000; - } - else if (fr == NPY_FR_ps) { - npy_int64 num1, num2; - num2 = 1000000000; - num2 *= 1000; - num1 = 86400 * num2; - - day = val / num1; - ps = val % num1; - sec = ps / num2; - ps = ps % num2; - us = ps / 1000000; - ps = ps % 1000000; - } - else if (fr == NPY_FR_fs) { - /* entire range is only += 9.2 hours */ - npy_int64 num1, num2; - num1 = 1000000000; - num2 = num1 * 1000000; - - day = 0; - sec = val / num2; - val = val % num2; - us = val / num1; - val = val % num1; - ps = val / 1000; - as = (val % 1000) * 1000; - } - else if (fr == NPY_FR_as) { - /* entire range is only += 2.6 seconds */ - npy_int64 num1, num2, num3; - num1 = 1000000; - num2 = num1 * 1000000; - num3 = num2 * 1000000; - day = 0; - sec = val / num3; - as = val % num3; - us = as / num2; - as = as % num2; - ps = as / num1; - as = as % num1; - } - else { - PyErr_SetString(PyExc_RuntimeError, "invalid internal time resolution"); - } - - if (negative) { - result->day = -day; - result->sec = -sec; - result->us = -us; - result->ps = -ps; - result->as = -as; - } - else { - result->day = day; - result->sec = sec; - result->us = us; - result->ps = ps; - result->as = as; - } - return; -} Modified: branches/1.4.x/numpy/core/src/multiarray/descriptor.c =================================================================== --- branches/1.4.x/numpy/core/src/multiarray/descriptor.c 2010-02-09 06:10:41 UTC (rev 8097) +++ branches/1.4.x/numpy/core/src/multiarray/descriptor.c 2010-02-09 06:11:19 UTC (rev 8098) @@ -125,21 +125,8 @@ return 0; } -static int -_check_for_datetime(char *type, int len) -{ - if (len < 1) return 0; - if (type[1] == '8' && (type[0] == 'M' || type[0] == 'm')) - return 1; - if (len < 10) return 0; - if (strncmp(type, "datetime64", 10) == 0) return 1; - if (len < 11) return 0; - if (strncmp(type, "timedelta64", 11) == 0) return 1; - return 0; -} - #undef _chk_byteorder static PyArray_Descr * @@ -477,234 +464,6 @@ return NULL; } -/* Exported as DATETIMEUNITS in multiarraymodule.c */ -NPY_NO_EXPORT char *_datetime_strings[] = { - NPY_STR_Y, - NPY_STR_M, - NPY_STR_W, - NPY_STR_B, - NPY_STR_D, - NPY_STR_h, - NPY_STR_m, - NPY_STR_s, - NPY_STR_ms, - NPY_STR_us, - NPY_STR_ns, - NPY_STR_ps, - NPY_STR_fs, - NPY_STR_as -}; - -static NPY_DATETIMEUNIT - _unit_from_str(char *base) -{ - NPY_DATETIMEUNIT unit; - - if (base == NULL) - return NPY_DATETIME_DEFAULTUNIT; - - unit = NPY_FR_Y; - while (unit < NPY_DATETIME_NUMUNITS) { - if (strcmp(base, _datetime_strings[unit]) == 0) - break; - unit++; - } - - if (unit == NPY_DATETIME_NUMUNITS) - return NPY_DATETIME_DEFAULTUNIT; - - return unit; -} - -static int _multiples_table[16][4] = { - {12, 52, 365}, /* NPY_FR_Y */ - {NPY_FR_M, NPY_FR_W, NPY_FR_D}, - {4, 30, 720}, /* NPY_FR_M */ - {NPY_FR_W, NPY_FR_D, NPY_FR_h}, - {5, 7, 168, 10080}, /* NPY_FR_W */ - {NPY_FR_B, NPY_FR_D, NPY_FR_h, NPY_FR_m}, - {24, 1440, 86400}, /* NPY_FR_B */ - {NPY_FR_h, NPY_FR_m, NPY_FR_s}, - {24, 1440, 86400}, /* NPY_FR_D */ - {NPY_FR_h, NPY_FR_m, NPY_FR_s}, - {60, 3600}, /* NPY_FR_h */ - {NPY_FR_m, NPY_FR_s}, - {60, 60000}, /* NPY_FR_m */ - {NPY_FR_s, NPY_FR_ms}, - {1000, 1000000}, /* >=NPY_FR_s */ - {0, 0} -}; - - -/* Translate divisors into multiples of smaller units */ -static int -_convert_divisor_to_multiple(PyArray_DatetimeMetaData *meta) -{ - int i, num, ind; - int *totry; - NPY_DATETIMEUNIT *baseunit; - int q, r; - - ind = ((int)meta->base - (int)NPY_FR_Y)*2; - totry = _multiples_table[ind]; - baseunit = (NPY_DATETIMEUNIT *)_multiples_table[ind+1]; - - num = 3; - if (meta->base == NPY_FR_W) num = 4; - else if (meta->base > NPY_FR_D) num = 2; - - if (meta->base >= NPY_FR_s) { - ind = ((int)NPY_FR_s - (int)NPY_FR_Y)*2; - totry = _multiples_table[ind]; - baseunit = (NPY_DATETIMEUNIT *)_multiples_table[ind+1]; - baseunit[0] = meta->base + 1; - baseunit[1] = meta->base + 2; - if (meta->base == NPY_DATETIME_NUMUNITS-2) num = 1; - if (meta->base == NPY_DATETIME_NUMUNITS-1) num = 0; - } - - for (i=0; iden; - r = totry[i] % meta->den; - if (r==0) break; - } - if (i==num) { - PyErr_Format(PyExc_ValueError, "divisor (%d) is not a multiple of a lower-unit", meta->den); - return -1; - } - meta->base = baseunit[i]; - meta->den = 1; - meta->num *= q; - - return 0; -} - - -static PyObject * -_get_datetime_tuple_from_cobj(PyObject *cobj) -{ - PyArray_DatetimeMetaData *dt_data; - PyObject *dt_tuple; - - dt_data = PyCObject_AsVoidPtr(cobj); - dt_tuple = PyTuple_New(4); - - PyTuple_SET_ITEM(dt_tuple, 0, - PyString_FromString(_datetime_strings[dt_data->base])); - PyTuple_SET_ITEM(dt_tuple, 1, - PyInt_FromLong(dt_data->num)); - PyTuple_SET_ITEM(dt_tuple, 2, - PyInt_FromLong(dt_data->den)); - PyTuple_SET_ITEM(dt_tuple, 3, - PyInt_FromLong(dt_data->events)); - - return dt_tuple; -} - -static PyObject * -_convert_datetime_tuple_to_cobj(PyObject *tuple) -{ - PyArray_DatetimeMetaData *dt_data; - - dt_data = _pya_malloc(sizeof(PyArray_DatetimeMetaData)); - - dt_data->base = _unit_from_str\ - (PyString_AsString(PyTuple_GET_ITEM(tuple, 0))); - - /* Assumes other objects are Python integers */ - dt_data->num = PyInt_AS_LONG(PyTuple_GET_ITEM(tuple, 1)); - dt_data->den = PyInt_AS_LONG(PyTuple_GET_ITEM(tuple, 2)); - dt_data->events = PyInt_AS_LONG(PyTuple_GET_ITEM(tuple, 3)); - - if (dt_data->den > 1) { - if (_convert_divisor_to_multiple(dt_data) < 0) return NULL; - } - - return PyCObject_FromVoidPtr((void *)dt_data, _pya_free); -} - -static PyArray_Descr * -_convert_from_datetime_tuple(PyObject *obj) -{ - PyArray_Descr *new; - PyObject *dt_tuple; - PyObject *dt_cobj; - PyObject *datetime; - - if (!PyTuple_Check(obj) || PyTuple_GET_SIZE(obj)!=2) { - PyErr_SetString(PyExc_RuntimeError, "_datetimestring is " \ - "not returning a tuple with length 2"); - return NULL; - } - - dt_tuple = PyTuple_GET_ITEM(obj, 0); - datetime = PyTuple_GET_ITEM(obj, 1); - if (!PyTuple_Check(dt_tuple) || PyTuple_GET_SIZE(dt_tuple) != 4 || \ - !PyInt_Check(datetime)) { - PyErr_SetString(PyExc_RuntimeError, "_datetimestring is " \ - "not returning a length 4 tuple and an integer"); - return NULL; - } - - /* Create new timedelta or datetime dtype */ - if (PyObject_IsTrue(datetime)) { - new = PyArray_DescrNewFromType(PyArray_DATETIME); - } - else { - new = PyArray_DescrNewFromType(PyArray_TIMEDELTA); - } - - if (new == NULL) return NULL; - - /* Remove any reference to old metadata dictionary */ - /* And create a new one for this new dtype */ - Py_XDECREF(new->metadata); - if ((new->metadata = PyDict_New())== NULL) return NULL; - - dt_cobj = _convert_datetime_tuple_to_cobj(dt_tuple); - if (dt_cobj == NULL) { /* Failure in conversion */ - Py_DECREF(new); - return NULL; - } - - /* Assume this sets a new reference to dt_cobj */ - PyDict_SetItemString(new->metadata, NPY_METADATA_DTSTR, dt_cobj); - Py_DECREF(dt_cobj); - - return new; -} - - -static PyArray_Descr * -_convert_from_datetime(PyObject *obj) -{ - PyObject *tupleobj; - PyArray_Descr *res; - PyObject *_numpy_internal; - - if (!PyString_Check(obj)) { - return NULL; - } - _numpy_internal = PyImport_ImportModule("numpy.core._internal"); - if (_numpy_internal == NULL) { - return NULL; - } - tupleobj = PyObject_CallMethod(_numpy_internal, "_datetimestring", "O", obj); - Py_DECREF(_numpy_internal); - if (!tupleobj) return NULL; - /* tuple of a standard tuple (baseunit, num, den, events) and a - timedelta boolean - */ - res = _convert_from_datetime_tuple(tupleobj); - Py_DECREF(tupleobj); - if (!res && !PyErr_Occurred()) { - PyErr_SetString(PyExc_ValueError, "invalid data-type"); - return NULL; - } - return res; -} - - /* * comma-separated string * this is the format developed by the numarray records module @@ -1161,6 +920,7 @@ if (len <= 0) { goto fail; } +#if 0 /* check for datetime format */ if ((len > 1) && _check_for_datetime(type, len)) { *at = _convert_from_datetime(obj); @@ -1169,6 +929,7 @@ } return PY_FAIL; } +#endif /* check for commas present or first (or second) element a digit */ if (_check_for_commastring(type, len)) { *at = _convert_from_commastring(obj, 0); @@ -1415,47 +1176,6 @@ self->subarray->shape); } -static PyObject * -_append_to_datetime_typestr(PyArray_Descr *self, PyObject *ret) -{ - PyObject *tmp; - PyObject *res; - int num, den, events; - char *basestr; - PyArray_DatetimeMetaData *dt_data; - - /* This shouldn't happen */ - if (self->metadata == NULL) return ret; - - tmp = PyDict_GetItemString(self->metadata, NPY_METADATA_DTSTR); - dt_data = PyCObject_AsVoidPtr(tmp); - num = dt_data->num; - den = dt_data->den; - events = dt_data->events; - basestr = _datetime_strings[dt_data->base]; - - if (num == 1) { - tmp = PyString_FromString(basestr); - } - else { - tmp = PyString_FromFormat("%d%s", num, basestr); - } - if (den != 1) { - res = PyString_FromFormat("/%d", den); - PyString_ConcatAndDel(&tmp, res); - } - - res = PyString_FromString("["); - PyString_ConcatAndDel(&res, tmp); - PyString_ConcatAndDel(&res, PyString_FromString("]")); - if (events != 1) { - tmp = PyString_FromFormat("//%d", events); - PyString_ConcatAndDel(&res, tmp); - } - PyString_ConcatAndDel(&ret, res); - return ret; -} - NPY_NO_EXPORT PyObject * arraydescr_protocol_typestr_get(PyArray_Descr *self) { @@ -1475,9 +1195,6 @@ } ret = PyString_FromFormat("%c%c%d", endian, basic_, size); - if (PyDataType_ISDATETIME(self)) { - ret = _append_to_datetime_typestr(self, ret); - } return ret; } @@ -1518,9 +1235,6 @@ p = PyString_FromFormat("%d", self->elsize * 8); PyString_ConcatAndDel(&res, p); } - if (PyDataType_ISDATETIME(self)) { - res = _append_to_datetime_typestr(self, res); - } return res; } @@ -1870,30 +1584,6 @@ return (PyObject *)conv; } -/* Return a tuple of (cleaned metadata dictionary, - tuple with (str, num, events)) -*/ -static PyObject * -_get_pickleabletype_from_metadata(PyObject *metadata) -{ - PyObject *newdict; - PyObject *newtup, *dt_tuple; - PyObject *cobj; - - newdict = PyDict_Copy(metadata); - PyDict_DelItemString(newdict, NPY_METADATA_DTSTR); - newtup = PyTuple_New(2); - PyTuple_SET_ITEM(newtup, 0, newdict); - - cobj = PyDict_GetItemString(metadata, NPY_METADATA_DTSTR); - dt_tuple = _get_datetime_tuple_from_cobj(cobj); - - PyTuple_SET_ITEM(newtup, 1, dt_tuple); - - return newtup; -} - - /* return a tuple of (callable object, args, state). */ static PyObject * arraydescr_reduce(PyArray_Descr *self, PyObject *NPY_UNUSED(args)) @@ -1981,18 +1671,8 @@ PyTuple_SET_ITEM(state, 6, PyInt_FromLong(alignment)); PyTuple_SET_ITEM(state, 7, PyInt_FromLong(self->hasobject)); if (self->metadata) { - if (PyDataType_ISDATETIME(self)) { - PyObject *newobj; - /* Handle CObject in NPY_METADATA_DTSTR key separately */ - /* newobj is a tuple of cleaned metadata dictionary - and tuple of date_time info (str, num, den, events) */ - newobj = _get_pickleabletype_from_metadata(self->metadata); - PyTuple_SET_ITEM(state, 8, newobj); - } - else { - Py_INCREF(self->metadata); - PyTuple_SET_ITEM(state, 8, self->metadata); - } + Py_INCREF(self->metadata); + PyTuple_SET_ITEM(state, 8, self->metadata); } else { PyTuple_SET_ITEM(state, 8, Py_None); @@ -2179,22 +1859,12 @@ } Py_XDECREF(self->metadata); - if (PyDataType_ISDATETIME(self) && (metadata != Py_None) && (metadata != NULL)) { - PyObject *cobj; - self->metadata = PyTuple_GET_ITEM(metadata, 0); - Py_INCREF(self->metadata); - cobj = _convert_datetime_tuple_to_cobj(PyTuple_GET_ITEM(metadata, 1)); - PyDict_SetItemString(self->metadata, NPY_METADATA_DTSTR, cobj); - Py_DECREF(cobj); - } - else { - /* We have a borrowed reference to metadata so no need - to alter reference count - */ - if (metadata == Py_None) metadata = NULL; - self->metadata = metadata; - Py_XINCREF(metadata); - } + /* We have a borrowed reference to metadata so no need + to alter reference count + */ + if (metadata == Py_None) metadata = NULL; + self->metadata = metadata; + Py_XINCREF(metadata); Py_INCREF(Py_None); return Py_None; Modified: branches/1.4.x/numpy/core/src/multiarray/multiarraymodule.c =================================================================== --- branches/1.4.x/numpy/core/src/multiarray/multiarraymodule.c 2010-02-09 06:10:41 UTC (rev 8097) +++ branches/1.4.x/numpy/core/src/multiarray/multiarraymodule.c 2010-02-09 06:11:19 UTC (rev 8098) @@ -1307,34 +1307,6 @@ return same; } -/* - * compare the metadata for two date-times - * return 1 if they are the same - * or 0 if not - */ -static int -_equivalent_units(PyObject *meta1, PyObject *meta2) -{ - PyObject *cobj1, *cobj2; - PyArray_DatetimeMetaData *data1, *data2; - - /* Same meta object */ - if (meta1 == meta2) - return 1; - - cobj1 = PyDict_GetItemString(meta1, NPY_METADATA_DTSTR); - cobj2 = PyDict_GetItemString(meta2, NPY_METADATA_DTSTR); - if (cobj1 == cobj2) - return 1; - - data1 = PyCObject_AsVoidPtr(cobj1); - data2 = PyCObject_AsVoidPtr(cobj2); - - return ((data1->base == data2->base) && (data1->num == data2->num) - && (data1->den == data2->den) && (data1->events == data2->events)); -} - - /*NUMPY_API * * This function returns true if the two typecodes are @@ -1359,11 +1331,6 @@ return ((typenum1 == typenum2) && _equivalent_fields(typ1->fields, typ2->fields)); } - if (typenum1 == PyArray_DATETIME || typenum1 == PyArray_DATETIME - || typenum2 == PyArray_TIMEDELTA || typenum2 == PyArray_TIMEDELTA) { - return ((typenum1 == typenum2) && - _equivalent_units(typ1->metadata, typ2->metadata)); - } return (typ1->kind == typ2->kind); } @@ -2839,10 +2806,6 @@ SINGLE_INHERIT(LongLong, SignedInteger); #endif - SINGLE_INHERIT(TimeInteger, SignedInteger); - SINGLE_INHERIT(Datetime, TimeInteger); - SINGLE_INHERIT(Timedelta, TimeInteger); - /* fprintf(stderr, "tp_free = %p, PyObject_Del = %p, int_tp_free = %p, base.tp_free = %p\n", @@ -2999,10 +2962,6 @@ PyDict_SetItemString(d, "METADATA_DTSTR", s); Py_DECREF(s); - s = PyCObject_FromVoidPtr((void *)_datetime_strings, NULL); - PyDict_SetItemString(d, "DATETIMEUNITS", s); - Py_DECREF(s); - #define ADDCONST(NAME) \ s = PyInt_FromLong(NPY_##NAME); \ PyDict_SetItemString(d, #NAME, s); \ Modified: branches/1.4.x/numpy/core/src/multiarray/scalarapi.c =================================================================== --- branches/1.4.x/numpy/core/src/multiarray/scalarapi.c 2010-02-09 06:10:41 UTC (rev 8097) +++ branches/1.4.x/numpy/core/src/multiarray/scalarapi.c 2010-02-09 06:11:19 UTC (rev 8098) @@ -60,8 +60,6 @@ CASE(CDOUBLE, CDouble); CASE(CLONGDOUBLE, CLongDouble); CASE(OBJECT, Object); - CASE(DATETIME, Datetime); - CASE(TIMEDELTA, Timedelta); #undef CASE case NPY_STRING: return (void *)PyString_AS_STRING(scalar); @@ -89,10 +87,6 @@ _IFCASE(Int); _IFCASE(Long); _IFCASE(LongLong); - if _CHK(TimeInteger) { - _IFCASE(Datetime); - _IFCASE(Timedelta); - } } else { /* Unsigned Integer */ @@ -513,40 +507,6 @@ return descr; } - if (PyArray_IsScalar(sc, TimeInteger)) { - PyObject *cobj; - PyArray_DatetimeMetaData *dt_data; - - dt_data = _pya_malloc(sizeof(PyArray_DatetimeMetaData)); - - if (PyArray_IsScalar(sc, Datetime)) { - descr = PyArray_DescrNewFromType(PyArray_DATETIME); - memcpy(dt_data, &((PyDatetimeScalarObject *)sc)->obmeta, - sizeof(PyArray_DatetimeMetaData)); - } - else {/* Timedelta */ - descr = PyArray_DescrNewFromType(PyArray_TIMEDELTA); - memcpy(dt_data, &((PyTimedeltaScalarObject *)sc)->obmeta, - sizeof(PyArray_DatetimeMetaData)); - } - cobj = PyCObject_FromVoidPtr((void *)dt_data, _pya_free); - - /* Add correct meta-data to the data-type */ - - if (descr == NULL) {Py_DECREF(cobj); return NULL;} - - Py_XDECREF(descr->metadata); - if ((descr->metadata = PyDict_New())== NULL) { - Py_DECREF(descr); Py_DECREF(cobj); return NULL; - } - - /* Assume this sets a new reference to cobj */ - PyDict_SetItemString(descr->metadata, NPY_METADATA_DTSTR, cobj); - Py_DECREF(cobj); - - return descr; - } - descr = PyArray_DescrFromTypeObject((PyObject *)sc->ob_type); if (descr->elsize == 0) { PyArray_DESCR_REPLACE(descr); @@ -647,16 +607,6 @@ if (obj == NULL) { return NULL; } - if PyTypeNum_ISDATETIME(type_num) { - /* We need to copy the resolution information over to the scalar */ - /* Get the void * from the metadata dictionary */ - PyObject *cobj; - PyArray_DatetimeMetaData *dt_data; - cobj = PyDict_GetItemString(descr->metadata, NPY_METADATA_DTSTR); - dt_data = PyCObject_AsVoidPtr(cobj); - memcpy(&(((PyDatetimeScalarObject *)obj)->obmeta), dt_data, - sizeof(PyArray_DatetimeMetaData)); - } if PyTypeNum_ISFLEXIBLE(type_num) { if (type_num == PyArray_STRING) { destptr = PyString_AS_STRING(obj); Modified: branches/1.4.x/numpy/core/src/multiarray/scalartypes.c.src =================================================================== --- branches/1.4.x/numpy/core/src/multiarray/scalartypes.c.src 2010-02-09 06:10:41 UTC (rev 8097) +++ branches/1.4.x/numpy/core/src/multiarray/scalartypes.c.src 2010-02-09 06:11:19 UTC (rev 8098) @@ -1917,12 +1917,12 @@ /**begin repeat * #name = byte, short, int, long, longlong, ubyte, ushort, uint, ulong, * ulonglong, float, double, longdouble, cfloat, cdouble, clongdouble, - * string, unicode, object, datetime, timedelta# + * string, unicode, object# * #TYPE = BYTE, SHORT, INT, LONG, LONGLONG, UBYTE, USHORT, UINT, ULONG, * ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE, - * STRING, UNICODE, OBJECT, DATETIME, TIMEDELTA# - * #work = 0,0,1,1,1,0,0,0,0,0,0,1,0,0,0,0,z,z,0,0,0# - * #default = 0*16,1*2,2,0*2# + * STRING, UNICODE, OBJECT# + * #work = 0,0,1,1,1,0,0,0,0,0,0,1,0,0,0,0,z,z,0# + * #default = 0*16,1*2,2# */ #define _NPY_UNUSED2_1 @@ -2324,50 +2324,6 @@ #endif - -/**begin repeat - * #lname=datetime, timedelta# - * #name=Datetime,Timedelta# - */ -#if SIZEOF_LONG==SIZEOF_DATETIME -static long - at lname@_arrtype_hash(PyObject *obj) -{ - long x = (long)(((Py at name@ScalarObject *)obj)->obval); - if (x == -1) { - x = -2; - } - return x; -} -#elif SIZEOF_LONGLONG==SIZEOF_DATETIME -static long - at lname@_arrtype_hash(PyObject *obj) -{ - long y; - longlong x = (((Py at name@ScalarObject *)obj)->obval); - - if ((x <= LONG_MAX)) { - y = (long) x; - } - else { - union Mask { - long hashvals[2]; - longlong v; - } both; - - both.v = x; - y = both.hashvals[0] + (1000003)*both.hashvals[1]; - } - if (y == -1) { - y = -2; - } - return y; -} -#endif -/**end repeat**/ - - - /* Wrong thing to do for longdouble, but....*/ /**begin repeat @@ -2791,10 +2747,9 @@ /**begin repeat * #NAME = Byte, Short, Int, Long, LongLong, UByte, UShort, UInt, ULong, - * ULongLong, Float, Double, LongDouble, Datetime, Timedelta# - * #name = int*5, uint*5, float*3, datetime, timedelta# - * #CNAME = (CHAR, SHORT, INT, LONG, LONGLONG)*2, FLOAT, DOUBLE, LONGDOUBLE, - * DATETIME, TIMEDELTA# + * ULongLong, Float, Double, LongDouble# + * #name = int*5, uint*5, float*3# + * #CNAME = (CHAR, SHORT, INT, LONG, LONGLONG)*2, FLOAT, DOUBLE, LONGDOUBLE# */ #if BITSOF_ at CNAME@ == 8 #define _THIS_SIZE "8" @@ -3046,10 +3001,10 @@ /**begin repeat * #name = bool, byte, short, int, long, longlong, ubyte, ushort, uint, * ulong, ulonglong, float, double, longdouble, cfloat, cdouble, - * clongdouble, string, unicode, void, object, datetime, timedelta# + * clongdouble, string, unicode, void, object# * #NAME = Bool, Byte, Short, Int, Long, LongLong, UByte, UShort, UInt, * ULong, ULongLong, Float, Double, LongDouble, CFloat, CDouble, - * CLongDouble, String, Unicode, Void, Object, Datetime, Timedelta# + * CLongDouble, String, Unicode, Void, Object# */ Py at NAME@ArrType_Type.tp_flags = BASEFLAGS; Py at NAME@ArrType_Type.tp_new = @name at _arrtype_new; @@ -3058,11 +3013,9 @@ /**begin repeat * #name = bool, byte, short, ubyte, ushort, uint, ulong, ulonglong, - * float, longdouble, cfloat, clongdouble, void, object, datetime, - * timedelta# + * float, longdouble, cfloat, clongdouble, void, object# * #NAME = Bool, Byte, Short, UByte, UShort, UInt, ULong, ULongLong, - * Float, LongDouble, CFloat, CLongDouble, Void, Object, Datetime, - * Timedelta# + * Float, LongDouble, CFloat, CLongDouble, Void, Object# */ Py at NAME@ArrType_Type.tp_hash = @name at _arrtype_hash; /**end repeat**/ @@ -3141,8 +3094,6 @@ &PyStringArrType_Type, &PyUnicodeArrType_Type, &PyVoidArrType_Type, - &PyDatetimeArrType_Type, - &PyTimedeltaArrType_Type }; NPY_NO_EXPORT int Modified: branches/1.4.x/numpy/core/src/multiarray/scalartypes.h =================================================================== --- branches/1.4.x/numpy/core/src/multiarray/scalartypes.h 2010-02-09 06:10:41 UTC (rev 8097) +++ branches/1.4.x/numpy/core/src/multiarray/scalartypes.h 2010-02-09 06:11:19 UTC (rev 8098) @@ -16,19 +16,4 @@ NPY_NO_EXPORT void * scalar_value(PyObject *scalar, PyArray_Descr *descr); -/* - * XXX: those are defined here for 1.4.x only -> they are intended to become - * public types, and are declared like all other types through the code - * generator machinery for >= 1.5.0 - */ -#ifdef NPY_ENABLE_SEPARATE_COMPILATION -extern NPY_NO_EXPORT PyTypeObject PyTimeIntegerArrType_Type; -extern NPY_NO_EXPORT PyTypeObject PyDatetimeArrType_Type; -extern NPY_NO_EXPORT PyTypeObject PyTimedeltaArrType_Type; -#else -NPY_NO_EXPORT PyTypeObject PyTimeIntegerArrType_Type; -NPY_NO_EXPORT PyTypeObject PyDatetimeArrType_Type; -NPY_NO_EXPORT PyTypeObject PyTimedeltaArrType_Type; #endif - -#endif Modified: branches/1.4.x/numpy/core/src/umath/loops.h =================================================================== --- branches/1.4.x/numpy/core/src/umath/loops.h 2010-02-09 06:10:41 UTC (rev 8097) +++ branches/1.4.x/numpy/core/src/umath/loops.h 2010-02-09 06:11:19 UTC (rev 8098) @@ -2357,177 +2357,31 @@ /* ***************************************************************************** - ** DATETIME LOOPS ** - ***************************************************************************** - */ - -#line 406 -#define DATETIME_fmax DATETIME_maximum -#define DATETIME_fmin DATETIME_minimum - -#line 406 -#define TIMEDELTA_fmax TIMEDELTA_maximum -#define TIMEDELTA_fmin TIMEDELTA_minimum - - -#line 415 -NPY_NO_EXPORT void -DATETIME_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -NPY_NO_EXPORT void -TIMEDELTA_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -#line 415 -NPY_NO_EXPORT void -DATETIME_not_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -NPY_NO_EXPORT void -TIMEDELTA_not_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -#line 415 -NPY_NO_EXPORT void -DATETIME_greater(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -NPY_NO_EXPORT void -TIMEDELTA_greater(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -#line 415 -NPY_NO_EXPORT void -DATETIME_greater_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -NPY_NO_EXPORT void -TIMEDELTA_greater_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -#line 415 -NPY_NO_EXPORT void -DATETIME_less(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -NPY_NO_EXPORT void -TIMEDELTA_less(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -#line 415 -NPY_NO_EXPORT void -DATETIME_less_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -NPY_NO_EXPORT void -TIMEDELTA_less_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -#line 415 -NPY_NO_EXPORT void -DATETIME_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -NPY_NO_EXPORT void -TIMEDELTA_absolute(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -#line 415 -NPY_NO_EXPORT void -DATETIME_logical_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -NPY_NO_EXPORT void -TIMEDELTA_logical_and(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -#line 415 -NPY_NO_EXPORT void -DATETIME_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -NPY_NO_EXPORT void -TIMEDELTA_logical_not(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -#line 415 -NPY_NO_EXPORT void -DATETIME_logical_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -NPY_NO_EXPORT void -TIMEDELTA_logical_or(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -#line 415 -NPY_NO_EXPORT void -DATETIME_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -NPY_NO_EXPORT void -TIMEDELTA_logical_xor(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -#line 415 -NPY_NO_EXPORT void -DATETIME_maximum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -NPY_NO_EXPORT void -TIMEDELTA_maximum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -#line 415 -NPY_NO_EXPORT void -DATETIME_minimum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -NPY_NO_EXPORT void -TIMEDELTA_minimum(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -#line 415 -NPY_NO_EXPORT void -DATETIME_negative(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -NPY_NO_EXPORT void -TIMEDELTA_negative(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -#line 415 -NPY_NO_EXPORT void -DATETIME_ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -NPY_NO_EXPORT void -TIMEDELTA_ones_like(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -#line 415 -NPY_NO_EXPORT void -DATETIME_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -NPY_NO_EXPORT void -TIMEDELTA_sign(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - - -NPY_NO_EXPORT void -DATETIME_Mm_M_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -NPY_NO_EXPORT void -DATETIME_mM_M_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -NPY_NO_EXPORT void -DATETIME_Mm_M_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -NPY_NO_EXPORT void -DATETIME_MM_m_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -NPY_NO_EXPORT void -TIMEDELTA_mm_m_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -NPY_NO_EXPORT void -TIMEDELTA_mm_m_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -/* - ***************************************************************************** ** OBJECT LOOPS ** ***************************************************************************** */ -#line 450 +#line 407 NPY_NO_EXPORT void OBJECT_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); -#line 450 +#line 407 NPY_NO_EXPORT void OBJECT_not_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); -#line 450 +#line 407 NPY_NO_EXPORT void OBJECT_greater(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); -#line 450 +#line 407 NPY_NO_EXPORT void OBJECT_greater_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); -#line 450 +#line 407 NPY_NO_EXPORT void OBJECT_less(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); -#line 450 +#line 407 NPY_NO_EXPORT void OBJECT_less_equal(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); Modified: branches/1.4.x/numpy/core/src/umath/loops.h.src =================================================================== --- branches/1.4.x/numpy/core/src/umath/loops.h.src 2010-02-09 06:10:41 UTC (rev 8097) +++ branches/1.4.x/numpy/core/src/umath/loops.h.src 2010-02-09 06:11:19 UTC (rev 8098) @@ -396,49 +396,6 @@ /* ***************************************************************************** - ** DATETIME LOOPS ** - ***************************************************************************** - */ - -/**begin repeat - * #TYPE = DATETIME, TIMEDELTA# - */ -#define @TYPE at _fmax @TYPE at _maximum -#define @TYPE at _fmin @TYPE at _minimum -/**end repeat**/ - -/**begin repeat - * #kind = equal, not_equal, greater, greater_equal, less, less_equal, - * absolute, logical_and, logical_not, logical_or, logical_xor, maximum, - * minimum, negative, ones_like, sign# - */ -NPY_NO_EXPORT void -DATETIME_ at kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -NPY_NO_EXPORT void -TIMEDELTA_ at kind@(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); -/**end repeat**/ - -NPY_NO_EXPORT void -DATETIME_Mm_M_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -NPY_NO_EXPORT void -DATETIME_mM_M_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -NPY_NO_EXPORT void -DATETIME_Mm_M_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -NPY_NO_EXPORT void -DATETIME_MM_m_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -NPY_NO_EXPORT void -TIMEDELTA_mm_m_add(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -NPY_NO_EXPORT void -TIMEDELTA_mm_m_subtract(char **args, intp *dimensions, intp *steps, void *NPY_UNUSED(func)); - -/* - ***************************************************************************** ** OBJECT LOOPS ** ***************************************************************************** */ Modified: branches/1.4.x/numpy/core/src/umath/ufunc_object.c =================================================================== --- branches/1.4.x/numpy/core/src/umath/ufunc_object.c 2010-02-09 06:10:41 UTC (rev 8097) +++ branches/1.4.x/numpy/core/src/umath/ufunc_object.c 2010-02-09 06:11:19 UTC (rev 8098) @@ -213,9 +213,6 @@ case PyArray_INT: case PyArray_LONG: case PyArray_LONGLONG: - case PyArray_DATETIME: - case PyArray_TIMEDELTA: - return PyArray_BYTE; /* case PyArray_UBYTE */ case PyArray_USHORT: case PyArray_UINT: @@ -1539,13 +1536,6 @@ || (arg_types[i] == PyArray_OBJECT))) { loop->obj = UFUNC_OBJ_ISOBJECT|UFUNC_OBJ_NEEDS_API; } - if (!(loop->obj & UFUNC_OBJ_NEEDS_API) - && ((mps[i]->descr->type_num == PyArray_DATETIME) - || (mps[i]->descr->type_num == PyArray_TIMEDELTA) - || (arg_types[i] == PyArray_DATETIME) - || (arg_types[i] == PyArray_TIMEDELTA))) { - loop->obj = UFUNC_OBJ_NEEDS_API; - } } if (self->core_enabled && (loop->obj & UFUNC_OBJ_ISOBJECT)) { @@ -2504,13 +2494,6 @@ if (otype == PyArray_OBJECT || aar->descr->type_num == PyArray_OBJECT) { loop->obj = UFUNC_OBJ_ISOBJECT | UFUNC_OBJ_NEEDS_API; } - else if ((otype == PyArray_DATETIME) - || (aar->descr->type_num == PyArray_DATETIME) - || (otype == PyArray_TIMEDELTA) - || (aar->descr->type_num == PyArray_TIMEDELTA)) - { - loop->obj = UFUNC_OBJ_NEEDS_API; - } else { loop->obj = 0; } Deleted: branches/1.4.x/numpy/core/tests/test_datetime.py =================================================================== --- branches/1.4.x/numpy/core/tests/test_datetime.py 2010-02-09 06:10:41 UTC (rev 8097) +++ branches/1.4.x/numpy/core/tests/test_datetime.py 2010-02-09 06:11:19 UTC (rev 8098) @@ -1,59 +0,0 @@ -from os import path -import numpy as np -from numpy.testing import * - -class TestDateTime(TestCase): - def test_creation(self): - for unit in ['Y', 'M', 'W', 'B', 'D', - 'h', 'm', 's', 'ms', 'us', - 'ns', 'ps', 'fs', 'as']: - dt1 = np.dtype('M8[750%s]'%unit) - assert dt1 == np.dtype('datetime64[750%s]' % unit) - dt2 = np.dtype('m8[%s]' % unit) - assert dt2 == np.dtype('timedelta64[%s]' % unit) - - def test_divisor_conversion_year(self): - assert np.dtype('M8[Y/4]') == np.dtype('M8[3M]') - assert np.dtype('M8[Y/13]') == np.dtype('M8[4W]') - assert np.dtype('M8[3Y/73]') == np.dtype('M8[15D]') - - def test_divisor_conversion_month(self): - assert np.dtype('M8[M/2]') == np.dtype('M8[2W]') - assert np.dtype('M8[M/15]') == np.dtype('M8[2D]') - assert np.dtype('M8[3M/40]') == np.dtype('M8[54h]') - - def test_divisor_conversion_week(self): - assert np.dtype('m8[W/5]') == np.dtype('m8[B]') - assert np.dtype('m8[W/7]') == np.dtype('m8[D]') - assert np.dtype('m8[3W/14]') == np.dtype('m8[36h]') - assert np.dtype('m8[5W/140]') == np.dtype('m8[360m]') - - def test_divisor_conversion_bday(self): - assert np.dtype('M8[B/12]') == np.dtype('M8[2h]') - assert np.dtype('M8[B/120]') == np.dtype('M8[12m]') - assert np.dtype('M8[3B/960]') == np.dtype('M8[270s]') - - def test_divisor_conversion_day(self): - assert np.dtype('M8[D/12]') == np.dtype('M8[2h]') - assert np.dtype('M8[D/120]') == np.dtype('M8[12m]') - assert np.dtype('M8[3D/960]') == np.dtype('M8[270s]') - - def test_divisor_conversion_hour(self): - assert np.dtype('m8[h/30]') == np.dtype('m8[2m]') - assert np.dtype('m8[3h/300]') == np.dtype('m8[36s]') - - def test_divisor_conversion_minute(self): - assert np.dtype('m8[m/30]') == np.dtype('m8[2s]') - assert np.dtype('m8[3m/300]') == np.dtype('m8[600ms]') - - def test_divisor_conversion_second(self): - assert np.dtype('m8[s/100]') == np.dtype('m8[10ms]') - assert np.dtype('m8[3s/10000]') == np.dtype('m8[300us]') - - def test_divisor_conversion_fs(self): - assert np.dtype('M8[fs/100]') == np.dtype('M8[10as]') - self.failUnlessRaises(ValueError, lambda : np.dtype('M8[3fs/10000]')) - - def test_divisor_conversion_as(self): - self.failUnlessRaises(ValueError, lambda : np.dtype('M8[as/10]')) - From numpy-svn at scipy.org Tue Feb 9 01:11:33 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 9 Feb 2010 00:11:33 -0600 (CST) Subject: [Numpy-svn] r8099 - branches/1.4.x/numpy/core Message-ID: <20100209061133.7880C39CAE7@scipy.org> Author: cdavid Date: 2010-02-09 00:11:33 -0600 (Tue, 09 Feb 2010) New Revision: 8099 Modified: branches/1.4.x/numpy/core/arrayprint.py branches/1.4.x/numpy/core/numerictypes.py Log: REF: remove datetime support at python level. Modified: branches/1.4.x/numpy/core/arrayprint.py =================================================================== --- branches/1.4.x/numpy/core/arrayprint.py 2010-02-09 06:11:19 UTC (rev 8098) +++ branches/1.4.x/numpy/core/arrayprint.py 2010-02-09 06:11:33 UTC (rev 8099) @@ -191,13 +191,10 @@ # make sure True and False line up. format_function = _boolFormatter elif issubclass(dtypeobj, _nt.integer): - if issubclass(dtypeobj, _nt.timeinteger): - format_function = str - else: - max_str_len = max(len(str(maximum.reduce(data))), - len(str(minimum.reduce(data)))) - format = '%' + str(max_str_len) + 'd' - format_function = lambda x: _formatInteger(x, format) + max_str_len = max(len(str(maximum.reduce(data))), + len(str(minimum.reduce(data)))) + format = '%' + str(max_str_len) + 'd' + format_function = lambda x: _formatInteger(x, format) elif issubclass(dtypeobj, _nt.floating): if issubclass(dtypeobj, _nt.longfloat): format_function = _longfloatFormatter(precision) Modified: branches/1.4.x/numpy/core/numerictypes.py =================================================================== --- branches/1.4.x/numpy/core/numerictypes.py 2010-02-09 06:11:19 UTC (rev 8098) +++ branches/1.4.x/numpy/core/numerictypes.py 2010-02-09 06:11:33 UTC (rev 8099) @@ -373,15 +373,13 @@ ('unicode_', 'unicode'), ('str_', 'string'), ('string_', 'string'), - ('object_', 'object'), - ('timedelta_', 'timedelta'), - ('datetime_', 'datetime')] + ('object_', 'object'),] for alias, t in type_pairs: allTypes[alias] = allTypes[t] sctypeDict[alias] = sctypeDict[t] # Remove aliases overriding python types and modules for t in ['ulong', 'object', 'unicode', 'int', 'long', 'float', - 'complex', 'bool', 'string', 'datetime', 'timedelta']: + 'complex', 'bool', 'string', 'datetime']: try: del allTypes[t] del sctypeDict[t] From numpy-svn at scipy.org Tue Feb 9 03:40:09 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 9 Feb 2010 02:40:09 -0600 (CST) Subject: [Numpy-svn] r8100 - trunk/numpy/testing/tests Message-ID: <20100209084009.274E3C7C01F@scipy.org> Author: cdavid Date: 2010-02-09 02:40:09 -0600 (Tue, 09 Feb 2010) New Revision: 8100 Modified: trunk/numpy/testing/tests/test_utils.py Log: TST: add simple test for complex arrays input to assert_array_almost_equal_nulp. Modified: trunk/numpy/testing/tests/test_utils.py =================================================================== --- trunk/numpy/testing/tests/test_utils.py 2010-02-09 06:11:33 UTC (rev 8099) +++ trunk/numpy/testing/tests/test_utils.py 2010-02-09 08:40:09 UTC (rev 8100) @@ -363,6 +363,19 @@ assert_array_almost_equal_nulp(x, y, nulp=1000) self.failUnlessRaises(AssertionError, failure) + def test_complex(self): + x = np.random.randn(10) + 1j * np.random.randn(10) + y = x + 1 + def failure(): + assert_array_almost_equal_nulp(x, y, nulp=1000) + self.failUnlessRaises(AssertionError, failure) + + def test_complex2(self): + x = np.random.randn(10) + y = np.array(x, np.complex) + 1e-16 * np.random.randn(10) + + assert_array_almost_equal_nulp(x, y, nulp=1000) + class TestULP(unittest.TestCase): def test_equal(self): x = np.random.randn(10) From numpy-svn at scipy.org Tue Feb 9 03:40:23 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 9 Feb 2010 02:40:23 -0600 (CST) Subject: [Numpy-svn] r8101 - trunk/numpy/testing Message-ID: <20100209084023.E8507C7C01F@scipy.org> Author: cdavid Date: 2010-02-09 02:40:23 -0600 (Tue, 09 Feb 2010) New Revision: 8101 Modified: trunk/numpy/testing/utils.py Log: BUG: fix typo. Modified: trunk/numpy/testing/utils.py =================================================================== --- trunk/numpy/testing/utils.py 2010-02-09 08:40:09 UTC (rev 8100) +++ trunk/numpy/testing/utils.py 2010-02-09 08:40:23 UTC (rev 8101) @@ -1152,7 +1152,7 @@ t = np.common_type(x, y) if np.iscomplexobj(x) or np.iscomplexobj(y): - raise NotImplementerError("_nulp not implemented for complex array") + raise NotImplementedError("_nulp not implemented for complex array") x = np.array(x, dtype=t) y = np.array(y, dtype=t) From numpy-svn at scipy.org Tue Feb 9 03:40:36 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 9 Feb 2010 02:40:36 -0600 (CST) Subject: [Numpy-svn] r8102 - trunk/numpy/testing Message-ID: <20100209084036.A82D8C7C01F@scipy.org> Author: cdavid Date: 2010-02-09 02:40:36 -0600 (Tue, 09 Feb 2010) New Revision: 8102 Modified: trunk/numpy/testing/utils.py Log: ENH: handle complex input for assert_array_almost_equal_nulp. Modified: trunk/numpy/testing/utils.py =================================================================== --- trunk/numpy/testing/utils.py 2010-02-09 08:40:23 UTC (rev 8101) +++ trunk/numpy/testing/utils.py 2010-02-09 08:40:36 UTC (rev 8102) @@ -1104,9 +1104,12 @@ ay = np.abs(y) ref = nulp * np.spacing(np.where(ax > ay, ax, ay)) if not np.all(np.abs(x-y) <= ref): - max_nulp = np.max(nulp_diff(x, y)) - raise AssertionError("X and Y are not equal to %d ULP "\ - "(max is %g)" % (nulp, max_nulp)) + if np.iscomplexobj(x) or np.iscomplexobj(y): + msg = "X and Y are not equal to %d ULP" % nulp + else: + max_nulp = np.max(nulp_diff(x, y)) + msg = "X and Y are not equal to %d ULP (max is %g)" % (nulp, max_nulp) + raise AssertionError(msg) def assert_array_max_ulp(a, b, maxulp=1, dtype=None): """Given two arrays a and b, check that every item differs in at most N From numpy-svn at scipy.org Tue Feb 9 03:59:21 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 9 Feb 2010 02:59:21 -0600 (CST) Subject: [Numpy-svn] r8103 - branches/1.4.x/numpy/testing/tests Message-ID: <20100209085921.90F67C7C01F@scipy.org> Author: cdavid Date: 2010-02-09 02:59:21 -0600 (Tue, 09 Feb 2010) New Revision: 8103 Modified: branches/1.4.x/numpy/testing/tests/test_utils.py Log: TST: add simple test for complex arrays input to assert_array_almost_equal_nulp. (cherry picked from commit 6a7be0559ccfb24cf39fe1fe8a11232e18b0d26d) Modified: branches/1.4.x/numpy/testing/tests/test_utils.py =================================================================== --- branches/1.4.x/numpy/testing/tests/test_utils.py 2010-02-09 08:40:36 UTC (rev 8102) +++ branches/1.4.x/numpy/testing/tests/test_utils.py 2010-02-09 08:59:21 UTC (rev 8103) @@ -363,6 +363,19 @@ assert_array_almost_equal_nulp(x, y, nulp=1000) self.failUnlessRaises(AssertionError, failure) + def test_complex(self): + x = np.random.randn(10) + 1j * np.random.randn(10) + y = x + 1 + def failure(): + assert_array_almost_equal_nulp(x, y, nulp=1000) + self.failUnlessRaises(AssertionError, failure) + + def test_complex2(self): + x = np.random.randn(10) + y = np.array(x, np.complex) + 1e-16 * np.random.randn(10) + + assert_array_almost_equal_nulp(x, y, nulp=1000) + class TestULP(unittest.TestCase): def test_equal(self): x = np.random.randn(10) From numpy-svn at scipy.org Tue Feb 9 03:59:35 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 9 Feb 2010 02:59:35 -0600 (CST) Subject: [Numpy-svn] r8104 - branches/1.4.x/numpy/testing Message-ID: <20100209085935.A3EBBC7C01F@scipy.org> Author: cdavid Date: 2010-02-09 02:59:35 -0600 (Tue, 09 Feb 2010) New Revision: 8104 Modified: branches/1.4.x/numpy/testing/utils.py Log: BUG: fix typo. (cherry picked from commit 74c0b63599641f2967075203280042876fb062fb) Modified: branches/1.4.x/numpy/testing/utils.py =================================================================== --- branches/1.4.x/numpy/testing/utils.py 2010-02-09 08:59:21 UTC (rev 8103) +++ branches/1.4.x/numpy/testing/utils.py 2010-02-09 08:59:35 UTC (rev 8104) @@ -1156,7 +1156,7 @@ t = np.common_type(x, y) if np.iscomplexobj(x) or np.iscomplexobj(y): - raise NotImplementerError("_nulp not implemented for complex array") + raise NotImplementedError("_nulp not implemented for complex array") x = np.array(x, dtype=t) y = np.array(y, dtype=t) From numpy-svn at scipy.org Tue Feb 9 03:59:54 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 9 Feb 2010 02:59:54 -0600 (CST) Subject: [Numpy-svn] r8105 - branches/1.4.x/numpy/testing Message-ID: <20100209085954.81956C7C01F@scipy.org> Author: cdavid Date: 2010-02-09 02:59:54 -0600 (Tue, 09 Feb 2010) New Revision: 8105 Modified: branches/1.4.x/numpy/testing/utils.py Log: ENH: handle complex input for assert_array_almost_equal_nulp. (cherry picked from commit 6078289d9c1e69c0b043e4bb2571caafb6b2910d) Modified: branches/1.4.x/numpy/testing/utils.py =================================================================== --- branches/1.4.x/numpy/testing/utils.py 2010-02-09 08:59:35 UTC (rev 8104) +++ branches/1.4.x/numpy/testing/utils.py 2010-02-09 08:59:54 UTC (rev 8105) @@ -1108,9 +1108,12 @@ ay = np.abs(y) ref = nulp * np.spacing(np.where(ax > ay, ax, ay)) if not np.all(np.abs(x-y) <= ref): - max_nulp = np.max(nulp_diff(x, y)) - raise AssertionError("X and Y are not equal to %d ULP "\ - "(max is %g)" % (nulp, max_nulp)) + if np.iscomplexobj(x) or np.iscomplexobj(y): + msg = "X and Y are not equal to %d ULP" % nulp + else: + max_nulp = np.max(nulp_diff(x, y)) + msg = "X and Y are not equal to %d ULP (max is %g)" % (nulp, max_nulp) + raise AssertionError(msg) def assert_array_max_ulp(a, b, maxulp=1, dtype=None): """Given two arrays a and b, check that every item differs in at most N From numpy-svn at scipy.org Tue Feb 9 04:06:23 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 9 Feb 2010 03:06:23 -0600 (CST) Subject: [Numpy-svn] r8106 - branches/1.4.x/numpy/core/src/multiarray Message-ID: <20100209090623.B6E59C7C01F@scipy.org> Author: cdavid Date: 2010-02-09 03:06:23 -0600 (Tue, 09 Feb 2010) New Revision: 8106 Modified: branches/1.4.x/numpy/core/src/multiarray/multiarraymodule_onefile.c Log: BUG: fix non-separate compilation. Modified: branches/1.4.x/numpy/core/src/multiarray/multiarraymodule_onefile.c =================================================================== --- branches/1.4.x/numpy/core/src/multiarray/multiarraymodule_onefile.c 2010-02-09 08:59:54 UTC (rev 8105) +++ branches/1.4.x/numpy/core/src/multiarray/multiarraymodule_onefile.c 2010-02-09 09:06:23 UTC (rev 8106) @@ -10,7 +10,6 @@ #include "scalartypes.c" #include "scalarapi.c" -#include "datetime.c" #include "arraytypes.c" #include "hashdescr.c" From numpy-svn at scipy.org Thu Feb 11 19:37:18 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 11 Feb 2010 18:37:18 -0600 (CST) Subject: [Numpy-svn] r8107 - in trunk: . numpy/core/src/multiarray Message-ID: <20100212003718.0CA6CC7C018@scipy.org> Author: oliphant Date: 2010-02-11 18:37:17 -0600 (Thu, 11 Feb 2010) New Revision: 8107 Modified: trunk/numpy/core/src/multiarray/descriptor.c trunk/setup.py Log: Update trunk version to 2.0 and fix descriptor pickle code so that it produces 1.3-compatible pickle unless it cannot. Modified: trunk/numpy/core/src/multiarray/descriptor.c =================================================================== --- trunk/numpy/core/src/multiarray/descriptor.c 2010-02-09 09:06:23 UTC (rev 8106) +++ trunk/numpy/core/src/multiarray/descriptor.c 2010-02-12 00:37:17 UTC (rev 8107) @@ -2032,8 +2032,27 @@ endian = '>'; } } - state = PyTuple_New(9); - PyTuple_SET_ITEM(state, 0, PyInt_FromLong(version)); + if (self->metadata) { + state = PyTuple_New(9); + PyTuple_SET_ITEM(state, 0, PyInt_FromLong(version)); + if (PyDataType_ISDATETIME(self)) { + PyObject *newobj; + /* Handle CObject in NPY_METADATA_DTSTR key separately */ + /* newobj is a tuple of cleaned metadata dictionary + and tuple of date_time info (str, num, den, events) */ + newobj = _get_pickleabletype_from_metadata(self->metadata); + PyTuple_SET_ITEM(state, 8, newobj); + } + else { + Py_INCREF(self->metadata); + PyTuple_SET_ITEM(state, 8, self->metadata); + } + } + else { /* Use version 3 pickle format */ + state = PyTuple_New(8); + PyTuple_SET_ITEM(state, 0, PyInt_FromLong(3)); + } + PyTuple_SET_ITEM(state, 1, PyUString_FromFormat("%c", endian)); PyTuple_SET_ITEM(state, 2, arraydescr_subdescr_get(self)); if (self->names) { @@ -2061,24 +2080,6 @@ PyTuple_SET_ITEM(state, 5, PyInt_FromLong(elsize)); PyTuple_SET_ITEM(state, 6, PyInt_FromLong(alignment)); PyTuple_SET_ITEM(state, 7, PyInt_FromLong(self->hasobject)); - if (self->metadata) { - if (PyDataType_ISDATETIME(self)) { - PyObject *newobj; - /* Handle CObject in NPY_METADATA_DTSTR key separately */ - /* newobj is a tuple of cleaned metadata dictionary - and tuple of date_time info (str, num, den, events) */ - newobj = _get_pickleabletype_from_metadata(self->metadata); - PyTuple_SET_ITEM(state, 8, newobj); - } - else { - Py_INCREF(self->metadata); - PyTuple_SET_ITEM(state, 8, self->metadata); - } - } - else { - PyTuple_SET_ITEM(state, 8, Py_None); - Py_INCREF(Py_None); - } PyTuple_SET_ITEM(ret, 2, state); return ret; @@ -2143,67 +2144,77 @@ !(PyTuple_Check(PyTuple_GET_ITEM(args, 0)))) { PyErr_BadInternalCall(); return NULL; - } + } switch (PyTuple_GET_SIZE(PyTuple_GET_ITEM(args,0))) { case 9: #if defined(NPY_PY3K) - if (!PyArg_ParseTuple(args, "(iCOOOiiiO)", &version, &endian, +#define _ARGSTR_ "(iCOOOiiiO)" #else - if (!PyArg_ParseTuple(args, "(icOOOiiiO)", &version, &endian, +#define _ARGSTR_ "(icOOOiiiO)" #endif - &subarray, &names, &fields, &elsize, - &alignment, &dtypeflags, &metadata)) { + if (!PyArg_ParseTuple(args, _ARGSTR_, &version, &endian, + &subarray, &names, &fields, &elsize, + &alignment, &dtypeflags, &metadata)) { return NULL; } break; case 8: #if defined(NPY_PY3K) - if (!PyArg_ParseTuple(args, "(iCOOOiii)", &version, &endian, +#define _ARGSTR_ "(iCOOOiii)" #else - if (!PyArg_ParseTuple(args, "(icOOOiii)", &version, &endian, +#define _ARGSTR_ "(icOOOiii)" #endif - &subarray, &names, &fields, &elsize, - &alignment, &dtypeflags)) { + if (!PyArg_ParseTuple(args, _ARGSTR_, &version, &endian, + &subarray, &names, &fields, &elsize, + &alignment, &dtypeflags)) { return NULL; } break; case 7: #if defined(NPY_PY3K) - if (!PyArg_ParseTuple(args, "(iCOOOii)", &version, &endian, +#define _ARGSTR_ "(iCOOOii)" #else - if (!PyArg_ParseTuple(args, "(icOOOii)", &version, &endian, +#define _ARGSTR_ "(icOOOii)" #endif - &subarray, &names, &fields, &elsize, - &alignment)) { + if (!PyArg_ParseTuple(args, _ARGSTR_, &version, &endian, + &subarray, &names, &fields, &elsize, + &alignment)) { return NULL; } break; case 6: #if defined(NPY_PY3K) - if (!PyArg_ParseTuple(args, "(iCOOii)", &version, +#define _ARGSTR_ "(iCOOii)" #else - if (!PyArg_ParseTuple(args, "(icOOii)", &version, +#define _ARGSTR_ "(icOOii)" #endif - &endian, &subarray, &fields, - &elsize, &alignment)) { + if (!PyArg_ParseTuple(args, _ARGSTR_, &version, + &endian, &subarray, &fields, + &elsize, &alignment)) { PyErr_Clear(); } break; case 5: version = 0; #if defined(NPY_PY3K) - if (!PyArg_ParseTuple(args, "(COOii)", +#define _ARGSTR_ "(COOii)" #else - if (!PyArg_ParseTuple(args, "(cOOii)", +#define _ARGSTR_ "(cOOii)" #endif - &endian, &subarray, &fields, &elsize, - &alignment)) { + if (!PyArg_ParseTuple(args, _ARGSTR_, + &endian, &subarray, &fields, &elsize, + &alignment)) { return NULL; } break; default: /* raise an error */ - version = -1; + if (PyTuple_GET_SIZE(PyTuple_GET_ITEM(args,0)) > 5) { + version = PyInt_AsLong(PyTuple_GET_ITEM(args, 0)); + } + else { + version = -1; + } } /* Modified: trunk/setup.py =================================================================== --- trunk/setup.py 2010-02-09 09:06:23 UTC (rev 8106) +++ trunk/setup.py 2010-02-12 00:37:17 UTC (rev 8107) @@ -53,8 +53,8 @@ AUTHOR = "Travis E. Oliphant, et.al." AUTHOR_EMAIL = "oliphant at enthought.com" PLATFORMS = ["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"] -MAJOR = 1 -MINOR = 5 +MAJOR = 2 +MINOR = 0 MICRO = 0 ISRELEASED = False VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO) From numpy-svn at scipy.org Thu Feb 11 20:18:19 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 11 Feb 2010 19:18:19 -0600 (CST) Subject: [Numpy-svn] r8108 - branches/1.4.x/numpy/core/src/multiarray Message-ID: <20100212011819.87A52C7C044@scipy.org> Author: oliphant Date: 2010-02-11 19:18:19 -0600 (Thu, 11 Feb 2010) New Revision: 8108 Modified: branches/1.4.x/numpy/core/src/multiarray/descriptor.c Log: Fix 1.4.x branch so that it also does not add the metadata info to the dtype pickle unless it has to. This will allow 1.4.x pickles to be compatible with 1.3.x pickles. Modified: branches/1.4.x/numpy/core/src/multiarray/descriptor.c =================================================================== --- branches/1.4.x/numpy/core/src/multiarray/descriptor.c 2010-02-12 00:37:17 UTC (rev 8107) +++ branches/1.4.x/numpy/core/src/multiarray/descriptor.c 2010-02-12 01:18:19 UTC (rev 8108) @@ -1641,8 +1641,18 @@ endian = '>'; } } - state = PyTuple_New(9); - PyTuple_SET_ITEM(state, 0, PyInt_FromLong(version)); + + if (self->metadata) { + state = PyTuple_New(9); + PyTuple_SET_ITEM(state, 0, PyInt_FromLong(version)); + Py_INCREF(self->metadata); + PyTuple_SET_ITEM(state, 8, self->metadata); + } + else { + state = PyTuple_New(8); + PyTuple_SET_ITEM(state, 0, PyInt_FromLong(3)); + } + PyTuple_SET_ITEM(state, 1, PyString_FromFormat("%c", endian)); PyTuple_SET_ITEM(state, 2, arraydescr_subdescr_get(self)); if (self->names) { @@ -1670,14 +1680,6 @@ PyTuple_SET_ITEM(state, 5, PyInt_FromLong(elsize)); PyTuple_SET_ITEM(state, 6, PyInt_FromLong(alignment)); PyTuple_SET_ITEM(state, 7, PyInt_FromLong(self->hasobject)); - if (self->metadata) { - Py_INCREF(self->metadata); - PyTuple_SET_ITEM(state, 8, self->metadata); - } - else { - PyTuple_SET_ITEM(state, 8, Py_None); - Py_INCREF(Py_None); - } PyTuple_SET_ITEM(ret, 2, state); return ret; From numpy-svn at scipy.org Sat Feb 13 17:56:30 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 13 Feb 2010 16:56:30 -0600 (CST) Subject: [Numpy-svn] r8109 - trunk/numpy/core/blasdot Message-ID: <20100213225630.DA93A39C674@scipy.org> Author: charris Date: 2010-02-13 16:56:30 -0600 (Sat, 13 Feb 2010) New Revision: 8109 Modified: trunk/numpy/core/blasdot/_dotblas.c Log: Fix _dotblas ob_type pointer for py3k. Modified: trunk/numpy/core/blasdot/_dotblas.c =================================================================== --- trunk/numpy/core/blasdot/_dotblas.c 2010-02-12 01:18:19 UTC (rev 8108) +++ trunk/numpy/core/blasdot/_dotblas.c 2010-02-13 22:56:30 UTC (rev 8109) @@ -401,14 +401,14 @@ } /* Choose which subtype to return */ - if (ap1->ob_type != ap2->ob_type) { + if (Py_Type(ap1) != Py_Type(ap2)) { prior2 = PyArray_GetPriority((PyObject *)ap2, 0.0); prior1 = PyArray_GetPriority((PyObject *)ap1, 0.0); - subtype = (prior2 > prior1 ? ap2->ob_type : ap1->ob_type); + subtype = (prior2 > prior1 ? Py_TYPE(ap2) : Py_TYPE(ap1)); } else { prior1 = prior2 = 0.0; - subtype = ap1->ob_type; + subtype = Py_TYPE(ap1); } ret = (PyArrayObject *)PyArray_New(subtype, nd, dimensions, @@ -900,7 +900,7 @@ /* Choose which subtype to return */ prior2 = PyArray_GetPriority((PyObject *)ap2, 0.0); prior1 = PyArray_GetPriority((PyObject *)ap1, 0.0); - subtype = (prior2 > prior1 ? ap2->ob_type : ap1->ob_type); + subtype = (prior2 > prior1 ? Py_TYPE(ap2) : Py_TYPE(ap1)); ret = (PyArrayObject *)PyArray_New(subtype, nd, dimensions, typenum, NULL, NULL, 0, 0, From numpy-svn at scipy.org Sun Feb 14 01:53:05 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 14 Feb 2010 00:53:05 -0600 (CST) Subject: [Numpy-svn] r8110 - trunk/numpy/core/tests Message-ID: <20100214065305.A82CB39CAE7@scipy.org> Author: charris Date: 2010-02-14 00:53:05 -0600 (Sun, 14 Feb 2010) New Revision: 8110 Modified: trunk/numpy/core/tests/test_regression.py Log: BUG: Apply patch to fix ticket #1326. Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2010-02-13 22:56:30 UTC (rev 8109) +++ trunk/numpy/core/tests/test_regression.py 2010-02-14 06:53:05 UTC (rev 8110) @@ -1251,7 +1251,7 @@ except ImportError: from md5 import new as md5 - x = np.array([1,2,3], dtype=np.int32) + x = np.array([1,2,3], dtype=np.dtype(' Author: pierregm Date: 2010-02-14 01:32:25 -0600 (Sun, 14 Feb 2010) New Revision: 8111 Modified: trunk/numpy/ma/core.py Log: Fix #1367 Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2010-02-14 06:53:05 UTC (rev 8110) +++ trunk/numpy/ma/core.py 2010-02-14 07:32:25 UTC (rev 8111) @@ -2786,7 +2786,7 @@ self._mask.shape = self.shape except ValueError: self._mask = nomask - except AttributeError: + except (TypeError, AttributeError): # When _mask.shape is not writable (because it's a void) pass # Finalize the fill_value for structured arrays From numpy-svn at scipy.org Sun Feb 14 18:04:18 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 14 Feb 2010 17:04:18 -0600 (CST) Subject: [Numpy-svn] r8112 - trunk/numpy/ma Message-ID: <20100214230418.BE14839CAE7@scipy.org> Author: pierregm Date: 2010-02-14 17:04:18 -0600 (Sun, 14 Feb 2010) New Revision: 8112 Modified: trunk/numpy/ma/core.py Log: Fix #1367 (round 2) Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2010-02-14 07:32:25 UTC (rev 8111) +++ trunk/numpy/ma/core.py 2010-02-14 23:04:18 UTC (rev 8112) @@ -2875,7 +2875,7 @@ # Try to reset the shape of the mask (if we don't have a void) try: output._mask.shape = output.shape - except AttributeError: + except (AttributeError, TypeError): pass # Make sure to reset the _fill_value if needed if getattr(output, '_fill_value', None): From numpy-svn at scipy.org Mon Feb 15 18:13:16 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 15 Feb 2010 17:13:16 -0600 (CST) Subject: [Numpy-svn] r8113 - in trunk: doc doc/cython doc/numpybook doc/numpybook/comparison/pyrex doc/pyrex doc/source/reference numpy/core numpy/core/code_generators numpy/core/include/numpy numpy/core/src/multiarray numpy/random/mtrand Message-ID: <20100215231316.EA2E3C7C01F@scipy.org> Author: oliphant Date: 2010-02-15 17:13:16 -0600 (Mon, 15 Feb 2010) New Revision: 8113 Modified: trunk/doc/CAPI.txt trunk/doc/cython/c_numpy.pxd trunk/doc/numpybook/capi.lyx trunk/doc/numpybook/comparison/pyrex/c_numpy.pxd trunk/doc/pyrex/c_numpy.pxd trunk/doc/source/reference/c-api.types-and-structures.rst trunk/numpy/core/code_generators/cversions.txt trunk/numpy/core/code_generators/numpy_api.py trunk/numpy/core/include/numpy/ndarrayobject.h trunk/numpy/core/setup_common.py trunk/numpy/core/src/multiarray/arraytypes.c.src trunk/numpy/core/src/multiarray/descriptor.c trunk/numpy/core/src/multiarray/hashdescr.c trunk/numpy/core/src/multiarray/mapping.c trunk/numpy/core/src/multiarray/multiarraymodule.c trunk/numpy/random/mtrand/numpy.pxi Log: API and ABI changes: Removed BigArrayType, Fixed hasobject to an integer (and inserted an unused character for alignment) and renamed it to flags. Re-organized the ArrFuncs structure. Moved NPY_DATETIME and friends to their 'correct' place in the type order. Modified: trunk/doc/CAPI.txt =================================================================== --- trunk/doc/CAPI.txt 2010-02-14 23:04:18 UTC (rev 8112) +++ trunk/doc/CAPI.txt 2010-02-15 23:13:16 UTC (rev 8113) @@ -61,9 +61,9 @@ ``subtype`` : ``PyTypeObject *`` The subtype that should be created (either pass in - ``&PyArray_Type``, ``&PyBigArray_Type``, or ``obj->ob_type``, + ``&PyArray_Type``, or ``obj->ob_type``, where ``obj`` is a an instance of a subtype (or subclass) of - ``PyArray_Type`` or ``PyBigArray_Type``). + ``PyArray_Type``). ``descr`` : ``PyArray_Descr *`` The type descriptor for the array. This is a Python object (this @@ -114,7 +114,7 @@ order array. See below for an explanation of the flags. ``obj`` : ``PyObject *`` - If subtypes is ``&PyArray_Type`` or ``&PyBigArray_Type``, this argument is + If subtypes is ``&PyArray_Type``, this argument is ignored. Otherwise, the ``__array_finalize__`` method of the subtype is called (if present) and passed this object. This is usually an array of the type to be created (so the ``__array_finalize__`` method Modified: trunk/doc/cython/c_numpy.pxd =================================================================== --- trunk/doc/cython/c_numpy.pxd 2010-02-14 23:04:18 UTC (rev 8112) +++ trunk/doc/cython/c_numpy.pxd 2010-02-15 23:13:16 UTC (rev 8113) @@ -76,7 +76,8 @@ ctypedef extern class numpy.dtype [object PyArray_Descr]: cdef int type_num, elsize, alignment - cdef char type, kind, byteorder, hasobject + cdef char type, kind, byteorder + cdef int flags cdef object fields, typeobj ctypedef extern class numpy.ndarray [object PyArrayObject]: Modified: trunk/doc/numpybook/capi.lyx =================================================================== --- trunk/doc/numpybook/capi.lyx 2010-02-14 23:04:18 UTC (rev 8112) +++ trunk/doc/numpybook/capi.lyx 2010-02-15 23:13:16 UTC (rev 8113) @@ -599,10 +599,18 @@ \emph on char \emph default - hasobject; + unused; \end_layout \begin_layout LyX-Code + +\emph on +int +\emph default + flags; +\end_layout + +\begin_layout LyX-Code \emph on int @@ -674,9 +682,9 @@ \family default flags should be set in the \family typewriter -hasobject +flags \family default - flag. + member. \end_layout \begin_layout Description @@ -702,7 +710,7 @@ \end_layout \begin_layout Description -hasobject A data-type bit-flag that determines if the data-type exhibits +flags A data-type bit-flag that determines if the data-type exhibits object-array like behavior. Each bit in this member is a flag which are named as: \end_layout Modified: trunk/doc/numpybook/comparison/pyrex/c_numpy.pxd =================================================================== --- trunk/doc/numpybook/comparison/pyrex/c_numpy.pxd 2010-02-14 23:04:18 UTC (rev 8112) +++ trunk/doc/numpybook/comparison/pyrex/c_numpy.pxd 2010-02-15 23:13:16 UTC (rev 8113) @@ -73,7 +73,8 @@ ctypedef extern class numpy.dtype [object PyArray_Descr]: cdef int type_num, elsize, alignment - cdef char type, kind, byteorder, hasobject + cdef char type, kind, byteorder + cdef int flags cdef object fields, typeobj ctypedef extern class numpy.ndarray [object PyArrayObject]: Modified: trunk/doc/pyrex/c_numpy.pxd =================================================================== --- trunk/doc/pyrex/c_numpy.pxd 2010-02-14 23:04:18 UTC (rev 8112) +++ trunk/doc/pyrex/c_numpy.pxd 2010-02-15 23:13:16 UTC (rev 8113) @@ -75,7 +75,8 @@ ctypedef extern class numpy.dtype [object PyArray_Descr]: cdef int type_num, elsize, alignment - cdef char type, kind, byteorder, hasobject + cdef char type, kind, byteorder + cdef int flags cdef object fields, typeobj ctypedef extern class numpy.ndarray [object PyArrayObject]: Modified: trunk/doc/source/reference/c-api.types-and-structures.rst =================================================================== --- trunk/doc/source/reference/c-api.types-and-structures.rst 2010-02-14 23:04:18 UTC (rev 8112) +++ trunk/doc/source/reference/c-api.types-and-structures.rst 2010-02-15 23:13:16 UTC (rev 8113) @@ -191,7 +191,8 @@ char kind; char type; char byteorder; - char hasobject; + char unused; + int flags; int type_num; int elsize; int alignment; @@ -208,7 +209,7 @@ should point to a user-defined typeobject. This typeobject can either inherit from array scalars or not. If it does not inherit from array scalars, then the :cdata:`NPY_USE_GETITEM` and - :cdata:`NPY_USE_SETITEM` flags should be set in the ``hasobject`` flag. + :cdata:`NPY_USE_SETITEM` flags should be set in the ``flags`` member. .. cmember:: char PyArray_Descr.kind @@ -229,7 +230,7 @@ endian), '=' (native), '\|' (irrelevant, ignore). All builtin data- types have byteorder '='. -.. cmember:: char PyArray_Descr.hasobject +.. cmember:: int PyArray_Descr.flags A data-type bit-flag that determines if the data-type exhibits object- array like behavior. Each bit in this member is a flag which are named Modified: trunk/numpy/core/code_generators/cversions.txt =================================================================== --- trunk/numpy/core/code_generators/cversions.txt 2010-02-14 23:04:18 UTC (rev 8112) +++ trunk/numpy/core/code_generators/cversions.txt 2010-02-15 23:13:16 UTC (rev 8113) @@ -5,3 +5,4 @@ # Starting from here, the hash is defined from numpy_api.full_api dict # version 4 added neighborhood iterators and PyArray_Correlate2 0x00000004 = 3d8940bf7b0d2a4e25be4338c14c3c85 +0x00000005 = 77e2e846db87f25d7cf99f9d812076f0 Modified: trunk/numpy/core/code_generators/numpy_api.py =================================================================== --- trunk/numpy/core/code_generators/numpy_api.py 2010-02-14 23:04:18 UTC (rev 8112) +++ trunk/numpy/core/code_generators/numpy_api.py 2010-02-15 23:13:16 UTC (rev 8113) @@ -13,7 +13,7 @@ """ multiarray_global_vars = { - 'NPY_NUMUSERTYPES': 7, + 'NPY_NUMUSERTYPES': 6, } multiarray_global_vars_types = { @@ -21,239 +21,236 @@ } multiarray_scalar_bool_values = { - '_PyArrayScalar_BoolValues': 9 + '_PyArrayScalar_BoolValues': 8 } multiarray_types_api = { - 'PyBigArray_Type': 1, - 'PyArray_Type': 2, - 'PyArrayDescr_Type': 3, - 'PyArrayFlags_Type': 4, - 'PyArrayIter_Type': 5, - 'PyArrayMultiIter_Type': 6, - 'PyBoolArrType_Type': 8, - 'PyGenericArrType_Type': 10, - 'PyNumberArrType_Type': 11, - 'PyIntegerArrType_Type': 12, - 'PySignedIntegerArrType_Type': 13, - 'PyUnsignedIntegerArrType_Type': 14, - 'PyInexactArrType_Type': 15, - 'PyFloatingArrType_Type': 16, - 'PyComplexFloatingArrType_Type': 17, - 'PyFlexibleArrType_Type': 18, - 'PyCharacterArrType_Type': 19, - 'PyByteArrType_Type': 20, - 'PyShortArrType_Type': 21, - 'PyIntArrType_Type': 22, - 'PyLongArrType_Type': 23, - 'PyLongLongArrType_Type': 24, - 'PyUByteArrType_Type': 25, - 'PyUShortArrType_Type': 26, - 'PyUIntArrType_Type': 27, - 'PyULongArrType_Type': 28, - 'PyULongLongArrType_Type': 29, - 'PyFloatArrType_Type': 30, - 'PyDoubleArrType_Type': 31, - 'PyLongDoubleArrType_Type': 32, - 'PyCFloatArrType_Type': 33, - 'PyCDoubleArrType_Type': 34, - 'PyCLongDoubleArrType_Type': 35, - 'PyObjectArrType_Type': 36, - 'PyStringArrType_Type': 37, - 'PyUnicodeArrType_Type': 38, - 'PyVoidArrType_Type': 39, -# Those were added much later, and there is no space anymore between Void and -# first functions from multiarray API - 'PyTimeIntegerArrType_Type': 215, - 'PyDatetimeArrType_Type': 216, - 'PyTimedeltaArrType_Type': 217, + 'PyArray_Type': 1, + 'PyArrayDescr_Type': 2, + 'PyArrayFlags_Type': 3, + 'PyArrayIter_Type': 4, + 'PyArrayMultiIter_Type': 5, + 'PyBoolArrType_Type': 7, + 'PyGenericArrType_Type': 9, + 'PyNumberArrType_Type': 10, + 'PyIntegerArrType_Type': 11, + 'PySignedIntegerArrType_Type': 12, + 'PyUnsignedIntegerArrType_Type': 13, + 'PyInexactArrType_Type': 14, + 'PyFloatingArrType_Type': 15, + 'PyComplexFloatingArrType_Type': 16, + 'PyFlexibleArrType_Type': 17, + 'PyCharacterArrType_Type': 18, + 'PyByteArrType_Type': 19, + 'PyShortArrType_Type': 20, + 'PyIntArrType_Type': 21, + 'PyLongArrType_Type': 22, + 'PyLongLongArrType_Type': 23, + 'PyUByteArrType_Type': 24, + 'PyUShortArrType_Type': 25, + 'PyUIntArrType_Type': 26, + 'PyULongArrType_Type': 27, + 'PyULongLongArrType_Type': 28, + 'PyFloatArrType_Type': 29, + 'PyDoubleArrType_Type': 30, + 'PyLongDoubleArrType_Type': 31, + 'PyCFloatArrType_Type': 32, + 'PyCDoubleArrType_Type': 33, + 'PyCLongDoubleArrType_Type': 34, + 'PyObjectArrType_Type': 35, + 'PyStringArrType_Type': 36, + 'PyUnicodeArrType_Type': 37, + 'PyVoidArrType_Type': 38, + 'PyTimeIntegerArrType_Type': 39, + 'PyDatetimeArrType_Type': 40, + 'PyTimedeltaArrType_Type': 41, } -#define NPY_NUMUSERTYPES (*(int *)PyArray_API[7]) -#define PyBoolArrType_Type (*(PyTypeObject *)PyArray_API[8]) -#define _PyArrayScalar_BoolValues ((PyBoolScalarObject *)PyArray_API[9]) +#define NPY_NUMUSERTYPES (*(int *)PyArray_API[6]) +#define PyBoolArrType_Type (*(PyTypeObject *)PyArray_API[7]) +#define _PyArrayScalar_BoolValues ((PyBoolScalarObject *)PyArray_API[8]) multiarray_funcs_api = { 'PyArray_GetNDArrayCVersion': 0, - 'PyArray_SetNumericOps': 40, - 'PyArray_GetNumericOps': 41, - 'PyArray_INCREF': 42, - 'PyArray_XDECREF': 43, - 'PyArray_SetStringFunction': 44, - 'PyArray_DescrFromType': 45, - 'PyArray_TypeObjectFromType': 46, - 'PyArray_Zero': 47, - 'PyArray_One': 48, - 'PyArray_CastToType': 49, - 'PyArray_CastTo': 50, - 'PyArray_CastAnyTo': 51, - 'PyArray_CanCastSafely': 52, - 'PyArray_CanCastTo': 53, - 'PyArray_ObjectType': 54, - 'PyArray_DescrFromObject': 55, - 'PyArray_ConvertToCommonType': 56, - 'PyArray_DescrFromScalar': 57, - 'PyArray_DescrFromTypeObject': 58, - 'PyArray_Size': 59, - 'PyArray_Scalar': 60, - 'PyArray_FromScalar': 61, - 'PyArray_ScalarAsCtype': 62, - 'PyArray_CastScalarToCtype': 63, - 'PyArray_CastScalarDirect': 64, - 'PyArray_ScalarFromObject': 65, - 'PyArray_GetCastFunc': 66, - 'PyArray_FromDims': 67, - 'PyArray_FromDimsAndDataAndDescr': 68, - 'PyArray_FromAny': 69, - 'PyArray_EnsureArray': 70, - 'PyArray_EnsureAnyArray': 71, - 'PyArray_FromFile': 72, - 'PyArray_FromString': 73, - 'PyArray_FromBuffer': 74, - 'PyArray_FromIter': 75, - 'PyArray_Return': 76, - 'PyArray_GetField': 77, - 'PyArray_SetField': 78, - 'PyArray_Byteswap': 79, - 'PyArray_Resize': 80, - 'PyArray_MoveInto': 81, - 'PyArray_CopyInto': 82, - 'PyArray_CopyAnyInto': 83, - 'PyArray_CopyObject': 84, - 'PyArray_NewCopy': 85, - 'PyArray_ToList': 86, - 'PyArray_ToString': 87, - 'PyArray_ToFile': 88, - 'PyArray_Dump': 89, - 'PyArray_Dumps': 90, - 'PyArray_ValidType': 91, - 'PyArray_UpdateFlags': 92, - 'PyArray_New': 93, - 'PyArray_NewFromDescr': 94, - 'PyArray_DescrNew': 95, - 'PyArray_DescrNewFromType': 96, - 'PyArray_GetPriority': 97, - 'PyArray_IterNew': 98, - 'PyArray_MultiIterNew': 99, - 'PyArray_PyIntAsInt': 100, - 'PyArray_PyIntAsIntp': 101, - 'PyArray_Broadcast': 102, - 'PyArray_FillObjectArray': 103, - 'PyArray_FillWithScalar': 104, - 'PyArray_CheckStrides': 105, - 'PyArray_DescrNewByteorder': 106, - 'PyArray_IterAllButAxis': 107, - 'PyArray_CheckFromAny': 108, - 'PyArray_FromArray': 109, - 'PyArray_FromInterface': 110, - 'PyArray_FromStructInterface': 111, - 'PyArray_FromArrayAttr': 112, - 'PyArray_ScalarKind': 113, - 'PyArray_CanCoerceScalar': 114, - 'PyArray_NewFlagsObject': 115, - 'PyArray_CanCastScalar': 116, - 'PyArray_CompareUCS4': 117, - 'PyArray_RemoveSmallest': 118, - 'PyArray_ElementStrides': 119, - 'PyArray_Item_INCREF': 120, - 'PyArray_Item_XDECREF': 121, - 'PyArray_FieldNames': 122, - 'PyArray_Transpose': 123, - 'PyArray_TakeFrom': 124, - 'PyArray_PutTo': 125, - 'PyArray_PutMask': 126, - 'PyArray_Repeat': 127, - 'PyArray_Choose': 128, - 'PyArray_Sort': 129, - 'PyArray_ArgSort': 130, - 'PyArray_SearchSorted': 131, - 'PyArray_ArgMax': 132, - 'PyArray_ArgMin': 133, - 'PyArray_Reshape': 134, - 'PyArray_Newshape': 135, - 'PyArray_Squeeze': 136, - 'PyArray_View': 137, - 'PyArray_SwapAxes': 138, - 'PyArray_Max': 139, - 'PyArray_Min': 140, - 'PyArray_Ptp': 141, - 'PyArray_Mean': 142, - 'PyArray_Trace': 143, - 'PyArray_Diagonal': 144, - 'PyArray_Clip': 145, - 'PyArray_Conjugate': 146, - 'PyArray_Nonzero': 147, - 'PyArray_Std': 148, - 'PyArray_Sum': 149, - 'PyArray_CumSum': 150, - 'PyArray_Prod': 151, - 'PyArray_CumProd': 152, - 'PyArray_All': 153, - 'PyArray_Any': 154, - 'PyArray_Compress': 155, - 'PyArray_Flatten': 156, - 'PyArray_Ravel': 157, - 'PyArray_MultiplyList': 158, - 'PyArray_MultiplyIntList': 159, - 'PyArray_GetPtr': 160, - 'PyArray_CompareLists': 161, - 'PyArray_AsCArray': 162, - 'PyArray_As1D': 163, - 'PyArray_As2D': 164, - 'PyArray_Free': 165, - 'PyArray_Converter': 166, - 'PyArray_IntpFromSequence': 167, - 'PyArray_Concatenate': 168, - 'PyArray_InnerProduct': 169, - 'PyArray_MatrixProduct': 170, - 'PyArray_CopyAndTranspose': 171, - 'PyArray_Correlate': 172, - 'PyArray_TypestrConvert': 173, - 'PyArray_DescrConverter': 174, - 'PyArray_DescrConverter2': 175, - 'PyArray_IntpConverter': 176, - 'PyArray_BufferConverter': 177, - 'PyArray_AxisConverter': 178, - 'PyArray_BoolConverter': 179, - 'PyArray_ByteorderConverter': 180, - 'PyArray_OrderConverter': 181, - 'PyArray_EquivTypes': 182, - 'PyArray_Zeros': 183, - 'PyArray_Empty': 184, - 'PyArray_Where': 185, - 'PyArray_Arange': 186, - 'PyArray_ArangeObj': 187, - 'PyArray_SortkindConverter': 188, - 'PyArray_LexSort': 189, - 'PyArray_Round': 190, - 'PyArray_EquivTypenums': 191, - 'PyArray_RegisterDataType': 192, - 'PyArray_RegisterCastFunc': 193, - 'PyArray_RegisterCanCast': 194, - 'PyArray_InitArrFuncs': 195, - 'PyArray_IntTupleFromIntp': 196, - 'PyArray_TypeNumFromName': 197, - 'PyArray_ClipmodeConverter': 198, - 'PyArray_OutputConverter': 199, - 'PyArray_BroadcastToShape': 200, - '_PyArray_SigintHandler': 201, - '_PyArray_GetSigintBuf': 202, - 'PyArray_DescrAlignConverter': 203, - 'PyArray_DescrAlignConverter2': 204, - 'PyArray_SearchsideConverter': 205, - 'PyArray_CheckAxis': 206, - 'PyArray_OverflowMultiplyList': 207, - 'PyArray_CompareString': 208, - 'PyArray_MultiIterFromObjects': 209, - 'PyArray_GetEndianness': 210, - 'PyArray_GetNDArrayCFeatureVersion': 211, - 'PyArray_Correlate2': 212, - 'PyArray_NeighborhoodIterNew': 213, - 'PyArray_SetDatetimeParseFunction': 214, - 'PyArray_DatetimeToDatetimeStruct': 218, - 'PyArray_TimedeltaToTimedeltaStruct': 219, - 'PyArray_DatetimeStructToDatetime': 220, - 'PyArray_TimedeltaStructToTimedelta': 221, + 'PyArray_SetNumericOps': 42, + 'PyArray_GetNumericOps': 43, + 'PyArray_INCREF': 44, + 'PyArray_XDECREF': 45, + 'PyArray_SetStringFunction': 46, + 'PyArray_DescrFromType': 47, + 'PyArray_TypeObjectFromType': 48, + 'PyArray_Zero': 49, + 'PyArray_One': 50, + 'PyArray_CastToType': 51, + 'PyArray_CastTo': 52, + 'PyArray_CastAnyTo': 53, + 'PyArray_CanCastSafely': 54, + 'PyArray_CanCastTo': 55, + 'PyArray_ObjectType': 56, + 'PyArray_DescrFromObject': 57, + 'PyArray_ConvertToCommonType': 58, + 'PyArray_DescrFromScalar': 59, + 'PyArray_DescrFromTypeObject': 60, + 'PyArray_Size': 61, + 'PyArray_Scalar': 62, + 'PyArray_FromScalar': 63, + 'PyArray_ScalarAsCtype': 64, + 'PyArray_CastScalarToCtype': 65, + 'PyArray_CastScalarDirect': 66, + 'PyArray_ScalarFromObject': 67, + 'PyArray_GetCastFunc': 68, + 'PyArray_FromDims': 69, + 'PyArray_FromDimsAndDataAndDescr': 70, + 'PyArray_FromAny': 71, + 'PyArray_EnsureArray': 72, + 'PyArray_EnsureAnyArray': 73, + 'PyArray_FromFile': 74, + 'PyArray_FromString': 75, + 'PyArray_FromBuffer': 76, + 'PyArray_FromIter': 77, + 'PyArray_Return': 78, + 'PyArray_GetField': 79, + 'PyArray_SetField': 80, + 'PyArray_Byteswap': 81, + 'PyArray_Resize': 82, + 'PyArray_MoveInto': 83, + 'PyArray_CopyInto': 84, + 'PyArray_CopyAnyInto': 85, + 'PyArray_CopyObject': 86, + 'PyArray_NewCopy': 87, + 'PyArray_ToList': 88, + 'PyArray_ToString': 89, + 'PyArray_ToFile': 90, + 'PyArray_Dump': 91, + 'PyArray_Dumps': 92, + 'PyArray_ValidType': 93, + 'PyArray_UpdateFlags': 94, + 'PyArray_New': 95, + 'PyArray_NewFromDescr': 96, + 'PyArray_DescrNew': 97, + 'PyArray_DescrNewFromType': 98, + 'PyArray_GetPriority': 99, + 'PyArray_IterNew': 100, + 'PyArray_MultiIterNew': 101, + 'PyArray_PyIntAsInt': 102, + 'PyArray_PyIntAsIntp': 103, + 'PyArray_Broadcast': 104, + 'PyArray_FillObjectArray': 105, + 'PyArray_FillWithScalar': 106, + 'PyArray_CheckStrides': 107, + 'PyArray_DescrNewByteorder': 108, + 'PyArray_IterAllButAxis': 109, + 'PyArray_CheckFromAny': 110, + 'PyArray_FromArray': 111, + 'PyArray_FromInterface': 112, + 'PyArray_FromStructInterface': 113, + 'PyArray_FromArrayAttr': 114, + 'PyArray_ScalarKind': 115, + 'PyArray_CanCoerceScalar': 116, + 'PyArray_NewFlagsObject': 117, + 'PyArray_CanCastScalar': 118, + 'PyArray_CompareUCS4': 119, + 'PyArray_RemoveSmallest': 120, + 'PyArray_ElementStrides': 121, + 'PyArray_Item_INCREF': 122, + 'PyArray_Item_XDECREF': 123, + 'PyArray_FieldNames': 124, + 'PyArray_Transpose': 125, + 'PyArray_TakeFrom': 126, + 'PyArray_PutTo': 127, + 'PyArray_PutMask': 128, + 'PyArray_Repeat': 129, + 'PyArray_Choose': 130, + 'PyArray_Sort': 131, + 'PyArray_ArgSort': 132, + 'PyArray_SearchSorted': 133, + 'PyArray_ArgMax': 134, + 'PyArray_ArgMin': 135, + 'PyArray_Reshape': 136, + 'PyArray_Newshape': 137, + 'PyArray_Squeeze': 138, + 'PyArray_View': 139, + 'PyArray_SwapAxes': 140, + 'PyArray_Max': 141, + 'PyArray_Min': 142, + 'PyArray_Ptp': 143, + 'PyArray_Mean': 144, + 'PyArray_Trace': 145, + 'PyArray_Diagonal': 146, + 'PyArray_Clip': 147, + 'PyArray_Conjugate': 148, + 'PyArray_Nonzero': 149, + 'PyArray_Std': 150, + 'PyArray_Sum': 151, + 'PyArray_CumSum': 152, + 'PyArray_Prod': 153, + 'PyArray_CumProd': 154, + 'PyArray_All': 155, + 'PyArray_Any': 156, + 'PyArray_Compress': 157, + 'PyArray_Flatten': 158, + 'PyArray_Ravel': 159, + 'PyArray_MultiplyList': 160, + 'PyArray_MultiplyIntList': 161, + 'PyArray_GetPtr': 162, + 'PyArray_CompareLists': 163, + 'PyArray_AsCArray': 164, + 'PyArray_As1D': 165, + 'PyArray_As2D': 166, + 'PyArray_Free': 167, + 'PyArray_Converter': 168, + 'PyArray_IntpFromSequence': 169, + 'PyArray_Concatenate': 170, + 'PyArray_InnerProduct': 171, + 'PyArray_MatrixProduct': 172, + 'PyArray_CopyAndTranspose': 173, + 'PyArray_Correlate': 174, + 'PyArray_TypestrConvert': 175, + 'PyArray_DescrConverter': 176, + 'PyArray_DescrConverter2': 177, + 'PyArray_IntpConverter': 178, + 'PyArray_BufferConverter': 179, + 'PyArray_AxisConverter': 180, + 'PyArray_BoolConverter': 181, + 'PyArray_ByteorderConverter': 182, + 'PyArray_OrderConverter': 183, + 'PyArray_EquivTypes': 184, + 'PyArray_Zeros': 185, + 'PyArray_Empty': 186, + 'PyArray_Where': 187, + 'PyArray_Arange': 188, + 'PyArray_ArangeObj': 189, + 'PyArray_SortkindConverter': 190, + 'PyArray_LexSort': 191, + 'PyArray_Round': 192, + 'PyArray_EquivTypenums': 193, + 'PyArray_RegisterDataType': 194, + 'PyArray_RegisterCastFunc': 195, + 'PyArray_RegisterCanCast': 196, + 'PyArray_InitArrFuncs': 197, + 'PyArray_IntTupleFromIntp': 198, + 'PyArray_TypeNumFromName': 199, + 'PyArray_ClipmodeConverter': 200, + 'PyArray_OutputConverter': 201, + 'PyArray_BroadcastToShape': 202, + '_PyArray_SigintHandler': 203, + '_PyArray_GetSigintBuf': 204, + 'PyArray_DescrAlignConverter': 205, + 'PyArray_DescrAlignConverter2': 206, + 'PyArray_SearchsideConverter': 207, + 'PyArray_CheckAxis': 208, + 'PyArray_OverflowMultiplyList': 209, + 'PyArray_CompareString': 210, + 'PyArray_MultiIterFromObjects': 211, + 'PyArray_GetEndianness': 212, + 'PyArray_GetNDArrayCFeatureVersion': 213, + 'PyArray_Correlate2': 214, + 'PyArray_NeighborhoodIterNew': 215, + 'PyArray_SetDatetimeParseFunction': 216, + 'PyArray_DatetimeToDatetimeStruct': 217, + 'PyArray_TimedeltaToTimedeltaStruct': 218, + 'PyArray_DatetimeStructToDatetime': 219, + 'PyArray_TimedeltaStructToTimedelta': 220, } ufunc_types_api = { Modified: trunk/numpy/core/include/numpy/ndarrayobject.h =================================================================== --- trunk/numpy/core/include/numpy/ndarrayobject.h 2010-02-14 23:04:18 UTC (rev 8112) +++ trunk/numpy/core/include/numpy/ndarrayobject.h 2010-02-15 23:13:16 UTC (rev 8113) @@ -75,10 +75,10 @@ NPY_LONGLONG, NPY_ULONGLONG, NPY_FLOAT, NPY_DOUBLE, NPY_LONGDOUBLE, NPY_CFLOAT, NPY_CDOUBLE, NPY_CLONGDOUBLE, - NPY_OBJECT=17, + NPY_DATETIME, NPY_TIMEDELTA, + NPY_OBJECT=19, NPY_STRING, NPY_UNICODE, NPY_VOID, - NPY_DATETIME, NPY_TIMEDELTA, NPY_NTYPES, NPY_NOTYPE, NPY_CHAR, /* special flag */ @@ -381,10 +381,6 @@ } PyArray_Dims; typedef struct { - /* Functions to cast to all other standard types*/ - /* Can have some NULL entries */ - PyArray_VectorUnaryFunc *cast[NPY_NTYPES]; - /* The next four functions *cannot* be NULL */ /* Functions to get and set items with standard @@ -453,6 +449,17 @@ PyArray_FastClipFunc *fastclip; PyArray_FastPutmaskFunc *fastputmask; PyArray_FastTakeFunc *fasttake; + + /* A little room to grow --- should use generic function interface for most additions */ + void *pad1; + void *pad2; + void *pad3; + void *pad4; + + /* Functions to cast to all other standard types*/ + /* Can have some NULL entries */ + PyArray_VectorUnaryFunc *cast[NPY_NTYPES]; + } PyArray_ArrFuncs; /* The item must be reference counted when it is inserted or extracted. */ @@ -483,12 +490,11 @@ NPY_NEEDS_INIT | NPY_NEEDS_PYAPI) #define PyDataType_FLAGCHK(dtype, flag) \ - (((dtype)->hasobject & (flag)) == (flag)) + (((dtype)->flags & (flag)) == (flag)) #define PyDataType_REFCHK(dtype) \ PyDataType_FLAGCHK(dtype, NPY_ITEM_REFCOUNT) -/* Change dtype hasobject to 32-bit in 1.1 and change its name */ typedef struct _PyArray_Descr { PyObject_HEAD PyTypeObject *typeobj; /* the type object representing an @@ -499,9 +505,9 @@ char type; /* unique-character representing this type */ char byteorder; /* '>' (big), '<' (little), '|' (not-applicable), or '=' (native). */ - char hasobject; /* non-zero if it has object arrays - in fields */ - int type_num; /* number representing this type */ + char unused; + int flags; /* flag describing data type */ + int type_num; /* number representing this type */ int elsize; /* element size for this type */ int alignment; /* alignment needed for this type */ struct _arr_descr \ Modified: trunk/numpy/core/setup_common.py =================================================================== --- trunk/numpy/core/setup_common.py 2010-02-14 23:04:18 UTC (rev 8112) +++ trunk/numpy/core/setup_common.py 2010-02-15 23:13:16 UTC (rev 8113) @@ -21,7 +21,7 @@ # Binary compatibility version number. This number is increased whenever the # C-API is changed such that binary compatibility is broken, i.e. whenever a # recompile of extension modules is needed. -C_ABI_VERSION = 0x01000009 +C_ABI_VERSION = 0x02000000 # Minor API version. This number is increased whenever a change is made to the # C-API -- whether it breaks binary compatibility or not. Some changes, such @@ -29,7 +29,7 @@ # without breaking binary compatibility. In this case, only the C_API_VERSION # (*not* C_ABI_VERSION) would be increased. Whenever binary compatibility is # broken, both C_API_VERSION and C_ABI_VERSION should be increased. -C_API_VERSION = 0x00000004 +C_API_VERSION = 0x00000005 class MismatchCAPIWarning(Warning): pass Modified: trunk/numpy/core/src/multiarray/arraytypes.c.src =================================================================== --- trunk/numpy/core/src/multiarray/arraytypes.c.src 2010-02-14 23:04:18 UTC (rev 8112) +++ trunk/numpy/core/src/multiarray/arraytypes.c.src 2010-02-15 23:13:16 UTC (rev 8113) @@ -3312,31 +3312,6 @@ * #endian = |, |, =# */ static PyArray_ArrFuncs _Py at NAME@_ArrFuncs = { - { - (PyArray_VectorUnaryFunc*)@from at _to_BOOL, - (PyArray_VectorUnaryFunc*)@from at _to_BYTE, - (PyArray_VectorUnaryFunc*)@from at _to_UBYTE, - (PyArray_VectorUnaryFunc*)@from at _to_SHORT, - (PyArray_VectorUnaryFunc*)@from at _to_USHORT, - (PyArray_VectorUnaryFunc*)@from at _to_INT, - (PyArray_VectorUnaryFunc*)@from at _to_UINT, - (PyArray_VectorUnaryFunc*)@from at _to_LONG, - (PyArray_VectorUnaryFunc*)@from at _to_ULONG, - (PyArray_VectorUnaryFunc*)@from at _to_LONGLONG, - (PyArray_VectorUnaryFunc*)@from at _to_ULONGLONG, - (PyArray_VectorUnaryFunc*)@from at _to_FLOAT, - (PyArray_VectorUnaryFunc*)@from at _to_DOUBLE, - (PyArray_VectorUnaryFunc*)@from at _to_LONGDOUBLE, - (PyArray_VectorUnaryFunc*)@from at _to_CFLOAT, - (PyArray_VectorUnaryFunc*)@from at _to_CDOUBLE, - (PyArray_VectorUnaryFunc*)@from at _to_CLONGDOUBLE, - (PyArray_VectorUnaryFunc*)@from at _to_OBJECT, - (PyArray_VectorUnaryFunc*)@from at _to_STRING, - (PyArray_VectorUnaryFunc*)@from at _to_UNICODE, - (PyArray_VectorUnaryFunc*)@from at _to_VOID, - (PyArray_VectorUnaryFunc*)@from at _to_DATETIME, - (PyArray_VectorUnaryFunc*)@from at _to_TIMEDELTA - }, (PyArray_GetItemFunc*)@from at _getitem, (PyArray_SetItemFunc*)@from at _setitem, (PyArray_CopySwapNFunc*)@from at _copyswapn, @@ -3361,7 +3336,33 @@ NULL, (PyArray_FastClipFunc *)NULL, (PyArray_FastPutmaskFunc *)NULL, - (PyArray_FastTakeFunc *)NULL + (PyArray_FastTakeFunc *)NULL, + NULL, NULL, NULL, NULL, + { + (PyArray_VectorUnaryFunc*)@from at _to_BOOL, + (PyArray_VectorUnaryFunc*)@from at _to_BYTE, + (PyArray_VectorUnaryFunc*)@from at _to_UBYTE, + (PyArray_VectorUnaryFunc*)@from at _to_SHORT, + (PyArray_VectorUnaryFunc*)@from at _to_USHORT, + (PyArray_VectorUnaryFunc*)@from at _to_INT, + (PyArray_VectorUnaryFunc*)@from at _to_UINT, + (PyArray_VectorUnaryFunc*)@from at _to_LONG, + (PyArray_VectorUnaryFunc*)@from at _to_ULONG, + (PyArray_VectorUnaryFunc*)@from at _to_LONGLONG, + (PyArray_VectorUnaryFunc*)@from at _to_ULONGLONG, + (PyArray_VectorUnaryFunc*)@from at _to_FLOAT, + (PyArray_VectorUnaryFunc*)@from at _to_DOUBLE, + (PyArray_VectorUnaryFunc*)@from at _to_LONGDOUBLE, + (PyArray_VectorUnaryFunc*)@from at _to_CFLOAT, + (PyArray_VectorUnaryFunc*)@from at _to_CDOUBLE, + (PyArray_VectorUnaryFunc*)@from at _to_CLONGDOUBLE, + (PyArray_VectorUnaryFunc*)@from at _to_DATETIME, + (PyArray_VectorUnaryFunc*)@from at _to_TIMEDELTA, + (PyArray_VectorUnaryFunc*)@from at _to_OBJECT, + (PyArray_VectorUnaryFunc*)@from at _to_STRING, + (PyArray_VectorUnaryFunc*)@from at _to_UNICODE, + (PyArray_VectorUnaryFunc*)@from at _to_VOID + } }; /* @@ -3374,6 +3375,7 @@ PyArray_ at from@LTR, '@endian@', 0, + 0, PyArray_ at from@, 0, _ALIGN(@align@), @@ -3406,31 +3408,6 @@ * #isobject= 0*17,NPY_OBJECT_DTYPE_FLAGS,0*2# */ static PyArray_ArrFuncs _Py at NAME@_ArrFuncs = { - { - (PyArray_VectorUnaryFunc*)@from at _to_BOOL, - (PyArray_VectorUnaryFunc*)@from at _to_BYTE, - (PyArray_VectorUnaryFunc*)@from at _to_UBYTE, - (PyArray_VectorUnaryFunc*)@from at _to_SHORT, - (PyArray_VectorUnaryFunc*)@from at _to_USHORT, - (PyArray_VectorUnaryFunc*)@from at _to_INT, - (PyArray_VectorUnaryFunc*)@from at _to_UINT, - (PyArray_VectorUnaryFunc*)@from at _to_LONG, - (PyArray_VectorUnaryFunc*)@from at _to_ULONG, - (PyArray_VectorUnaryFunc*)@from at _to_LONGLONG, - (PyArray_VectorUnaryFunc*)@from at _to_ULONGLONG, - (PyArray_VectorUnaryFunc*)@from at _to_FLOAT, - (PyArray_VectorUnaryFunc*)@from at _to_DOUBLE, - (PyArray_VectorUnaryFunc*)@from at _to_LONGDOUBLE, - (PyArray_VectorUnaryFunc*)@from at _to_CFLOAT, - (PyArray_VectorUnaryFunc*)@from at _to_CDOUBLE, - (PyArray_VectorUnaryFunc*)@from at _to_CLONGDOUBLE, - (PyArray_VectorUnaryFunc*)@from at _to_OBJECT, - (PyArray_VectorUnaryFunc*)@from at _to_STRING, - (PyArray_VectorUnaryFunc*)@from at _to_UNICODE, - (PyArray_VectorUnaryFunc*)@from at _to_VOID, - (PyArray_VectorUnaryFunc*)@from at _to_DATETIME, - (PyArray_VectorUnaryFunc*)@from at _to_TIMEDELTA - }, (PyArray_GetItemFunc*)@from at _getitem, (PyArray_SetItemFunc*)@from at _setitem, (PyArray_CopySwapNFunc*)@from at _copyswapn, @@ -3455,7 +3432,33 @@ NULL, (PyArray_FastClipFunc*)@from at _fastclip, (PyArray_FastPutmaskFunc*)@from at _fastputmask, - (PyArray_FastTakeFunc*)@from at _fasttake + (PyArray_FastTakeFunc*)@from at _fasttake, + NULL, NULL, NULL, NULL, + { + (PyArray_VectorUnaryFunc*)@from at _to_BOOL, + (PyArray_VectorUnaryFunc*)@from at _to_BYTE, + (PyArray_VectorUnaryFunc*)@from at _to_UBYTE, + (PyArray_VectorUnaryFunc*)@from at _to_SHORT, + (PyArray_VectorUnaryFunc*)@from at _to_USHORT, + (PyArray_VectorUnaryFunc*)@from at _to_INT, + (PyArray_VectorUnaryFunc*)@from at _to_UINT, + (PyArray_VectorUnaryFunc*)@from at _to_LONG, + (PyArray_VectorUnaryFunc*)@from at _to_ULONG, + (PyArray_VectorUnaryFunc*)@from at _to_LONGLONG, + (PyArray_VectorUnaryFunc*)@from at _to_ULONGLONG, + (PyArray_VectorUnaryFunc*)@from at _to_FLOAT, + (PyArray_VectorUnaryFunc*)@from at _to_DOUBLE, + (PyArray_VectorUnaryFunc*)@from at _to_LONGDOUBLE, + (PyArray_VectorUnaryFunc*)@from at _to_CFLOAT, + (PyArray_VectorUnaryFunc*)@from at _to_CDOUBLE, + (PyArray_VectorUnaryFunc*)@from at _to_CLONGDOUBLE, + (PyArray_VectorUnaryFunc*)@from at _to_OBJECT, + (PyArray_VectorUnaryFunc*)@from at _to_DATETIME, + (PyArray_VectorUnaryFunc*)@from at _to_TIMEDELTA, + (PyArray_VectorUnaryFunc*)@from at _to_STRING, + (PyArray_VectorUnaryFunc*)@from at _to_UNICODE, + (PyArray_VectorUnaryFunc*)@from at _to_VOID + } }; /* @@ -3467,6 +3470,7 @@ PyArray_ at kind@LTR, PyArray_ at from@LTR, '@endian@', + 0, @isobject@, PyArray_ at from@, @num@*sizeof(@fromtyp@), @@ -3520,12 +3524,12 @@ &CFLOAT_Descr, &CDOUBLE_Descr, &CLONGDOUBLE_Descr, + &DATETIME_Descr, + &TIMEDELTA_Descr, &OBJECT_Descr, &STRING_Descr, &UNICODE_Descr, &VOID_Descr, - &DATETIME_Descr, - &TIMEDELTA_Descr, }; /*NUMPY_API Modified: trunk/numpy/core/src/multiarray/descriptor.c =================================================================== --- trunk/numpy/core/src/multiarray/descriptor.c 2010-02-14 23:04:18 UTC (rev 8112) +++ trunk/numpy/core/src/multiarray/descriptor.c 2010-02-15 23:13:16 UTC (rev 8113) @@ -231,7 +231,7 @@ PyDimMem_FREE(shape.ptr); newdescr->subarray = _pya_malloc(sizeof(PyArray_ArrayDescr)); newdescr->subarray->base = type; - newdescr->hasobject = type->hasobject; + newdescr->flags = type->flags; Py_INCREF(val); newdescr->subarray->shape = val; Py_XDECREF(newdescr->fields); @@ -356,7 +356,7 @@ "two fields with the same name"); goto fail; } - dtypeflags |= (conv->hasobject & NPY_FROM_FIELDS); + dtypeflags |= (conv->flags & NPY_FROM_FIELDS); tup = PyTuple_New((title == NULL ? 2 : 3)); PyTuple_SET_ITEM(tup, 0, (PyObject *)conv); if (align) { @@ -402,7 +402,7 @@ new->fields = fields; new->names = nameslist; new->elsize = totalsize; - new->hasobject=dtypeflags; + new->flags=dtypeflags; if (maxalign > 1) { totalsize = ((totalsize+maxalign-1)/maxalign)*maxalign; } @@ -465,7 +465,7 @@ Py_DECREF(key); goto fail; } - dtypeflags |= (conv->hasobject & NPY_FROM_FIELDS); + dtypeflags |= (conv->flags & NPY_FROM_FIELDS); PyTuple_SET_ITEM(tup, 0, (PyObject *)conv); if (align) { int _align; @@ -485,7 +485,7 @@ new = PyArray_DescrNewFromType(PyArray_VOID); new->fields = fields; new->names = nameslist; - new->hasobject=dtypeflags; + new->flags=dtypeflags; if (maxalign > 1) { totalsize = ((totalsize+maxalign-1)/maxalign)*maxalign; } @@ -839,7 +839,7 @@ new->names = conv->names; Py_XINCREF(new->names); } - new->hasobject = conv->hasobject; + new->flags = conv->flags; Py_DECREF(conv); *errflag = 0; return new; @@ -1033,7 +1033,7 @@ if ((ret == PY_FAIL) || (newdescr->elsize == 0)) { goto fail; } - dtypeflags |= (newdescr->hasobject & NPY_FROM_FIELDS); + dtypeflags |= (newdescr->flags & NPY_FROM_FIELDS); totalsize += newdescr->elsize; } @@ -1056,7 +1056,7 @@ } new->names = names; new->fields = fields; - new->hasobject = dtypeflags; + new->flags = dtypeflags; metadata = PyDict_GetItemString(obj, "metadata"); @@ -1477,7 +1477,7 @@ {"alignment", T_INT, offsetof(PyArray_Descr, alignment), READONLY, NULL}, {"flags", - T_UBYTE, offsetof(PyArray_Descr, hasobject), READONLY, NULL}, + T_INT, offsetof(PyArray_Descr, flags), READONLY, NULL}, {NULL, 0, 0, 0, NULL}, }; @@ -2079,7 +2079,7 @@ } PyTuple_SET_ITEM(state, 5, PyInt_FromLong(elsize)); PyTuple_SET_ITEM(state, 6, PyInt_FromLong(alignment)); - PyTuple_SET_ITEM(state, 7, PyInt_FromLong(self->hasobject)); + PyTuple_SET_ITEM(state, 7, PyInt_FromLong(self->flags)); PyTuple_SET_ITEM(ret, 2, state); return ret; @@ -2091,7 +2091,7 @@ static int _descr_find_object(PyArray_Descr *self) { - if (self->hasobject || self->type_num == PyArray_OBJECT || + if (self->flags || self->type_num == PyArray_OBJECT || self->kind == 'O') { return NPY_OBJECT_DTYPE_FLAGS; } @@ -2110,7 +2110,7 @@ return 0; } if (_descr_find_object(new)) { - new->hasobject = NPY_OBJECT_DTYPE_FLAGS; + new->flags = NPY_OBJECT_DTYPE_FLAGS; return NPY_OBJECT_DTYPE_FLAGS; } } @@ -2156,6 +2156,7 @@ &subarray, &names, &fields, &elsize, &alignment, &dtypeflags, &metadata)) { return NULL; +#undef _ARGSTR_ } break; case 8: @@ -2168,6 +2169,7 @@ &subarray, &names, &fields, &elsize, &alignment, &dtypeflags)) { return NULL; +#undef _ARGSTR_ } break; case 7: @@ -2180,6 +2182,7 @@ &subarray, &names, &fields, &elsize, &alignment)) { return NULL; +#undef _ARGSTR_ } break; case 6: @@ -2192,6 +2195,7 @@ &endian, &subarray, &fields, &elsize, &alignment)) { PyErr_Clear(); +#undef _ARGSTR_ } break; case 5: @@ -2204,6 +2208,7 @@ if (!PyArg_ParseTuple(args, _ARGSTR_, &endian, &subarray, &fields, &elsize, &alignment)) { +#undef _ARGSTR_ return NULL; } break; @@ -2289,9 +2294,9 @@ self->alignment = alignment; } - self->hasobject = dtypeflags; + self->flags = dtypeflags; if (version < 3) { - self->hasobject = _descr_find_object(self); + self->flags = _descr_find_object(self); } Py_XDECREF(self->metadata); Modified: trunk/numpy/core/src/multiarray/hashdescr.c =================================================================== --- trunk/numpy/core/src/multiarray/hashdescr.c 2010-02-14 23:04:18 UTC (rev 8112) +++ trunk/numpy/core/src/multiarray/hashdescr.c 2010-02-15 23:13:16 UTC (rev 8113) @@ -53,11 +53,11 @@ PyObject *t, *item; /* - * For builtin type, hash relies on : kind + byteorder + hasobject + + * For builtin type, hash relies on : kind + byteorder + flags + * type_num + elsize + alignment */ - t = Py_BuildValue("(ccciii)", descr->kind, descr->byteorder, - descr->hasobject, descr->type_num, descr->elsize, + t = Py_BuildValue("(cciiii)", descr->kind, descr->byteorder, + descr->flags, descr->type_num, descr->elsize, descr->alignment); for(i = 0; i < PyTuple_Size(t); ++i) { Modified: trunk/numpy/core/src/multiarray/mapping.c =================================================================== --- trunk/numpy/core/src/multiarray/mapping.c 2010-02-14 23:04:18 UTC (rev 8112) +++ trunk/numpy/core/src/multiarray/mapping.c 2010-02-15 23:13:16 UTC (rev 8113) @@ -316,7 +316,7 @@ (PyArray_ISNOTSWAPPED(arr))); copyswap = PyArray_DESCR(arr)->f->copyswap; PyArray_MapIterReset(mit); - /* Need to decref hasobject arrays */ + /* Need to decref arrays with objects in them */ if (PyDataType_FLAGCHK(descr, NPY_ITEM_HASOBJECT)) { while (index--) { PyArray_Item_INCREF(it->dataptr, PyArray_DESCR(arr)); Modified: trunk/numpy/core/src/multiarray/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarray/multiarraymodule.c 2010-02-14 23:04:18 UTC (rev 8112) +++ trunk/numpy/core/src/multiarray/multiarraymodule.c 2010-02-15 23:13:16 UTC (rev 8113) @@ -42,8 +42,6 @@ #include "number.h" #include "scalartypes.h" -NPY_NO_EXPORT PyTypeObject PyBigArray_Type; - /*NUMPY_API * Get Priority from object */ Modified: trunk/numpy/random/mtrand/numpy.pxi =================================================================== --- trunk/numpy/random/mtrand/numpy.pxi 2010-02-14 23:04:18 UTC (rev 8112) +++ trunk/numpy/random/mtrand/numpy.pxi 2010-02-15 23:13:16 UTC (rev 8113) @@ -73,7 +73,7 @@ ctypedef extern class numpy.dtype [object PyArray_Descr]: cdef int type_num, elsize, alignment - cdef char type, kind, byteorder, hasobject + cdef char type, kind, byteorder, flags cdef object fields, typeobj ctypedef extern class numpy.ndarray [object PyArrayObject]: From numpy-svn at scipy.org Mon Feb 15 18:14:20 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 15 Feb 2010 17:14:20 -0600 (CST) Subject: [Numpy-svn] r8114 - trunk/numpy/core/src/multiarray Message-ID: <20100215231420.2C682C7C01F@scipy.org> Author: oliphant Date: 2010-02-15 17:14:19 -0600 (Mon, 15 Feb 2010) New Revision: 8114 Modified: trunk/numpy/core/src/multiarray/arraytypes.c.src Log: Update ordering of cast functions which was incorrectly placed. Modified: trunk/numpy/core/src/multiarray/arraytypes.c.src =================================================================== --- trunk/numpy/core/src/multiarray/arraytypes.c.src 2010-02-15 23:13:16 UTC (rev 8113) +++ trunk/numpy/core/src/multiarray/arraytypes.c.src 2010-02-15 23:14:19 UTC (rev 8114) @@ -3452,9 +3452,9 @@ (PyArray_VectorUnaryFunc*)@from at _to_CFLOAT, (PyArray_VectorUnaryFunc*)@from at _to_CDOUBLE, (PyArray_VectorUnaryFunc*)@from at _to_CLONGDOUBLE, - (PyArray_VectorUnaryFunc*)@from at _to_OBJECT, (PyArray_VectorUnaryFunc*)@from at _to_DATETIME, (PyArray_VectorUnaryFunc*)@from at _to_TIMEDELTA, + (PyArray_VectorUnaryFunc*)@from at _to_OBJECT, (PyArray_VectorUnaryFunc*)@from at _to_STRING, (PyArray_VectorUnaryFunc*)@from at _to_UNICODE, (PyArray_VectorUnaryFunc*)@from at _to_VOID From numpy-svn at scipy.org Mon Feb 15 23:44:41 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 15 Feb 2010 22:44:41 -0600 (CST) Subject: [Numpy-svn] r8115 - trunk/numpy/core/src/multiarray Message-ID: <20100216044441.371B3C7C01F@scipy.org> Author: oliphant Date: 2010-02-15 22:44:41 -0600 (Mon, 15 Feb 2010) New Revision: 8115 Modified: trunk/numpy/core/src/multiarray/scalartypes.c.src Log: Fix Order of scalartypes. Modified: trunk/numpy/core/src/multiarray/scalartypes.c.src =================================================================== --- trunk/numpy/core/src/multiarray/scalartypes.c.src 2010-02-15 23:14:19 UTC (rev 8114) +++ trunk/numpy/core/src/multiarray/scalartypes.c.src 2010-02-16 04:44:41 UTC (rev 8115) @@ -3338,12 +3338,12 @@ &PyCFloatArrType_Type, &PyCDoubleArrType_Type, &PyCLongDoubleArrType_Type, + &PyDatetimeArrType_Type, + &PyTimedeltaArrType_Type, &PyObjectArrType_Type, &PyStringArrType_Type, &PyUnicodeArrType_Type, - &PyVoidArrType_Type, - &PyDatetimeArrType_Type, - &PyTimedeltaArrType_Type + &PyVoidArrType_Type }; NPY_NO_EXPORT int From numpy-svn at scipy.org Tue Feb 16 13:52:08 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 16 Feb 2010 12:52:08 -0600 (CST) Subject: [Numpy-svn] r8116 - in trunk/numpy/lib: . tests Message-ID: <20100216185208.E374639CAEA@scipy.org> Author: dhuard Date: 2010-02-16 12:52:08 -0600 (Tue, 16 Feb 2010) New Revision: 8116 Modified: trunk/numpy/lib/function_base.py trunk/numpy/lib/tests/test_function_base.py trunk/numpy/lib/tests/test_regression.py Log: removed old behavior for the histogram function. Modified: trunk/numpy/lib/function_base.py =================================================================== --- trunk/numpy/lib/function_base.py 2010-02-16 04:44:41 UTC (rev 8115) +++ trunk/numpy/lib/function_base.py 2010-02-16 18:52:08 UTC (rev 8116) @@ -38,7 +38,7 @@ except: return 0 return 1 -def histogram(a, bins=10, range=None, normed=False, weights=None, new=None): +def histogram(a, bins=10, range=None, normed=False, weights=None): """ Compute the histogram of a set of data. @@ -54,9 +54,7 @@ range : (float, float), optional The lower and upper range of the bins. If not provided, range is simply ``(a.min(), a.max())``. Values outside the range are - ignored. Note that with `new` set to False, values below - the range are ignored, while those above the range are tallied - in the rightmost bin. + ignored. normed : bool, optional If False, the result will contain the number of samples in each bin. If True, the result is the value of the @@ -68,18 +66,8 @@ An array of weights, of the same shape as `a`. Each value in `a` only contributes its associated weight towards the bin count (instead of 1). If `normed` is True, the weights are normalized, - so that the integral of the density over the range remains 1. - The `weights` keyword is only available with `new` set to True. - new : {None, True, False}, optional - Whether to use the new semantics for histogram: - * None : the new behaviour is used, no warning is printed. - * True : the new behaviour is used and a warning is raised about - the future removal of the `new` keyword. - * False : the old behaviour is used and a DeprecationWarning - is raised. - As of NumPy 1.3, this keyword should not be used explicitly since it - will disappear in NumPy 1.4. - + so that the integral of the density over the range remains 1 + Returns ------- hist : array @@ -87,7 +75,7 @@ description of the possible semantics. bin_edges : array of dtype float Return the bin edges ``(length(hist)+1)``. - With ``new=False``, return the left bin edges (``length(hist)``). + See Also -------- @@ -123,127 +111,69 @@ 1.0 """ - # Old behavior - if new == False: - warnings.warn(""" - The histogram semantics being used is now deprecated and - will disappear in NumPy 1.4. Please update your code to - use the default semantics. - """, DeprecationWarning) + + a = asarray(a) + if weights is not None: + weights = asarray(weights) + if np.any(weights.shape != a.shape): + raise ValueError, 'weights should have the same shape as a.' + weights = weights.ravel() + a = a.ravel() - a = asarray(a).ravel() + if (range is not None): + mn, mx = range + if (mn > mx): + raise AttributeError, \ + 'max must be larger than min in range parameter.' - if (range is not None): - mn, mx = range - if (mn > mx): - raise AttributeError, \ - 'max must be larger than min in range parameter.' + if not iterable(bins): + if range is None: + range = (a.min(), a.max()) + mn, mx = [mi+0.0 for mi in range] + if mn == mx: + mn -= 0.5 + mx += 0.5 + bins = linspace(mn, mx, bins+1, endpoint=True) + else: + bins = asarray(bins) + if (np.diff(bins) < 0).any(): + raise AttributeError, 'bins must increase monotonically.' - if not iterable(bins): - if range is None: - range = (a.min(), a.max()) - mn, mx = [mi+0.0 for mi in range] - if mn == mx: - mn -= 0.5 - mx += 0.5 - bins = np.linspace(mn, mx, bins, endpoint=False) - else: - if normed: - raise ValueError, 'Use new=True to pass bin edges explicitly.' - raise ValueError, 'Use new=True to pass bin edges explicitly.' - bins = asarray(bins) - if (np.diff(bins) < 0).any(): - raise AttributeError, 'bins must increase monotonically.' + # Histogram is an integer or a float array depending on the weights. + if weights is None: + ntype = int + else: + ntype = weights.dtype + n = np.zeros(bins.shape, ntype) + block = 65536 + if weights is None: + for i in arange(0, len(a), block): + sa = sort(a[i:i+block]) + n += np.r_[sa.searchsorted(bins[:-1], 'left'), \ + sa.searchsorted(bins[-1], 'right')] + else: + zero = array(0, dtype=ntype) + for i in arange(0, len(a), block): + tmp_a = a[i:i+block] + tmp_w = weights[i:i+block] + sorting_index = np.argsort(tmp_a) + sa = tmp_a[sorting_index] + sw = tmp_w[sorting_index] + cw = np.concatenate(([zero,], sw.cumsum())) + bin_index = np.r_[sa.searchsorted(bins[:-1], 'left'), \ + sa.searchsorted(bins[-1], 'right')] + n += cw[bin_index] - if weights is not None: - raise ValueError, 'weights are only available with new=True.' + n = np.diff(n) - # best block size probably depends on processor cache size - block = 65536 - n = sort(a[:block]).searchsorted(bins) - for i in xrange(block, a.size, block): - n += sort(a[i:i+block]).searchsorted(bins) - n = concatenate([n, [len(a)]]) - n = n[1:]-n[:-1] + if normed: + db = array(np.diff(bins), float) + return n/(n*db).sum(), bins + else: + return n, bins - if normed: - db = bins[1] - bins[0] - return 1.0/(a.size*db) * n, bins - else: - return n, bins - - - # New behavior - elif new in [True, None]: - if new is True: - warnings.warn(""" - The new semantics of histogram is now the default and the `new` - keyword will be removed in NumPy 1.4. - """, Warning) - a = asarray(a) - if weights is not None: - weights = asarray(weights) - if np.any(weights.shape != a.shape): - raise ValueError, 'weights should have the same shape as a.' - weights = weights.ravel() - a = a.ravel() - - if (range is not None): - mn, mx = range - if (mn > mx): - raise AttributeError, \ - 'max must be larger than min in range parameter.' - - if not iterable(bins): - if range is None: - range = (a.min(), a.max()) - mn, mx = [mi+0.0 for mi in range] - if mn == mx: - mn -= 0.5 - mx += 0.5 - bins = linspace(mn, mx, bins+1, endpoint=True) - else: - bins = asarray(bins) - if (np.diff(bins) < 0).any(): - raise AttributeError, 'bins must increase monotonically.' - - # Histogram is an integer or a float array depending on the weights. - if weights is None: - ntype = int - else: - ntype = weights.dtype - n = np.zeros(bins.shape, ntype) - - block = 65536 - if weights is None: - for i in arange(0, len(a), block): - sa = sort(a[i:i+block]) - n += np.r_[sa.searchsorted(bins[:-1], 'left'), \ - sa.searchsorted(bins[-1], 'right')] - else: - zero = array(0, dtype=ntype) - for i in arange(0, len(a), block): - tmp_a = a[i:i+block] - tmp_w = weights[i:i+block] - sorting_index = np.argsort(tmp_a) - sa = tmp_a[sorting_index] - sw = tmp_w[sorting_index] - cw = np.concatenate(([zero,], sw.cumsum())) - bin_index = np.r_[sa.searchsorted(bins[:-1], 'left'), \ - sa.searchsorted(bins[-1], 'right')] - n += cw[bin_index] - - n = np.diff(n) - - if normed: - db = array(np.diff(bins), float) - return n/(n*db).sum(), bins - else: - return n, bins - - def histogramdd(sample, bins=10, range=None, normed=False, weights=None): """ Compute the multidimensional histogram of some data. Modified: trunk/numpy/lib/tests/test_function_base.py =================================================================== --- trunk/numpy/lib/tests/test_function_base.py 2010-02-16 04:44:41 UTC (rev 8115) +++ trunk/numpy/lib/tests/test_function_base.py 2010-02-16 18:52:08 UTC (rev 8116) @@ -444,22 +444,11 @@ class TestHistogram(TestCase): def setUp(self): - warnings.simplefilter('ignore', DeprecationWarning) + pass def tearDown(self): - warnings.resetwarnings() + pass - def test_simple_old(self): - n=100 - v=rand(n) - (a,b)=histogram(v, new=False) - #check if the sum of the bins equals the number of samples - assert_equal(sum(a,axis=0), n) - #check that the bin counts are evenly spaced when the data is from a - # linear function - (a,b)=histogram(linspace(0,10,100), new=False) - assert_array_equal(a, 10) - def test_simple(self): n=100 v=rand(n) Modified: trunk/numpy/lib/tests/test_regression.py =================================================================== --- trunk/numpy/lib/tests/test_regression.py 2010-02-16 04:44:41 UTC (rev 8115) +++ trunk/numpy/lib/tests/test_regression.py 2010-02-16 18:52:08 UTC (rev 8116) @@ -98,16 +98,6 @@ tested = np.polyfit(x, y, 4) assert_array_almost_equal(ref, tested) - def test_hist_bins_as_list(self, level=rlevel): - """Ticket #632""" - import warnings - warnings.simplefilter('ignore', Warning) - try: - hist,edges = np.histogram([1,2,3,4],[1,2], new=False) - assert_array_equal(hist,[1,3]) - assert_array_equal(edges,[1,2]) - finally: - warnings.resetwarnings() def test_polydiv_type(self) : """Make polydiv work for complex types""" From numpy-svn at scipy.org Wed Feb 17 11:48:08 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 17 Feb 2010 10:48:08 -0600 (CST) Subject: [Numpy-svn] r8117 - trunk/numpy/polynomial Message-ID: <20100217164808.0215E39C4B4@scipy.org> Author: charris Date: 2010-02-17 10:48:07 -0600 (Wed, 17 Feb 2010) New Revision: 8117 Modified: trunk/numpy/polynomial/chebyshev.py trunk/numpy/polynomial/polynomial.py Log: BUG: Import warnings module in polynomial modules. Modified: trunk/numpy/polynomial/chebyshev.py =================================================================== --- trunk/numpy/polynomial/chebyshev.py 2010-02-16 18:52:08 UTC (rev 8116) +++ trunk/numpy/polynomial/chebyshev.py 2010-02-17 16:48:07 UTC (rev 8117) @@ -69,8 +69,8 @@ import numpy as np import numpy.linalg as la import polyutils as pu +import warnings from polytemplate import polytemplate -from polyutils import RankWarning, PolyError, PolyDomainError chebtrim = pu.trimcoef Modified: trunk/numpy/polynomial/polynomial.py =================================================================== --- trunk/numpy/polynomial/polynomial.py 2010-02-16 18:52:08 UTC (rev 8116) +++ trunk/numpy/polynomial/polynomial.py 2010-02-17 16:48:07 UTC (rev 8117) @@ -50,6 +50,7 @@ import numpy as np import numpy.linalg as la import polyutils as pu +import warnings from polytemplate import polytemplate polytrim = pu.trimcoef From numpy-svn at scipy.org Wed Feb 17 11:48:13 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 17 Feb 2010 10:48:13 -0600 (CST) Subject: [Numpy-svn] r8118 - trunk/numpy/core Message-ID: <20100217164813.5C25F39C4B4@scipy.org> Author: charris Date: 2010-02-17 10:48:13 -0600 (Wed, 17 Feb 2010) New Revision: 8118 Modified: trunk/numpy/core/SConscript Log: STY: Remove hard tab. Modified: trunk/numpy/core/SConscript =================================================================== --- trunk/numpy/core/SConscript 2010-02-17 16:48:07 UTC (rev 8117) +++ trunk/numpy/core/SConscript 2010-02-17 16:48:13 UTC (rev 8118) @@ -13,7 +13,7 @@ from code_generators.numpy_api import \ multiarray_api as multiarray_api_dict, \ ufunc_api as ufunc_api_dict - + from setup_common import * from scons_support import CheckBrokenMathlib, define_no_smp, \ check_mlib, check_mlibs, is_npy_no_signal, CheckInline @@ -408,8 +408,7 @@ env.Prepend(LIBPATH=["."]) subst_dict = {'@prefix@': '$distutils_install_prefix', - '@pkgname@': 'numpy.core', - '@sep@': os.path.sep} + '@pkgname@': 'numpy.core', '@sep@': os.path.sep} npymath_ini = env.SubstInFile(pjoin('lib', 'npy-pkg-config', 'npymath.ini'), 'npymath.ini.in', SUBST_DICT=subst_dict) From numpy-svn at scipy.org Wed Feb 17 11:48:19 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 17 Feb 2010 10:48:19 -0600 (CST) Subject: [Numpy-svn] r8119 - trunk/numpy/core/include/numpy Message-ID: <20100217164819.D380739C4B4@scipy.org> Author: charris Date: 2010-02-17 10:48:19 -0600 (Wed, 17 Feb 2010) New Revision: 8119 Modified: trunk/numpy/core/include/numpy/npy_common.h Log: STY: Remove hard tabs. Modified: trunk/numpy/core/include/numpy/npy_common.h =================================================================== --- trunk/numpy/core/include/numpy/npy_common.h 2010-02-17 16:48:13 UTC (rev 8118) +++ trunk/numpy/core/include/numpy/npy_common.h 2010-02-17 16:48:19 UTC (rev 8119) @@ -95,7 +95,7 @@ /* * Disabling C99 complex usage: a lot of C code in numpy/scipy rely on being - * able to do .real/.imag. Will have to convert code first. + * able to do .real/.imag. Will have to convert code first. */ #if 0 #if defined(NPY_USE_C99_COMPLEX) && defined(NPY_HAVE_COMPLEX_DOUBLE) @@ -118,22 +118,22 @@ #endif #if NPY_SIZEOF_COMPLEX_DOUBLE != 2 * NPY_SIZEOF_DOUBLE #error npy_cdouble definition is not compatible with C99 complex definition ! \ - Please contact Numpy maintainers and give detailed information about your \ - compiler and platform + Please contact Numpy maintainers and give detailed information about your \ + compiler and platform #endif typedef struct { double real, imag; } npy_cdouble; #if NPY_SIZEOF_COMPLEX_FLOAT != 2 * NPY_SIZEOF_FLOAT #error npy_cfloat definition is not compatible with C99 complex definition ! \ - Please contact Numpy maintainers and give detailed information about your \ - compiler and platform + Please contact Numpy maintainers and give detailed information about your \ + compiler and platform #endif typedef struct { float real, imag; } npy_cfloat; #if NPY_SIZEOF_COMPLEX_LONGDOUBLE != 2 * NPY_SIZEOF_LONGDOUBLE #error npy_clongdouble definition is not compatible with C99 complex definition ! \ - Please contact Numpy maintainers and give detailed information about your \ - compiler and platform + Please contact Numpy maintainers and give detailed information about your \ + compiler and platform #endif typedef struct { npy_longdouble real, imag; } npy_clongdouble; From numpy-svn at scipy.org Wed Feb 17 11:48:28 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 17 Feb 2010 10:48:28 -0600 (CST) Subject: [Numpy-svn] r8120 - trunk/numpy/core/include/numpy Message-ID: <20100217164828.EBF4B39C4B4@scipy.org> Author: charris Date: 2010-02-17 10:48:28 -0600 (Wed, 17 Feb 2010) New Revision: 8120 Modified: trunk/numpy/core/include/numpy/npy_math.h Log: STY: Remove hard tabs. Reindent. Modified: trunk/numpy/core/include/numpy/npy_math.h =================================================================== --- trunk/numpy/core/include/numpy/npy_math.h 2010-02-17 16:48:19 UTC (rev 8119) +++ trunk/numpy/core/include/numpy/npy_math.h 2010-02-17 16:48:28 UTC (rev 8120) @@ -12,26 +12,26 @@ */ NPY_INLINE static float __npy_inff(void) { - const union { npy_uint32 __i; float __f;} __bint = {0x7f800000UL}; - return __bint.__f; + const union { npy_uint32 __i; float __f;} __bint = {0x7f800000UL}; + return __bint.__f; } NPY_INLINE static float __npy_nanf(void) { - const union { npy_uint32 __i; float __f;} __bint = {0x7fc00000UL}; - return __bint.__f; + const union { npy_uint32 __i; float __f;} __bint = {0x7fc00000UL}; + return __bint.__f; } NPY_INLINE static float __npy_pzerof(void) { - const union { npy_uint32 __i; float __f;} __bint = {0x00000000UL}; - return __bint.__f; + const union { npy_uint32 __i; float __f;} __bint = {0x00000000UL}; + return __bint.__f; } NPY_INLINE static float __npy_nzerof(void) { - const union { npy_uint32 __i; float __f;} __bint = {0x80000000UL}; - return __bint.__f; + const union { npy_uint32 __i; float __f;} __bint = {0x80000000UL}; + return __bint.__f; } #define NPY_INFINITYF __npy_inff() @@ -145,33 +145,33 @@ * IEEE 754 fpu handling. Those are guaranteed to be macros */ #ifndef NPY_HAVE_DECL_ISNAN - #define npy_isnan(x) ((x) != (x)) + #define npy_isnan(x) ((x) != (x)) #else - #define npy_isnan(x) isnan((x)) + #define npy_isnan(x) isnan((x)) #endif #ifndef NPY_HAVE_DECL_ISFINITE - #define npy_isfinite(x) !npy_isnan((x) + (-x)) + #define npy_isfinite(x) !npy_isnan((x) + (-x)) #else - #define npy_isfinite(x) isfinite((x)) + #define npy_isfinite(x) isfinite((x)) #endif #ifndef NPY_HAVE_DECL_ISINF - #define npy_isinf(x) (!npy_isfinite(x) && !npy_isnan(x)) + #define npy_isinf(x) (!npy_isfinite(x) && !npy_isnan(x)) #else - #define npy_isinf(x) isinf((x)) + #define npy_isinf(x) isinf((x)) #endif #ifndef NPY_HAVE_DECL_SIGNBIT - int _npy_signbit_f(float x); - int _npy_signbit_d(double x); - int _npy_signbit_ld(npy_longdouble x); - #define npy_signbit(x) \ - (sizeof (x) == sizeof (long double) ? _npy_signbit_ld (x) \ - : sizeof (x) == sizeof (double) ? _npy_signbit_d (x) \ - : _npy_signbit_f (x)) + int _npy_signbit_f(float x); + int _npy_signbit_d(double x); + int _npy_signbit_ld(npy_longdouble x); + #define npy_signbit(x) \ + (sizeof (x) == sizeof (long double) ? _npy_signbit_ld (x) \ + : sizeof (x) == sizeof (double) ? _npy_signbit_d (x) \ + : _npy_signbit_f (x)) #else - #define npy_signbit(x) signbit((x)) + #define npy_signbit(x) signbit((x)) #endif /* @@ -292,14 +292,14 @@ * and the second element is the imaginary part. */ #define __NPY_CPACK_IMP(x, y, type, ctype) \ - union { \ - ctype z; \ - type a[2]; \ - } z1;; \ - \ - z1.a[0] = (x); \ - z1.a[1] = (y); \ - \ + union { \ + ctype z; \ + type a[2]; \ + } z1;; \ + \ + z1.a[0] = (x); \ + z1.a[1] = (y); \ + \ return z1.z; static NPY_INLINE npy_cdouble npy_cpack(double x, double y) @@ -326,42 +326,42 @@ * most likely compile this to one or two instructions (on CISC at least) */ #define __NPY_CEXTRACT_IMP(z, index, type, ctype) \ - union { \ - ctype z; \ - type a[2]; \ - } __z_repr; \ - __z_repr.z = z; \ - \ - return __z_repr.a[index]; + union { \ + ctype z; \ + type a[2]; \ + } __z_repr; \ + __z_repr.z = z; \ + \ + return __z_repr.a[index]; static NPY_INLINE double npy_creal(npy_cdouble z) { - __NPY_CEXTRACT_IMP(z, 0, double, npy_cdouble); + __NPY_CEXTRACT_IMP(z, 0, double, npy_cdouble); } static NPY_INLINE double npy_cimag(npy_cdouble z) { - __NPY_CEXTRACT_IMP(z, 1, double, npy_cdouble); + __NPY_CEXTRACT_IMP(z, 1, double, npy_cdouble); } static NPY_INLINE float npy_crealf(npy_cfloat z) { - __NPY_CEXTRACT_IMP(z, 0, float, npy_cfloat); + __NPY_CEXTRACT_IMP(z, 0, float, npy_cfloat); } static NPY_INLINE float npy_cimagf(npy_cfloat z) { - __NPY_CEXTRACT_IMP(z, 1, float, npy_cfloat); + __NPY_CEXTRACT_IMP(z, 1, float, npy_cfloat); } static NPY_INLINE npy_longdouble npy_creall(npy_clongdouble z) { - __NPY_CEXTRACT_IMP(z, 0, npy_longdouble, npy_clongdouble); + __NPY_CEXTRACT_IMP(z, 0, npy_longdouble, npy_clongdouble); } static NPY_INLINE npy_longdouble npy_cimagl(npy_clongdouble z) { - __NPY_CEXTRACT_IMP(z, 1, npy_longdouble, npy_clongdouble); + __NPY_CEXTRACT_IMP(z, 1, npy_longdouble, npy_clongdouble); } #undef __NPY_CEXTRACT_IMP From numpy-svn at scipy.org Wed Feb 17 11:48:37 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 17 Feb 2010 10:48:37 -0600 (CST) Subject: [Numpy-svn] r8121 - trunk/numpy/core/src/umath Message-ID: <20100217164837.3942839C4B4@scipy.org> Author: charris Date: 2010-02-17 10:48:37 -0600 (Wed, 17 Feb 2010) New Revision: 8121 Modified: trunk/numpy/core/src/umath/ufunc_object.c Log: STY: Remove hard tabs, reindent. Modified: trunk/numpy/core/src/umath/ufunc_object.c =================================================================== --- trunk/numpy/core/src/umath/ufunc_object.c 2010-02-17 16:48:28 UTC (rev 8120) +++ trunk/numpy/core/src/umath/ufunc_object.c 2010-02-17 16:48:37 UTC (rev 8121) @@ -2514,17 +2514,18 @@ else { loop->obj = 0; } - if ((loop->meth == ZERO_EL_REDUCELOOP) || - ((operation == UFUNC_REDUCEAT) && (loop->meth == BUFFER_UFUNCLOOP))) { + if ((loop->meth == ZERO_EL_REDUCELOOP) + || ((operation == UFUNC_REDUCEAT) + && (loop->meth == BUFFER_UFUNCLOOP))) { idarr = _getidentity(self, otype, str); if (idarr == NULL) { goto fail; } if (idarr->descr->elsize > UFUNC_MAXIDENTITY) { PyErr_Format(PyExc_RuntimeError, - "UFUNC_MAXIDENTITY (%d)" \ - " is too small (needs to be at least %d)", - UFUNC_MAXIDENTITY, idarr->descr->elsize); + "UFUNC_MAXIDENTITY (%d) is too small"\ + "(needs to be at least %d)", + UFUNC_MAXIDENTITY, idarr->descr->elsize); Py_DECREF(idarr); goto fail; } @@ -2555,7 +2556,7 @@ if (out == NULL) { loop->ret = (PyArrayObject *) PyArray_New(Py_TYPE(aar), aar->nd, aar->dimensions, - otype, NULL, NULL, 0, 0, (PyObject *)aar); + otype, NULL, NULL, 0, 0, (PyObject *)aar); } else { outsize = PyArray_MultiplyList(aar->dimensions, aar->nd); @@ -2568,7 +2569,7 @@ if (out == NULL) { loop->ret = (PyArrayObject *) PyArray_New(Py_TYPE(aar), aar->nd, loop_i, otype, - NULL, NULL, 0, 0, (PyObject *)aar); + NULL, NULL, 0, 0, (PyObject *)aar); } else { outsize = PyArray_MultiplyList(loop_i, aar->nd); @@ -2585,7 +2586,7 @@ if (out) { if (PyArray_SIZE(out) != outsize) { PyErr_SetString(PyExc_ValueError, - "wrong shape for output"); + "wrong shape for output"); goto fail; } loop->ret = (PyArrayObject *) From numpy-svn at scipy.org Wed Feb 17 11:48:46 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 17 Feb 2010 10:48:46 -0600 (CST) Subject: [Numpy-svn] r8122 - trunk/numpy/core/src/multiarray Message-ID: <20100217164846.7151D39C4B4@scipy.org> Author: charris Date: 2010-02-17 10:48:46 -0600 (Wed, 17 Feb 2010) New Revision: 8122 Modified: trunk/numpy/core/src/multiarray/multiarraymodule.c Log: STY: Remove hardtabs, reindent. Modified: trunk/numpy/core/src/multiarray/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarray/multiarraymodule.c 2010-02-17 16:48:37 UTC (rev 8121) +++ trunk/numpy/core/src/multiarray/multiarraymodule.c 2010-02-17 16:48:46 UTC (rev 8122) @@ -1340,19 +1340,22 @@ PyArray_DatetimeMetaData *data1, *data2; /* Same meta object */ - if (meta1 == meta2) - return 1; + if (meta1 == meta2) { + return 1; + } cobj1 = PyDict_GetItemString(meta1, NPY_METADATA_DTSTR); cobj2 = PyDict_GetItemString(meta2, NPY_METADATA_DTSTR); - if (cobj1 == cobj2) - return 1; + if (cobj1 == cobj2) { + return 1; + } data1 = PyCObject_AsVoidPtr(cobj1); data2 = PyCObject_AsVoidPtr(cobj2); - - return ((data1->base == data2->base) && (data1->num == data2->num) - && (data1->den == data2->den) && (data1->events == data2->events)); + return ((data1->base == data2->base) + && (data1->num == data2->num) + && (data1->den == data2->den) + && (data1->events == data2->events)); } @@ -1377,13 +1380,15 @@ } if (typenum1 == PyArray_VOID || typenum2 == PyArray_VOID) { - return ((typenum1 == typenum2) && - _equivalent_fields(typ1->fields, typ2->fields)); + return ((typenum1 == typenum2) + && _equivalent_fields(typ1->fields, typ2->fields)); } - if (typenum1 == PyArray_DATETIME || typenum1 == PyArray_DATETIME - || typenum2 == PyArray_TIMEDELTA || typenum2 == PyArray_TIMEDELTA) { - return ((typenum1 == typenum2) && - _equivalent_units(typ1->metadata, typ2->metadata)); + if (typenum1 == PyArray_DATETIME + || typenum1 == PyArray_DATETIME + || typenum2 == PyArray_TIMEDELTA + || typenum2 == PyArray_TIMEDELTA) { + return ((typenum1 == typenum2) + && _equivalent_units(typ1->metadata, typ2->metadata)); } return (typ1->kind == typ2->kind); } @@ -1425,8 +1430,7 @@ } Py_INCREF(arr->descr); ret = PyArray_NewFromDescr(Py_TYPE(arr), arr->descr, ndmin, - newdims, newstrides, arr->data, arr->flags, - (PyObject *)arr); + newdims, newstrides, arr->data, arr->flags, (PyObject *)arr); /* steals a reference to arr --- so don't increment here */ PyArray_BASE(ret) = (PyObject *)arr; return ret; From numpy-svn at scipy.org Wed Feb 17 11:48:56 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 17 Feb 2010 10:48:56 -0600 (CST) Subject: [Numpy-svn] r8123 - trunk/numpy/core/src/multiarray Message-ID: <20100217164856.4422B39C4B4@scipy.org> Author: charris Date: 2010-02-17 10:48:56 -0600 (Wed, 17 Feb 2010) New Revision: 8123 Modified: trunk/numpy/core/src/multiarray/descriptor.c Log: STY: Remove hardtabs, reindent. Modified: trunk/numpy/core/src/multiarray/descriptor.c =================================================================== --- trunk/numpy/core/src/multiarray/descriptor.c 2010-02-17 16:48:46 UTC (rev 8122) +++ trunk/numpy/core/src/multiarray/descriptor.c 2010-02-17 16:48:56 UTC (rev 8123) @@ -107,15 +107,22 @@ int i; /* Check for ints at start of string */ - if ((type[0] >= '0' && type[0] <= '9') || - ((len > 1) && _chk_byteorder(type[0]) && - (type[1] >= '0' && type[1] <= '9'))) { + if ((type[0] >= '0' + && type[0] <= '9') + || ((len > 1) + && _chk_byteorder(type[0]) + && (type[1] >= '0' + && type[1] <= '9'))) { return 1; } /* Check for empty tuple */ - if (((len > 1) && (type[0] == '(' && type[1] == ')')) || - ((len > 3) && _chk_byteorder(type[0]) && - (type[1] == '(' && type[2] == ')'))) { + if (((len > 1) + && (type[0] == '(' + && type[1] == ')')) + || ((len > 3) + && _chk_byteorder(type[0]) + && (type[1] == '(' + && type[2] == ')'))) { return 1; } /* Check for presence of commas */ @@ -130,13 +137,24 @@ static int _check_for_datetime(char *type, int len) { - if (len < 1) return 0; - if (type[1] == '8' && (type[0] == 'M' || type[0] == 'm')) + if (len < 1) { + return 0; + } + if (type[1] == '8' && (type[0] == 'M' || type[0] == 'm')) { return 1; - if (len < 10) return 0; - if (strncmp(type, "datetime64", 10) == 0) return 1; - if (len < 11) return 0; - if (strncmp(type, "timedelta64", 11) == 0) return 1; + } + if (len < 10) { + return 0; + } + if (strncmp(type, "datetime64", 10) == 0) { + return 1; + } + if (len < 11) { + return 0; + } + if (strncmp(type, "timedelta64", 11) == 0) { + return 1; + } return 0; } @@ -180,8 +198,7 @@ if (error_converting(itemsize)) { PyErr_SetString(PyExc_ValueError, - "invalid itemsize in generic type "\ - "tuple"); + "invalid itemsize in generic type tuple"); goto fail; } PyArray_DESCR_REPLACE(type); @@ -192,7 +209,8 @@ type->elsize = itemsize; } } - else if PyDict_Check(val) { /* Assume it's a metadata dictionary */ + else if PyDict_Check(val) { + /* Assume it's a metadata dictionary */ if (PyDict_Merge(type->metadata, val, 0) == -1) { Py_DECREF(type); return NULL; @@ -207,17 +225,21 @@ PyArray_Dims shape = {NULL, -1}; PyArray_Descr *newdescr; - if (!(PyArray_IntpConverter(val, &shape)) - || (shape.len > MAX_DIMS)) { + if (!(PyArray_IntpConverter(val, &shape)) || (shape.len > MAX_DIMS)) { PyDimMem_FREE(shape.ptr); PyErr_SetString(PyExc_ValueError, - "invalid shape in fixed-type tuple."); + "invalid shape in fixed-type tuple."); goto fail; } - /* If (type, 1) was given, it is equivalent to type... - or (type, ()) was given it is equivalent to type... */ - if ((shape.len == 1 && shape.ptr[0] == 1 && PyNumber_Check(val)) - || (shape.len == 0 && PyTuple_Check(val))) { + /* + * If (type, 1) was given, it is equivalent to type... + * or (type, ()) was given it is equivalent to type... + */ + if ((shape.len == 1 + && shape.ptr[0] == 1 + && PyNumber_Check(val)) + || (shape.len == 0 + && PyTuple_Check(val))) { PyDimMem_FREE(shape.ptr); return type; } @@ -331,7 +353,7 @@ if (PyTuple_GET_SIZE(item) == 2) { ret = PyArray_DescrConverter(PyTuple_GET_ITEM(item, 1), &conv); if (ret == PY_FAIL) { - PyObject_Print(PyTuple_GET_ITEM(item,1), stderr, 0); + PyObject_Print(PyTuple_GET_ITEM(item, 1), stderr, 0); } } else if (PyTuple_GET_SIZE(item) == 3) { @@ -345,15 +367,18 @@ if (ret == PY_FAIL) { goto fail; } - if ((PyDict_GetItem(fields, name) != NULL) || + if ((PyDict_GetItem(fields, name) != NULL) #if defined(NPY_PY3K) - (title && PyUString_Check(title) && + || (title + && PyUString_Check(title) + && (PyDict_GetItem(fields, title) != NULL))) { #else - (title && (PyUString_Check(title) || PyUnicode_Check(title)) && + || (title + && (PyUString_Check(title) || PyUnicode_Check(title)) + && (PyDict_GetItem(fields, title) != NULL))) { #endif - (PyDict_GetItem(fields, title) != NULL))) { PyErr_SetString(PyExc_ValueError, - "two fields with the same name"); + "two fields with the same name"); goto fail; } dtypeflags |= (conv->flags & NPY_FROM_FIELDS); @@ -387,8 +412,7 @@ #endif if (PyDict_GetItem(fields, title) != NULL) { PyErr_SetString(PyExc_ValueError, - "title already used as a "\ - "name or title."); + "title already used as a name or title."); Py_DECREF(tup); goto fail; } @@ -404,7 +428,7 @@ new->elsize = totalsize; new->flags=dtypeflags; if (maxalign > 1) { - totalsize = ((totalsize+maxalign-1)/maxalign)*maxalign; + totalsize = ((totalsize + maxalign - 1)/maxalign)*maxalign; } if (align) { new->alignment = maxalign; @@ -524,18 +548,20 @@ { NPY_DATETIMEUNIT unit; - if (base == NULL) + if (base == NULL) { return NPY_DATETIME_DEFAULTUNIT; + } unit = NPY_FR_Y; while (unit < NPY_DATETIME_NUMUNITS) { - if (strcmp(base, _datetime_strings[unit]) == 0) + if (strcmp(base, _datetime_strings[unit]) == 0) { break; + } unit++; } - - if (unit == NPY_DATETIME_NUMUNITS) + if (unit == NPY_DATETIME_NUMUNITS) { return NPY_DATETIME_DEFAULTUNIT; + } return unit; } @@ -571,29 +597,39 @@ ind = ((int)meta->base - (int)NPY_FR_Y)*2; totry = _multiples_table[ind]; - baseunit = (NPY_DATETIMEUNIT *)_multiples_table[ind+1]; + baseunit = (NPY_DATETIMEUNIT *)_multiples_table[ind + 1]; num = 3; - if (meta->base == NPY_FR_W) num = 4; - else if (meta->base > NPY_FR_D) num = 2; - + if (meta->base == NPY_FR_W) { + num = 4; + } + else if (meta->base > NPY_FR_D) { + num = 2; + } if (meta->base >= NPY_FR_s) { ind = ((int)NPY_FR_s - (int)NPY_FR_Y)*2; totry = _multiples_table[ind]; - baseunit = (NPY_DATETIMEUNIT *)_multiples_table[ind+1]; + baseunit = (NPY_DATETIMEUNIT *)_multiples_table[ind + 1]; baseunit[0] = meta->base + 1; baseunit[1] = meta->base + 2; - if (meta->base == NPY_DATETIME_NUMUNITS-2) num = 1; - if (meta->base == NPY_DATETIME_NUMUNITS-1) num = 0; + if (meta->base == NPY_DATETIME_NUMUNITS - 2) { + num = 1; + } + if (meta->base == NPY_DATETIME_NUMUNITS - 1) { + num = 0; + } } - for (i=0; iden; r = totry[i] % meta->den; - if (r==0) break; + if (r == 0) { + break; + } } - if (i==num) { - PyErr_Format(PyExc_ValueError, "divisor (%d) is not a multiple of a lower-unit", meta->den); + if (i == num) { + PyErr_Format(PyExc_ValueError, + "divisor (%d) is not a multiple of a lower-unit", meta->den); return -1; } meta->base = baseunit[i]; @@ -614,13 +650,13 @@ dt_tuple = PyTuple_New(4); PyTuple_SET_ITEM(dt_tuple, 0, - PyBytes_FromString(_datetime_strings[dt_data->base])); + PyBytes_FromString(_datetime_strings[dt_data->base])); PyTuple_SET_ITEM(dt_tuple, 1, - PyInt_FromLong(dt_data->num)); + PyInt_FromLong(dt_data->num)); PyTuple_SET_ITEM(dt_tuple, 2, - PyInt_FromLong(dt_data->den)); + PyInt_FromLong(dt_data->den)); PyTuple_SET_ITEM(dt_tuple, 3, - PyInt_FromLong(dt_data->events)); + PyInt_FromLong(dt_data->events)); return dt_tuple; } @@ -631,17 +667,18 @@ PyArray_DatetimeMetaData *dt_data; dt_data = _pya_malloc(sizeof(PyArray_DatetimeMetaData)); + dt_data->base = _unit_from_str( + PyBytes_AsString(PyTuple_GET_ITEM(tuple, 0))); - dt_data->base = _unit_from_str\ - (PyBytes_AsString(PyTuple_GET_ITEM(tuple, 0))); - /* Assumes other objects are Python integers */ dt_data->num = PyInt_AS_LONG(PyTuple_GET_ITEM(tuple, 1)); dt_data->den = PyInt_AS_LONG(PyTuple_GET_ITEM(tuple, 2)); dt_data->events = PyInt_AS_LONG(PyTuple_GET_ITEM(tuple, 3)); if (dt_data->den > 1) { - if (_convert_divisor_to_multiple(dt_data) < 0) return NULL; + if (_convert_divisor_to_multiple(dt_data) < 0) { + return NULL; + } } return PyCObject_FromVoidPtr((void *)dt_data, _pya_free); @@ -656,17 +693,19 @@ PyObject *datetime; if (!PyTuple_Check(obj) || PyTuple_GET_SIZE(obj)!=2) { - PyErr_SetString(PyExc_RuntimeError, "_datetimestring is " \ - "not returning a tuple with length 2"); + PyErr_SetString(PyExc_RuntimeError, + "_datetimestring is not returning a tuple with length 2"); return NULL; } dt_tuple = PyTuple_GET_ITEM(obj, 0); datetime = PyTuple_GET_ITEM(obj, 1); - if (!PyTuple_Check(dt_tuple) || PyTuple_GET_SIZE(dt_tuple) != 4 || \ - !PyInt_Check(datetime)) { - PyErr_SetString(PyExc_RuntimeError, "_datetimestring is " \ - "not returning a length 4 tuple and an integer"); + if (!PyTuple_Check(dt_tuple) + || PyTuple_GET_SIZE(dt_tuple) != 4 + || !PyInt_Check(datetime)) { + PyErr_SetString(PyExc_RuntimeError, + "_datetimestring is not returning a length 4 tuple"\ + " and an integer"); return NULL; } @@ -678,15 +717,20 @@ new = PyArray_DescrNewFromType(PyArray_TIMEDELTA); } - if (new == NULL) return NULL; - - /* Remove any reference to old metadata dictionary */ - /* And create a new one for this new dtype */ + if (new == NULL) { + return NULL; + } + /* + * Remove any reference to old metadata dictionary + * And create a new one for this new dtype + */ Py_XDECREF(new->metadata); - if ((new->metadata = PyDict_New())== NULL) return NULL; - + if ((new->metadata = PyDict_New()) == NULL) { + return NULL; + } dt_cobj = _convert_datetime_tuple_to_cobj(dt_tuple); - if (dt_cobj == NULL) { /* Failure in conversion */ + if (dt_cobj == NULL) { + /* Failure in conversion */ Py_DECREF(new); return NULL; } @@ -694,7 +738,6 @@ /* Assume this sets a new reference to dt_cobj */ PyDict_SetItemString(new->metadata, NPY_METADATA_DTSTR, dt_cobj); Py_DECREF(dt_cobj); - return new; } @@ -713,16 +756,21 @@ if (_numpy_internal == NULL) { return NULL; } - tupleobj = PyObject_CallMethod(_numpy_internal, "_datetimestring", "O", obj); + tupleobj = PyObject_CallMethod(_numpy_internal, + "_datetimestring", "O", obj); Py_DECREF(_numpy_internal); - if (!tupleobj) return NULL; - /* tuple of a standard tuple (baseunit, num, den, events) and a - timedelta boolean - */ + if (!tupleobj) { + return NULL; + } + /* + * tuple of a standard tuple (baseunit, num, den, events) and a timedelta + * boolean + */ res = _convert_from_datetime_tuple(tupleobj); Py_DECREF(tupleobj); if (!res && !PyErr_Occurred()) { - PyErr_SetString(PyExc_ValueError, "invalid data-type"); + PyErr_SetString(PyExc_ValueError, + "invalid data-type"); return NULL; } return res; @@ -731,12 +779,11 @@ /* * comma-separated string - * this is the format developed by the numarray records module - * and implemented by the format parser in that module - * this is an alternative implementation found in the _internal.py - * file patterned after that one -- the approach is to try to convert - * to a list (with tuples if any repeat information is present) - * and then call the _convert_from_list) + * this is the format developed by the numarray records module and implemented + * by the format parser in that module this is an alternative implementation + * found in the _internal.py file patterned after that one -- the approach is + * to try to convert to a list (with tuples if any repeat information is + * present) and then call the _convert_from_list) */ static PyArray_Descr * _convert_from_commastring(PyObject *obj, int align) @@ -757,14 +804,14 @@ if (!listobj) { return NULL; } - if (!PyList_Check(listobj) || PyList_GET_SIZE(listobj)<1) { - PyErr_SetString(PyExc_RuntimeError, "_commastring is " \ - "not returning a list with len >= 1"); + if (!PyList_Check(listobj) || PyList_GET_SIZE(listobj) < 1) { + PyErr_SetString(PyExc_RuntimeError, + "_commastring is not returning a list with len >= 1"); return NULL; } if (PyList_GET_SIZE(listobj) == 1) { - if (PyArray_DescrConverter(PyList_GET_ITEM(listobj, 0), - &res) == NPY_FAIL) { + if (PyArray_DescrConverter( + PyList_GET_ITEM(listobj, 0), &res) == NPY_FAIL) { res = NULL; } } @@ -773,7 +820,8 @@ } Py_DECREF(listobj); if (!res && !PyErr_Occurred()) { - PyErr_SetString(PyExc_ValueError, "invalid data-type"); + PyErr_SetString(PyExc_ValueError, + "invalid data-type"); return NULL; } return res; @@ -897,8 +945,7 @@ return NULL; } res = (PyArray_Descr *)PyObject_CallMethod(_numpy_internal, - "_usefields", - "Oi", obj, align); + "_usefields", "Oi", obj, align); Py_DECREF(_numpy_internal); return res; } @@ -932,8 +979,7 @@ || (offsets && (n > PyObject_Length(offsets))) || (titles && (n > PyObject_Length(titles)))) { PyErr_SetString(PyExc_ValueError, - "all items in the dictionary must have" \ - " the same length."); + "all items in the dictionary must have the same length."); goto fail; } @@ -978,11 +1024,12 @@ PyTuple_SET_ITEM(tup, 1, off); if (offset < totalsize) { PyErr_SetString(PyExc_ValueError, - "invalid offset (must be "\ - "ordered)"); + "invalid offset (must be ordered)"); ret = PY_FAIL; } - if (offset > totalsize) totalsize = offset; + if (offset > totalsize) { + totalsize = offset; + } } else { if (align && _align > 1) { @@ -1001,15 +1048,14 @@ if (!(PyUString_Check(name) || PyUnicode_Check(name))) { #endif PyErr_SetString(PyExc_ValueError, - "field names must be strings"); + "field names must be strings"); ret = PY_FAIL; } /* Insert into dictionary */ if (PyDict_GetItem(fields, name) != NULL) { PyErr_SetString(PyExc_ValueError, - "name already used as a name or "\ - "title"); + "name already used as a name or title"); ret = PY_FAIL; } PyDict_SetItem(fields, name, tup); @@ -1022,8 +1068,7 @@ #endif if (PyDict_GetItem(fields, item) != NULL) { PyErr_SetString(PyExc_ValueError, - "title already used as a " \ - "name or title."); + "title already used as a name or title."); ret=PY_FAIL; } PyDict_SetItem(fields, item, tup); @@ -1141,8 +1186,7 @@ } if (PyType_Check(obj)) { - if (PyType_IsSubtype((PyTypeObject *)obj, - &PyGenericArrType_Type)) { + if (PyType_IsSubtype((PyTypeObject *)obj, &PyGenericArrType_Type)) { *at = PyArray_DescrFromTypeObject(obj); if (*at) { return PY_SUCCEED; @@ -1242,8 +1286,10 @@ return PY_FAIL; } check_num = (int) type[0]; - if ((char) check_num == '>' || (char) check_num == '<' - || (char) check_num == '|' || (char) check_num == '=') { + if ((char) check_num == '>' + || (char) check_num == '<' + || (char) check_num == '|' + || (char) check_num == '=') { if (len <= 1) { goto fail; } @@ -1330,8 +1376,9 @@ if (PyErr_Occurred()) { goto fail; } - /* - if (check_num == PyArray_NOTYPE) return PY_FAIL; + /* if (check_num == PyArray_NOTYPE) { + return PY_FAIL; + } */ finish: @@ -1488,8 +1535,8 @@ Py_INCREF(Py_None); return Py_None; } - return Py_BuildValue("OO", (PyObject *)self->subarray->base, - self->subarray->shape); + return Py_BuildValue("OO", + (PyObject *)self->subarray->base, self->subarray->shape); } static PyObject * @@ -1502,8 +1549,9 @@ PyArray_DatetimeMetaData *dt_data; /* This shouldn't happen */ - if (self->metadata == NULL) return ret; - + if (self->metadata == NULL) { + return ret; + } tmp = PyDict_GetItemString(self->metadata, NPY_METADATA_DTSTR); dt_data = PyCObject_AsVoidPtr(tmp); num = dt_data->num; @@ -1776,14 +1824,16 @@ int i; PyObject *new_names; if (self->names == NULL) { - PyErr_SetString(PyExc_ValueError, "there are no fields defined"); + PyErr_SetString(PyExc_ValueError, + "there are no fields defined"); return -1; } N = PyTuple_GET_SIZE(self->names); if (!PySequence_Check(val) || PyObject_Size((PyObject *)val) != N) { - PyErr_Format(PyExc_ValueError, "must replace all names at once" \ - " with a sequence of length %d", N); + PyErr_Format(PyExc_ValueError, + "must replace all names at once with a sequence of length %d", + N); return -1; } /* Make sure all entries are strings */ @@ -1795,8 +1845,8 @@ Py_DECREF(item); if (!valid) { PyErr_Format(PyExc_ValueError, - "item #%d of names is of type %s and not string", - i, Py_TYPE(item)->tp_name); + "item #%d of names is of type %s and not string", + i, Py_TYPE(item)->tp_name); return -1; } } @@ -1809,11 +1859,13 @@ key = PyTuple_GET_ITEM(self->names, i); /* Borrowed reference to item */ item = PyDict_GetItem(self->fields, key); - Py_INCREF(item); /* Hold on to it even through DelItem */ + /* Hold on to it even through DelItem */ + Py_INCREF(item); new_key = PyTuple_GET_ITEM(new_names, i); PyDict_DelItem(self->fields, key); PyDict_SetItem(self->fields, new_key, item); - Py_DECREF(item); /* self->fields now holds reference */ + /* self->fields now holds reference */ + Py_DECREF(item); } /* Replace names */ @@ -1871,11 +1923,14 @@ /* borrowed reference */ res = PyDict_GetItemString(metadata, NPY_METADATA_DTSTR); - if (res == NULL) return 0; - - PyErr_SetString(PyExc_ValueError, "cannot set " NPY_METADATA_DTSTR \ - " in dtype metadata"); - return 1; + if (res == NULL) { + return 0; + } + else { + PyErr_SetString(PyExc_ValueError, + "cannot set " NPY_METADATA_DTSTR "in dtype metadata"); + return 1; + } } static PyObject * @@ -1888,18 +1943,16 @@ Bool copied = FALSE; static char *kwlist[] = {"dtype", "align", "copy", "metadata", NULL}; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O&O&O!", - kwlist, &odescr, - PyArray_BoolConverter, &align, - PyArray_BoolConverter, ©, - &PyDict_Type, &ometadata - )) { + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O&O&O!", kwlist, + &odescr, PyArray_BoolConverter, &align, + PyArray_BoolConverter, ©, + &PyDict_Type, &ometadata)) { return NULL; } - if ((ometadata != NULL) && (_invalid_metadata_check(ometadata))) + if ((ometadata != NULL) && (_invalid_metadata_check(ometadata))) { return NULL; - + } if (align) { if (!PyArray_DescrAlignConverter(odescr, &conv)) { return NULL; @@ -1917,24 +1970,30 @@ } if ((ometadata != NULL)) { - /* We need to be sure to make a new copy of the data-type and any - underlying dictionary */ + /* + * We need to be sure to make a new copy of the data-type and any + * underlying dictionary + */ if (!copied) { descr = PyArray_DescrNew(conv); Py_DECREF(conv); conv = descr; } if ((conv->metadata != NULL)) { - /* Make a copy of the metadata before merging with ometadata - so that this data-type descriptor has it's own copy - */ - odescr = conv->metadata; /* Save a reference */ + /* + * Make a copy of the metadata before merging with ometadata + * so that this data-type descriptor has it's own copy + */ + /* Save a reference */ + odescr = conv->metadata; conv->metadata = PyDict_Copy(odescr); - Py_DECREF(odescr); /* Decrement the old reference */ + /* Decrement the old reference */ + Py_DECREF(odescr); - /* Update conv->metadata with anything new in metadata - keyword, but do not over-write anything already there - */ + /* + * Update conv->metadata with anything new in metadata + * keyword, but do not over-write anything already there + */ if (PyDict_Merge(conv->metadata, ometadata, 0) != 0) { Py_DECREF(conv); return NULL; @@ -1951,9 +2010,10 @@ return (PyObject *)conv; } -/* Return a tuple of (cleaned metadata dictionary, - tuple with (str, num, events)) -*/ +/* + * Return a tuple of + * (cleaned metadata dictionary, tuple with (str, num, events)) + */ static PyObject * _get_pickleabletype_from_metadata(PyObject *metadata) { @@ -2006,9 +2066,9 @@ return NULL; } PyTuple_SET_ITEM(ret, 0, obj); - if (PyTypeNum_ISUSERDEF(self->type_num) || - ((self->type_num == PyArray_VOID && - self->typeobj != &PyVoidArrType_Type))) { + if (PyTypeNum_ISUSERDEF(self->type_num) + || ((self->type_num == PyArray_VOID + && self->typeobj != &PyVoidArrType_Type))) { obj = (PyObject *)self->typeobj; Py_INCREF(obj); } @@ -2034,12 +2094,14 @@ } if (self->metadata) { state = PyTuple_New(9); - PyTuple_SET_ITEM(state, 0, PyInt_FromLong(version)); + PyTuple_SET_ITEM(state, 0, PyInt_FromLong(version)); if (PyDataType_ISDATETIME(self)) { PyObject *newobj; /* Handle CObject in NPY_METADATA_DTSTR key separately */ - /* newobj is a tuple of cleaned metadata dictionary - and tuple of date_time info (str, num, den, events) */ + /* + * newobj is a tuple of cleaned metadata dictionary + * and tuple of date_time info (str, num, den, events) + */ newobj = _get_pickleabletype_from_metadata(self->metadata); PyTuple_SET_ITEM(state, 8, newobj); } @@ -2085,14 +2147,16 @@ return ret; } -/* returns 1 if this data-type has an object portion - used when setting the state because hasobject is not stored. -*/ +/* + * returns 1 if this data-type has an object portion + * used when setting the state because hasobject is not stored. + */ static int _descr_find_object(PyArray_Descr *self) { - if (self->flags || self->type_num == PyArray_OBJECT || - self->kind == 'O') { + if (self->flags + || self->type_num == PyArray_OBJECT + || self->kind == 'O') { return NPY_OBJECT_DTYPE_FLAGS; } if (PyDescr_HASFIELDS(self)) { @@ -2140,11 +2204,11 @@ Py_INCREF(Py_None); return Py_None; } - if (PyTuple_GET_SIZE(args) != 1 || - !(PyTuple_Check(PyTuple_GET_ITEM(args, 0)))) { + if (PyTuple_GET_SIZE(args) != 1 + || !(PyTuple_Check(PyTuple_GET_ITEM(args, 0)))) { PyErr_BadInternalCall(); return NULL; - } + } switch (PyTuple_GET_SIZE(PyTuple_GET_ITEM(args,0))) { case 9: #if defined(NPY_PY3K) @@ -2153,8 +2217,8 @@ #define _ARGSTR_ "(icOOOiiiO)" #endif if (!PyArg_ParseTuple(args, _ARGSTR_, &version, &endian, - &subarray, &names, &fields, &elsize, - &alignment, &dtypeflags, &metadata)) { + &subarray, &names, &fields, &elsize, + &alignment, &dtypeflags, &metadata)) { return NULL; #undef _ARGSTR_ } @@ -2166,8 +2230,8 @@ #define _ARGSTR_ "(icOOOiii)" #endif if (!PyArg_ParseTuple(args, _ARGSTR_, &version, &endian, - &subarray, &names, &fields, &elsize, - &alignment, &dtypeflags)) { + &subarray, &names, &fields, &elsize, + &alignment, &dtypeflags)) { return NULL; #undef _ARGSTR_ } @@ -2179,8 +2243,8 @@ #define _ARGSTR_ "(icOOOii)" #endif if (!PyArg_ParseTuple(args, _ARGSTR_, &version, &endian, - &subarray, &names, &fields, &elsize, - &alignment)) { + &subarray, &names, &fields, &elsize, + &alignment)) { return NULL; #undef _ARGSTR_ } @@ -2192,8 +2256,8 @@ #define _ARGSTR_ "(icOOii)" #endif if (!PyArg_ParseTuple(args, _ARGSTR_, &version, - &endian, &subarray, &fields, - &elsize, &alignment)) { + &endian, &subarray, &fields, + &elsize, &alignment)) { PyErr_Clear(); #undef _ARGSTR_ } @@ -2206,8 +2270,8 @@ #define _ARGSTR_ "(cOOii)" #endif if (!PyArg_ParseTuple(args, _ARGSTR_, - &endian, &subarray, &fields, &elsize, - &alignment)) { + &endian, &subarray, &fields, &elsize, + &alignment)) { #undef _ARGSTR_ return NULL; } @@ -2255,7 +2319,7 @@ if ((fields == Py_None && names != Py_None) || (names == Py_None && fields != Py_None)) { PyErr_Format(PyExc_ValueError, - "inconsistent fields and names"); + "inconsistent fields and names"); return NULL; } @@ -2300,7 +2364,9 @@ } Py_XDECREF(self->metadata); - if (PyDataType_ISDATETIME(self) && (metadata != Py_None) && (metadata != NULL)) { + if (PyDataType_ISDATETIME(self) + && (metadata != Py_None) + && (metadata != NULL)) { PyObject *cobj; self->metadata = PyTuple_GET_ITEM(metadata, 0); Py_INCREF(self->metadata); @@ -2309,10 +2375,13 @@ Py_DECREF(cobj); } else { - /* We have a borrowed reference to metadata so no need - to alter reference count - */ - if (metadata == Py_None) metadata = NULL; + /* + * We have a borrowed reference to metadata so no need + * to alter reference count + */ + if (metadata == Py_None) { + metadata = NULL; + } self->metadata = metadata; Py_XINCREF(metadata); } @@ -2322,6 +2391,7 @@ } /*NUMPY_API + * * Get type-descriptor from an object forcing alignment if possible * None goes to DEFAULT type. * @@ -2364,6 +2434,7 @@ } /*NUMPY_API + * * Get type-descriptor from an object forcing alignment if possible * None goes to NULL. */ @@ -2400,7 +2471,8 @@ - /*NUMPY_API +/*NUMPY_API + * * returns a copy of the PyArray_Descr structure with the byteorder * altered: * no arguments: The byteorder is swapped (in all subfields as well) @@ -2484,8 +2556,8 @@ } if (new->subarray) { Py_DECREF(new->subarray->base); - new->subarray->base = PyArray_DescrNewByteorder - (self->subarray->base, newendian); + new->subarray->base = PyArray_DescrNewByteorder( + self->subarray->base, newendian); } return new; } @@ -2497,7 +2569,7 @@ char endian=PyArray_SWAP; if (!PyArg_ParseTuple(args, "|O&", PyArray_ByteorderConverter, - &endian)) { + &endian)) { return NULL; } return (PyObject *)PyArray_DescrNewByteorder(self, endian); @@ -2696,8 +2768,7 @@ PyArray_Descr *new; if (length < 0) { return PyErr_Format(PyExc_ValueError, - "Array length must be >= 0, not %"INTP_FMT, - length); + "Array length must be >= 0, not %"INTP_FMT, length); } tup = Py_BuildValue("O" NPY_SSIZE_T_PYFMT, self, length); if (tup == NULL) { @@ -2722,8 +2793,7 @@ astr = bstr; #endif PyErr_Format(PyExc_KeyError, - "There are no fields in dtype %s.", - PyBytes_AsString(astr)); + "There are no fields in dtype %s.", PyBytes_AsString(astr)); Py_DECREF(astr); return NULL; } @@ -2745,9 +2815,7 @@ } PyErr_Format(PyExc_KeyError, - "Field named \'%s\' not found.", - PyBytes_AsString(s)); - + "Field named \'%s\' not found.", PyBytes_AsString(s)); if (s != op) { Py_DECREF(s); } From numpy-svn at scipy.org Wed Feb 17 11:49:05 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 17 Feb 2010 10:49:05 -0600 (CST) Subject: [Numpy-svn] r8124 - trunk/numpy/core/src/multiarray Message-ID: <20100217164905.E888439CAE6@scipy.org> Author: charris Date: 2010-02-17 10:49:05 -0600 (Wed, 17 Feb 2010) New Revision: 8124 Modified: trunk/numpy/core/src/multiarray/multiarraymodule.c Log: STY: Remove hardtabs, reindent. Modified: trunk/numpy/core/src/multiarray/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarray/multiarraymodule.c 2010-02-17 16:48:56 UTC (rev 8123) +++ trunk/numpy/core/src/multiarray/multiarraymodule.c 2010-02-17 16:49:05 UTC (rev 8124) @@ -1184,8 +1184,7 @@ static char *kwlist[] = {"arr", "mask", "values", NULL}; if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!OO:putmask", kwlist, - &PyArray_Type, - &array, &mask, &values)) { + &PyArray_Type, &array, &mask, &values)) { return NULL; } return PyArray_PutMask((PyArrayObject *)array, values, mask); @@ -1282,7 +1281,7 @@ goto fail; } if (number <= (int) NPY_RAISE - && number >= (int) NPY_CLIP) { + && number >= (int) NPY_CLIP) { *val = (NPY_CLIPMODE) number; } else { @@ -1390,7 +1389,7 @@ return ((typenum1 == typenum2) && _equivalent_units(typ1->metadata, typ2->metadata)); } - return (typ1->kind == typ2->kind); + return typ1->kind == typ2->kind; } /*NUMPY_API*/ @@ -1465,12 +1464,11 @@ return NULL; } if(!PyArg_ParseTupleAndKeywords(args, kws, "O|O&O&O&O&i", kwd, &op, - PyArray_DescrConverter2, - &type, - PyArray_BoolConverter, ©, - PyArray_OrderConverter, &order, - PyArray_BoolConverter, &subok, - &ndmin)) { + PyArray_DescrConverter2, &type, + PyArray_BoolConverter, ©, + PyArray_OrderConverter, &order, + PyArray_BoolConverter, &subok, + &ndmin)) { goto clean_type; } @@ -1482,7 +1480,7 @@ } /* fast exit if simple call */ if ((subok && PyArray_Check(op)) - || (!subok && PyArray_CheckExact(op))) { + || (!subok && PyArray_CheckExact(op))) { if (type == NULL) { if (!copy && STRIDING_OK(op, order)) { Py_INCREF(op); @@ -1561,12 +1559,10 @@ Bool fortran; PyObject *ret = NULL; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&|O&O&", - kwlist, PyArray_IntpConverter, - &shape, - PyArray_DescrConverter, - &typecode, - PyArray_OrderConverter, &order)) { + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&|O&O&", kwlist, + PyArray_IntpConverter, &shape, + PyArray_DescrConverter, &typecode, + PyArray_OrderConverter, &order)) { goto fail; } if (order == PyArray_FORTRANORDER) { @@ -1601,14 +1597,13 @@ PyObject *ret; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!|O", - kwlist, &PyArrayDescr_Type, - &typecode, - &obj)) { + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!|O", kwlist, + &PyArrayDescr_Type, &typecode, &obj)) { return NULL; } if (typecode->elsize == 0) { - PyErr_SetString(PyExc_ValueError, "itemsize cannot be zero"); + PyErr_SetString(PyExc_ValueError, + "itemsize cannot be zero"); return NULL; } @@ -1630,20 +1625,17 @@ else { if (!PyString_Check(obj)) { PyErr_SetString(PyExc_TypeError, - "initializing object must "\ - "be a string"); + "initializing object must be a string"); return NULL; } if (PyString_GET_SIZE(obj) < typecode->elsize) { PyErr_SetString(PyExc_ValueError, - "initialization string is too"\ - " small"); + "initialization string is too small"); return NULL; } dptr = PyString_AS_STRING(obj); } } - ret = PyArray_Scalar(dptr, typecode, NULL); /* free dptr which contains zeros */ @@ -1663,13 +1655,10 @@ Bool fortran = FALSE; PyObject *ret = NULL; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&|O&O&", - kwlist, PyArray_IntpConverter, - &shape, - PyArray_DescrConverter, - &typecode, - PyArray_OrderConverter, - &order)) { + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&|O&O&", kwlist, + PyArray_IntpConverter, &shape, + PyArray_DescrConverter, &typecode, + PyArray_OrderConverter, &order)) { goto fail; } if (order == PyArray_FORTRANORDER) { @@ -1698,11 +1687,9 @@ static char *kwlist[] = {"string", "dtype", "count", "sep", NULL}; PyArray_Descr *descr = NULL; - if (!PyArg_ParseTupleAndKeywords(args, keywds, "s#|O&" - NPY_SSIZE_T_PYFMT "s", kwlist, - &data, &s, - PyArray_DescrConverter, &descr, - &nin, &sep)) { + if (!PyArg_ParseTupleAndKeywords(args, keywds, + "s#|O&" NPY_SSIZE_T_PYFMT "s", kwlist, + &data, &s, PyArray_DescrConverter, &descr, &nin, &sep)) { Py_XDECREF(descr); return NULL; } @@ -1722,11 +1709,8 @@ PyArray_Descr *type = NULL; if (!PyArg_ParseTupleAndKeywords(args, keywds, - "O|O&" NPY_SSIZE_T_PYFMT "s", - kwlist, - &file, - PyArray_DescrConverter, &type, - &nin, &sep)) { + "O|O&" NPY_SSIZE_T_PYFMT "s", kwlist, + &file, PyArray_DescrConverter, &type, &nin, &sep)) { Py_XDECREF(type); return NULL; } @@ -1742,7 +1726,7 @@ fp = npy_PyFile_AsFile(file, "rb"); if (fp == NULL) { PyErr_SetString(PyExc_IOError, - "first argument must be an open file"); + "first argument must be an open file"); Py_DECREF(file); return NULL; } @@ -1763,11 +1747,8 @@ PyArray_Descr *descr = NULL; if (!PyArg_ParseTupleAndKeywords(args, keywds, - "OO&|" NPY_SSIZE_T_PYFMT, - kwlist, - &iter, - PyArray_DescrConverter, &descr, - &nin)) { + "OO&|" NPY_SSIZE_T_PYFMT, kwlist, + &iter, PyArray_DescrConverter, &descr, &nin)) { Py_XDECREF(descr); return NULL; } @@ -1782,12 +1763,9 @@ static char *kwlist[] = {"buffer", "dtype", "count", "offset", NULL}; PyArray_Descr *type = NULL; - if (!PyArg_ParseTupleAndKeywords(args, keywds, "O|O&" - NPY_SSIZE_T_PYFMT - NPY_SSIZE_T_PYFMT, kwlist, - &obj, - PyArray_DescrConverter, &type, - &nin, &offset)) { + if (!PyArg_ParseTupleAndKeywords(args, keywds, + "O|O&" NPY_SSIZE_T_PYFMT NPY_SSIZE_T_PYFMT, kwlist, + &obj, PyArray_DescrConverter, &type, &nin, &offset)) { Py_XDECREF(type); return NULL; } @@ -1805,14 +1783,15 @@ static char *kwlist[] = {"seq", "axis", NULL}; if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O&", kwlist, - &a0, - PyArray_AxisConverter, &axis)) { + &a0, PyArray_AxisConverter, &axis)) { return NULL; } return PyArray_Concatenate(a0, axis); } -static PyObject *array_innerproduct(PyObject *NPY_UNUSED(dummy), PyObject *args) { +static PyObject * +array_innerproduct(PyObject *NPY_UNUSED(dummy), PyObject *args) +{ PyObject *b0, *a0; if (!PyArg_ParseTuple(args, "OO", &a0, &b0)) { @@ -1821,7 +1800,9 @@ return _ARET(PyArray_InnerProduct(a0, b0)); } -static PyObject *array_matrixproduct(PyObject *NPY_UNUSED(dummy), PyObject *args) { +static PyObject * +array_matrixproduct(PyObject *NPY_UNUSED(dummy), PyObject *args) +{ PyObject *v, *a; if (!PyArg_ParseTuple(args, "OO", &a, &v)) { @@ -1830,7 +1811,9 @@ return _ARET(PyArray_MatrixProduct(a, v)); } -static PyObject *array_fastCopyAndTranspose(PyObject *NPY_UNUSED(dummy), PyObject *args) { +static PyObject * +array_fastCopyAndTranspose(PyObject *NPY_UNUSED(dummy), PyObject *args) +{ PyObject *a0; if (!PyArg_ParseTuple(args, "O", &a0)) { @@ -1839,13 +1822,15 @@ return _ARET(PyArray_CopyAndTranspose(a0)); } -static PyObject *array_correlate(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds) { +static PyObject * +array_correlate(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds) +{ PyObject *shape, *a0; int mode = 0; static char *kwlist[] = {"a", "v", "mode", NULL}; if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO|i", kwlist, - &a0, &shape, &mode)) { + &a0, &shape, &mode)) { return NULL; } return PyArray_Correlate(a0, shape, mode); @@ -1859,7 +1844,7 @@ static char *kwlist[] = {"a", "v", "mode", NULL}; if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO|i", kwlist, - &a0, &shape, &mode)) { + &a0, &shape, &mode)) { return NULL; } return PyArray_Correlate2(a0, shape, mode); @@ -1871,10 +1856,9 @@ static char *kwd[]= {"start", "stop", "step", "dtype", NULL}; PyArray_Descr *typecode = NULL; - if(!PyArg_ParseTupleAndKeywords(args, kws, "O|OOO&", kwd, &o_start, - &o_stop, &o_step, - PyArray_DescrConverter2, - &typecode)) { + if(!PyArg_ParseTupleAndKeywords(args, kws, "O|OOO&", kwd, + &o_start, &o_stop, &o_step, + PyArray_DescrConverter2, &typecode)) { Py_XDECREF(typecode); return NULL; } @@ -1882,8 +1866,8 @@ } /*NUMPY_API - * Included at the very first so not auto-grabbed and thus not - * labeled. + * + * Included at the very first so not auto-grabbed and thus not labeled. */ NPY_NO_EXPORT unsigned int PyArray_GetNDArrayCVersion(void) @@ -1941,20 +1925,19 @@ PyArray_Dims shape = {NULL, 0}; PyArray_Descr *dtype = NULL; - if (!PyArg_ParseTuple(args, "O!O&O&", &PyType_Type, &subtype, - PyArray_IntpConverter, &shape, - PyArray_DescrConverter, &dtype)) { + if (!PyArg_ParseTuple(args, "O!O&O&", + &PyType_Type, &subtype, + PyArray_IntpConverter, &shape, + PyArray_DescrConverter, &dtype)) { goto fail; } if (!PyType_IsSubtype(subtype, &PyArray_Type)) { PyErr_SetString(PyExc_TypeError, - "_reconstruct: First argument must be " \ - "a sub-type of ndarray"); + "_reconstruct: First argument must be a sub-type of ndarray"); goto fail; } ret = PyArray_NewFromDescr(subtype, dtype, - (int)shape.len, shape.ptr, - NULL, NULL, 0, NULL); + (int)shape.len, shape.ptr, NULL, NULL, 0, NULL); if (shape.ptr) { PyDimMem_FREE(shape.ptr); } @@ -1969,14 +1952,14 @@ } static PyObject * -array_set_string_function(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds) +array_set_string_function(PyObject *NPY_UNUSED(self), PyObject *args, + PyObject *kwds) { PyObject *op = NULL; - int repr=1; + int repr = 1; static char *kwlist[] = {"f", "repr", NULL}; - if(!PyArg_ParseTupleAndKeywords(args, kwds, "|Oi", kwlist, - &op, &repr)) { + if(!PyArg_ParseTupleAndKeywords(args, kwds, "|Oi", kwlist, &op, &repr)) { return NULL; } /* reset the array_repr function to built-in */ @@ -1984,7 +1967,8 @@ op = NULL; } if (op != NULL && !PyCallable_Check(op)) { - PyErr_SetString(PyExc_TypeError, "Argument must be callable."); + PyErr_SetString(PyExc_TypeError, + "Argument must be callable."); return NULL; } PyArray_SetStringFunction(op, repr); @@ -1993,7 +1977,8 @@ } static PyObject * -array_set_ops_function(PyObject *NPY_UNUSED(self), PyObject *NPY_UNUSED(args), PyObject *kwds) +array_set_ops_function(PyObject *NPY_UNUSED(self), PyObject *NPY_UNUSED(args), + PyObject *kwds) { PyObject *oldops = NULL; @@ -2007,32 +1992,36 @@ */ if (kwds && PyArray_SetNumericOps(kwds) == -1) { Py_DECREF(oldops); - PyErr_SetString(PyExc_ValueError, "one or more objects not callable"); + PyErr_SetString(PyExc_ValueError, + "one or more objects not callable"); return NULL; } return oldops; } static PyObject * -array_set_datetimeparse_function(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds) +array_set_datetimeparse_function(PyObject *NPY_UNUSED(self), PyObject *args, + PyObject *kwds) { PyObject *op = NULL; static char *kwlist[] = {"f", NULL}; PyObject *_numpy_internal; - if(!PyArg_ParseTupleAndKeywords(args, kwds, "|O", kwlist, - &op)) { + if(!PyArg_ParseTupleAndKeywords(args, kwds, "|O", kwlist, &op)) { return NULL; } /* reset the array_repr function to built-in */ if (op == Py_None) { _numpy_internal = PyImport_ImportModule("numpy.core._internal"); - if (_numpy_internal == NULL) return NULL; + if (_numpy_internal == NULL) { + return NULL; + } op = PyObject_GetAttrString(_numpy_internal, "datetime_from_string"); } else { /* Must balance reference count increment in both branches */ if (!PyCallable_Check(op)) { - PyErr_SetString(PyExc_TypeError, "Argument must be callable."); + PyErr_SetString(PyExc_TypeError, + "Argument must be callable."); return NULL; } Py_INCREF(op); @@ -2065,15 +2054,15 @@ } if ((x == NULL) || (y == NULL)) { Py_DECREF(arr); - PyErr_SetString(PyExc_ValueError, "either both or neither " - "of x and y should be given"); + PyErr_SetString(PyExc_ValueError, + "either both or neither of x and y should be given"); return NULL; } zero = PyInt_FromLong((long) 0); obj = PyArray_EnsureAnyArray(PyArray_GenericBinaryFunction(arr, zero, - n_ops.not_equal)); + n_ops.not_equal)); Py_DECREF(zero); Py_DECREF(arr); if (obj == NULL) { @@ -2108,8 +2097,7 @@ PyObject *obj; static char *kwlist[] = {"keys", "axis", NULL}; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|i", kwlist, - &obj, &axis)) { + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|i", kwlist, &obj, &axis)) { return NULL; } return _ARET(PyArray_LexSort(obj, axis)); @@ -2118,7 +2106,8 @@ #undef _ARET static PyObject * -array_can_cast_safely(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds) +array_can_cast_safely(PyObject *NPY_UNUSED(self), PyObject *args, + PyObject *kwds) { PyArray_Descr *d1 = NULL; PyArray_Descr *d2 = NULL; @@ -2127,14 +2116,12 @@ static char *kwlist[] = {"from", "to", NULL}; if(!PyArg_ParseTupleAndKeywords(args, kwds, "O&O&", kwlist, - PyArray_DescrConverter, &d1, - PyArray_DescrConverter, &d2)) { + PyArray_DescrConverter, &d1, PyArray_DescrConverter, &d2)) { goto finish; } if (d1 == NULL || d2 == NULL) { PyErr_SetString(PyExc_TypeError, - "did not understand one of the types; " \ - "'None' not accepted"); + "did not understand one of the types; 'None' not accepted"); goto finish; } @@ -2169,9 +2156,9 @@ void *unused; static char *kwlist[] = {"object", "offset", "size", NULL}; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|" NPY_SSIZE_T_PYFMT - NPY_SSIZE_T_PYFMT, kwlist, - &obj, &offset, &size)) { + if (!PyArg_ParseTupleAndKeywords(args, kwds, + "O|" NPY_SSIZE_T_PYFMT NPY_SSIZE_T_PYFMT, kwlist, + &obj, &offset, &size)) { return NULL; } if (PyObject_AsWriteBuffer(obj, &unused, &n) < 0) { @@ -2217,11 +2204,10 @@ void *memptr; static char *kwlist[] = {"mem", "size", "readonly", "check", NULL}; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "O" \ - NPY_SSIZE_T_PYFMT "|O&O&", kwlist, - &mem, &size, PyArray_BoolConverter, - &ro, PyArray_BoolConverter, - &check)) { + if (!PyArg_ParseTupleAndKeywords(args, kwds, + "O" NPY_SSIZE_T_PYFMT "|O&O&", kwlist, + &mem, &size, PyArray_BoolConverter, &ro, + PyArray_BoolConverter, &check)) { return NULL; } memptr = PyLong_AsVoidPtr(mem); @@ -2256,8 +2242,7 @@ #endif if (err) { PyErr_SetString(PyExc_ValueError, - "cannot use memory location as " \ - "a buffer."); + "cannot use memory location as a buffer."); return NULL; } } @@ -2265,7 +2250,7 @@ #if defined(NPY_PY3K) PyErr_SetString(PyExc_RuntimeError, - "XXX -- not implemented!"); + "XXX -- not implemented!"); return NULL; #else if (ro) { @@ -2287,11 +2272,12 @@ static char repr[100]; if (!PyArg_ParseTupleAndKeywords(args, kwds, "OI", kwlist, - &obj, &precision)) { + &obj, &precision)) { return NULL; } if (!PyArray_IsScalar(obj, LongDouble)) { - PyErr_SetString(PyExc_TypeError, "not a longfloat"); + PyErr_SetString(PyExc_TypeError, + "not a longfloat"); return NULL; } x = ((PyLongDoubleScalarObject *)obj)->obval; @@ -2317,9 +2303,8 @@ static char *kwlist[] = {"a1", "a2", "cmp", "rstrip", NULL}; if (!PyArg_ParseTupleAndKeywords(args, kwds, "OOs#O&", kwlist, - &array, &other, - &cmp_str, &strlen, - PyArray_BoolConverter, &rstrip)) { + &array, &other, &cmp_str, &strlen, + PyArray_BoolConverter, &rstrip)) { return NULL; } if (strlen < 1 || strlen > 2) { @@ -2370,7 +2355,8 @@ res = _strings_richcompare(newarr, newoth, cmp_op, rstrip != 0); } else { - PyErr_SetString(PyExc_TypeError, "comparison of non-string arrays"); + PyErr_SetString(PyExc_TypeError, + "comparison of non-string arrays"); } Py_DECREF(newarr); Py_DECREF(newoth); @@ -2394,7 +2380,8 @@ nargs = PySequence_Size(args) + 1; if (nargs == -1 || nargs > NPY_MAXARGS) { - PyErr_Format(PyExc_ValueError, "len(args) must be < %d", NPY_MAXARGS - 1); + PyErr_Format(PyExc_ValueError, + "len(args) must be < %d", NPY_MAXARGS - 1); goto err; } @@ -2414,8 +2401,8 @@ } n = in_iter->numiter; - result = (PyArrayObject*)PyArray_SimpleNewFromDescr - (in_iter->nd, in_iter->dimensions, type); + result = (PyArrayObject*)PyArray_SimpleNewFromDescr(in_iter->nd, + in_iter->dimensions, type); if (result == NULL) { goto err; } @@ -2439,7 +2426,8 @@ if (arg == NULL) { goto err; } - PyTuple_SetItem(args_tuple, i, arg); /* Steals ref to arg */ + /* Steals ref to arg */ + PyTuple_SetItem(args_tuple, i, arg); } item_result = PyObject_CallObject(method, args_tuple); @@ -2449,9 +2437,8 @@ if (PyArray_SETITEM(result, PyArray_ITER_DATA(out_iter), item_result)) { Py_DECREF(item_result); - PyErr_SetString( - PyExc_TypeError, - "result array type does not match underlying function"); + PyErr_SetString( PyExc_TypeError, + "result array type does not match underlying function"); goto err; } Py_DECREF(item_result); @@ -2479,10 +2466,12 @@ _vec_string_no_args(PyArrayObject* char_array, PyArray_Descr* type, PyObject* method) { - /* This is a faster version of _vec_string_args to use when there - are no additional arguments to the string method. This doesn't - require a broadcast iterator (and broadcast iterators don't work - with 1 argument anyway). */ + /* + * This is a faster version of _vec_string_args to use when there + * are no additional arguments to the string method. This doesn't + * require a broadcast iterator (and broadcast iterators don't work + * with 1 argument anyway). + */ PyArrayIterObject* in_iter = NULL; PyArrayObject* result = NULL; PyArrayIterObject* out_iter = NULL; @@ -2492,8 +2481,8 @@ goto err; } - result = (PyArrayObject*)PyArray_SimpleNewFromDescr - (PyArray_NDIM(char_array), PyArray_DIMS(char_array), type); + result = (PyArrayObject*)PyArray_SimpleNewFromDescr( + PyArray_NDIM(char_array), PyArray_DIMS(char_array), type); if (result == NULL) { goto err; } @@ -2518,8 +2507,7 @@ if (PyArray_SETITEM(result, PyArray_ITER_DATA(out_iter), item_result)) { Py_DECREF(item_result); - PyErr_SetString( - PyExc_TypeError, + PyErr_SetString( PyExc_TypeError, "result array type does not match underlying function"); goto err; } @@ -2554,34 +2542,37 @@ PyObject* result = NULL; if (!PyArg_ParseTuple(args, "O&O&O|O", - PyArray_Converter, - &char_array, - PyArray_DescrConverter, - &type, - &method_name, - &args_seq)) { + PyArray_Converter, &char_array, + PyArray_DescrConverter, &type, + &method_name, &args_seq)) { goto err; } if (PyArray_TYPE(char_array) == NPY_STRING) { method = PyObject_GetAttr((PyObject *)&PyString_Type, method_name); - } else if (PyArray_TYPE(char_array) == NPY_UNICODE) { + } + else if (PyArray_TYPE(char_array) == NPY_UNICODE) { method = PyObject_GetAttr((PyObject *)&PyUnicode_Type, method_name); - } else { - PyErr_SetString(PyExc_TypeError, "string operation on non-string array"); + } + else { + PyErr_SetString(PyExc_TypeError, + "string operation on non-string array"); goto err; } if (method == NULL) { goto err; } - if (args_seq == NULL || - (PySequence_Check(args_seq) && PySequence_Size(args_seq) == 0)) { + if (args_seq == NULL + || (PySequence_Check(args_seq) && PySequence_Size(args_seq) == 0)) { result = _vec_string_no_args(char_array, type, method); - } else if (PySequence_Check(args_seq)) { + } + else if (PySequence_Check(args_seq)) { result = _vec_string_with_args(char_array, type, method, args_seq); - } else { - PyErr_SetString(PyExc_TypeError, "'args' must be a sequence of arguments"); + } + else { + PyErr_SetString(PyExc_TypeError, + "'args' must be a sequence of arguments"); goto err; } if (result == NULL) { From numpy-svn at scipy.org Wed Feb 17 11:49:17 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 17 Feb 2010 10:49:17 -0600 (CST) Subject: [Numpy-svn] r8125 - trunk/numpy/core/src/multiarray Message-ID: <20100217164917.EB39939C4B4@scipy.org> Author: charris Date: 2010-02-17 10:49:17 -0600 (Wed, 17 Feb 2010) New Revision: 8125 Modified: trunk/numpy/core/src/multiarray/scalarapi.c Log: STY: Remove hard tabs, reindent. Modified: trunk/numpy/core/src/multiarray/scalarapi.c =================================================================== --- trunk/numpy/core/src/multiarray/scalarapi.c 2010-02-17 16:49:05 UTC (rev 8124) +++ trunk/numpy/core/src/multiarray/scalarapi.c 2010-02-17 16:49:17 UTC (rev 8125) @@ -315,8 +315,8 @@ { memcpy(PyArray_DATA(r), memptr, PyArray_ITEMSIZE(r)); if (PyDataType_FLAGCHK(typecode, NPY_ITEM_HASOBJECT)) { - /* Need to INCREF just the PyObject portion */ - PyArray_Item_INCREF(memptr, typecode); + /* Need to INCREF just the PyObject portion */ + PyArray_Item_INCREF(memptr, typecode); } } @@ -325,9 +325,10 @@ return r; } if (outcode->type_num == typecode->type_num) { - if (!PyTypeNum_ISEXTENDED(typecode->type_num) || - (outcode->elsize == typecode->elsize)) + if (!PyTypeNum_ISEXTENDED(typecode->type_num) + || (outcode->elsize == typecode->elsize)) { return r; + } } /* cast if necessary to desired output typecode */ @@ -404,7 +405,7 @@ PyArray_DescrFromTypeObject(PyObject *type) { int typenum; - PyArray_Descr *new, *conv=NULL; + PyArray_Descr *new, *conv = NULL; /* if it's a builtin type, then use the typenumber */ typenum = _typenum_fromtypeobj(type,1); @@ -514,39 +515,41 @@ Py_INCREF(descr); return descr; } - + if (PyArray_IsScalar(sc, TimeInteger)) { - PyObject *cobj; - PyArray_DatetimeMetaData *dt_data; - - dt_data = _pya_malloc(sizeof(PyArray_DatetimeMetaData)); - - if (PyArray_IsScalar(sc, Datetime)) { - descr = PyArray_DescrNewFromType(PyArray_DATETIME); - memcpy(dt_data, &((PyDatetimeScalarObject *)sc)->obmeta, - sizeof(PyArray_DatetimeMetaData)); - } - else {/* Timedelta */ - descr = PyArray_DescrNewFromType(PyArray_TIMEDELTA); - memcpy(dt_data, &((PyTimedeltaScalarObject *)sc)->obmeta, - sizeof(PyArray_DatetimeMetaData)); - } + PyObject *cobj; + PyArray_DatetimeMetaData *dt_data; + + dt_data = _pya_malloc(sizeof(PyArray_DatetimeMetaData)); + if (PyArray_IsScalar(sc, Datetime)) { + descr = PyArray_DescrNewFromType(PyArray_DATETIME); + memcpy(dt_data, &((PyDatetimeScalarObject *)sc)->obmeta, + sizeof(PyArray_DatetimeMetaData)); + } + else { + /* Timedelta */ + descr = PyArray_DescrNewFromType(PyArray_TIMEDELTA); + memcpy(dt_data, &((PyTimedeltaScalarObject *)sc)->obmeta, + sizeof(PyArray_DatetimeMetaData)); + } cobj = PyCObject_FromVoidPtr((void *)dt_data, _pya_free); - - /* Add correct meta-data to the data-type */ - if (descr == NULL) {Py_DECREF(cobj); return NULL;} + /* Add correct meta-data to the data-type */ + if (descr == NULL) { + Py_DECREF(cobj); + return NULL; + } + Py_XDECREF(descr->metadata); + if ((descr->metadata = PyDict_New()) == NULL) { + Py_DECREF(descr); + Py_DECREF(cobj); + return NULL; + } - Py_XDECREF(descr->metadata); - if ((descr->metadata = PyDict_New())== NULL) { - Py_DECREF(descr); Py_DECREF(cobj); return NULL; - } - - /* Assume this sets a new reference to cobj */ - PyDict_SetItemString(descr->metadata, NPY_METADATA_DTSTR, cobj); - Py_DECREF(cobj); - - return descr; + /* Assume this sets a new reference to cobj */ + PyDict_SetItemString(descr->metadata, NPY_METADATA_DTSTR, cobj); + Py_DECREF(cobj); + return descr; } descr = PyArray_DescrFromTypeObject((PyObject *)Py_TYPE(sc)); @@ -563,11 +566,11 @@ #endif } else { - descr->elsize = - Py_SIZE((PyVoidScalarObject *)sc); + descr->elsize = Py_SIZE((PyVoidScalarObject *)sc); descr->fields = PyObject_GetAttrString(sc, "fields"); - if (!descr->fields || !PyDict_Check(descr->fields) || - (descr->fields == Py_None)) { + if (!descr->fields + || !PyDict_Check(descr->fields) + || (descr->fields == Py_None)) { Py_XDECREF(descr->fields); descr->fields = NULL; } @@ -627,20 +630,24 @@ copyswap = descr->f->copyswap; type = descr->typeobj; swap = !PyArray_ISNBO(descr->byteorder); - if PyTypeNum_ISSTRING(type_num) { /* Eliminate NULL bytes */ - char *dptr = data; + if PyTypeNum_ISSTRING(type_num) { + /* Eliminate NULL bytes */ + char *dptr = data; - dptr += itemsize - 1; - while(itemsize && *dptr-- == 0) { - itemsize--; - } - if (type_num == PyArray_UNICODE && itemsize) { - /* make sure itemsize is a multiple of 4 */ - /* so round up to nearest multiple */ - itemsize = (((itemsize-1) >> 2) + 1) << 2; - } + dptr += itemsize - 1; + while(itemsize && *dptr-- == 0) { + itemsize--; } - if (type->tp_itemsize != 0) { /* String type */ + if (type_num == PyArray_UNICODE && itemsize) { + /* + * make sure itemsize is a multiple of 4 + * so round up to nearest multiple + */ + itemsize = (((itemsize - 1) >> 2) + 1) << 2; + } + } + if (type->tp_itemsize != 0) { + /* String type */ obj = type->tp_alloc(type, itemsize); } else { @@ -650,114 +657,114 @@ return NULL; } if PyTypeNum_ISDATETIME(type_num) { - /* We need to copy the resolution information over to the scalar */ - /* Get the void * from the metadata dictionary */ - PyObject *cobj; + /* + * We need to copy the resolution information over to the scalar + * Get the void * from the metadata dictionary + */ + PyObject *cobj; PyArray_DatetimeMetaData *dt_data; cobj = PyDict_GetItemString(descr->metadata, NPY_METADATA_DTSTR); dt_data = PyCObject_AsVoidPtr(cobj); memcpy(&(((PyDatetimeScalarObject *)obj)->obmeta), dt_data, - sizeof(PyArray_DatetimeMetaData)); + sizeof(PyArray_DatetimeMetaData)); } if PyTypeNum_ISFLEXIBLE(type_num) { - if (type_num == PyArray_STRING) { - destptr = PyString_AS_STRING(obj); - ((PyStringObject *)obj)->ob_shash = -1; + if (type_num == PyArray_STRING) { + destptr = PyString_AS_STRING(obj); + ((PyStringObject *)obj)->ob_shash = -1; #if !defined(NPY_PY3K) - ((PyStringObject *)obj)->ob_sstate = \ - SSTATE_NOT_INTERNED; + ((PyStringObject *)obj)->ob_sstate = SSTATE_NOT_INTERNED; #endif - memcpy(destptr, data, itemsize); - return obj; - } - else if (type_num == PyArray_UNICODE) { - PyUnicodeObject *uni = (PyUnicodeObject*)obj; - size_t length = itemsize >> 2; + memcpy(destptr, data, itemsize); + return obj; + } + else if (type_num == PyArray_UNICODE) { + PyUnicodeObject *uni = (PyUnicodeObject*)obj; + size_t length = itemsize >> 2; #ifndef Py_UNICODE_WIDE - char *buffer; - int alloc = 0; - length *= 2; + char *buffer; + int alloc = 0; + length *= 2; #endif - /* Need an extra slot and need to use - Python memory manager */ - uni->str = NULL; - destptr = PyMem_NEW(Py_UNICODE,length+1); - if (destptr == NULL) { - Py_DECREF(obj); + /* Need an extra slot and need to use Python memory manager */ + uni->str = NULL; + destptr = PyMem_NEW(Py_UNICODE,length+1); + if (destptr == NULL) { + Py_DECREF(obj); + return PyErr_NoMemory(); + } + uni->str = (Py_UNICODE *)destptr; + uni->str[0] = 0; + uni->str[length] = 0; + uni->length = length; + uni->hash = -1; + uni->defenc = NULL; +#ifdef Py_UNICODE_WIDE + memcpy(destptr, data, itemsize); + if (swap) { + byte_swap_vector(destptr, length, 4); + } +#else + /* need aligned data buffer */ + if ((swap) || ((((intp)data) % descr->alignment) != 0)) { + buffer = _pya_malloc(itemsize); + if (buffer == NULL) { return PyErr_NoMemory(); } - uni->str = (Py_UNICODE *)destptr; - uni->str[0] = 0; - uni->str[length] = 0; - uni->length = length; - uni->hash = -1; - uni->defenc = NULL; -#ifdef Py_UNICODE_WIDE - memcpy(destptr, data, itemsize); + alloc = 1; + memcpy(buffer, data, itemsize); if (swap) { - byte_swap_vector(destptr, length, 4); + byte_swap_vector(buffer, itemsize >> 2, 4); } -#else - /* need aligned data buffer */ - if ((swap) || ((((intp)data) % descr->alignment) != 0)) { - buffer = _pya_malloc(itemsize); - if (buffer == NULL) { - return PyErr_NoMemory(); - } - alloc = 1; - memcpy(buffer, data, itemsize); - if (swap) { - byte_swap_vector(buffer, itemsize >> 2, 4); - } - } - else { - buffer = data; - } + } + else { + buffer = data; + } - /* Allocated enough for 2-characters per itemsize. - Now convert from the data-buffer - */ - length = PyUCS2Buffer_FromUCS4(uni->str, - (PyArray_UCS4 *)buffer, - itemsize >> 2); - if (alloc) { - _pya_free(buffer); - } - /* Resize the unicode result */ - if (MyPyUnicode_Resize(uni, length) < 0) { - Py_DECREF(obj); - return NULL; - } + /* + * Allocated enough for 2-characters per itemsize. + * Now convert from the data-buffer + */ + length = PyUCS2Buffer_FromUCS4(uni->str, + (PyArray_UCS4 *)buffer, itemsize >> 2); + if (alloc) { + _pya_free(buffer); + } + /* Resize the unicode result */ + if (MyPyUnicode_Resize(uni, length) < 0) { + Py_DECREF(obj); + return NULL; + } #endif - return obj; - } - else { - PyVoidScalarObject *vobj = (PyVoidScalarObject *)obj; - vobj->base = NULL; - vobj->descr = descr; - Py_INCREF(descr); - vobj->obval = NULL; - Py_SIZE(vobj) = itemsize; - vobj->flags = BEHAVED | OWNDATA; - swap = 0; - if (descr->names) { - if (base) { - Py_INCREF(base); - vobj->base = base; - vobj->flags = PyArray_FLAGS(base); - vobj->flags &= ~OWNDATA; - vobj->obval = data; - return obj; - } + return obj; + } + else { + PyVoidScalarObject *vobj = (PyVoidScalarObject *)obj; + vobj->base = NULL; + vobj->descr = descr; + Py_INCREF(descr); + vobj->obval = NULL; + Py_SIZE(vobj) = itemsize; + vobj->flags = BEHAVED | OWNDATA; + swap = 0; + if (descr->names) { + if (base) { + Py_INCREF(base); + vobj->base = base; + vobj->flags = PyArray_FLAGS(base); + vobj->flags &= ~OWNDATA; + vobj->obval = data; + return obj; } - destptr = PyDataMem_NEW(itemsize); - if (destptr == NULL) { - Py_DECREF(obj); - return PyErr_NoMemory(); - } - vobj->obval = destptr; } + destptr = PyDataMem_NEW(itemsize); + if (destptr == NULL) { + Py_DECREF(obj); + return PyErr_NoMemory(); + } + vobj->obval = destptr; } + } else { destptr = scalar_value(obj, descr); } @@ -769,9 +776,10 @@ /* Return Array Scalar if 0-d array object is encountered */ /*NUMPY_API - Return either an array or the appropriate Python object if the array - is 0d and matches a Python type. -*/ + * + *Return either an array or the appropriate Python object if the array + *is 0d and matches a Python type. + */ NPY_NO_EXPORT PyObject * PyArray_Return(PyArrayObject *mp) { @@ -796,5 +804,3 @@ return (PyObject *)mp; } } - - From numpy-svn at scipy.org Wed Feb 17 18:42:43 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 17 Feb 2010 17:42:43 -0600 (CST) Subject: [Numpy-svn] r8126 - in trunk/numpy: core distutils Message-ID: <20100217234243.1755E39C4B4@scipy.org> Author: jarrod.millman Date: 2010-02-17 17:42:42 -0600 (Wed, 17 Feb 2010) New Revision: 8126 Modified: trunk/numpy/core/defchararray.py trunk/numpy/core/fromnumeric.py trunk/numpy/core/numeric.py trunk/numpy/core/numerictypes.py trunk/numpy/core/shape_base.py trunk/numpy/distutils/misc_util.py Log: updated docstrings from pydoc website (thanks to everyone who contributed!) Modified: trunk/numpy/core/defchararray.py =================================================================== --- trunk/numpy/core/defchararray.py 2010-02-17 16:49:17 UTC (rev 8125) +++ trunk/numpy/core/defchararray.py 2010-02-17 23:42:42 UTC (rev 8126) @@ -4,12 +4,12 @@ .. note:: The `chararray` class exists for backwards compatibility with - Numarray, it is not recommended for new development. If one needs - arrays of strings, use arrays of `dtype` `object_`, `string_` or - `unicode_`, and use the free functions in the `numpy.char` module - for fast vectorized string operations. + Numarray, it is not recommended for new development. Starting from numpy + 1.4, if one needs arrays of strings, it is recommended to use arrays of + `dtype` `object_`, `string_` or `unicode_`, and use the free functions + in the `numpy.char` module for fast vectorized string operations. -Some methods will only be available if the corresponding str method is +Some methods will only be available if the corresponding string method is available in your version of Python. The preferred alias for `defchararray` is `numpy.char`. @@ -1692,10 +1692,10 @@ .. note:: The `chararray` class exists for backwards compatibility with - Numarray, it is not recommended for new development. If one needs - arrays of strings, use arrays of `dtype` `object_`, `string_` or - `unicode_`, and use the free functions in the `numpy.char` module - for fast vectorized string operations. + Numarray, it is not recommended for new development. Starting from numpy + 1.4, if one needs arrays of strings, it is recommended to use arrays of + `dtype` `object_`, `string_` or `unicode_`, and use the free functions + in the `numpy.char` module for fast vectorized string operations. Versus a regular Numpy array of type `str` or `unicode`, this class adds the following functionality: @@ -1718,6 +1718,71 @@ ``len(shape) >= 2`` and ``order='Fortran'``, in which case `strides` is in "Fortran order". + Methods + ------- + astype + argsort + copy + count + decode + dump + dumps + encode + endswith + expandtabs + fill + find + flatten + getfield + index + isalnum + isalpha + isdecimal + isdigit + islower + isnumeric + isspace + istitle + isupper + item + join + ljust + lower + lstrip + nonzero + put + ravel + repeat + replace + reshape + resize + rfind + rindex + rjust + rsplit + rstrip + searchsorted + setfield + setflags + sort + split + splitlines + squeeze + startswith + strip + swapaxes + swapcase + take + title + tofile + tolist + tostring + translate + transpose + upper + view + zfill + Parameters ---------- shape : tuple Modified: trunk/numpy/core/fromnumeric.py =================================================================== --- trunk/numpy/core/fromnumeric.py 2010-02-17 16:49:17 UTC (rev 8125) +++ trunk/numpy/core/fromnumeric.py 2010-02-17 23:42:42 UTC (rev 8126) @@ -127,10 +127,28 @@ This will be a new view object if possible; otherwise, it will be a copy. + See Also -------- ndarray.reshape : Equivalent method. + Notes + ----- + + It is not always possible to change the shape of an array without + copying the data. If you want an error to be raise if the data is copied, + you should assign the new shape to the shape attribute of the array:: + + >>> a = np.zeros((10, 2)) + # A transpose make the array non-contiguous + >>> b = a.T + # Taking a view makes it possible to modify the shape without modiying the + # initial object. + >>> c = b.view() + >>> c.shape = (20) + AttributeError: incompatible shape for a non-contiguous array + + Examples -------- >>> a = np.array([[1,2,3], [4,5,6]]) @@ -1708,7 +1726,7 @@ def amax(a, axis=None, out=None): """ - Return the maximum along an axis. + Return the maximum of an array or maximum along an axis. Parameters ---------- @@ -1724,8 +1742,7 @@ Returns ------- amax : ndarray - A new array or a scalar with the result, or a reference to `out` - if it was specified. + A new array or a scalar array with the result. See Also -------- @@ -1769,7 +1786,7 @@ def amin(a, axis=None, out=None): """ - Return the minimum along an axis. + Return the minimum of an array or minimum along an axis. Parameters ---------- @@ -1785,8 +1802,7 @@ Returns ------- amin : ndarray - A new array or a scalar with the result, or a reference to `out` if it - was specified. + A new array or a scalar array with the result. See Also -------- Modified: trunk/numpy/core/numeric.py =================================================================== --- trunk/numpy/core/numeric.py 2010-02-17 16:49:17 UTC (rev 8125) +++ trunk/numpy/core/numeric.py 2010-02-17 23:42:42 UTC (rev 8126) @@ -262,6 +262,14 @@ >>> np.asarray(a) is a True + If `dtype` is set, array is copied only if dtype does not match: + + >>> a = np.array([1, 2], dtype=np.float32) + >>> np.asarray(a, dtype=np.float32) is a + True + >>> np.asarray(a, dtype=np.float64) is a + False + Contrary to `asanyarray`, ndarray subclasses are not passed through: >>> issubclass(np.matrix, np.ndarray) @@ -2090,25 +2098,6 @@ Warning: overflow encountered in short_scalars 30464 - Calling `seterr` with no arguments resets treatment for all floating-point - errors to the defaults. XXX: lies!!! code doesn't do that - >>> np.geterr() - {'over': 'ignore', 'divide': 'ignore', 'invalid': 'ignore', 'under': 'ignore'} - >>> np.seterr(all='warn') - {'over': 'ignore', 'divide': 'ignore', 'invalid': 'ignore', 'under': 'ignore'} - >>> np.geterr() - {'over': 'warn', 'divide': 'warn', 'invalid': 'warn', 'under': 'warn'} - >>> np.seterr() # XXX: this should reset to defaults according to docstring above - {'over': 'warn', 'divide': 'warn', 'invalid': 'warn', 'under': 'warn'} - >>> np.geterr() # XXX: but clearly it doesn't - {'over': 'warn', 'divide': 'warn', 'invalid': 'warn', 'under': 'warn'} - - >>> old_settings = np.seterr() - >>> old_settings = np.seterr(all='ignore') - >>> np.geterr() - {'over': 'ignore', 'divide': 'ignore', 'invalid': 'ignore', - 'under': 'ignore'} - """ pyvals = umath.geterrobj() Modified: trunk/numpy/core/numerictypes.py =================================================================== --- trunk/numpy/core/numerictypes.py 2010-02-17 16:49:17 UTC (rev 8125) +++ trunk/numpy/core/numerictypes.py 2010-02-17 23:42:42 UTC (rev 8126) @@ -1,6 +1,7 @@ -"""numerictypes: Define the numeric type objects +""" +numerictypes: Define the numeric type objects -This module is designed so 'from numerictypes import *' is safe. +This module is designed so "from numerictypes import \\*" is safe. Exported symbols include: Dictionary with all registered number types (including aliases): @@ -37,9 +38,11 @@ float_, complex_, longfloat, clongfloat, - datetime_, timedelta_, (these inherit from timeinteger which inherits from signedinteger) - + datetime_, timedelta_, (these inherit from timeinteger which inherits + from signedinteger) + + As part of the type-hierarchy: xx -- is bit-width generic @@ -65,7 +68,7 @@ | | single | | float_ (double) | | longfloat - | \-> complexfloating (complexxx) (kind=c) + | \\-> complexfloating (complexxx) (kind=c) | csingle (singlecomplex) | complex_ (cfloat, cdouble) | clongfloat (longcomplex) @@ -75,7 +78,8 @@ | unicode_ (kind=U) | void (kind=V) | - \-> object_ (not used much) (kind=O) + \\-> object_ (not used much) (kind=O) + """ # we add more at the bottom Modified: trunk/numpy/core/shape_base.py =================================================================== --- trunk/numpy/core/shape_base.py 2010-02-17 16:49:17 UTC (rev 8125) +++ trunk/numpy/core/shape_base.py 2010-02-17 23:42:42 UTC (rev 8126) @@ -218,7 +218,7 @@ Stack arrays in sequence horizontally (column wise). Take a sequence of arrays and stack them horizontally to make - a single array. Rebuild arrays divided by ``hsplit``. + a single array. Rebuild arrays divided by `hsplit`. Parameters ---------- Modified: trunk/numpy/distutils/misc_util.py =================================================================== --- trunk/numpy/distutils/misc_util.py 2010-02-17 16:49:17 UTC (rev 8125) +++ trunk/numpy/distutils/misc_util.py 2010-02-17 23:42:42 UTC (rev 8126) @@ -795,13 +795,15 @@ sys.stderr.write('Warning: %s' % (message,)) def set_options(self, **options): - """Configure Configuration instance. + """ + Configure Configuration instance. The following options are available: - - ignore_setup_xxx_py - - assume_default_configuration - - delegate_options_to_subpackages - - quiet + - ignore_setup_xxx_py + - assume_default_configuration + - delegate_options_to_subpackages + - quiet + """ for key, value in options.items(): if key in self.options: From numpy-svn at scipy.org Wed Feb 17 18:53:04 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 17 Feb 2010 17:53:04 -0600 (CST) Subject: [Numpy-svn] r8127 - in trunk/numpy: doc lib linalg ma polynomial testing Message-ID: <20100217235304.E483539C4B4@scipy.org> Author: jarrod.millman Date: 2010-02-17 17:53:04 -0600 (Wed, 17 Feb 2010) New Revision: 8127 Modified: trunk/numpy/doc/basics.py trunk/numpy/doc/creation.py trunk/numpy/doc/indexing.py trunk/numpy/doc/misc.py trunk/numpy/doc/ufuncs.py trunk/numpy/lib/financial.py trunk/numpy/lib/function_base.py trunk/numpy/lib/io.py trunk/numpy/lib/shape_base.py trunk/numpy/linalg/linalg.py trunk/numpy/ma/core.py trunk/numpy/polynomial/__init__.py trunk/numpy/polynomial/chebyshev.py trunk/numpy/polynomial/polynomial.py trunk/numpy/polynomial/polytemplate.py trunk/numpy/polynomial/polyutils.py trunk/numpy/testing/utils.py Log: more docstring updates from pydoc website (thanks to everyone who contributed!) Modified: trunk/numpy/doc/basics.py =================================================================== --- trunk/numpy/doc/basics.py 2010-02-17 23:42:42 UTC (rev 8126) +++ trunk/numpy/doc/basics.py 2010-02-17 23:53:04 UTC (rev 8127) @@ -44,7 +44,7 @@ the dtypes are available as ``np.bool``, ``np.float32``, etc. Advanced types, not listed in the table above, are explored in -section `link_here`. +section :ref:`structured_arrays`. There are 5 basic numerical types representing booleans (bool), integers (int), unsigned integers (uint) floating point (float) and complex. Those with numbers @@ -98,8 +98,8 @@ dtype('uint8') dtype objects also contain information about the type, such as its bit-width -and its byte-order. See xxx for details. The data type can also be used -indirectly to query properties of the type, such as whether it is an integer:: +and its byte-order. The data type can also be used indirectly to query +properties of the type, such as whether it is an integer:: >>> d = np.dtype(int) >>> d Modified: trunk/numpy/doc/creation.py =================================================================== --- trunk/numpy/doc/creation.py 2010-02-17 23:42:42 UTC (rev 8126) +++ trunk/numpy/doc/creation.py 2010-02-17 23:53:04 UTC (rev 8127) @@ -9,7 +9,8 @@ There are 5 general mechanisms for creating arrays: 1) Conversion from other Python structures (e.g., lists, tuples) -2) Intrinsic numpy array array creation objects (e.g., arange, ones, zeros, etc.) +2) Intrinsic numpy array array creation objects (e.g., arange, ones, zeros, + etc.) 3) Reading arrays from disk, either from standard or custom formats 4) Creating arrays from raw bytes through the use of strings or buffers 5) Use of special library functions (e.g., random) @@ -22,17 +23,19 @@ ==================================================== In general, numerical data arranged in an array-like structure in Python can -be converted to arrays through the use of the array() function. The most obvious -examples are lists and tuples. See the documentation for array() for details for -its use. Some objects may support the array-protocol and allow conversion to arrays -this way. A simple way to find out if the object can be converted to a numpy array -using array() is simply to try it interactively and see if it works! (The Python Way). +be converted to arrays through the use of the array() function. The most +obvious examples are lists and tuples. See the documentation for array() for +details for its use. Some objects may support the array-protocol and allow +conversion to arrays this way. A simple way to find out if the object can be +converted to a numpy array using array() is simply to try it interactively and +see if it works! (The Python Way). Examples: :: >>> x = np.array([2,3,1,0]) >>> x = np.array([2, 3, 1, 0]) - >>> x = np.array([[1,2.0],[0,0],(1+1j,3.)]) # note mix of tuple and lists, and types + >>> x = np.array([[1,2.0],[0,0],(1+1j,3.)]) # note mix of tuple and lists, + and types >>> x = np.array([[ 1.+0.j, 2.+0.j], [ 0.+0.j, 0.+0.j], [ 1.+1.j, 3.+0.j]]) Intrinsic Numpy Array Creation @@ -102,7 +105,6 @@ HDF5: PyTables FITS: PyFITS - Others? xxx Examples of formats that cannot be read directly but for which it is not hard to convert are libraries like PIL (able to read and write many image formats @@ -125,9 +127,9 @@ simple format then one can write a simple I/O library and use the numpy fromfile() function and .tofile() method to read and write numpy arrays directly (mind your byteorder though!) If a good C or C++ library exists that -read the data, one can wrap that library with a variety of techniques (see -xxx) though that certainly is much more work and requires significantly more -advanced knowledge to interface with C or C++. +read the data, one can wrap that library with a variety of techniques though +that certainly is much more work and requires significantly more advanced +knowledge to interface with C or C++. Use of Special Libraries ------------------------ @@ -136,6 +138,6 @@ and it isn't possible to enumerate all of them. The most common uses are use of the many array generation functions in random that can generate arrays of random values, and some utility functions to generate special matrices (e.g. -diagonal) +diagonal). """ Modified: trunk/numpy/doc/indexing.py =================================================================== --- trunk/numpy/doc/indexing.py 2010-02-17 23:42:42 UTC (rev 8126) +++ trunk/numpy/doc/indexing.py 2010-02-17 23:53:04 UTC (rev 8127) @@ -14,10 +14,10 @@ Assignment vs referencing ========================= -Most of the following examples show the use of indexing when referencing -data in an array. The examples work just as well when assigning to an -array. See the section at the end for specific examples and explanations -on how assignments work. +Most of the following examples show the use of indexing when +referencing data in an array. The examples work just as well +when assigning to an array. See the section at the end for +specific examples and explanations on how assignments work. Single element indexing ======================= @@ -48,39 +48,38 @@ >>> x[0] array([0, 1, 2, 3, 4]) -That is, each index specified selects the array corresponding to the rest -of the dimensions selected. In the above example, choosing 0 means that -remaining dimension of lenth 5 is being left unspecified, and that what -is returned is an array of that dimensionality and size. It must be noted -that the returned array is not a copy of the original, but points to the -same values in memory as does the original array (a new view of the same -data in other words, see xxx for details). In this case, -the 1-D array at the first position (0) is returned. So using a single -index on the returned array, results in a single element being returned. -That is: :: +That is, each index specified selects the array corresponding to the +rest of the dimensions selected. In the above example, choosing 0 +means that remaining dimension of lenth 5 is being left unspecified, +and that what is returned is an array of that dimensionality and size. +It must be noted that the returned array is not a copy of the original, +but points to the same values in memory as does the original array. +In this case, the 1-D array at the first position (0) is returned. +So using a single index on the returned array, results in a single +element being returned. That is: :: >>> x[0][2] 2 -So note that ``x[0,2] = x[0][2]`` though the second case is more inefficient -a new temporary array is created after the first index that is subsequently -indexed by 2. +So note that ``x[0,2] = x[0][2]`` though the second case is more +inefficient a new temporary array is created after the first index +that is subsequently indexed by 2. -Note to those used to IDL or Fortran memory order as it relates to indexing. -Numpy uses C-order indexing. That means that the last index usually (see -xxx for exceptions) represents the most rapidly changing memory location, -unlike Fortran or IDL, where the first index represents the most rapidly -changing location in memory. This difference represents a great potential -for confusion. +Note to those used to IDL or Fortran memory order as it relates to +indexing. Numpy uses C-order indexing. That means that the last +index usually represents the most rapidly changing memory location, +unlike Fortran or IDL, where the first index represents the most +rapidly changing location in memory. This difference represents a +great potential for confusion. Other indexing options ====================== -It is possible to slice and stride arrays to extract arrays of the same -number of dimensions, but of different sizes than the original. The slicing -and striding works exactly the same way it does for lists and tuples except -that they can be applied to multiple dimensions as well. A few -examples illustrates best: :: +It is possible to slice and stride arrays to extract arrays of the +same number of dimensions, but of different sizes than the original. +The slicing and striding works exactly the same way it does for lists +and tuples except that they can be applied to multiple dimensions as +well. A few examples illustrates best: :: >>> x = np.arange(10) >>> x[2:5] @@ -95,35 +94,34 @@ [21, 24, 27]]) Note that slices of arrays do not copy the internal array data but -also produce new views of the original data (see xxx for more -explanation of this issue). +also produce new views of the original data. It is possible to index arrays with other arrays for the purposes of -selecting lists of values out of arrays into new arrays. There are two -different ways of accomplishing this. One uses one or more arrays of -index values (see xxx for details). The other involves giving a boolean -array of the proper shape to indicate the values to be selected. -Index arrays are a very powerful tool that allow one to avoid looping -over individual elements in arrays and thus greatly improve performance -(see xxx for examples) +selecting lists of values out of arrays into new arrays. There are +two different ways of accomplishing this. One uses one or more arrays +of index values. The other involves giving a boolean array of the proper +shape to indicate the values to be selected. Index arrays are a very +powerful tool that allow one to avoid looping over individual elements in +arrays and thus greatly improve performance. It is possible to use special features to effectively increase the number of dimensions in an array through indexing so the resulting array aquires the shape needed for use in an expression or with a -specific function. See xxx. +specific function. Index arrays ============ -Numpy arrays may be indexed with other arrays (or any other sequence-like -object that can be converted to an array, such as lists, with the exception -of tuples; see the end of this document for why this is). The use of index -arrays ranges from simple, straightforward cases to complex, hard-to-understand -cases. For all cases of index arrays, what is returned is a copy of the -original data, not a view as one gets for slices. +Numpy arrays may be indexed with other arrays (or any other sequence- +like object that can be converted to an array, such as lists, with the +exception of tuples; see the end of this document for why this is). The +use of index arrays ranges from simple, straightforward cases to +complex, hard-to-understand cases. For all cases of index arrays, what +is returned is a copy of the original data, not a view as one gets for +slices. -Index arrays must be of integer type. Each value in the array indicates which -value in the array to use in place of the index. To illustrate: :: +Index arrays must be of integer type. Each value in the array indicates +which value in the array to use in place of the index. To illustrate: :: >>> x = np.arange(10,1,-1) >>> x @@ -132,11 +130,12 @@ array([7, 7, 9, 2]) -The index array consisting of the values 3, 3, 1 and 8 correspondingly create -an array of length 4 (same as the index array) where each index is replaced by -the value the index array has in the array being indexed. +The index array consisting of the values 3, 3, 1 and 8 correspondingly +create an array of length 4 (same as the index array) where each index +is replaced by the value the index array has in the array being indexed. -Negative values are permitted and work as they do with single indices or slices: :: +Negative values are permitted and work as they do with single indices +or slices: :: >>> x[np.array([3,3,-3,8])] array([7, 7, 4, 2]) @@ -146,9 +145,10 @@ >>> x[np.array([3, 3, 20, 8])] : index 20 out of bounds 0<=index<9 -Generally speaking, what is returned when index arrays are used is an array with -the same shape as the index array, but with the type and values of the array being -indexed. As an example, we can use a multidimensional index array instead: :: +Generally speaking, what is returned when index arrays are used is +an array with the same shape as the index array, but with the type +and values of the array being indexed. As an example, we can use a +multidimensional index array instead: :: >>> x[np.array([[1,1],[2,3]])] array([[9, 9], @@ -157,77 +157,85 @@ Indexing Multi-dimensional arrays ================================= -Things become more complex when multidimensional arrays are indexed, particularly -with multidimensional index arrays. These tend to be more unusal uses, but they -are permitted, and they are useful for some problems. We'll start with the -simplest multidimensional case (using the array y from the previous examples): :: +Things become more complex when multidimensional arrays are indexed, +particularly with multidimensional index arrays. These tend to be +more unusal uses, but theyare permitted, and they are useful for some +problems. We'll start with thesimplest multidimensional case (using +the array y from the previous examples): :: >>> y[np.array([0,2,4]), np.array([0,1,2])] array([ 0, 15, 30]) -In this case, if the index arrays have a matching shape, and there is an index -array for each dimension of the array being indexed, the resultant array has the -same shape as the index arrays, and the values correspond to the index set for each -position in the index arrays. In this example, the first index value is 0 for both -index arrays, and thus the first value of the resultant array is y[0,0]. The next -value is y[2,1], and the last is y[4,2]. +In this case, if the index arrays have a matching shape, and there is +an index array for each dimension of the array being indexed, the +resultant array has the same shape as the index arrays, and the values +correspond to the index set for each position in the index arrays. In +this example, the first index value is 0 for both index arrays, and +thus the first value of the resultant array is y[0,0]. The next value +is y[2,1], and the last is y[4,2]. -If the index arrays do not have the same shape, there is an attempt to broadcast -them to the same shape. Broadcasting won't be discussed here but is discussed in -detail in xxx. If they cannot be broadcast to the same shape, an exception is -raised: :: +If the index arrays do not have the same shape, there is an attempt to +broadcast them to the same shape. If they cannot be broadcast to the +same shape, an exception is raised: :: >>> y[np.array([0,2,4]), np.array([0,1])] - : shape mismatch: objects cannot be broadcast to a single shape + : shape mismatch: objects cannot be + broadcast to a single shape -The broadcasting mechanism permits index arrays to be combined with scalars for -other indices. The effect is that the scalar value is used for all the corresponding -values of the index arrays: :: +The broadcasting mechanism permits index arrays to be combined with +scalars for other indices. The effect is that the scalar value is used +for all the corresponding values of the index arrays: :: >>> y[np.array([0,2,4]), 1] array([ 1, 15, 29]) -Jumping to the next level of complexity, it is possible to only partially index an array -with index arrays. It takes a bit of thought to understand what happens in such cases. -For example if we just use one index array with y: :: +Jumping to the next level of complexity, it is possible to only +partially index an array with index arrays. It takes a bit of thought +to understand what happens in such cases. For example if we just use +one index array with y: :: >>> y[np.array([0,2,4])] array([[ 0, 1, 2, 3, 4, 5, 6], [14, 15, 16, 17, 18, 19, 20], [28, 29, 30, 31, 32, 33, 34]]) -What results is the construction of a new array where each value of the index array -selects one row from the array being indexed and the resultant array has the resulting -shape (size of row, number index elements). +What results is the construction of a new array where each value of +the index array selects one row from the array being indexed and the +resultant array has the resulting shape (size of row, number index +elements). -An example of where this may be useful is for a color lookup table where we want to map -the values of an image into RGB triples for display. The lookup table could have a shape -(nlookup, 3). Indexing such an array with an image with shape (ny, nx) with dtype=np.uint8 -(or any integer type so long as values are with the bounds of the lookup table) will -result in an array of shape (ny, nx, 3) where a triple of RGB values is associated with -each pixel location. +An example of where this may be useful is for a color lookup table +where we want to map the values of an image into RGB triples for +display. The lookup table could have a shape (nlookup, 3). Indexing +such an array with an image with shape (ny, nx) with dtype=np.uint8 +(or any integer type so long as values are with the bounds of the +lookup table) will result in an array of shape (ny, nx, 3) where a +triple of RGB values is associated with each pixel location. -In general, the shape of the resulant array will be the concatenation of the shape of -the index array (or the shape that all the index arrays were broadcast to) with the -shape of any unused dimensions (those not indexed) in the array being indexed. +In general, the shape of the resulant array will be the concatenation +of the shape of the index array (or the shape that all the index arrays +were broadcast to) with the shape of any unused dimensions (those not +indexed) in the array being indexed. Boolean or "mask" index arrays ============================== -Boolean arrays used as indices are treated in a different manner entirely than index -arrays. Boolean arrays must be of the same shape as the array being indexed, or -broadcastable to the same shape. In the most straightforward case, the boolean array -has the same shape: :: +Boolean arrays used as indices are treated in a different manner +entirely than index arrays. Boolean arrays must be of the same shape +as the array being indexed, or broadcastable to the same shape. In the +most straightforward case, the boolean array has the same shape: :: >>> b = y>20 >>> y[b] array([21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34]) -The result is a 1-D array containing all the elements in the indexed array corresponding -to all the true elements in the boolean array. As with index arrays, what is returned -is a copy of the data, not a view as one gets with slices. +The result is a 1-D array containing all the elements in the indexed +array corresponding to all the true elements in the boolean array. As +with index arrays, what is returned is a copy of the data, not a view +as one gets with slices. -With broadcasting, multidimesional arrays may be the result. For example: :: +With broadcasting, multidimensional arrays may be the result. For +example: :: >>> b[:,5] # use a 1-D boolean that broadcasts with y array([False, False, False, True, True], dtype=bool) @@ -235,8 +243,8 @@ array([[21, 22, 23, 24, 25, 26, 27], [28, 29, 30, 31, 32, 33, 34]]) -Here the 4th and 5th rows are selected from the indexed array and combined to make a -2-D array. +Here the 4th and 5th rows are selected from the indexed array and +combined to make a 2-D array. Combining index arrays with slices ================================== @@ -248,8 +256,9 @@ [15, 16], [29, 30]]) -In effect, the slice is converted to an index array np.array([[1,2]]) (shape (1,2)) that is -broadcast with the index array to produce a resultant array of shape (3,2). +In effect, the slice is converted to an index array +np.array([[1,2]]) (shape (1,2)) that is broadcast with the index array +to produce a resultant array of shape (3,2). Likewise, slicing can be combined with broadcasted boolean indices: :: @@ -322,7 +331,8 @@ >>> x[1] 1 >>> x[1] = 1.2j - : can't convert complex to long; use long(abs(z)) + : can't convert complex to long; use + long(abs(z)) Unlike some of the references (such as array and mask indices) @@ -331,7 +341,12 @@ actions may not work as one may naively expect. This particular example is often surprising to people: :: + >>> x = np.arange(0, 50, 10) + >>> x + array([ 0, 10, 20, 30, 40]) >>> x[np.array([1, 1, 3, 1])] += 1 + >>> x + array([ 0, 11, 20, 31, 40]) Where people expect that the 1st location will be incremented by 3. In fact, it will only be incremented by 1. The reason is because @@ -367,7 +382,8 @@ >>> z[indices] array([39, 40]) -Likewise, ellipsis can be specified by code by using the Ellipsis object: :: +Likewise, ellipsis can be specified by code by using the Ellipsis +object: :: >>> indices = (1, Ellipsis, 1) # same as [1,...,1] >>> z[indices] @@ -376,10 +392,11 @@ [46, 49, 52]]) For this reason it is possible to use the output from the np.where() -function directly as an index since it always returns a tuple of index arrays. +function directly as an index since it always returns a tuple of index +arrays. -Because the special treatment of tuples, they are not automatically converted -to an array as a list would be. As an example: :: +Because the special treatment of tuples, they are not automatically +converted to an array as a list would be. As an example: :: >>> z[[1,1,1,1]] # produces a large array array([[[[27, 28, 29], Modified: trunk/numpy/doc/misc.py =================================================================== --- trunk/numpy/doc/misc.py 2010-02-17 23:42:42 UTC (rev 8126) +++ trunk/numpy/doc/misc.py 2010-02-17 23:53:04 UTC (rev 8127) @@ -30,8 +30,8 @@ isfinite(): True if not nan or inf nan_to_num(): Map nan to 0, inf to max float, -inf to min float -The following corresponds to the usual functions except that nans are excluded from -the results: :: +The following corresponds to the usual functions except that nans are excluded +from the results: :: nansum() nanmax() @@ -160,7 +160,8 @@ - Minuses: - - can't use for writing code to be turned into C extensions, only a wrapper tool. + - can't use for writing code to be turned into C extensions, only a wrapper + tool. 5) SWIG (automatic wrapper generator) @@ -174,11 +175,11 @@ - Minuses: - generates lots of code between Python and the C code - - - can cause performance problems that are nearly impossible to optimize out - + - can cause performance problems that are nearly impossible to optimize + out - interface files can be hard to write - - doesn't necessarily avoid reference counting issues or needing to know API's + - doesn't necessarily avoid reference counting issues or needing to know + API's 7) Weave @@ -187,8 +188,8 @@ - Phenomenal tool - can turn many numpy expressions into C code - dynamic compiling and loading of generated C code - - can embed pure C code in Python module and have weave extract, generate interfaces - and compile, etc. + - can embed pure C code in Python module and have weave extract, generate + interfaces and compile, etc. - Minuses: @@ -198,7 +199,8 @@ - Plusses: - - Turns pure python into efficient machine code through jit-like optimizations + - Turns pure python into efficient machine code through jit-like + optimizations - very fast when it optimizes well - Minuses: @@ -208,15 +210,15 @@ Interfacing to Fortran: ----------------------- -Fortran: Clear choice is f2py. (Pyfort is an older alternative, but not supported -any longer) +Fortran: Clear choice is f2py. (Pyfort is an older alternative, but not +supported any longer) Interfacing to C++: ------------------- -1) CXX -2) Boost.python -3) SWIG -4) Sage has used cython to wrap C++ (not pretty, but it can be done) -5) SIP (used mainly in PyQT) + 1) CXX + 2) Boost.python + 3) SWIG + 4) Sage has used cython to wrap C++ (not pretty, but it can be done) + 5) SIP (used mainly in PyQT) """ Modified: trunk/numpy/doc/ufuncs.py =================================================================== --- trunk/numpy/doc/ufuncs.py 2010-02-17 23:42:42 UTC (rev 8126) +++ trunk/numpy/doc/ufuncs.py 2010-02-17 23:53:04 UTC (rev 8127) @@ -13,12 +13,11 @@ >>> np.array([0,2,3,4]) + np.array([1,1,-1,2]) array([1, 3, 2, 6]) -The unfunc module lists all the available ufuncs in numpy. Additional ufuncts -available in xxx in scipy. Documentation on the specific ufuncs may be found -in those modules. This documentation is intended to address the more general -aspects of unfuncs common to most of them. All of the ufuncs that make use of -Python operators (e.g., +, -, etc.) have equivalent functions defined -(e.g. add() for +) +The unfunc module lists all the available ufuncs in numpy. Documentation on +the specific ufuncs may be found in those modules. This documentation is +intended to address the more general aspects of unfuncs common to most of +them. All of the ufuncs that make use of Python operators (e.g., +, -, etc.) +have equivalent functions defined (e.g. add() for +) Type coercion ============= @@ -58,10 +57,10 @@ ufunc methods ============= -Binary ufuncs support 4 methods. These methods are explained in detail in xxx -(or are they, I don't see anything in the ufunc docstring that is useful?). +Binary ufuncs support 4 methods. -**.reduce(arr)** applies the binary operator to elements of the array in sequence. For example: :: +**.reduce(arr)** applies the binary operator to elements of the array in + sequence. For example: :: >>> np.add.reduce(np.arange(10)) # adds all elements of array 45 @@ -76,22 +75,25 @@ >>> np.add.reduce(np.arange(10).reshape(2,5),axis=1) array([10, 35]) -**.accumulate(arr)** applies the binary operator and generates an an equivalently -shaped array that includes the accumulated amount for each element of the -array. A couple examples: :: +**.accumulate(arr)** applies the binary operator and generates an an +equivalently shaped array that includes the accumulated amount for each +element of the array. A couple examples: :: >>> np.add.accumulate(np.arange(10)) array([ 0, 1, 3, 6, 10, 15, 21, 28, 36, 45]) >>> np.multiply.accumulate(np.arange(1,9)) array([ 1, 2, 6, 24, 120, 720, 5040, 40320]) -The behavior for multidimensional arrays is the same as for .reduce(), as is the use of the axis keyword). +The behavior for multidimensional arrays is the same as for .reduce(), +as is the use of the axis keyword). -**.reduceat(arr,indices)** allows one to apply reduce to selected parts of an array. -It is a difficult method to understand. See the documentation at: +**.reduceat(arr,indices)** allows one to apply reduce to selected parts + of an array. It is a difficult method to understand. See the documentation + at: -**.outer(arr1,arr2)** generates an outer operation on the two arrays arr1 and arr2. It will work on multidimensional arrays (the shape of the result is the -concatenation of the two input shapes.: :: +**.outer(arr1,arr2)** generates an outer operation on the two arrays arr1 and + arr2. It will work on multidimensional arrays (the shape of the result is + the concatenation of the two input shapes.: :: >>> np.multiply.outer(np.arange(3),np.arange(4)) array([[0, 0, 0, 0], @@ -101,14 +103,14 @@ Output arguments ================ -All ufuncs accept an optional output array. The array must be of the expected output shape. Beware that if the type of the output array is of a -different (and lower) type than the output result, the results may be silently -truncated or otherwise corrupted in the downcast to the lower type. This usage -is useful when one wants to avoid creating large temporary arrays and instead -allows one to reuse the same array memory repeatedly (at the expense of not -being able to use more convenient operator notation in expressions). Note that -when the output argument is used, the ufunc still returns a reference to the -result. +All ufuncs accept an optional output array. The array must be of the expected +output shape. Beware that if the type of the output array is of a different +(and lower) type than the output result, the results may be silently truncated +or otherwise corrupted in the downcast to the lower type. This usage is useful +when one wants to avoid creating large temporary arrays and instead allows one +to reuse the same array memory repeatedly (at the expense of not being able to +use more convenient operator notation in expressions). Note that when the +output argument is used, the ufunc still returns a reference to the result. >>> x = np.arange(2) >>> np.add(np.arange(2),np.arange(2.),x) Modified: trunk/numpy/lib/financial.py =================================================================== --- trunk/numpy/lib/financial.py 2010-02-17 23:42:42 UTC (rev 8126) +++ trunk/numpy/lib/financial.py 2010-02-17 23:53:04 UTC (rev 8127) @@ -206,7 +206,7 @@ def nper(rate, pmt, pv, fv=0, when='end'): """ - Compute the number of periods. + Compute the number of periodic payments. Parameters ---------- @@ -225,16 +225,16 @@ ----- The number of periods ``nper`` is computed by solving the equation:: - fv + pv*(1+rate)**nper + pmt*(1+rate*when)/rate * ((1+rate)**nper - 1) == 0 + fv + pv*(1+rate)**nper + pmt*(1+rate*when)/rate*((1+rate)**nper-1) = 0 - or, when ``rate == 0``:: + but if ``rate = 0`` then:: - fv + pv + pmt * nper == 0 + fv + pv + pmt*nper = 0 Examples -------- - If you only had $150 to spend as payment, how long would it take to pay-off - a loan of $8,000 at 7% annual interest? + If you only had $150/month to pay towards the loan, how long would it take + to pay-off a loan of $8,000 at 7% annual interest? >>> np.nper(0.07/12, -150, 8000) 64.073348770661852 @@ -244,11 +244,13 @@ The same analysis could be done with several different interest rates and/or payments and/or total amounts to produce an entire table. - >>> np.nper(*(np.ogrid[0.06/12:0.071/12:0.01/12, -200:-99:100, 6000:7001:1000])) - array([[[ 32.58497782, 38.57048452], - [ 71.51317802, 86.37179563]], - [[ 33.07413144, 39.26244268], - [ 74.06368256, 90.22989997]]]) + >>> np.nper(*(np.ogrid[0.07/12: 0.08/12: 0.01/12, + ... -150 : -99 : 50 , + ... 8000 : 9001 : 1000])) + array([[[ 64.07334877, 74.06368256], + [ 108.07548412, 127.99022654]], + [[ 66.12443902, 76.87897353], + [ 114.70165583, 137.90124779]]]) """ when = _convert_when(when) Modified: trunk/numpy/lib/function_base.py =================================================================== --- trunk/numpy/lib/function_base.py 2010-02-17 23:42:42 UTC (rev 8126) +++ trunk/numpy/lib/function_base.py 2010-02-17 23:53:04 UTC (rev 8127) @@ -1366,25 +1366,21 @@ def nanmin(a, axis=None): """ - Return the minimum of array elements over the given axis ignoring any NaNs. + Return the minimum of an array or minimum along an axis ignoring any NaNs. Parameters ---------- a : array_like - Array containing numbers whose sum is desired. If `a` is not - an array, a conversion is attempted. + Array containing numbers whose minimum is desired. axis : int, optional Axis along which the minimum is computed.The default is to compute the minimum of the flattened array. Returns ------- - y : {ndarray, scalar} - An array with the same shape as `a`, with the specified axis removed. - If `a` is a 0-d array, or if axis is None, a scalar is returned. The - the same dtype as `a` is returned. + nanmin : ndarray + A new array or a scalar array with the result. - See Also -------- numpy.amin : Minimum across array including any Not a Numbers. @@ -1461,7 +1457,7 @@ def nanmax(a, axis=None): """ - Return the maximum of array elements over the given axis ignoring any NaNs. + Return the maximum of an array or maximum along an axis ignoring any NaNs. Parameters ---------- @@ -1469,15 +1465,15 @@ Array containing numbers whose maximum is desired. If `a` is not an array, a conversion is attempted. axis : int, optional - Axis along which the maximum is computed.The default is to compute + Axis along which the maximum is computed. The default is to compute the maximum of the flattened array. Returns ------- - y : ndarray + nanmax : ndarray An array with the same shape as `a`, with the specified axis removed. - If `a` is a 0-d array, or if axis is None, a scalar is returned. The - the same dtype as `a` is returned. + If `a` is a 0-d array, or if axis is None, a ndarray scalar is + returned. The the same dtype as `a` is returned. See Also -------- Modified: trunk/numpy/lib/io.py =================================================================== --- trunk/numpy/lib/io.py 2010-02-17 23:42:42 UTC (rev 8126) +++ trunk/numpy/lib/io.py 2010-02-17 23:53:04 UTC (rev 8127) @@ -306,9 +306,11 @@ Parameters ---------- - file : file or string - File or filename to which the data is saved. If the filename - does not already have a ``.npy`` extension, it is added. + file : file or str + File or filename to which the data is saved. If file is a file-object, + then the filename is unchanged. If file is a string, a ``.npy`` + extension will be appended to the file name if it does not already + have one. arr : array_like Array data to be saved. @@ -329,7 +331,7 @@ >>> x = np.arange(10) >>> np.save(outfile, x) - >>> outfile.seek(0) # only necessary in this example (with tempfile) + >>> outfile.seek(0) # Only needed here to simulate closing & reopening file >>> np.load(outfile) array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) @@ -348,26 +350,30 @@ """ Save several arrays into a single, compressed file in ``.npz`` format. - If keyword arguments are given, the names for variables assigned to the - keywords are the keyword names (not the variable names in the caller). If arguments are passed in with no keywords, the corresponding variable - names are arr_0, arr_1, etc. + names, in the .npz file, are 'arr_0', 'arr_1', etc. If keyword arguments + are given, the corresponding variable names, in the ``.npz`` file will + match the keyword names. Parameters ---------- file : str or file Either the file name (string) or an open file (file-like object) - If file is a string, it names the output file. ".npz" will be appended - to the file name if it is not already there. - args : Arguments - Any function arguments other than the file name are variables to save. - Since it is not possible for Python to know their names outside - `savez`, they will be saved with names "arr_0", "arr_1", and so on. - These arguments can be any expression. - kwds : Keyword arguments - All keyword=value pairs cause the value to be saved with the name of - the keyword. + where the data will be saved. If file is a string, the ``.npz`` + extension will be appended to the file name if it is not already there. + \\*args : Arguments, optional + Arrays to save to the file. Since it is not possible for Python to + know the names of the arrays outside `savez`, the arrays will be saved + with names "arr_0", "arr_1", and so on. These arguments can be any + expression. + \\*\\*kwds : Keyword arguments, optional + Arrays to save to the file. Arrays will be saved in the file with the + keyword names. + Returns + ------- + None + See Also -------- save : Save a single array to a binary file in NumPy format. @@ -379,6 +385,11 @@ variables they contain. Each file contains one variable in ``.npy`` format. For a description of the ``.npy`` format, see `format`. + When opening the saved ``.npz`` file with `load` a `NpzFile` object is + returned. This is a dictionary-like object which can be queried for + its list of arrays (with the ``.files`` attribute), and for the arrays + themselves. + Examples -------- >>> from tempfile import TemporaryFile @@ -389,11 +400,11 @@ Using `savez` with \\*args, the arrays are saved with default names. >>> np.savez(outfile, x, y) - >>> outfile.seek(0) # only necessary in this example (with tempfile) - >>> npz = np.load(outfile) - >>> npz.files + >>> outfile.seek(0) # Only needed here to simulate closing & reopening file + >>> npzfile = np.load(outfile) + >>> npzfile.files ['arr_1', 'arr_0'] - >>> npz['arr_0'] + >>> npzfile['arr_0'] array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) Using `savez` with \\*\\*kwds, the arrays are saved with the keyword names. @@ -401,10 +412,10 @@ >>> outfile = TemporaryFile() >>> np.savez(outfile, x=x, y=y) >>> outfile.seek(0) - >>> npz = np.load(outfile) - >>> npz.files + >>> npzfile = np.load(outfile) + >>> npzfile.files ['y', 'x'] - >>> npz['x'] + >>> npzfile['x'] array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) """ @@ -510,8 +521,15 @@ See Also -------- load, fromstring, fromregex + genfromtxt : Load data with missing values handled as specified. scipy.io.loadmat : reads Matlab(R) data files + Notes + ----- + This function aims to be a fast reader for simply formatted files. The + `genfromtxt` function provides more sophisticated handling of, e.g., + lines with missing values. + Examples -------- >>> from StringIO import StringIO # StringIO behaves like a file object Modified: trunk/numpy/lib/shape_base.py =================================================================== --- trunk/numpy/lib/shape_base.py 2010-02-17 23:42:42 UTC (rev 8126) +++ trunk/numpy/lib/shape_base.py 2010-02-17 23:53:04 UTC (rev 8127) @@ -301,7 +301,7 @@ Stack arrays in sequence depth wise (along third axis). Takes a sequence of arrays and stack them along the third axis - to make a single array. Rebuilds arrays divided by ``dsplit``. + to make a single array. Rebuilds arrays divided by `dsplit`. This is a simple way to stack 2D arrays (images) into a single 3D array for processing. @@ -325,7 +325,7 @@ Notes ----- - Equivalent to ``np.concatenate(tup, axis=2)`` + Equivalent to ``np.concatenate(tup, axis=2)``. Examples -------- @@ -420,7 +420,7 @@ If `indices_or_sections` is a 1-D array of sorted integers, the entries indicate where along `axis` the array is split. For example, - ``[2, 3]`` would, for ``axis = 0``, result in + ``[2, 3]`` would, for ``axis=0``, result in - ary[:2] - ary[2:3] @@ -483,8 +483,8 @@ """ Split an array into multiple sub-arrays horizontally (column-wise). - Please refer to the ``split`` documentation. ``hsplit`` is equivalent - to ``split`` with `axis=1`, the array is always split along the second + Please refer to the `split` documentation. `hsplit` is equivalent + to `split` with ``axis=1``, the array is always split along the second axis regardless of the array dimension. See Also @@ -596,8 +596,8 @@ """ Split array into multiple sub-arrays along the 3rd axis (depth). - Please refer to the ``split`` documentation. ``dsplit`` is equivalent - to ``split`` with `axis=2`, the array is always split along the third + Please refer to the `split` documentation. `dsplit` is equivalent + to `split` with ``axis=2``, the array is always split along the third axis provided the array dimension is greater than or equal to 3. See Also Modified: trunk/numpy/linalg/linalg.py =================================================================== --- trunk/numpy/linalg/linalg.py 2010-02-17 23:42:42 UTC (rev 8126) +++ trunk/numpy/linalg/linalg.py 2010-02-17 23:53:04 UTC (rev 8127) @@ -1175,34 +1175,38 @@ """ Singular Value Decomposition. - Factors the matrix `a` into ``u * np.diag(s) * v.H``, where `u` and `v` - are unitary (i.e., ``u.H = inv(u)`` and similarly for `v`), ``.H`` is the - conjugate transpose operator (which is the ordinary transpose for - real-valued matrices), and `s` is a 1-D array of `a`'s singular values. + Factors the matrix ``a`` into ``u * np.diag(s) * v``, where ``u`` and + ``v`` are unitary (i.e., ``u.H = inv(u)`` and similarly for ``v``) and + ``s`` is a 1-D array of ``a``'s singular values. Note that, in the + literature, it is common to see this decomposition expressed as (in + NumPy notation) ``a = u * np.diag(s) * v.H``, whereas the ``v`` this + function returns is such that ``a`` would be reconstructed as above; in + other words, "our" ``v`` is the Hermitian (conjugate transpose) of that + commonly seen in the literature. Parameters ---------- a : array_like Matrix of shape ``(M, N)`` to decompose. full_matrices : bool, optional - If True (default), ``u`` and ``v.H`` have the shapes - ``(M, M)`` and ``(N, N)``, respectively. Otherwise, the shapes - are ``(M, K)`` and ``(K, N)``, resp., where ``K = min(M, N)``. + If True (default), ``u`` and ``v`` have the shapes ``(M, M)`` + and ``(N, N)``, respectively. Otherwise, the shapes are ``(M, K)`` + and ``(K, N)``, resp., where ``K = min(M, N)``. compute_uv : bool, optional - Whether or not to compute ``u`` and ``v.H`` in addition to ``s``. + Whether or not to compute ``u`` and ``v`` in addition to ``s``. True by default. Returns ------- u : ndarray - Unitary matrix. The shape of `U` is ``(M, M)`` or ``(M, K)`` - depending on value of `full_matrices`. + Unitary matrix. The shape of ``U`` is ``(M, M)`` or ``(M, K)`` + depending on value of ``full_matrices``. s : ndarray The singular values, sorted so that ``s[i] >= s[i+1]``. - `S` is a 1-D array of length ``min(M, N)`` - v.H : ndarray + ``S`` is a 1-D array of length ``min(M, N)`` + v : ndarray Unitary matrix of shape ``(N, N)`` or ``(K, N)``, depending - on `full_matrices`. + on ``full_matrices``. Raises ------ @@ -1211,21 +1215,21 @@ Notes ----- - If `a` is a matrix object (as opposed to an `ndarray`), then so are all - the return values. + If ``a`` is a matrix object (as opposed to an `ndarray`), then so are + all the return values. Examples -------- >>> a = np.random.randn(9, 6) + 1j*np.random.randn(9, 6) - >>> U, s, Vh = np.linalg.svd(a) - >>> U.shape, Vh.shape, s.shape + >>> U, s, V = np.linalg.svd(a) + >>> U.shape, V.shape, s.shape ((9, 9), (6, 6), (6,)) - >>> U, s, Vh = np.linalg.svd(a, full_matrices=False) - >>> U.shape, Vh.shape, s.shape + >>> U, s, V = np.linalg.svd(a, full_matrices=False) + >>> U.shape, V.shape, s.shape ((9, 6), (6, 6), (6,)) >>> S = np.diag(s) - >>> np.allclose(a, np.dot(U, np.dot(S, Vh))) + >>> np.allclose(a, np.dot(U, np.dot(S, V))) True >>> s2 = np.linalg.svd(a, compute_uv=False) Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2010-02-17 23:42:42 UTC (rev 8126) +++ trunk/numpy/ma/core.py 2010-02-17 23:53:04 UTC (rev 8127) @@ -545,6 +545,10 @@ a : ndarray The filled array. + See Also + -------- + compressed + Examples -------- >>> x = np.ma.array(np.arange(9).reshape(3, 3), mask=[[1, 0, 0], Modified: trunk/numpy/polynomial/__init__.py =================================================================== --- trunk/numpy/polynomial/__init__.py 2010-02-17 23:42:42 UTC (rev 8126) +++ trunk/numpy/polynomial/__init__.py 2010-02-17 23:53:04 UTC (rev 8127) @@ -1,3 +1,18 @@ +""" +A sub-package for efficiently dealing with polynomials. + +Within the documentation for this sub-package, a "finite power series," +i.e., a polynomial (also referred to simply as a "series") is represented +by a 1-D numpy array of the polynomial's coefficients, ordered from lowest +order term to highest. For example, array([1,2,3]) represents +``P_0 + 2*P_1 + 3*P_2``, where P_n is the n-th order basis polynomial +applicable to the specific module in question, e.g., `polynomial` (which +"wraps" the "standard" basis) or `chebyshev`. For optimal performance, +all operations on polynomials, including evaluation at an argument, are +implemented as operations on the coefficients. Additional (module-specific) +information can be found in the docstring for the module of interest. + +""" from polynomial import * from chebyshev import * from polyutils import * Modified: trunk/numpy/polynomial/chebyshev.py =================================================================== --- trunk/numpy/polynomial/chebyshev.py 2010-02-17 23:42:42 UTC (rev 8126) +++ trunk/numpy/polynomial/chebyshev.py 2010-02-17 23:53:04 UTC (rev 8127) @@ -1,50 +1,58 @@ -"""Functions for dealing with Chebyshev series. +""" +Objects for dealing with Chebyshev series. -This module provide s a number of functions that are useful in dealing with -Chebyshev series as well as a ``Chebyshev`` class that encapsuletes the usual -arithmetic operations. All the Chebyshev series are assumed to be ordered -from low to high, thus ``array([1,2,3])`` will be treated as the series -``T_0 + 2*T_1 + 3*T_2`` +This module provides a number of objects (mostly functions) useful for +dealing with Chebyshev series, including a `Chebyshev` class that +encapsulates the usual arithmetic operations. (General information +on how this module represents and works with such polynomials is in the +docstring for its "parent" sub-package, `numpy.polynomial`). Constants --------- -- chebdomain -- Chebyshev series default domain -- chebzero -- Chebyshev series that evaluates to 0. -- chebone -- Chebyshev series that evaluates to 1. -- chebx -- Chebyshev series of the identity map (x). +- `chebdomain` -- Chebyshev series default domain, [-1,1]. +- `chebzero` -- (Coefficients of the) Chebyshev series that evaluates + identically to 0. +- `chebone` -- (Coefficients of the) Chebyshev series that evaluates + identically to 1. +- `chebx` -- (Coefficients of the) Chebyshev series for the identity map, + ``f(x) = x``. Arithmetic ---------- -- chebadd -- add a Chebyshev series to another. -- chebsub -- subtract a Chebyshev series from another. -- chebmul -- multiply a Chebyshev series by another -- chebdiv -- divide one Chebyshev series by another. -- chebval -- evaluate a Chebyshev series at given points. +- `chebadd` -- add two Chebyshev series. +- `chebsub` -- subtract one Chebyshev series from another. +- `chebmul` -- multiply two Chebyshev series. +- `chebdiv` -- divide one Chebyshev series by another. +- `chebval` -- evaluate a Chebyshev series at given points. Calculus -------- -- chebder -- differentiate a Chebyshev series. -- chebint -- integrate a Chebyshev series. +- `chebder` -- differentiate a Chebyshev series. +- `chebint` -- integrate a Chebyshev series. Misc Functions -------------- -- chebfromroots -- create a Chebyshev series with specified roots. -- chebroots -- find the roots of a Chebyshev series. -- chebvander -- Vandermode like matrix for Chebyshev polynomials. -- chebfit -- least squares fit returning a Chebyshev series. -- chebtrim -- trim leading coefficients from a Chebyshev series. -- chebline -- Chebyshev series of given straight line -- cheb2poly -- convert a Chebyshev series to a polynomial. -- poly2cheb -- convert a polynomial to a Chebyshev series. +- `chebfromroots` -- create a Chebyshev series with specified roots. +- `chebroots` -- find the roots of a Chebyshev series. +- `chebvander` -- Vandermonde-like matrix for Chebyshev polynomials. +- `chebfit` -- least-squares fit returning a Chebyshev series. +- `chebtrim` -- trim leading coefficients from a Chebyshev series. +- `chebline` -- Chebyshev series of given straight line. +- `cheb2poly` -- convert a Chebyshev series to a polynomial. +- `poly2cheb` -- convert a polynomial to a Chebyshev series. Classes ------- -- Chebyshev -- Chebyshev series class. +- `Chebyshev` -- A Chebyshev series class. +See also +-------- +`numpy.polynomial` + Notes ----- The implementations of multiplication, division, integration, and -differentiation use the algebraic identities: +differentiation use the algebraic identities [1]_: .. math :: T_n(x) = \\frac{z^n + z^{-n}}{2} \\\\ @@ -55,9 +63,15 @@ .. math :: x = \\frac{z + z^{-1}}{2}. These identities allow a Chebyshev series to be expressed as a finite, -symmetric Laurent series. These sorts of Laurent series are referred to as -z-series in this module. +symmetric Laurent series. In this module, this sort of Laurent series +is referred to as a "z-series." +References +---------- +.. [1] A. T. Benjamin, et al., "Combinatorial Trigonometry with Chebyshev + Polynomials," *Journal of Statistical Planning and Inference 14*, 2008 + (preprint: http://www.math.hmc.edu/~benjamin/papers/CombTrig.pdf, pg. 4) + """ from __future__ import division @@ -289,20 +303,24 @@ def poly2cheb(pol) : - """Convert a polynomial to a Chebyshev series. + """ + poly2cheb(pol) - Convert a series containing polynomial coefficients ordered by degree - from low to high to an equivalent Chebyshev series ordered from low to - high. + Convert a polynomial to a Chebyshev series. - Inputs - ------ + Convert an array representing the coefficients of a polynomial (relative + to the "standard" basis) ordered from lowest degree to highest, to an + array of the coefficients of the equivalent Chebyshev series, ordered + from lowest to highest degree. + + Parameters + ---------- pol : array_like - 1-d array containing the polynomial coeffients + 1-d array containing the polynomial coefficients Returns ------- - cseries : ndarray + cs : ndarray 1-d array containing the coefficients of the equivalent Chebyshev series. @@ -310,6 +328,23 @@ -------- cheb2poly + Notes + ----- + Note that a consequence of the input needing to be array_like and that + the output is an ndarray, is that if one is going to use this function + to convert a Polynomial instance, P, to a Chebyshev instance, T, the + usage is ``T = Chebyshev(poly2cheb(P.coef))``; see Examples below. + + Examples + -------- + >>> from numpy import polynomial as P + >>> p = P.Polynomial(np.arange(4)) + >>> p + Polynomial([ 0., 1., 2., 3.], [-1., 1.]) + >>> c = P.Chebyshev(P.poly2cheb(p.coef)) + >>> c + Chebyshev([ 1. , 3.25, 1. , 0.75], [-1., 1.]) + """ [pol] = pu.as_series([pol]) pol = pol[::-1] @@ -322,28 +357,50 @@ def cheb2poly(cs) : - """Convert a Chebyshev series to a polynomial. + """ + cheb2poly(cs) - Covert a series containing Chebyshev series coefficients orderd from - low to high to an equivalent polynomial ordered from low to - high by degree. + Convert a Chebyshev series to a polynomial. - Inputs - ------ + Convert an array representing the coefficients of a Chebyshev series, + ordered from lowest degree to highest, to an array of the coefficients + of the equivalent polynomial (relative to the "standard" basis) ordered + from lowest to highest degree. + + Parameters + ---------- cs : array_like - 1-d array containing the Chebyshev series coeffients ordered from - low to high. + 1-d array containing the Chebyshev series coefficients, ordered + from lowest order term to highest. Returns ------- pol : ndarray 1-d array containing the coefficients of the equivalent polynomial - ordered from low to high by degree. + (relative to the "standard" basis) ordered from lowest order term + to highest. See Also -------- poly2cheb + Notes + ----- + Note that a consequence of the input needing to be array_like and that + the output is an ndarray, is that if one is going to use this function + to convert a Chebyshev instance, T, to a Polynomial instance, P, the + usage is ``P = Polynomial(cheb2poly(T.coef))``; see Examples below. + + Examples + -------- + >>> from numpy import polynomial as P + >>> c = P.Chebyshev(np.arange(4)) + >>> c + Chebyshev([ 0., 1., 2., 3.], [-1., 1.]) + >>> p = P.Polynomial(P.cheb2poly(c.coef)) + >>> p + Polynomial([ -2., -8., 4., 12.], [-1., 1.]) + """ [cs] = pu.as_series([cs]) pol = np.zeros(len(cs), dtype=cs.dtype) @@ -373,20 +430,34 @@ chebx = np.array([0,1]) def chebline(off, scl) : - """Chebyshev series whose graph is a straight line + """ + Chebyshev series whose graph is a straight line. - The line has the formula ``off + scl*x`` - Parameters: - ----------- + + Parameters + ---------- off, scl : scalars The specified line is given by ``off + scl*x``. - Returns: + Returns + ------- + y : ndarray + This module's representation of the Chebyshev series for + ``off + scl*x``. + + See Also -------- - series : 1d ndarray - The Chebyshev series representation of ``off + scl*x``. + polyline + Examples + -------- + >>> import numpy.polynomial.chebyshev as C + >>> C.chebline(3,2) + array([3, 2]) + >>> C.chebval(-3, C.chebline(3,2)) # should be -3 + -3.0 + """ if scl != 0 : return np.array([off,scl]) @@ -394,26 +465,56 @@ return np.array([off]) def chebfromroots(roots) : - """Generate a Chebyschev series with given roots. + """ + Generate a Chebyshev series with the given roots. - Generate a Chebyshev series whose roots are given by `roots`. The - resulting series is the produet `(x - roots[0])*(x - roots[1])*...` + Return the array of coefficients for the C-series whose roots (a.k.a. + "zeros") are given by *roots*. The returned array of coefficients is + ordered from lowest order "term" to highest, and zeros of multiplicity + greater than one must be included in *roots* a number of times equal + to their multiplicity (e.g., if `2` is a root of multiplicity three, + then [2,2,2] must be in *roots*). - Inputs - ------ + Parameters + ---------- roots : array_like - 1-d array containing the roots in sorted order. + Sequence containing the roots. Returns ------- - series : ndarray - 1-d array containing the coefficients of the Chebeshev series - ordered from low to high. + out : ndarray + 1-d array of the C-series' coefficients, ordered from low to + high. If all roots are real, ``out.dtype`` is a float type; + otherwise, ``out.dtype`` is a complex type, even if all the + coefficients in the result are real (see Examples below). See Also -------- - chebroots + polyfromroots + Notes + ----- + What is returned are the :math:`c_i` such that: + + .. math:: + + \\sum_{i=0}^{n} c_i*T_i(x) = \\prod_{i=0}^{n} (x - roots[i]) + + where ``n == len(roots)`` and :math:`T_i(x)` is the `i`-th Chebyshev + (basis) polynomial over the domain `[-1,1]`. Note that, unlike + `polyfromroots`, due to the nature of the C-series basis set, the + above identity *does not* imply :math:`c_n = 1` identically (see + Examples). + + Examples + -------- + >>> import numpy.polynomial.chebyshev as C + >>> C.chebfromroots((-1,0,1)) # x^3 - x relative to the standard basis + array([ 0. , -0.25, 0. , 0.25]) + >>> j = complex(0,1) + >>> C.chebfromroots((-j,j)) # x^2 + 1 relative to the standard basis + array([ 1.5+0.j, 0.0+0.j, 0.5+0.j]) + """ if len(roots) == 0 : return np.ones(1) @@ -427,27 +528,43 @@ def chebadd(c1, c2): - """Add one Chebyshev series to another. + """ + Add one Chebyshev series to another. - Returns the sum of two Chebyshev series `c1` + `c2`. The arguments are - sequences of coefficients ordered from low to high, i.e., [1,2,3] is - the series "T_0 + 2*T_1 + 3*T_2". + Returns the sum of two Chebyshev series `c1` + `c2`. The arguments + are sequences of coefficients ordered from lowest order term to + highest, i.e., [1,2,3] represents the series ``T_0 + 2*T_1 + 3*T_2``. Parameters ---------- c1, c2 : array_like - 1d arrays of Chebyshev series coefficients ordered from low to + 1-d arrays of Chebyshev series coefficients ordered from low to high. Returns ------- out : ndarray - Chebyshev series of the sum. + Array representing the Chebyshev series of their sum. See Also -------- chebsub, chebmul, chebdiv, chebpow + Notes + ----- + Unlike multiplication, division, etc., the sum of two Chebyshev series + is a Chebyshev series (without having to "reproject" the result onto + the basis set) so addition, just like that of "standard" polynomials, + is simply "component-wise." + + Examples + -------- + >>> from numpy.polynomial import chebyshev as C + >>> c1 = (1,2,3) + >>> c2 = (3,2,1) + >>> C.chebadd(c1,c2) + array([ 4., 4., 4.]) + """ # c1, c2 are trimmed copies [c1, c2] = pu.as_series([c1, c2]) @@ -461,29 +578,44 @@ def chebsub(c1, c2): - """Subtract one Chebyshev series from another. + """ + Subtract one Chebyshev series from another. - Returns the difference of two Chebyshev series `c1` - `c2`. The - sequences of coefficients are ordered from low to high, i.e., [1,2,3] - is the series ``T_0 + 2*T_1 + 3*T_2.`` + Returns the difference of two Chebyshev series `c1` - `c2`. The + sequences of coefficients are from lowest order term to highest, i.e., + [1,2,3] represents the series ``T_0 + 2*T_1 + 3*T_2``. Parameters ---------- c1, c2 : array_like - 1d arrays of Chebyshev series coefficients ordered from low to + 1-d arrays of Chebyshev series coefficients ordered from low to high. Returns ------- out : ndarray - Chebyshev series of the difference. + Of Chebyshev series coefficients representing their difference. See Also -------- chebadd, chebmul, chebdiv, chebpow + Notes + ----- + Unlike multiplication, division, etc., the difference of two Chebyshev + series is a Chebyshev series (without having to "reproject" the result + onto the basis set) so subtraction, just like that of "standard" + polynomials, is simply "component-wise." + Examples -------- + >>> from numpy.polynomial import chebyshev as C + >>> c1 = (1,2,3) + >>> c2 = (3,2,1) + >>> C.chebsub(c1,c2) + array([-2., 0., 2.]) + >>> C.chebsub(c2,c1) # -C.chebsub(c1,c2) + array([ 2., 0., -2.]) """ # c1, c2 are trimmed copies @@ -499,27 +631,44 @@ def chebmul(c1, c2): - """Multiply one Chebyshev series by another. + """ + Multiply one Chebyshev series by another. - Returns the product of two Chebyshev series `c1` * `c2`. The arguments - are sequences of coefficients ordered from low to high, i.e., [1,2,3] - is the series ``T_0 + 2*T_1 + 3*T_2.`` + Returns the product of two Chebyshev series `c1` * `c2`. The arguments + are sequences of coefficients, from lowest order "term" to highest, + e.g., [1,2,3] represents the series ``T_0 + 2*T_1 + 3*T_2``. Parameters ---------- c1, c2 : array_like - 1d arrays of chebyshev series coefficients ordered from low to + 1-d arrays of Chebyshev series coefficients ordered from low to high. Returns ------- out : ndarray - Chebyshev series of the product. + Of Chebyshev series coefficients representing their product. See Also -------- chebadd, chebsub, chebdiv, chebpow + Notes + ----- + In general, the (polynomial) product of two C-series results in terms + that are not in the Chebyshev polynomial basis set. Thus, to express + the product as a C-series, it is typically necessary to "re-project" + the product onto said basis set, which typically produces + "un-intuitive" (but correct) results; see Examples section below. + + Examples + -------- + >>> from numpy.polynomial import chebyshev as C + >>> c1 = (1,2,3) + >>> c2 = (3,2,1) + >>> C.chebmul(c1,c2) # multiplication requires "reprojection" + array([ 6.5, 12. , 12. , 4. , 1.5]) + """ # c1, c2 are trimmed copies [c1, c2] = pu.as_series([c1, c2]) @@ -531,29 +680,49 @@ def chebdiv(c1, c2): - """Divide one Chebyshev series by another. + """ + Divide one Chebyshev series by another. - Returns the quotient of two Chebyshev series `c1` / `c2`. The arguments - are sequences of coefficients ordered from low to high, i.e., [1,2,3] - is the series ``T_0 + 2*T_1 + 3*T_2.`` + Returns the quotient-with-remainder of two Chebyshev series + `c1` / `c2`. The arguments are sequences of coefficients from lowest + order "term" to highest, e.g., [1,2,3] represents the series + ``T_0 + 2*T_1 + 3*T_2``. Parameters ---------- c1, c2 : array_like - 1d arrays of chebyshev series coefficients ordered from low to + 1-d arrays of Chebyshev series coefficients ordered from low to high. Returns ------- - [quo, rem] : ndarray - Chebyshev series of the quotient and remainder. + [quo, rem] : ndarrays + Of Chebyshev series coefficients representing the quotient and + remainder. See Also -------- chebadd, chebsub, chebmul, chebpow + Notes + ----- + In general, the (polynomial) division of one C-series by another + results in quotient and remainder terms that are not in the Chebyshev + polynomial basis set. Thus, to express these results as C-series, it + is typically necessary to "re-project" the results onto said basis + set, which typically produces "un-intuitive" (but correct) results; + see Examples section below. + Examples -------- + >>> from numpy.polynomial import chebyshev as C + >>> c1 = (1,2,3) + >>> c2 = (3,2,1) + >>> C.chebdiv(c1,c2) # quotient "intuitive," remainder not + (array([ 3.]), array([-8., -4.])) + >>> c2 = (0,1,2,3) + >>> C.chebdiv(c2,c1) # neither "intuitive" + (array([ 0., 2.]), array([-2., -4.])) """ # c1, c2 are trimmed copies @@ -627,24 +796,25 @@ return _zseries_to_cseries(prd) def chebder(cs, m=1, scl=1) : - """Differentiate a Chebyshev series. + """ + Differentiate a Chebyshev series. - Returns the series `cs` differentiated `m` times. At each iteration the - result is multiplied by `scl`. The scaling factor is for use in a - linear change of variable. The argument `cs` is a sequence of - coefficients ordered from low to high. i.e., [1,2,3] is the series + Returns the series `cs` differentiated `m` times. At each iteration the + result is multiplied by `scl` (the scaling factor is for use in a linear + change of variable). The argument `cs` is the sequence of coefficients + from lowest order "term" to highest, e.g., [1,2,3] represents the series ``T_0 + 2*T_1 + 3*T_2``. Parameters ---------- cs: array_like - 1d array of chebyshev series coefficients ordered from low to high. + 1-d array of Chebyshev series coefficients ordered from low to high. m : int, optional - Order of differentiation, must be non-negative. (default: 1) + Number of derivatives taken, must be non-negative. (Default: 1) scl : scalar, optional - The result of each derivation is multiplied by `scl`. The end - result is multiplication by `scl`**`m`. This is for use in a linear - change of variable. (default: 1) + Each differentiation is multiplied by `scl`. The end result is + multiplication by ``scl**m``. This is for use in a linear change of + variable. (Default: 1) Returns ------- @@ -655,8 +825,25 @@ -------- chebint + Notes + ----- + In general, the result of differentiating a C-series needs to be + "re-projected" onto the C-series basis set. Thus, typically, the + result of this function is "un-intuitive," albeit correct; see Examples + section below. + Examples -------- + >>> from numpy.polynomial import chebyshev as C + >>> cs = (1,2,3,4) + >>> C.chebder(cs) + array([ 14., 12., 24.]) + >>> C.chebder(cs,3) + array([ 96.]) + >>> C.chebder(cs,scl=-1) + array([-14., -12., -24.]) + >>> C.chebder(cs,2,-1) + array([ 12., 96.]) """ # cs is a trimmed copy @@ -678,49 +865,80 @@ def chebint(cs, m=1, k=[], lbnd=0, scl=1) : - """Integrate a Chebyshev series. + """ + Integrate a Chebyshev series. - Returns the series integrated from `lbnd` to x `m` times. At each - iteration the resulting series is multiplied by `scl` and an - integration constant specified by `k` is added. The scaling factor is - for use in a linear change of variable. The argument `cs` is a sequence - of coefficients ordered from low to high. i.e., [1,2,3] is the series - ``T_0 + 2*T_1 + 3*T_2``. + Returns, as a C-series, the input C-series `cs`, integrated `m` times + from `lbnd` to `x`. At each iteration the resulting series is + **multiplied** by `scl` and an integration constant, `k`, is added. + The scaling factor is for use in a linear change of variable. ("Buyer + beware": note that, depending on what one is doing, one may want `scl` + to be the reciprocal of what one might expect; for more information, + see the Notes section below.) The argument `cs` is a sequence of + coefficients, from lowest order C-series "term" to highest, e.g., + [1,2,3] represents the series :math:`T_0(x) + 2T_1(x) + 3T_2(x)`. - Parameters ---------- - cs: array_like - 1d array of chebyshev series coefficients ordered from low to high. + cs : array_like + 1-d array of C-series coefficients, ordered from low to high. m : int, optional - Order of integration, must be positeve. (default: 1) + Order of integration, must be positive. (Default: 1) k : {[], list, scalar}, optional - Integration constants. The value of the first integral at zero is - the first value in the list, the value of the second integral at - zero is the second value in the list, and so on. If ``[]`` - (default), all constants are set zero. If `m = 1`, a single scalar - can be given instead of a list. + Integration constant(s). The value of the first integral at zero + is the first value in the list, the value of the second integral + at zero is the second value, etc. If ``k == []`` (the default), + all constants are set to zero. If ``m == 1``, a single scalar can + be given instead of a list. lbnd : scalar, optional - The lower bound of the integral. (default: 0) + The lower bound of the integral. (Default: 0) scl : scalar, optional - Following each integration the result is multiplied by `scl` before - the integration constant is added. (default: 1) + Following each integration the result is *multiplied* by `scl` + before the integration constant is added. (Default: 1) Returns ------- - der : ndarray - Chebyshev series of the integral. + S : ndarray + C-series coefficients of the integral. Raises ------ ValueError + If ``m < 1``, ``len(k) > m``, ``np.isscalar(lbnd) == False``, or + ``np.isscalar(scl) == False``. See Also -------- chebder + Notes + ----- + Note that the result of each integration is *multiplied* by `scl`. + Why is this important to note? Say one is making a linear change of + variable :math:`u = ax + b` in an integral relative to `x`. Then + :math:`dx = du/a`, so one will need to set `scl` equal to :math:`1/a` + - perhaps not what one would have first thought. + + Also note that, in general, the result of integrating a C-series needs + to be "re-projected" onto the C-series basis set. Thus, typically, + the result of this function is "un-intuitive," albeit correct; see + Examples section below. + Examples -------- + >>> from numpy.polynomial import chebyshev as C + >>> cs = (1,2,3) + >>> C.chebint(cs) + array([ 0.5, -0.5, 0.5, 0.5]) + >>> C.chebint(cs,3) + array([ 0.03125 , -0.1875 , 0.04166667, -0.05208333, 0.01041667, + 0.00625 ]) + >>> C.chebint(cs, k=3) + array([ 3.5, -0.5, 0.5, 0.5]) + >>> C.chebint(cs,lbnd=-2) + array([ 8.5, -0.5, 0.5, 0.5]) + >>> C.chebint(cs,scl=-2) + array([-1., 1., -1., -1.]) """ if np.isscalar(k) : @@ -839,10 +1057,11 @@ return v def chebfit(x, y, deg, rcond=None, full=False): - """Least squares fit of Chebyshev series to data. + """ + Least squares fit of Chebyshev series to data. - Fit a Chebyshev series ``p(x) = p[0] * T_{deq}(x) + ... + p[deg] * - T_{0}(x)`` of degree `deg` to points `(x, y)`. Returns a vector of + Fit a Chebyshev series ``p(x) = p[0] * T_{0}(x) + ... + p[deg] * + T_{deg}(x)`` of degree `deg` to points `(x, y)`. Returns a vector of coefficients `p` that minimises the squared error. Parameters @@ -900,7 +1119,7 @@ The solution are the coefficients ``c[i]`` of the Chebyshev series ``T(x)`` that minimizes the squared error - ``E = \sum_j |y_j - T(x_j)|^2``. + ``E = \\sum_j |y_j - T(x_j)|^2``. This problem is solved by setting up as the overdetermined matrix equation @@ -971,24 +1190,45 @@ def chebroots(cs): - """Roots of a Chebyshev series. + """ + Compute the roots of a Chebyshev series. - Compute the roots of the Chebyshev series `cs`. The argument `cs` is a - sequence of coefficients ordered from low to high. i.e., [1,2,3] is the - series ``T_0 + 2*T_1 + 3*T_2``. + Return the roots (a.k.a "zeros") of the C-series represented by `cs`, + which is the sequence of the C-series' coefficients from lowest order + "term" to highest, e.g., [1,2,3] represents the C-series + ``T_0 + 2*T_1 + 3*T_2``. Parameters ---------- cs : array_like - 1D array of Chebyshev coefficients ordered from low to high. + 1-d array of C-series coefficients ordered from low to high. Returns ------- out : ndarray - An array containing the complex roots of the chebyshev series. + Array of the roots. If all the roots are real, then so is the + dtype of ``out``; otherwise, ``out``'s dtype is complex. + See Also + -------- + polyroots + + Notes + ----- + Algorithm(s) used: + + Remember: because the C-series basis set is different from the + "standard" basis set, the results of this function *may* not be what + one is expecting. + Examples -------- + >>> import numpy.polynomial as P + >>> import numpy.polynomial.chebyshev as C + >>> P.polyroots((-1,1,-1,1)) # x^3 - x^2 + x - 1 has two complex roots + array([ -4.99600361e-16-1.j, -4.99600361e-16+1.j, 1.00000e+00+0.j]) + >>> C.chebroots((-1,1,-1,1)) # T3 - T2 + T1 - T0 has only real roots + array([ -5.00000000e-01, 2.60860684e-17, 1.00000000e+00]) """ # cs is a trimmed copy Modified: trunk/numpy/polynomial/polynomial.py =================================================================== --- trunk/numpy/polynomial/polynomial.py 2010-02-17 23:42:42 UTC (rev 8126) +++ trunk/numpy/polynomial/polynomial.py 2010-02-17 23:53:04 UTC (rev 8127) @@ -1,44 +1,50 @@ -"""Functions for dealing with polynomials. +""" +Objects for dealing with polynomials. -This module provides a number of functions that are useful in dealing with -polynomials as well as a ``Polynomial`` class that encapsuletes the usual -arithmetic operations. All arrays of polynomial coefficients are assumed to -be ordered from low to high degree, thus `array([1,2,3])` will be treated -as the polynomial ``1 + 2*x + 3*x**2`` +This module provides a number of objects (mostly functions) useful for +dealing with polynomials, including a `Polynomial` class that +encapsulates the usual arithmetic operations. (General information +on how this module represents and works with polynomial objects is in +the docstring for its "parent" sub-package, `numpy.polynomial`). Constants --------- -- polydomain -- Polynomial default domain -- polyzero -- Polynomial that evaluates to 0. -- polyone -- Polynomial that evaluates to 1. -- polyx -- Polynomial of the identity map (x). +- `polydomain` -- Polynomial default domain, [-1,1]. +- `polyzero` -- (Coefficients of the) "zero polynomial." +- `polyone` -- (Coefficients of the) constant polynomial 1. +- `polyx` -- (Coefficients of the) identity map polynomial, ``f(x) = x``. Arithmetic ---------- -- polyadd -- add a polynomial to another. -- polysub -- subtract a polynomial from another. -- polymul -- multiply a polynomial by another -- polydiv -- divide one polynomial by another. -- polyval -- evaluate a polynomial at given points. +- `polyadd` -- add two polynomials. +- `polysub` -- subtract one polynomial from another. +- `polymul` -- multiply two polynomials. +- `polydiv` -- divide one polynomial by another. +- `polyval` -- evaluate a polynomial at given points. Calculus -------- -- polyder -- differentiate a polynomial. -- polyint -- integrate a polynomial. +- `polyder` -- differentiate a polynomial. +- `polyint` -- integrate a polynomial. Misc Functions -------------- -- polyfromroots -- create a polynomial with specified roots. -- polyroots -- find the roots of a polynomial. -- polyvander -- Vandermode like matrix for powers. -- polyfit -- least squares fit returning a polynomial. -- polytrim -- trim leading coefficients from a polynomial. -- polyline -- Polynomial of given straight line +- `polyfromroots` -- create a polynomial with specified roots. +- `polyroots` -- find the roots of a polynomial. +- `polyvander` -- Vandermonde-like matrix for powers. +- `polyfit` -- least-squares fit returning a polynomial. +- `polytrim` -- trim leading coefficients from a polynomial. +- `polyline` -- Given a straight line, return the equivalent polynomial + object. Classes ------- -- Polynomial -- polynomial class. +- `Polynomial` -- polynomial class. +See also +-------- +`numpy.polynomial` + """ from __future__ import division @@ -77,20 +83,32 @@ # def polyline(off, scl) : - """Polynomial whose graph is a straight line. + """ + Returns an array representing a linear polynomial. - The line has the formula ``off + scl*x`` - - Parameters: - ----------- + Parameters + ---------- off, scl : scalars - The specified line is given by ``off + scl*x``. + The "y-intercept" and "slope" of the line, respectively. - Returns: + Returns + ------- + y : ndarray + This module's representation of the linear polynomial ``off + + scl*x``. + + See Also -------- - series : 1d ndarray - The polynomial equal to ``off + scl*x``. + chebline + Examples + -------- + >>> from numpy import polynomial as P + >>> P.polyline(1,-1) + array([ 1, -1]) + >>> P.polyval(1, P.polyline(1,-1)) # should be 0 + 0.0 + """ if scl != 0 : return np.array([off,scl]) @@ -98,26 +116,54 @@ return np.array([off]) def polyfromroots(roots) : - """Generate a polynomial with given roots. + """ + Generate a polynomial with the given roots. - Generate a polynomial whose roots are given by `roots`. The resulting - series is the produet `(x - roots[0])*(x - roots[1])*...` + Return the array of coefficients for the polynomial whose leading + coefficient (i.e., that of the highest order term) is `1` and whose + roots (a.k.a. "zeros") are given by *roots*. The returned array of + coefficients is ordered from lowest order term to highest, and zeros + of multiplicity greater than one must be included in *roots* a number + of times equal to their multiplicity (e.g., if `2` is a root of + multiplicity three, then [2,2,2] must be in *roots*). - Inputs - ------ + Parameters + ---------- roots : array_like - 1-d array containing the roots in sorted order. + Sequence containing the roots. Returns ------- - series : ndarray - 1-d array containing the coefficients of the Chebeshev series - ordered from low to high. + out : ndarray + 1-d array of the polynomial's coefficients, ordered from low to + high. If all roots are real, ``out.dtype`` is a float type; + otherwise, ``out.dtype`` is a complex type, even if all the + coefficients in the result are real (see Examples below). See Also -------- - polyroots + chebfromroots + Notes + ----- + What is returned are the :math:`a_i` such that: + + .. math:: + + \\sum_{i=0}^{n} a_ix^i = \\prod_{i=0}^{n} (x - roots[i]) + + where ``n == len(roots)``; note that this implies that `1` is always + returned for :math:`a_n`. + + Examples + -------- + >>> import numpy.polynomial as P + >>> P.polyfromroots((-1,0,1)) # x(x - 1)(x + 1) = x^3 - x + array([ 0., -1., 0., 1.]) + >>> j = complex(0,1) + >>> P.polyfromroots((-j,j)) # complex returned, though values are real + array([ 1.+0.j, 0.+0.j, 1.+0.j]) + """ if len(roots) == 0 : return np.ones(1) @@ -131,27 +177,37 @@ def polyadd(c1, c2): - """Add one polynomial to another. + """ + Add one polynomial to another. - Returns the sum of two polynomials `c1` + `c2`. The arguments are - sequences of coefficients ordered from low to high, i.e., [1,2,3] is - the polynomial ``1 + 2*x + 3*x**2"``. + Returns the sum of two polynomials `c1` + `c2`. The arguments are + sequences of coefficients from lowest order term to highest, i.e., + [1,2,3] represents the polynomial ``1 + 2*x + 3*x**2"``. Parameters ---------- c1, c2 : array_like - 1d arrays of polynomial coefficients ordered from low to - high. + 1-d arrays of polynomial coefficients ordered from low to high. Returns ------- out : ndarray - polynomial of the sum. + The coefficient array representing their sum. See Also -------- polysub, polymul, polydiv, polypow + Examples + -------- + >>> from numpy import polynomial as P + >>> c1 = (1,2,3) + >>> c2 = (3,2,1) + >>> sum = P.polyadd(c1,c2); sum + array([ 4., 4., 4.]) + >>> P.polyval(2, sum) # 4 + 4(2) + 4(2**2) + 28.0 + """ # c1, c2 are trimmed copies [c1, c2] = pu.as_series([c1, c2]) @@ -165,22 +221,23 @@ def polysub(c1, c2): - """Subtract one polynomial from another. + """ + Subtract one polynomial from another. - Returns the difference of two polynomials `c1` - `c2`. The arguments - are sequences of coefficients ordered from low to high, i.e., [1,2,3] - is the polynomial ``1 + 2*x + 3*x**2``. + Returns the difference of two polynomials `c1` - `c2`. The arguments + are sequences of coefficients from lowest order term to highest, i.e., + [1,2,3] represents the polynomial ``1 + 2*x + 3*x**2``. Parameters ---------- c1, c2 : array_like - 1d arrays of polynomial coefficients ordered from low to + 1-d arrays of polynomial coefficients ordered from low to high. Returns ------- out : ndarray - polynomial of the difference. + Of coefficients representing their difference. See Also -------- @@ -188,6 +245,13 @@ Examples -------- + >>> from numpy import polynomial as P + >>> c1 = (1,2,3) + >>> c2 = (3,2,1) + >>> P.polysub(c1,c2) + array([-2., 0., 2.]) + >>> P.polysub(c2,c1) # -P.polysub(c1,c2) + array([ 2., 0., -2.]) """ # c1, c2 are trimmed copies @@ -203,27 +267,36 @@ def polymul(c1, c2): - """Multiply one polynomial by another. + """ + Multiply one polynomial by another. - Returns the product of two polynomials `c1` * `c2`. The arguments - are sequences of coefficients ordered from low to high, i.e., [1,2,3] - is the polynomial ``1 + 2*x + 3*x**2.`` + Returns the product of two polynomials `c1` * `c2`. The arguments are + sequences of coefficients, from lowest order term to highest, e.g., + [1,2,3] represents the polynomial ``1 + 2*x + 3*x**2.`` Parameters ---------- c1, c2 : array_like - 1d arrays of polyyshev series coefficients ordered from low to - high. + 1-d arrays of coefficients representing a polynomial, relative to the + "standard" basis, and ordered from lowest order term to highest. Returns ------- out : ndarray - polynomial of the product. + Of the coefficients of their product. See Also -------- polyadd, polysub, polydiv, polypow + Examples + -------- + >>> import numpy.polynomial as P + >>> c1 = (1,2,3) + >>> c2 = (3,2,1) + >>> P.polymul(c1,c2) + array([ 3., 8., 14., 8., 3.]) + """ # c1, c2 are trimmed copies [c1, c2] = pu.as_series([c1, c2]) @@ -232,22 +305,22 @@ def polydiv(c1, c2): - """Divide one polynomial by another. + """ + Divide one polynomial by another. - Returns the quotient of two polynomials `c1` / `c2`. The arguments are - sequences of coefficients ordered from low to high, i.e., [1,2,3] is - the series ``1 + 2*x + 3*x**2.`` + Returns the quotient-with-remainder of two polynomials `c1` / `c2`. + The arguments are sequences of coefficients, from lowest order term + to highest, e.g., [1,2,3] represents ``1 + 2*x + 3*x**2``. Parameters ---------- c1, c2 : array_like - 1d arrays of chebyshev series coefficients ordered from low to - high. + 1-d arrays of polynomial coefficients ordered from low to high. Returns ------- - [quo, rem] : ndarray - polynomial of the quotient and remainder. + [quo, rem] : ndarrays + Of coefficient series representing the quotient and remainder. See Also -------- @@ -255,6 +328,13 @@ Examples -------- + >>> import numpy.polynomial as P + >>> c1 = (1,2,3) + >>> c2 = (3,2,1) + >>> P.polydiv(c1,c2) + (array([ 3.]), array([-8., -4.])) + >>> P.polydiv(c2,c1) + (array([ 0.33333333]), array([ 2.66666667, 1.33333333])) """ # c1, c2 are trimmed copies @@ -331,27 +411,30 @@ return prd def polyder(cs, m=1, scl=1) : - """Differentiate a polynomial. + """ + Differentiate a polynomial. - Returns the polynomial `cs` differentiated `m` times. The argument `cs` - is a sequence of coefficients ordered from low to high. i.e., [1,2,3] - is the series ``1 + 2*x + 3*x**2.`` + Returns the polynomial `cs` differentiated `m` times. At each + iteration the result is multiplied by `scl` (the scaling factor is for + use in a linear change of variable). The argument `cs` is the sequence + of coefficients from lowest order term to highest, e.g., [1,2,3] + represents the polynomial ``1 + 2*x + 3*x**2``. Parameters ---------- cs: array_like - 1d array of chebyshev series coefficients ordered from low to high. + 1-d array of polynomial coefficients ordered from low to high. m : int, optional - Order of differentiation, must be non-negative. (default: 1) + Number of derivatives taken, must be non-negative. (Default: 1) scl : scalar, optional - The result of each derivation is multiplied by `scl`. The end - result is multiplication by `scl`**`m`. This is for use in a linear - change of variable. (default: 1) + Each differentiation is multiplied by `scl`. The end result is + multiplication by ``scl**m``. This is for use in a linear change + of variable. (Default: 1) Returns ------- der : ndarray - polynomial of the derivative. + Polynomial of the derivative. See Also -------- @@ -359,6 +442,16 @@ Examples -------- + >>> from numpy import polynomial as P + >>> cs = (1,2,3,4) # 1 + 2x + 3x**2 + 4x**3 + >>> P.polyder(cs) # (d/dx)(cs) = 2 + 6x + 12x**2 + array([ 2., 6., 12.]) + >>> P.polyder(cs,3) # (d**3/dx**3)(cs) = 24 + array([ 24.]) + >>> P.polyder(cs,scl=-1) # (d/d(-x))(cs) = -2 - 6x - 12x**2 + array([ -2., -6., -12.]) + >>> P.polyder(cs,2,-1) # (d**2/d(-x)**2)(cs) = 6 + 24x + array([ 6., 24.]) """ # cs is a trimmed copy @@ -380,49 +473,75 @@ return cs[i+1:].copy() def polyint(cs, m=1, k=[], lbnd=0, scl=1) : - """Integrate a polynomial. + """ + Integrate a polynomial. - Returns the polynomial `cs` integrated from `lbnd` to x `m` times. At - each iteration the resulting series is multiplied by `scl` and an - integration constant specified by `k` is added. The scaling factor is - for use in a linear change of variable. The argument `cs` is a sequence - of coefficients ordered from low to high. i.e., [1,2,3] is the - polynomial ``1 + 2*x + 3*x**2``. + Returns the polynomial `cs`, integrated `m` times from `lbnd` to `x`. + At each iteration the resulting series is **multiplied** by `scl` and + an integration constant, `k`, is added. The scaling factor is for use + in a linear change of variable. ("Buyer beware": note that, depending + on what one is doing, one may want `scl` to be the reciprocal of what + one might expect; for more information, see the Notes section below.) + The argument `cs` is a sequence of coefficients, from lowest order + term to highest, e.g., [1,2,3] represents the polynomial + ``1 + 2*x + 3*x**2``. - Parameters ---------- cs : array_like - 1d array of chebyshev series coefficients ordered from low to high. + 1-d array of polynomial coefficients, ordered from low to high. m : int, optional - Order of integration, must be positeve. (default: 1) + Order of integration, must be positive. (Default: 1) k : {[], list, scalar}, optional - Integration constants. The value of the first integral at zero is - the first value in the list, the value of the second integral at - zero is the second value in the list, and so on. If ``[]`` - (default), all constants are set zero. If `m = 1`, a single scalar - can be given instead of a list. + Integration constant(s). The value of the first integral at zero + is the first value in the list, the value of the second integral + at zero is the second value, etc. If ``k == []`` (the default), + all constants are set to zero. If ``m == 1``, a single scalar can + be given instead of a list. lbnd : scalar, optional - The lower bound of the integral. (default: 0) + The lower bound of the integral. (Default: 0) scl : scalar, optional - Following each integration the result is multiplied by `scl` before - the integration constant is added. (default: 1) + Following each integration the result is *multiplied* by `scl` + before the integration constant is added. (Default: 1) Returns ------- - der : ndarray - polynomial of the integral. + S : ndarray + Coefficients of the integral. Raises ------ ValueError + If ``m < 1``, ``len(k) > m``, ``np.isscalar(lbnd) == False``, or + ``np.isscalar(scl) == False``. See Also -------- polyder + Notes + ----- + Note that the result of each integration is *multiplied* by `scl`. + Why is this important to note? Say one is making a linear change of + variable :math:`u = ax + b` in an integral relative to `x`. Then + :math:`dx = du/a`, so one will need to set `scl` equal to :math:`1/a` + - perhaps not what one would have first thought. + Examples -------- + >>> from numpy import polynomial as P + >>> cs = (1,2,3) + >>> P.polyint(cs) # should return array([0, 1, 1, 1]) + array([ 0., 1., 1., 1.]) + >>> P.polyint(cs,3) # should return array([0, 0, 0, 1/6, 1/12, 1/20]) + array([ 0. , 0. , 0. , 0.16666667, 0.08333333, + 0.05 ]) + >>> P.polyint(cs,k=3) # should return array([3, 1, 1, 1]) + array([ 3., 1., 1., 1.]) + >>> P.polyint(cs,lbnd=-2) # should return array([6, 1, 1, 1]) + array([ 6., 1., 1., 1.]) + >>> P.polyint(cs,scl=-2) # should return array([0, -2, -2, -2]) + array([ 0., -2., -2., -2.]) """ if np.isscalar(k) : @@ -448,7 +567,8 @@ return ret def polyval(x, cs): - """Evaluate a polynomial. + """ + Evaluate a polynomial. If `cs` is of length `n`, this function returns : @@ -476,16 +596,10 @@ -------- polyfit - Examples - -------- - Notes ----- The evaluation uses Horner's method. - Examples - -------- - """ # cs is a trimmed copy [cs] = pu.as_series([cs]) @@ -529,50 +643,56 @@ return v def polyfit(x, y, deg, rcond=None, full=False): - """Least squares fit of polynomial to data. + """ + Least-squares fit of a polynomial to data. - Fit a polynomial ``p(x) = p[0] * T_{deq}(x) + ... + p[deg] * - T_{0}(x)`` of degree `deg` to points `(x, y)`. Returns a vector of - coefficients `p` that minimises the squared error. + Fit a polynomial ``c0 + c1*x + c2*x**2 + ... + c[deg]*x**deg`` to + points (`x`, `y`). Returns a 1-d (if `y` is 1-d) or 2-d (if `y` is 2-d) + array of coefficients representing, from lowest order term to highest, + the polynomial(s) which minimize the total square error. Parameters ---------- - x : array_like, shape (M,) - x-coordinates of the M sample points ``(x[i], y[i])``. - y : array_like, shape (M,) or (M, K) - y-coordinates of the sample points. Several data sets of sample - points sharing the same x-coordinates can be fitted at once by - passing in a 2D-array that contains one dataset per column. + x : array_like, shape (`M`,) + x-coordinates of the `M` sample (data) points ``(x[i], y[i])``. + y : array_like, shape (`M`,) or (`M`, `K`) + y-coordinates of the sample points. Several sets of sample points + sharing the same x-coordinates can be (independently) fit with one + call to `polyfit` by passing in for `y` a 2-d array that contains + one data set per column. deg : int - Degree of the fitting polynomial + Degree of the polynomial(s) to be fit. rcond : float, optional - Relative condition number of the fit. Singular values smaller than - this relative to the largest singular value will be ignored. The - default value is len(x)*eps, where eps is the relative precision of - the float type, about 2e-16 in most cases. + Relative condition number of the fit. Singular values smaller + than `rcond`, relative to the largest singular value, will be + ignored. The default value is ``len(x)*eps``, where `eps` is the + relative precision of the platform's float type, about 2e-16 in + most cases. full : bool, optional - Switch determining nature of return value. When it is False (the - default) just the coefficients are returned, when True diagnostic - information from the singular value decomposition is also returned. + Switch determining the nature of the return value. When ``False`` + (the default) just the coefficients are returned; when ``True``, + diagnostic information from the singular value decomposition (used + to solve the fit's matrix equation) is also returned. Returns ------- - coef : ndarray, shape (M,) or (M, K) - Polynomial coefficients ordered from low to high. If `y` was 2-D, - the coefficients for the data in column k of `y` are in column - `k`. + coef : ndarray, shape (`deg` + 1,) or (`deg` + 1, `K`) + Polynomial coefficients ordered from low to high. If `y` was 2-d, + the coefficients in column `k` of `coef` represent the polynomial + fit to the data in `y`'s `k`-th column. - [residuals, rank, singular_values, rcond] : present when `full` = True - Residuals of the least-squares fit, the effective rank of the - scaled Vandermonde matrix and its singular values, and the - specified value of `rcond`. For more details, see `linalg.lstsq`. + [residuals, rank, singular_values, rcond] : present when `full` == True + Sum of the squared residuals (SSR) of the least-squares fit; the + effective rank of the scaled Vandermonde matrix; its singular + values; and the specified value of `rcond`. For more information, + see `linalg.lstsq`. - Warns - ----- + Raises + ------ RankWarning - The rank of the coefficient matrix in the least-squares fit is - deficient. The warning is only raised if `full` = False. The - warnings can be turned off by + Raised if the matrix in the least-squares fit is rank deficient. + The warning is only raised if `full` == False. The warnings can + be turned off by: >>> import warnings >>> warnings.simplefilter('ignore', RankWarning) @@ -587,42 +707,61 @@ Notes ----- - The solution are the coefficients ``c[i]`` of the polynomial ``P(x)`` - that minimizes the squared error + The solutions are the coefficients ``c[i]`` of the polynomial ``P(x)`` + that minimizes the total squared error: - ``E = \sum_j |y_j - P(x_j)|^2``. + .. math :: E = \\sum_j (y_j - P(x_j))^2 - This problem is solved by setting up as the overdetermined matrix - equation + This problem is solved by setting up the (typically) over-determined + matrix equation: - ``V(x)*c = y``, + .. math :: V(x)*c = y - where ``V`` is the Vandermonde matrix of `x`, the elements of ``c`` are - the coefficients to be solved for, and the elements of `y` are the - observed values. This equation is then solved using the singular value - decomposition of ``V``. + where `V` is the Vandermonde matrix of `x`, the elements of `c` are the + coefficients to be solved for, and the elements of `y` are the observed + values. This equation is then solved using the singular value + decomposition of `V`. - If some of the singular values of ``V`` are so small that they are - neglected, then a `RankWarning` will be issued. This means that the - coeficient values may be poorly determined. Using a lower order fit - will usually get rid of the warning. The `rcond` parameter can also be - set to a value smaller than its default, but the resulting fit may be - spurious and have large contributions from roundoff error. + If some of the singular values of `V` are so small that they are + neglected (and `full` == ``False``), a `RankWarning` will be raised. + This means that the coefficient values may be poorly determined. + Fitting to a lower order polynomial will usually get rid of the warning + (but may not be what you want, of course; if you have independent + reason(s) for choosing the degree which isn't working, you may have to: + a) reconsider those reasons, and/or b) reconsider the quality of your + data). The `rcond` parameter can also be set to a value smaller than + its default, but the resulting fit may be spurious and have large + contributions from roundoff error. - Fits using double precision and polynomials tend to fail at about - degree 20. Fits using Chebyshev series are generally better - conditioned, but much can still depend on the distribution of the - sample points and the smoothness of the data. If the quality of the fit - is inadequate splines may be a good alternative. + Polynomial fits using double precision tend to "fail" at about + (polynomial) degree 20. Fits using Chebyshev series are generally + better conditioned, but much can still depend on the distribution of + the sample points and the smoothness of the data. If the quality of + the fit is inadequate, splines may be a good alternative. - References - ---------- - .. [1] Wikipedia, "Curve fitting", - http://en.wikipedia.org/wiki/Curve_fitting - Examples -------- + >>> from numpy import polynomial as P + >>> x = np.linspace(-1,1,51) # x "data": [-1, -0.96, ..., 0.96, 1] + >>> y = x**3 - x + np.random.randn(len(x)) # x^3 - x + N(0,1) "noise" + >>> c, stats = P.polyfit(x,y,3,full=True) + >>> c # c[0], c[2] should be approx. 0, c[1] approx. -1, c[3] approx. 1 + array([ 0.01909725, -1.30598256, -0.00577963, 1.02644286]) + >>> stats # note the large SSR, explaining the rather poor results + [array([ 38.06116253]), 4, array([ 1.38446749, 1.32119158, 0.50443316, + 0.28853036]), 1.1324274851176597e-014] + Same thing without the added noise + + >>> y = x**3 - x + >>> c, stats = P.polyfit(x,y,3,full=True) + >>> c # c[0], c[2] should be "very close to 0", c[1] ~= -1, c[3] ~= 1 + array([ -1.73362882e-17, -1.00000000e+00, -2.67471909e-16, + 1.00000000e+00]) + >>> stats # note the minuscule SSR + [array([ 7.46346754e-31]), 4, array([ 1.38446749, 1.32119158, + 0.50443316, 0.28853036]), 1.1324274851176597e-014] + """ order = int(deg) + 1 x = np.asarray(x) + 0.0 @@ -662,24 +801,39 @@ def polyroots(cs): - """Roots of a polynomial. + """ + Compute the roots of a polynomial. - Compute the roots of the Chebyshev series `cs`. The argument `cs` is a - sequence of coefficients ordered from low to high. i.e., [1,2,3] is the - polynomial ``1 + 2*x + 3*x**2``. + Return the roots (a.k.a. "zeros") of the "polynomial" `cs`, the + polynomial's coefficients from lowest order term to highest + (e.g., [1,2,3] represents the polynomial ``1 + 2*x + 3*x**2``). Parameters ---------- - cs : array_like of shape(M,) - 1D array of polynomial coefficients ordered from low to high. + cs : array_like of shape (M,) + 1-d array of polynomial coefficients ordered from low to high. Returns ------- out : ndarray - An array containing the complex roots of the polynomial series. + Array of the roots of the polynomial. If all the roots are real, + then so is the dtype of ``out``; otherwise, ``out``'s dtype is + complex. + See Also + -------- + chebroots + Examples -------- + >>> import numpy.polynomial as P + >>> P.polyroots(P.polyfromroots((-1,0,1))) + array([-1., 0., 1.]) + >>> P.polyroots(P.polyfromroots((-1,0,1))).dtype + dtype('float64') + >>> j = complex(0,1) + >>> P.polyroots(P.polyfromroots((-j,0,j))) + array([ 0.00000000e+00+0.j, 0.00000000e+00+1.j, 2.77555756e-17-1.j]) """ # cs is a trimmed copy Modified: trunk/numpy/polynomial/polytemplate.py =================================================================== --- trunk/numpy/polynomial/polytemplate.py 2010-02-17 23:42:42 UTC (rev 8126) +++ trunk/numpy/polynomial/polytemplate.py 2010-02-17 23:53:04 UTC (rev 8127) @@ -1,5 +1,13 @@ -"""Template for the Chebyshev and Polynomial classes. +""" +Template for the Chebyshev and Polynomial classes. +This module houses a Python string module Template object (see, e.g., +http://docs.python.org/library/string.html#template-strings) used by +the `polynomial` and `chebyshev` modules to implement their respective +`Polynomial` and `Chebyshev` classes. It provides a mechanism for easily +creating additional specific polynomial classes (e.g., Legendre, Jacobi, +etc.) in the future, such that all these classes will have a common API. + """ import string import sys Modified: trunk/numpy/polynomial/polyutils.py =================================================================== --- trunk/numpy/polynomial/polyutils.py 2010-02-17 23:42:42 UTC (rev 8126) +++ trunk/numpy/polynomial/polyutils.py 2010-02-17 23:53:04 UTC (rev 8127) @@ -1,30 +1,34 @@ -"""Utililty functions for polynomial modules. +""" +Utililty objects for the polynomial modules. -This modules provides errors, warnings, and a polynomial base class along -with some common routines that are used in both the polynomial and -chebyshev modules. +This module provides: error and warning objects; a polynomial base class; +and some routines used in both the `polynomial` and `chebyshev` modules. -Errors ------- -- PolyError -- base class for errors -- PolyDomainError -- mismatched domains +Error objects +------------- +- `PolyError` -- base class for this sub-package's errors. +- `PolyDomainError` -- raised when domains are "mismatched." -Warnings --------- -- RankWarning -- issued by least squares fits to warn of deficient rank +Warning objects +--------------- +- `RankWarning` -- raised by a least-squares fit when a rank-deficient + matrix is encountered. -Base Class +Base class ---------- -- PolyBase -- Base class for the Polynomial and Chebyshev classes. +- `PolyBase` -- The base class for the `Polynomial` and `Chebyshev` + classes. Functions --------- -- as_series -- turns list of array_like into 1d arrays of common type -- trimseq -- removes trailing zeros -- trimcoef -- removes trailing coefficients less than given magnitude -- getdomain -- finds appropriate domain for collection of points -- mapdomain -- maps points between domains -- mapparms -- parameters of the linear map between domains +- `as_series` -- turns a list of array_likes into 1-D arrays of common + type. +- `trimseq` -- removes trailing zeros. +- `trimcoef` -- removes trailing coefficients that are less than a given + magnitude (thereby removing the corresponding terms). +- `getdomain` -- returns a domain appropriate for a given set of abscissae. +- `mapdomain` -- maps points between domains. +- `mapparms` -- parameters of the linear map between domains. """ from __future__ import division @@ -109,30 +113,45 @@ def as_series(alist, trim=True) : - """Return arguments as a list of 1d arrays. + """ + Return argument as a list of 1-d arrays. - The return type will always be an array of double, complex double. or - object. + The returned list contains array(s) of dtype double, complex double, or + object. A 1-d argument of shape ``(N,)`` is parsed into ``N`` arrays of + size one; a 2-d argument of shape ``(M,N)`` is parsed into ``M`` arrays + of size ``N`` (i.e., is "parsed by row"); and a higher dimensional array + raises a Value Error if it is not first reshaped into either a 1-d or 2-d + array. Parameters ---------- - [a1, a2,...] : list of array_like. - The arrays must have no more than one dimension when converted. - trim : boolean + a : array_like + A 1- or 2-d array_like + trim : boolean, optional When True, trailing zeros are removed from the inputs. When False, the inputs are passed through intact. Returns ------- [a1, a2,...] : list of 1d-arrays - A copy of the input data as a 1d-arrays. + A copy of the input data as a list of 1-d arrays. Raises ------ ValueError : - Raised when an input can not be coverted to 1-d array or the - resulting array is empty. + Raised when `as_series` cannot convert its input to 1-d arrays, or at + least one of the resulting arrays is empty. + Examples + -------- + >>> from numpy import polynomial as P + >>> a = np.arange(4) + >>> P.as_series(a) + [array([ 0.]), array([ 1.]), array([ 2.]), array([ 3.])] + >>> b = np.arange(6).reshape((2,3)) + >>> P.as_series(b) + [array([ 0., 1., 2.]), array([ 3., 4., 5.])] + """ arrays = [np.array(a, ndmin=1, copy=0) for a in alist] if min([a.size for a in arrays]) == 0 : @@ -161,25 +180,48 @@ def trimcoef(c, tol=0) : - """Remove small trailing coefficients from a polynomial series. + """ + Remove "small" "trailing" coefficients from a polynomial. + "Small" means "small in absolute value" and is controlled by the + parameter `tol`; "trailing" means highest order coefficient(s), e.g., in + ``[0, 1, 1, 0, 0]`` (which represents ``0 + x + x**2 + 0*x**3 + 0*x**4``) + both the 3-rd and 4-th order coefficients would be "trimmed." + Parameters ---------- c : array_like - 1-d array of coefficients, ordered from low to high. - tol : number - Trailing elements with absolute value less than tol are removed. + 1-d array of coefficients, ordered from lowest order to highest. + tol : number, optional + Trailing (i.e., highest order) elements with absolute value less + than or equal to `tol` (default value is zero) are removed. Returns ------- trimmed : ndarray - 1_d array with tailing zeros removed. If the resulting series would - be empty, a series containing a singel zero is returned. + 1-d array with trailing zeros removed. If the resulting series + would be empty, a series containing a single zero is returned. Raises ------ - ValueError : if tol < 0 + ValueError + If `tol` < 0 + See Also + -------- + trimseq + + Examples + -------- + >>> from numpy import polynomial as P + >>> P.trimcoef((0,0,3,0,5,0,0)) + array([ 0., 0., 3., 0., 5.]) + >>> P.trimcoef((0,0,1e-3,0,1e-5,0,0),1e-3) # item == tol is trimmed + array([ 0.]) + >>> i = complex(0,1) # works for complex + >>> P.trimcoef((3e-4,1e-3*(1-i),5e-4,2e-5*(1+i)), 1e-3) + array([ 0.0003+0.j , 0.0010-0.001j]) + """ if tol < 0 : raise ValueError("tol must be non-negative") @@ -192,29 +234,42 @@ return c[:ind[-1] + 1].copy() def getdomain(x) : - """Determine suitable domain for given points. + """ + Return a domain suitable for given abscissae. - Find a suitable domain in which to fit a function defined at the points - `x` with a polynomial or Chebyshev series. - + Find a domain suitable for a polynomial or Chebyshev series + defined at the values supplied. + Parameters ---------- x : array_like - 1D array of points whose domain will be determined. + 1-d array of abscissae whose domain will be determined. Returns ------- domain : ndarray - 1D ndarray containing two values. If the inputs are complex, then - the two points are the corners of the smallest rectangle alinged - with the axes in the complex plane containing the points `x`. If - the inputs are real, then the two points are the ends of the - smallest interval containing the points `x`, + 1-d array containing two values. If the inputs are complex, then + the two returned points are the lower left and upper right corners + of the smallest rectangle (aligned with the axes) in the complex + plane containing the points `x`. If the inputs are real, then the + two points are the ends of the smallest interval containing the + points `x`. See Also -------- mapparms, mapdomain + Examples + -------- + >>> from numpy.polynomial import polyutils as pu + >>> points = np.arange(4)**2 - 5; points + array([-5, -4, -1, 4]) + >>> pu.getdomain(points) + array([-5., 4.]) + >>> c = np.exp(complex(0,1)*np.pi*np.arange(12)/6) # unit circle + >>> pu.getdomain(c) + array([-1.-1.j, 1.+1.j]) + """ [x] = as_series([x], trim=False) if x.dtype.char in np.typecodes['Complex'] : @@ -225,27 +280,45 @@ return np.array((x.min(), x.max())) def mapparms(old, new) : - """Linear map between domains. + """ + Linear map parameters between domains. - Return the parameters of the linear map ``off + scl*x`` that maps the - `old` domain to the `new` domain. The map is defined by the requirement - that the left end of the old domain map to the left end of the new - domain, and similarly for the right ends. + Return the parameters of the linear map ``offset + scale*x`` that maps + `old` to `new` such that ``old[i] -> new[i]``, ``i = 0, 1``. Parameters ---------- old, new : array_like - The two domains should convert as 1D arrays containing two values. + Each domain must (successfully) convert to a 1-d array containing + precisely two values. Returns ------- - off, scl : scalars - The map `=``off + scl*x`` maps the first domain to the second. + offset, scale : scalars + The map ``L(x) = offset + scale*x`` maps the first domain to the + second. See Also -------- getdomain, mapdomain + Notes + ----- + Also works for complex numbers, and thus can be used to calculate the + parameters required to map any line in the complex plane to any other + line therein. + + Examples + -------- + >>> from numpy import polynomial as P + >>> P.mapparms((-1,1),(-1,1)) + (0.0, 1.0) + >>> P.mapparms((1,-1),(-1,1)) + (0.0, -1.0) + >>> i = complex(0,1) + >>> P.mapparms((-i,-1),(1,i)) + ((1+1j), (1+0j)) + """ oldlen = old[1] - old[0] newlen = new[1] - new[0] @@ -254,30 +327,66 @@ return off, scl def mapdomain(x, old, new) : - """Apply linear map to input points. - - The linear map of the form ``off + scl*x`` that takes the `old` domain - to the `new` domain is applied to the points `x`. + """ + Apply linear map to input points. + The linear map ``offset + scale*x`` that maps `old` to `new` is applied + to the points `x`. + Parameters ---------- x : array_like - Points to be mapped + Points to be mapped. old, new : array_like - The two domains that determin the map. They should both convert as - 1D arrays containing two values. + The two domains that determine the map. Each must (successfully) + convert to 1-d arrays containing precisely two values. - Returns ------- - new_x : ndarray - Array of points of the same shape as the input `x` after the linear - map defined by the two domains is applied. + x_out : ndarray + Array of points of the same shape as `x`, after application of the + linear map between the two domains. See Also -------- getdomain, mapparms + Notes + ----- + Effectively, this implements: + + .. math :: + x\\_out = new[0] + m(x - old[0]) + + where + + .. math :: + m = \\frac{new[1]-new[0]}{old[1]-old[0]} + + Examples + -------- + >>> from numpy import polynomial as P + >>> old_domain = (-1,1) + >>> new_domain = (0,2*np.pi) + >>> x = np.linspace(-1,1,6); x + array([-1. , -0.6, -0.2, 0.2, 0.6, 1. ]) + >>> x_out = P.mapdomain(x, old_domain, new_domain); x_out + array([ 0. , 1.25663706, 2.51327412, 3.76991118, 5.02654825, + 6.28318531]) + >>> x - P.mapdomain(x_out, new_domain, old_domain) + array([ 0., 0., 0., 0., 0., 0.]) + + Also works for complex numbers (and thus can be used to map any line in + the complex plane to any other line therein). + + >>> i = complex(0,1) + >>> old = (-1 - i, 1 + i) + >>> new = (-1 + i, 1 - i) + >>> z = np.linspace(old[0], old[1], 6); z + array([-1.0-1.j , -0.6-0.6j, -0.2-0.2j, 0.2+0.2j, 0.6+0.6j, 1.0+1.j ]) + >>> new_z = P.mapdomain(z, old, new); new_z + array([-1.0+1.j , -0.6+0.6j, -0.2+0.2j, 0.2-0.2j, 0.6-0.6j, 1.0-1.j ]) + """ [x] = as_series([x], trim=False) off, scl = mapparms(old, new) Modified: trunk/numpy/testing/utils.py =================================================================== --- trunk/numpy/testing/utils.py 2010-02-17 23:42:42 UTC (rev 8126) +++ trunk/numpy/testing/utils.py 2010-02-17 23:53:04 UTC (rev 8127) @@ -1081,23 +1081,54 @@ assert(sys.getrefcount(i) >= rc) def assert_array_almost_equal_nulp(x, y, nulp=1): - """Compare two arrays relatively to their spacing. It is a relatively - robust method to compare two arrays whose amplitude is variable. + """ + Compare two arrays relatively to their spacing. - Note - ---- - An assertion is raised if the following condition is not met: + This is a relatively robust method to compare two arrays whose amplitude + is variable. + Parameters + ---------- + x, y : array_like + Input arrays. + nulp : int, optional + The maximum number of unit in the last place for tolerance (see Notes). + Default is 1. + + Returns + ------- + None + + Raises + ------ + AssertionError + If the spacing between `x` and `y` for one or more elements is larger + than `nulp`. + + See Also + -------- + assert_array_max_ulp : Check that all items of arrays differ in at most + N Units in the Last Place. + spacing : Return the distance between x and the nearest adjacent number. + + Notes + ----- + An assertion is raised if the following condition is not met:: + abs(x - y) <= nulps * spacing(max(abs(x), abs(y))) - Parameters - ---------- - x: array_like - first input array - y: array_like - second input array - nulp: int - max number of unit in the last place for tolerance (see Note) + Examples + -------- + >>> x = np.array([1., 1e-10, 1e-20]) + >>> eps = np.finfo(x.dtype).eps + >>> np.testing.assert_array_almost_equal_nulp(x, x*eps/2 + x) + + >>> np.testing.assert_array_almost_equal_nulp(x, x*eps + x) + ------------------------------------------------------------ + Traceback (most recent call last): + ... + AssertionError: X and Y are not equal to 1 ULP (max is 2) + """ import numpy as np ax = np.abs(x) @@ -1112,8 +1143,41 @@ raise AssertionError(msg) def assert_array_max_ulp(a, b, maxulp=1, dtype=None): - """Given two arrays a and b, check that every item differs in at most N - Unit in the Last Place.""" + """ + Check that all items of arrays differ in at most N Units in the Last Place. + + Parameters + ---------- + a, b : array_like + Input arrays to be compared. + maxulp : int, optional + The maximum number of units in the last place that elements of `a` and + `b` can differ. Default is 1. + dtype : dtype, optional + Data-type to convert `a` and `b` to if given. Default is None. + + Returns + ------- + ret : ndarray + Array containing number of representable floating point numbers between + items in `a` and `b`. + + Raises + ------ + AssertionError + If one or more elements differ by more than `maxulp`. + + See Also + -------- + assert_array_almost_equal_nulp : Compare two arrays relatively to their + spacing. + + Examples + -------- + >>> a = np.linspace(0., 1., 100) + >>> res = np.testing.assert_array_max_ulp(a, np.arcsin(np.sin(a))) + + """ import numpy as np ret = nulp_diff(a, b, dtype) if not np.all(ret <= maxulp): @@ -1282,11 +1346,29 @@ self._module.showwarning = self._showwarning def assert_warns(warning_class, func, *args, **kw): - """Fail unless a warning of class warning_class is thrown by callable when + """ + Fail unless the given callable throws the specified warning. + + A warning of class warning_class should be thrown by the callable when invoked with arguments args and keyword arguments kwargs. - If a different type of warning is thrown, it will not be caught, and the test case will be deemed to have suffered an error. + + Parameters + ---------- + warning_class : class + The class defining the warning that `func` is expected to throw. + func : callable + The callable to test. + \\*args : Arguments + Arguments passed to `func`. + \\*\\*kwargs : Kwargs + Keyword arguments passed to `func`. + + Returns + ------- + None + """ # XXX: once we may depend on python >= 2.6, this can be replaced by the From numpy-svn at scipy.org Wed Feb 17 18:55:17 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 17 Feb 2010 17:55:17 -0600 (CST) Subject: [Numpy-svn] r8128 - in trunk: doc/source/reference doc/source/user numpy numpy/core/code_generators numpy/doc Message-ID: <20100217235517.2C6A639C4B4@scipy.org> Author: jarrod.millman Date: 2010-02-17 17:55:16 -0600 (Wed, 17 Feb 2010) New Revision: 8128 Modified: trunk/doc/source/reference/arrays.classes.rst trunk/doc/source/reference/arrays.dtypes.rst trunk/doc/source/reference/arrays.indexing.rst trunk/doc/source/reference/arrays.ndarray.rst trunk/doc/source/reference/c-api.coremath.rst trunk/doc/source/reference/c-api.types-and-structures.rst trunk/doc/source/reference/c-api.ufunc.rst trunk/doc/source/reference/index.rst trunk/doc/source/reference/internals.code-explanations.rst trunk/doc/source/reference/maskedarray.generic.rst trunk/doc/source/reference/routines.array-creation.rst trunk/doc/source/reference/routines.rst trunk/doc/source/user/basics.indexing.rst trunk/doc/source/user/basics.rec.rst trunk/doc/source/user/basics.rst trunk/doc/source/user/basics.types.rst trunk/doc/source/user/c-info.beyond-basics.rst trunk/doc/source/user/c-info.python-as-glue.rst trunk/doc/source/user/howtofind.rst trunk/doc/source/user/install.rst trunk/doc/source/user/misc.rst trunk/doc/source/user/performance.rst trunk/numpy/add_newdocs.py trunk/numpy/core/code_generators/ufunc_docstrings.py trunk/numpy/doc/constants.py Log: updated documentation from pydoc website (thanks to everyone who contributed!) Modified: trunk/doc/source/reference/arrays.classes.rst =================================================================== --- trunk/doc/source/reference/arrays.classes.rst 2010-02-17 23:53:04 UTC (rev 8127) +++ trunk/doc/source/reference/arrays.classes.rst 2010-02-17 23:55:16 UTC (rev 8128) @@ -13,8 +13,8 @@ several tools for simplifying how your new object interacts with other array objects, and so the choice may not be significant in the end. One way to simplify the question is by asking yourself if the -object you are interested in can be replaced as a single array or does it -really require two or more arrays at its core. +object you are interested in can be replaced as a single array or does +it really require two or more arrays at its core. Note that :func:`asarray` always returns the base-class ndarray. If you are confident that your use of the array object can handle any @@ -42,10 +42,10 @@ This method is called whenever the system internally allocates a new array from *obj*, where *obj* is a subclass (subtype) of the - :class:`ndarray`. It can be used to change attributes of *self* after - construction (so as to ensure a 2-d matrix for example), or to - update meta-information from the "parent." Subclasses inherit a - default implementation of this method that does nothing. + :class:`ndarray`. It can be used to change attributes of *self* + after construction (so as to ensure a 2-d matrix for example), or + to update meta-information from the "parent." Subclasses inherit + a default implementation of this method that does nothing. .. function:: __array_prepare__(array, context=None) @@ -66,10 +66,10 @@ the output object if one was specified. The ufunc-computed array is passed in and whatever is returned is passed to the user. Subclasses inherit a default implementation of this method, which - transforms the array into a new instance of the object's class. Subclasses - may opt to use this method to transform the output array into an - instance of the subclass and update metadata before returning the - array to the user. + transforms the array into a new instance of the object's class. + Subclasses may opt to use this method to transform the output array + into an instance of the subclass and update metadata before + returning the array to the user. .. data:: __array_priority__ @@ -96,21 +96,21 @@ unexpected results when you use matrices but expect them to act like arrays: -1. Matrix objects can be created using a string notation to allow Matlab- - style syntax where spaces separate columns and semicolons (';') - separate rows. +1. Matrix objects can be created using a string notation to allow + Matlab-style syntax where spaces separate columns and semicolons + (';') separate rows. 2. Matrix objects are always two-dimensional. This has far-reaching - implications, in that m.ravel() is still two-dimensional (with a 1 in - the first dimension) and item selection returns two-dimensional + implications, in that m.ravel() is still two-dimensional (with a 1 + in the first dimension) and item selection returns two-dimensional objects so that sequence behavior is fundamentally different than arrays. 3. Matrix objects over-ride multiplication to be matrix-multiplication. **Make sure you understand this for functions that you may want to receive matrices. Especially in - light of the fact that asanyarray(m) returns a matrix when m is a - matrix.** + light of the fact that asanyarray(m) returns a matrix when m is + a matrix.** 4. Matrix objects over-ride power to be matrix raised to a power. The same warning about using power inside a function that uses @@ -119,8 +119,8 @@ 5. The default __array_priority\__ of matrix objects is 10.0, and therefore mixed operations with ndarrays always produce matrices. -6. Matrices have special attributes which make calculations easier. These - are +6. Matrices have special attributes which make calculations easier. + These are .. autosummary:: :toctree: generated/ @@ -132,11 +132,12 @@ .. warning:: - Matrix objects over-ride multiplication, '*', and power, '**', to be - matrix-multiplication and matrix power, respectively. If your - subroutine can accept sub-classes and you do not convert to base-class - arrays, then you must use the ufuncs multiply and power to be sure - that you are performing the correct operation for all inputs. + Matrix objects over-ride multiplication, '*', and power, '**', to + be matrix-multiplication and matrix power, respectively. If your + subroutine can accept sub-classes and you do not convert to base- + class arrays, then you must use the ufuncs multiply and power to + be sure that you are performing the correct operation for all + inputs. The matrix class is a Python subclass of the ndarray and can be used as a reference for how to construct your own subclass of the ndarray. @@ -194,10 +195,10 @@ .. note:: - Memory-mapped arrays use the the Python memory-map object which (prior - to Python 2.5) does not allow files to be larger than a certain size - depending on the platform. This size is always < 2GB even on 64-bit - systems. + Memory-mapped arrays use the the Python memory-map object which + (prior to Python 2.5) does not allow files to be larger than a + certain size depending on the platform. This size is always + < 2GB even on 64-bit systems. .. autosummary:: :toctree: generated/ @@ -228,10 +229,11 @@ single: character arrays .. note:: - The chararray module exists for backwards compatibility with - Numarray, it is not recommended for new development. If one needs - arrays of strings, use arrays of `dtype` `object_`, `str` or - `unicode`. + The `chararray` class exists for backwards compatibility with + Numarray, it is not recommended for new development. Starting from numpy + 1.4, if one needs arrays of strings, it is recommended to use arrays of + `dtype` `object_`, `string_` or `unicode_`, and use the free functions + in the `numpy.char` module for fast vectorized string operations. These are enhanced arrays of either :class:`string_` type or :class:`unicode_` type. These arrays inherit from the @@ -240,8 +242,8 @@ operations are not available on the standard :class:`ndarray` of character type. In addition, the :class:`chararray` has all of the standard :class:`string ` (and :class:`unicode`) methods, -executing them on an element-by-element basis. Perhaps the easiest way -to create a chararray is to use :meth:`self.view(chararray) +executing them on an element-by-element basis. Perhaps the easiest +way to create a chararray is to use :meth:`self.view(chararray) ` where *self* is an ndarray of str or unicode data-type. However, a chararray can also be created using the :meth:`numpy.chararray` constructor, or via the @@ -255,8 +257,8 @@ Another difference with the standard ndarray of str data-type is that the chararray inherits the feature introduced by Numarray that -white-space at the end of any element in the array will be ignored on -item retrieval and comparison operations. +white-space at the end of any element in the array will be ignored +on item retrieval and comparison operations. .. _arrays.classes.rec: @@ -341,7 +343,8 @@ for i in arr.shape[0]: val = arr[i] -This default iterator selects a sub-array of dimension :math:`N-1` from the array. This can be a useful construct for defining recursive +This default iterator selects a sub-array of dimension :math:`N-1` +from the array. This can be a useful construct for defining recursive algorithms. To loop over the entire array requires :math:`N` for-loops. >>> a = arange(24).reshape(3,2,4)+10 Modified: trunk/doc/source/reference/arrays.dtypes.rst =================================================================== --- trunk/doc/source/reference/arrays.dtypes.rst 2010-02-17 23:53:04 UTC (rev 8127) +++ trunk/doc/source/reference/arrays.dtypes.rst 2010-02-17 23:55:16 UTC (rev 8128) @@ -148,8 +148,8 @@ .. admonition:: Example - >>> dt = np.dtype(np.int32) # 32-bit integer - >>> dt = np.dtype(np.complex128) # 128-bit complex floating-point number + >>> dt = np.dtype(np.int32) # 32-bit integer + >>> dt = np.dtype(np.complex128) # 128-bit complex floating-point number Generic types @@ -305,9 +305,9 @@ .. admonition:: Example - >>> dt = np.dtype((np.int32, (2,2))) # 2 x 2 integer sub-array - >>> dt = np.dtype(('S10', 1)) # 10-character string - >>> dt = np.dtype(('i4, (2,3)f8, f4', (2,3))) # 2 x 3 record sub-array + >>> dt = np.dtype((np.int32, (2,2))) # 2 x 2 integer sub-array + >>> dt = np.dtype(('S10', 1)) # 10-character string + >>> dt = np.dtype(('i4, (2,3)f8, f4', (2,3))) # 2 x 3 record sub-array ``(base_dtype, new_dtype)`` @@ -321,7 +321,7 @@ 32-bit integer, whose first two bytes are interpreted as an integer via field ``real``, and the following two bytes via field ``imag``. - >>> dt = np.dtype((np.int32, {'real': (np.int16, 0), 'imag': (np.int16, 2)}) + >>> dt = np.dtype((np.int32,{'real':(np.int16, 0),'imag':(np.int16, 2)}) 32-bit integer, which is interpreted as consisting of a sub-array of shape ``(4,)`` containing 8-bit integers: @@ -333,8 +333,6 @@ >>> dt = np.dtype(('i4', [('r','u1'),('g','u1'),('b','u1'),('a','u1')])) -.. note:: XXX: does the second-to-last example above make sense? - .. index:: triple: dtype; construction; from list @@ -428,7 +426,8 @@ byte position 0), ``col2`` (32-bit float at byte position 10), and ``col3`` (integers at byte position 14): - >>> dt = np.dtype({'col1': ('S10', 0), 'col2': (float32, 10), 'col3': (int, 14)}) + >>> dt = np.dtype({'col1': ('S10', 0), 'col2': (float32, 10), + 'col3': (int, 14)}) :class:`dtype` Modified: trunk/doc/source/reference/arrays.indexing.rst =================================================================== --- trunk/doc/source/reference/arrays.indexing.rst 2010-02-17 23:53:04 UTC (rev 8127) +++ trunk/doc/source/reference/arrays.indexing.rst 2010-02-17 23:55:16 UTC (rev 8128) @@ -318,13 +318,6 @@ Also recognize that ``x[[1,2,3]]`` will trigger advanced indexing, whereas ``x[[1,2,slice(None)]]`` will trigger basic slicing. -.. note:: - - XXX: this section may need some tuning... - Also the above warning needs explanation as the last part is at odds - with the definition of basic indexing. - - .. _arrays.indexing.rec: Record Access Modified: trunk/doc/source/reference/arrays.ndarray.rst =================================================================== --- trunk/doc/source/reference/arrays.ndarray.rst 2010-02-17 23:53:04 UTC (rev 8127) +++ trunk/doc/source/reference/arrays.ndarray.rst 2010-02-17 23:55:16 UTC (rev 8128) @@ -9,9 +9,9 @@ An :class:`ndarray` is a (usually fixed-size) multidimensional container of items of the same type and size. The number of dimensions and items in an array is defined by its :attr:`shape `, -which is a :class:`tuple` of *N* positive integers that specify the sizes of -each dimension. The type of items in the array is specified by a -separate :ref:`data-type object (dtype) `, one of which +which is a :class:`tuple` of *N* positive integers that specify the +sizes of each dimension. The type of items in the array is specified by +a separate :ref:`data-type object (dtype) `, one of which is associated with each ndarray. As with other container objects in Python, the contents of an @@ -32,7 +32,8 @@ .. admonition:: Example - A 2-dimensional array of size 2 x 3, composed of 4-byte integer elements: + A 2-dimensional array of size 2 x 3, composed of 4-byte integer + elements: >>> x = np.array([[1, 2, 3], [4, 5, 6]], np.int32) >>> type(x) @@ -44,10 +45,11 @@ The array can be indexed using Python container-like syntax: - >>> x[1,2] # i.e., the element of x in the *second* row, *third* column - 6 + >>> x[1,2] # i.e., the element of x in the *second* row, *third* + column, namely, 6. - For example :ref:`slicing ` can produce views of the array: + For example :ref:`slicing ` can produce views of + the array: >>> y = x[:,1] >>> y @@ -96,14 +98,15 @@ the bytes are interpreted is defined by the :ref:`data-type object ` associated with the array. -.. index:: C-order, Fortran-order, row-major, column-major, stride, offset +.. index:: C-order, Fortran-order, row-major, column-major, stride, + offset A segment of memory is inherently 1-dimensional, and there are many -different schemes for arranging the items of an *N*-dimensional array in -a 1-dimensional block. Numpy is flexible, and :class:`ndarray` objects -can accommodate any *strided indexing scheme*. In a strided scheme, -the N-dimensional index :math:`(n_0, n_1, ..., n_{N-1})` corresponds -to the offset (in bytes) +different schemes for arranging the items of an *N*-dimensional array +in a 1-dimensional block. Numpy is flexible, and :class:`ndarray` +objects can accommodate any *strided indexing scheme*. In a strided +scheme, the N-dimensional index :math:`(n_0, n_1, ..., n_{N-1})` +corresponds to the offset (in bytes): .. math:: n_{\mathrm{offset}} = \sum_{k=0}^{N-1} s_k n_k @@ -116,7 +119,8 @@ .. math:: - s_k^{\mathrm{column}} = \prod_{j=0}^{k-1} d_j , \quad s_k^{\mathrm{row}} = \prod_{j=k+1}^{N-1} d_j . + s_k^{\mathrm{column}} = \prod_{j=0}^{k-1} d_j , + \quad s_k^{\mathrm{row}} = \prod_{j=k+1}^{N-1} d_j . .. index:: single-segment, contiguous, non-contiguous @@ -172,8 +176,6 @@ ndarray.nbytes ndarray.base -.. note:: XXX: update and check these docstrings. - Data type --------- @@ -187,8 +189,6 @@ ndarray.dtype -.. note:: XXX: update the dtype attribute docstring: setting etc. - Other attributes ---------------- @@ -223,9 +223,6 @@ ndarray.ctypes -.. note:: XXX: update and check these docstrings. - - .. _array.ndarray.methods: Array methods @@ -241,11 +238,12 @@ :func:`argmin`, :func:`argsort`, :func:`choose`, :func:`clip`, :func:`compress`, :func:`copy`, :func:`cumprod`, :func:`cumsum`, :func:`diagonal`, :func:`imag`, :func:`max `, :func:`mean`, -:func:`min `, :func:`nonzero`, :func:`prod`, :func:`ptp`, :func:`put`, -:func:`ravel`, :func:`real`, :func:`repeat`, :func:`reshape`, -:func:`round `, :func:`searchsorted`, :func:`sort`, :func:`squeeze`, -:func:`std`, :func:`sum`, :func:`swapaxes`, :func:`take`, -:func:`trace`, :func:`transpose`, :func:`var`. +:func:`min `, :func:`nonzero`, :func:`prod`, :func:`ptp`, +:func:`put`, :func:`ravel`, :func:`real`, :func:`repeat`, +:func:`reshape`, :func:`round `, :func:`searchsorted`, +:func:`sort`, :func:`squeeze`, :func:`std`, :func:`sum`, +:func:`swapaxes`, :func:`take`, :func:`trace`, :func:`transpose`, +:func:`var`. Array conversion ---------------- @@ -268,8 +266,6 @@ ndarray.setflags ndarray.fill -.. note:: XXX: update and check these docstrings. - Shape manipulation ------------------ @@ -323,8 +319,8 @@ float32, float64, etc., whereas a 0-dimensional array is an ndarray instance containing precisely one array scalar.) -- If *axis* is an integer, then the operation is done over the given axis - (for each 1-D subarray that can be created along the given axis). +- If *axis* is an integer, then the operation is done over the given + axis (for each 1-D subarray that can be created along the given axis). .. admonition:: Example of the *axis* argument @@ -393,9 +389,6 @@ Arithmetic and comparison operations ==================================== -.. note:: XXX: write all attributes explicitly here instead of relying on - the auto\* stuff? - .. index:: comparison, arithmetic, operation, operator Arithmetic and comparison operations on :class:`ndarrays ` @@ -435,9 +428,9 @@ :meth:`ndarray.__nonzero__`, which raises an error if the number of elements in the the array is larger than 1, because the truth value of such arrays is ambiguous. Use :meth:`.any() ` and - :meth:`.all() ` instead to be clear about what is meant in - such cases. (If the number of elements is 0, the array evaluates to - ``False``.) + :meth:`.all() ` instead to be clear about what is meant + in such cases. (If the number of elements is 0, the array evaluates + to ``False``.) Unary operations: Modified: trunk/doc/source/reference/c-api.coremath.rst =================================================================== --- trunk/doc/source/reference/c-api.coremath.rst 2010-02-17 23:53:04 UTC (rev 8127) +++ trunk/doc/source/reference/c-api.coremath.rst 2010-02-17 23:55:16 UTC (rev 8128) @@ -125,7 +125,8 @@ .. cvar:: NPY_EULER - The Euler constant (:math:`\lim_{n\rightarrow \infty}{\sum_{k=1}^n{\frac{1}{k}} - \ln n}`) + The Euler constant + :math:`\lim_{n\rightarrow\infty}({\sum_{k=1}^n{\frac{1}{k}}-\ln n})` Low-level floating point manipulation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Modified: trunk/doc/source/reference/c-api.types-and-structures.rst =================================================================== --- trunk/doc/source/reference/c-api.types-and-structures.rst 2010-02-17 23:53:04 UTC (rev 8127) +++ trunk/doc/source/reference/c-api.types-and-structures.rst 2010-02-17 23:55:16 UTC (rev 8128) @@ -416,7 +416,8 @@ functions can (and must) deal with mis-behaved arrays. The other functions require behaved memory segments. - .. cmember:: void cast(void *from, void *to, npy_intp n, void *fromarr, void *toarr) + .. cmember:: void cast(void *from, void *to, npy_intp n, void *fromarr, + void *toarr) An array of function pointers to cast from the current type to all of the other builtin types. Each function casts a @@ -442,7 +443,8 @@ a zero is returned, otherwise, a negative one is returned (and a Python error set). - .. cmember:: void copyswapn(void *dest, npy_intp dstride, void *src, npy_intp sstride, npy_intp n, int swap, void *arr) + .. cmember:: void copyswapn(void *dest, npy_intp dstride, void *src, + npy_intp sstride, npy_intp n, int swap, void *arr) .. cmember:: void copyswap(void *dest, void *src, int swap, void *arr) @@ -468,7 +470,8 @@ ``d1`` < * ``d2``. The array object arr is used to retrieve itemsize and field information for flexible arrays. - .. cmember:: int argmax(void* data, npy_intp n, npy_intp* max_ind, void* arr) + .. cmember:: int argmax(void* data, npy_intp n, npy_intp* max_ind, + void* arr) A pointer to a function that retrieves the index of the largest of ``n`` elements in ``arr`` beginning at the element @@ -477,7 +480,8 @@ always 0. The index of the largest element is returned in ``max_ind``. - .. cmember:: void dotfunc(void* ip1, npy_intp is1, void* ip2, npy_intp is2, void* op, npy_intp n, void* arr) + .. cmember:: void dotfunc(void* ip1, npy_intp is1, void* ip2, npy_intp is2, + void* op, npy_intp n, void* arr) A pointer to a function that multiplies two ``n`` -length sequences together, adds them, and places the result in @@ -527,7 +531,8 @@ computed by repeatedly adding this computed delta. The data buffer must be well-behaved. - .. cmember:: void fillwithscalar(void* buffer, npy_intp length, void* value, void* arr) + .. cmember:: void fillwithscalar(void* buffer, npy_intp length, + void* value, void* arr) A pointer to a function that fills a contiguous ``buffer`` of the given ``length`` with a single scalar ``value`` whose @@ -542,7 +547,8 @@ :cdata:`PyArray_MERGESORT` are defined). These sorts are done in-place assuming contiguous and aligned data. - .. cmember:: int argsort(void* start, npy_intp* result, npy_intp length, void \*arr) + .. cmember:: int argsort(void* start, npy_intp* result, npy_intp length, + void \*arr) An array of function pointers to sorting algorithms for this data type. The same sorting algorithms as for sort are @@ -666,11 +672,12 @@ .. cmember:: int PyUFuncObject.identity - Either :cdata:`PyUFunc_One`, :cdata:`PyUFunc_Zero`, or :cdata:`PyUFunc_None` - to indicate the identity for this operation. It is only used - for a reduce-like call on an empty array. + Either :cdata:`PyUFunc_One`, :cdata:`PyUFunc_Zero`, or + :cdata:`PyUFunc_None` to indicate the identity for this operation. + It is only used for a reduce-like call on an empty array. - .. cmember:: void PyUFuncObject.functions(char** args, npy_intp* dims, npy_intp* steps, void* extradata) + .. cmember:: void PyUFuncObject.functions(char** args, npy_intp* dims, + npy_intp* steps, void* extradata) An array of function pointers --- one for each data type supported by the ufunc. This is the vector loop that is called @@ -764,8 +771,8 @@ .. ctype:: PyArrayIterObject The C-structure corresponding to an object of :cdata:`PyArrayIter_Type` is - the :ctype:`PyArrayIterObject`. The :ctype:`PyArrayIterObject` is used to keep - track of a pointer into an N-dimensional array. It contains associated + the :ctype:`PyArrayIterObject`. The :ctype:`PyArrayIterObject` is used to + keep track of a pointer into an N-dimensional array. It contains associated information used to quickly march through the array. The pointer can be adjusted in three basic ways: 1) advance to the "next" position in the array in a C-style contiguous fashion, 2) advance to an arbitrary @@ -928,8 +935,9 @@ .. ctype:: PyArrayNeighborhoodIterObject - The C-structure corresponding to an object of :cdata:`PyArrayNeighborhoodIter_Type` is - the :ctype:`PyArrayNeighborhoodIterObject`. + The C-structure corresponding to an object of + :cdata:`PyArrayNeighborhoodIter_Type` is the + :ctype:`PyArrayNeighborhoodIterObject`. PyArrayFlags_Type ----------------- @@ -1183,4 +1191,3 @@ ``arrayobject.h`` header. This type is not exposed to Python and could be replaced with a C-structure. As a Python type it takes advantage of reference- counted memory management. - Modified: trunk/doc/source/reference/c-api.ufunc.rst =================================================================== --- trunk/doc/source/reference/c-api.ufunc.rst 2010-02-17 23:53:04 UTC (rev 8127) +++ trunk/doc/source/reference/c-api.ufunc.rst 2010-02-17 23:55:16 UTC (rev 8128) @@ -63,7 +63,9 @@ Functions --------- -.. cfunction:: PyObject* PyUFunc_FromFuncAndData(PyUFuncGenericFunction* func, void** data, char* types, int ntypes, int nin, int nout, int identity, char* name, char* doc, int check_return) +.. cfunction:: PyObject* PyUFunc_FromFuncAndData(PyUFuncGenericFunction* func, + void** data, char* types, int ntypes, int nin, int nout, int identity, + char* name, char* doc, int check_return) Create a new broadcasting universal function from required variables. Each ufunc builds around the notion of an element-by-element @@ -102,9 +104,6 @@ :param nout: The number of outputs - :param identity: - XXX: Undocumented - :param name: The name for the ufunc. Specifying a name of 'add' or 'multiply' enables a special behavior for integer-typed @@ -127,7 +126,8 @@ structure and it does get set with this value when the ufunc object is created. -.. cfunction:: int PyUFunc_RegisterLoopForType(PyUFuncObject* ufunc, int usertype, PyUFuncGenericFunction function, int* arg_types, void* data) +.. cfunction:: int PyUFunc_RegisterLoopForType(PyUFuncObject* ufunc, + int usertype, PyUFuncGenericFunction function, int* arg_types, void* data) This function allows the user to register a 1-d loop with an already- created ufunc to be used whenever the ufunc is called @@ -140,7 +140,9 @@ in as *arg_types* which must be a pointer to memory at least as large as ufunc->nargs. -.. cfunction:: int PyUFunc_ReplaceLoopBySignature(PyUFuncObject* ufunc, PyUFuncGenericFunction newfunc, int* signature, PyUFuncGenericFunction* oldfunc) +.. cfunction:: int PyUFunc_ReplaceLoopBySignature(PyUFuncObject* ufunc, + PyUFuncGenericFunction newfunc, int* signature, + PyUFuncGenericFunction* oldfunc) Replace a 1-d loop matching the given *signature* in the already-created *ufunc* with the new 1-d loop newfunc. Return the @@ -150,7 +152,8 @@ signature is an array of data-type numbers indicating the inputs followed by the outputs assumed by the 1-d loop. -.. cfunction:: int PyUFunc_GenericFunction(PyUFuncObject* self, PyObject* args, PyArrayObject** mps) +.. cfunction:: int PyUFunc_GenericFunction(PyUFuncObject* self, + PyObject* args, PyArrayObject** mps) A generic ufunc call. The ufunc is passed in as *self*, the arguments to the ufunc as *args*. The *mps* argument is an array @@ -179,7 +182,8 @@ Clear the IEEE error flags. -.. cfunction:: void PyUFunc_GetPyValues(char* name, int* bufsize, int* errmask, PyObject** errobj) +.. cfunction:: void PyUFunc_GetPyValues(char* name, int* bufsize, + int* errmask, PyObject** errobj) Get the Python values used for ufunc processing from the thread-local storage area unless the defaults have been set in @@ -206,21 +210,29 @@ functions stored in the functions member of the PyUFuncObject structure. -.. cfunction:: void PyUFunc_f_f_As_d_d(char** args, npy_intp* dimensions, npy_intp* steps, void* func) +.. cfunction:: void PyUFunc_f_f_As_d_d(char** args, npy_intp* dimensions, + npy_intp* steps, void* func) -.. cfunction:: void PyUFunc_d_d(char** args, npy_intp* dimensions, npy_intp* steps, void* func) +.. cfunction:: void PyUFunc_d_d(char** args, npy_intp* dimensions, + npy_intp* steps, void* func) -.. cfunction:: void PyUFunc_f_f(char** args, npy_intp* dimensions, npy_intp* steps, void* func) +.. cfunction:: void PyUFunc_f_f(char** args, npy_intp* dimensions, + npy_intp* steps, void* func) -.. cfunction:: void PyUFunc_g_g(char** args, npy_intp* dimensions, npy_intp* steps, void* func) +.. cfunction:: void PyUFunc_g_g(char** args, npy_intp* dimensions, + npy_intp* steps, void* func) -.. cfunction:: void PyUFunc_F_F_As_D_D(char** args, npy_intp* dimensions, npy_intp* steps, void* func) +.. cfunction:: void PyUFunc_F_F_As_D_D(char** args, npy_intp* dimensions, + npy_intp* steps, void* func) -.. cfunction:: void PyUFunc_F_F(char** args, npy_intp* dimensions, npy_intp* steps, void* func) +.. cfunction:: void PyUFunc_F_F(char** args, npy_intp* dimensions, + npy_intp* steps, void* func) -.. cfunction:: void PyUFunc_D_D(char** args, npy_intp* dimensions, npy_intp* steps, void* func) +.. cfunction:: void PyUFunc_D_D(char** args, npy_intp* dimensions, + npy_intp* steps, void* func) -.. cfunction:: void PyUFunc_G_G(char** args, npy_intp* dimensions, npy_intp* steps, void* func) +.. cfunction:: void PyUFunc_G_G(char** args, npy_intp* dimensions, + npy_intp* steps, void* func) Type specific, core 1-d functions for ufuncs where each calculation is obtained by calling a function taking one input @@ -235,21 +247,29 @@ but calls out to a C-function that takes double and returns double. -.. cfunction:: void PyUFunc_ff_f_As_dd_d(char** args, npy_intp* dimensions, npy_intp* steps, void* func) +.. cfunction:: void PyUFunc_ff_f_As_dd_d(char** args, npy_intp* dimensions, + npy_intp* steps, void* func) -.. cfunction:: void PyUFunc_ff_f(char** args, npy_intp* dimensions, npy_intp* steps, void* func) +.. cfunction:: void PyUFunc_ff_f(char** args, npy_intp* dimensions, + npy_intp* steps, void* func) -.. cfunction:: void PyUFunc_dd_d(char** args, npy_intp* dimensions, npy_intp* steps, void* func) +.. cfunction:: void PyUFunc_dd_d(char** args, npy_intp* dimensions, + npy_intp* steps, void* func) -.. cfunction:: void PyUFunc_gg_g(char** args, npy_intp* dimensions, npy_intp* steps, void* func) +.. cfunction:: void PyUFunc_gg_g(char** args, npy_intp* dimensions, + npy_intp* steps, void* func) -.. cfunction:: void PyUFunc_FF_F_As_DD_D(char** args, npy_intp* dimensions, npy_intp* steps, void* func) +.. cfunction:: void PyUFunc_FF_F_As_DD_D(char** args, npy_intp* dimensions, + npy_intp* steps, void* func) -.. cfunction:: void PyUFunc_DD_D(char** args, npy_intp* dimensions, npy_intp* steps, void* func) +.. cfunction:: void PyUFunc_DD_D(char** args, npy_intp* dimensions, + npy_intp* steps, void* func) -.. cfunction:: void PyUFunc_FF_F(char** args, npy_intp* dimensions, npy_intp* steps, void* func) +.. cfunction:: void PyUFunc_FF_F(char** args, npy_intp* dimensions, + npy_intp* steps, void* func) -.. cfunction:: void PyUFunc_GG_G(char** args, npy_intp* dimensions, npy_intp* steps, void* func) +.. cfunction:: void PyUFunc_GG_G(char** args, npy_intp* dimensions, + npy_intp* steps, void* func) Type specific, core 1-d functions for ufuncs where each calculation is obtained by calling a function taking two input @@ -261,25 +281,29 @@ of one data type but cast the values at each iteration of the loop to use the underlying function that takes a different data type. -.. cfunction:: void PyUFunc_O_O(char** args, npy_intp* dimensions, npy_intp* steps, void* func) +.. cfunction:: void PyUFunc_O_O(char** args, npy_intp* dimensions, + npy_intp* steps, void* func) -.. cfunction:: void PyUFunc_OO_O(char** args, npy_intp* dimensions, npy_intp* steps, void* func) +.. cfunction:: void PyUFunc_OO_O(char** args, npy_intp* dimensions, + npy_intp* steps, void* func) One-input, one-output, and two-input, one-output core 1-d functions - for the :cdata:`NPY_OBJECT` data type. These functions handle reference count - issues and return early on error. The actual function to call is *func* - and it must accept calls with the signature ``(PyObject*)(PyObject*)`` - for :cfunc:`PyUFunc_O_O` or ``(PyObject*)(PyObject *, PyObject *)`` - for :cfunc:`PyUFunc_OO_O`. + for the :cdata:`NPY_OBJECT` data type. These functions handle reference + count issues and return early on error. The actual function to call is + *func* and it must accept calls with the signature ``(PyObject*) + (PyObject*)`` for :cfunc:`PyUFunc_O_O` or ``(PyObject*)(PyObject *, + PyObject *)`` for :cfunc:`PyUFunc_OO_O`. -.. cfunction:: void PyUFunc_O_O_method(char** args, npy_intp* dimensions, npy_intp* steps, void* func) +.. cfunction:: void PyUFunc_O_O_method(char** args, npy_intp* dimensions, + npy_intp* steps, void* func) This general purpose 1-d core function assumes that *func* is a string representing a method of the input object. For each iteration of the loop, the Python obejct is extracted from the array and its *func* method is called returning the result to the output array. -.. cfunction:: void PyUFunc_OO_O_method(char** args, npy_intp* dimensions, npy_intp* steps, void* func) +.. cfunction:: void PyUFunc_OO_O_method(char** args, npy_intp* dimensions, + npy_intp* steps, void* func) This general purpose 1-d core function assumes that *func* is a string representing a method of the input object that takes one @@ -288,7 +312,8 @@ function. The output of the function is stored in the third entry of *args*. -.. cfunction:: void PyUFunc_On_Om(char** args, npy_intp* dimensions, npy_intp* steps, void* func) +.. cfunction:: void PyUFunc_On_Om(char** args, npy_intp* dimensions, + npy_intp* steps, void* func) This is the 1-d core function used by the dynamic ufuncs created by umath.frompyfunc(function, nin, nout). In this case *func* is a Modified: trunk/doc/source/reference/index.rst =================================================================== --- trunk/doc/source/reference/index.rst 2010-02-17 23:53:04 UTC (rev 8127) +++ trunk/doc/source/reference/index.rst 2010-02-17 23:55:16 UTC (rev 8128) @@ -34,7 +34,8 @@ Public Domain in August 2008). The reference documentation for many of the functions are written by numerous contributors and developers of Numpy, both prior to and during the -`Numpy Documentation Marathon `__. +`Numpy Documentation Marathon +`__. Please help to improve NumPy's documentation! Instructions on how to join the ongoing documentation marathon can be found Modified: trunk/doc/source/reference/internals.code-explanations.rst =================================================================== --- trunk/doc/source/reference/internals.code-explanations.rst 2010-02-17 23:53:04 UTC (rev 8127) +++ trunk/doc/source/reference/internals.code-explanations.rst 2010-02-17 23:55:16 UTC (rev 8128) @@ -99,7 +99,7 @@ dataptr member of the iterator object structure and call the macro :cfunc:`PyArray_ITER_NEXT` (it) on the iterator object to move to the next element. The "next" element is always in C-contiguous order. The macro -works by first special casing the C-contiguous, 1-d, and 2-d cases +works by first special casing the C-contiguous, 1-D, and 2-D cases which work very simply. For the general case, the iteration works by keeping track of a list @@ -196,7 +196,7 @@ The implementation of advanced indexing represents some of the most difficult code to write and explain. In fact, there are two -implementations of advanced indexing. The first works only with 1-d +implementations of advanced indexing. The first works only with 1-D arrays and is implemented to handle expressions involving a.flat[obj]. The second is general-purpose that works for arrays of "arbitrary dimension" (up to a fixed maximum). The one-dimensional indexing @@ -222,7 +222,7 @@ After these optimizations, the array_subscript function itself is called. This function first checks for field selection which occurs -when a string is passed as the indexing object. Then, 0-d arrays are +when a string is passed as the indexing object. Then, 0-D arrays are given special-case consideration. Finally, the code determines whether or not advanced, or fancy, indexing needs to be performed. If fancy indexing is not needed, then standard view-based indexing is performed @@ -330,12 +330,12 @@ single: ufunc Universal functions are callable objects that take :math:`N` inputs -and produce :math:`M` outputs by wrapping basic 1-d loops that work +and produce :math:`M` outputs by wrapping basic 1-D loops that work element-by-element into full easy-to use functions that seamlessly implement broadcasting, type-checking and buffered coercion, and output-argument handling. New universal functions are normally created in C, although there is a mechanism for creating ufuncs from Python -functions (:func:`frompyfunc`). The user must supply a 1-d loop that +functions (:func:`frompyfunc`). The user must supply a 1-D loop that implements the basic function taking the input scalar values and placing the resulting scalars into the appropriate output slots as explaine n implementation. @@ -349,7 +349,7 @@ even though the actual calculation of the ufunc is very fast, you will be able to write array and type-specific code that will work faster for small arrays than the ufunc. In particular, using ufuncs to -perform many calculations on 0-d arrays will be slower than other +perform many calculations on 0-D arrays will be slower than other Python-based solutions (the silently-imported scalarmath module exists precisely to give array scalars the look-and-feel of ufunc-based calculations with significantly reduced overhead). @@ -366,9 +366,9 @@ dictionary the current values for the buffer-size, the error mask, and the associated error object. The state of the error mask controls what happens when an error-condiction is found. It should be noted that -checking of the hardware error flags is only performed after each 1-d +checking of the hardware error flags is only performed after each 1-D loop is executed. This means that if the input and output arrays are -contiguous and of the correct type so that a single 1-d loop is +contiguous and of the correct type so that a single 1-D loop is performed, then the flags may not be checked until all elements of the array have been calcluated. Looking up these values in a thread- specific dictionary takes time which is easily ignored for all but @@ -378,11 +378,11 @@ evaluated to determine how the ufunc should proceed and the input and output arrays are constructed if necessary. Any inputs which are not arrays are converted to arrays (using context if necessary). Which of -the inputs are scalars (and therefore converted to 0-d arrays) is +the inputs are scalars (and therefore converted to 0-D arrays) is noted. -Next, an appropriate 1-d loop is selected from the 1-d loops available -to the ufunc based on the input array types. This 1-d loop is selected +Next, an appropriate 1-D loop is selected from the 1-D loops available +to the ufunc based on the input array types. This 1-D loop is selected by trying to match the signature of the data-types of the inputs against the available signatures. The signatures corresponding to built-in types are stored in the types member of the ufunc structure. @@ -394,10 +394,10 @@ input arrays can all be cast safely (ignoring any scalar arguments which are not allowed to determine the type of the result). The implication of this search procedure is that "lesser types" should be -placed below "larger types" when the signatures are stored. If no 1-d +placed below "larger types" when the signatures are stored. If no 1-D loop is found, then an error is reported. Otherwise, the argument_list is updated with the stored signature --- in case casting is necessary -and to fix the output types assumed by the 1-d loop. +and to fix the output types assumed by the 1-D loop. If the ufunc has 2 inputs and 1 output and the second input is an Object array then a special-case check is performed so that @@ -406,7 +406,7 @@ method. In this way, Python is signaled to give the other object a chance to complete the operation instead of using generic object-array calculations. This allows (for example) sparse matrices to override -the multiplication operator 1-d loop. +the multiplication operator 1-D loop. For input arrays that are smaller than the specified buffer size, copies are made of all non-contiguous, mis-aligned, or out-of- @@ -441,7 +441,7 @@ compilation, then the Python Global Interpreter Lock (GIL) is released prior to calling all of these loops (as long as they don't involve object arrays). It is re-acquired if necessary to handle error -conditions. The hardware error flags are checked only after the 1-d +conditions. The hardware error flags are checked only after the 1-D loop is calcluated. @@ -449,10 +449,10 @@ ^^^^^^^^ This is the simplest case of all. The ufunc is executed by calling the -underlying 1-d loop exactly once. This is possible only when we have +underlying 1-D loop exactly once. This is possible only when we have aligned data of the correct type (including byte-order) for both input and output and all arrays have uniform strides (either contiguous, -0-d, or 1-d). In this case, the 1-d computational loop is called once +0-D, or 1-D). In this case, the 1-D computational loop is called once to compute the calculation for the entire array. Note that the hardware error flags are only checked after the entire calculation is complete. @@ -462,13 +462,13 @@ ^^^^^^^^^^^^ When the input and output arrays are aligned and of the correct type, -but the striding is not uniform (non-contiguous and 2-d or larger), +but the striding is not uniform (non-contiguous and 2-D or larger), then a second looping structure is employed for the calculation. This approach converts all of the iterators for the input and output arguments to iterate over all but the largest dimension. The inner -loop is then handled by the underlying 1-d computational loop. The +loop is then handled by the underlying 1-D computational loop. The outer loop is a standard iterator loop on the converted iterators. The -hardware error flags are checked after each 1-d loop is completed. +hardware error flags are checked after each 1-D loop is completed. Buffered Loop @@ -476,12 +476,12 @@ This is the code that handles the situation whenever the input and/or output arrays are either misaligned or of the wrong data-type -(including being byte-swapped) from what the underlying 1-d loop +(including being byte-swapped) from what the underlying 1-D loop expects. The arrays are also assumed to be non-contiguous. The code -works very much like the strided loop except for the inner 1-d loop is +works very much like the strided loop except for the inner 1-D loop is modified so that pre-processing is performed on the inputs and post- processing is performed on the outputs in bufsize chunks (where -bufsize is a user-settable parameter). The underlying 1-d +bufsize is a user-settable parameter). The underlying 1-D computational loop is called on data that is copied over (if it needs to be). The setup code and the loop code is considerably more complicated in this case because it has to handle: @@ -497,10 +497,10 @@ - special-casing Object arrays so that reference counts are properly handled when copies and/or casts are necessary. -- breaking up the inner 1-d loop into bufsize chunks (with a possible +- breaking up the inner 1-D loop into bufsize chunks (with a possible remainder). -Again, the hardware error flags are checked at the end of each 1-d +Again, the hardware error flags are checked at the end of each 1-D loop. @@ -544,7 +544,7 @@ This function creates a reducing loop object and fills it with parameters needed to complete the loop. All of the methods only work on ufuncs that take 2-inputs and return 1 output. Therefore, the -underlying 1-d loop is selected assuming a signature of [ ``otype``, +underlying 1-D loop is selected assuming a signature of [ ``otype``, ``otype``, ``otype`` ] where ``otype`` is the requested reduction data-type. The buffer size and error handling is then retrieved from (per-thread) global storage. For small arrays that are mis-aligned or @@ -573,10 +573,10 @@ .. index:: triple: ufunc; methods; reduce -All of the ufunc methods use the same underlying 1-d computational +All of the ufunc methods use the same underlying 1-D computational loops with input and output arguments adjusted so that the appropriate reduction takes place. For example, the key to the functioning of -reduce is that the 1-d loop is called with the output and the second +reduce is that the 1-D loop is called with the output and the second input pointing to the same position in memory and both having a step- size of 0. The first input is pointing to the input array with a step- size given by the appropriate stride for the selected axis. In this @@ -594,7 +594,7 @@ :math:`o` is the output, and :math:`i[k]` is the :math:`k^{\textrm{th}}` element of :math:`i` along the selected axis. This basic operations is repeated for arrays with greater than 1 -dimension so that the reduction takes place for every 1-d sub-array +dimension so that the reduction takes place for every 1-D sub-array along the selected axis. An iterator with the selected dimension removed handles this looping. @@ -625,9 +625,10 @@ o[k] & = & i[k]\textrm{}o[k-1]\quad k=1\ldots N. \end{align*} -The output has the same shape as the input and each 1-d loop operates -over :math:`N` elements when the shape in the selected axis is :math:`N+1`. Again, buffered loops take care to copy and cast the data before -calling the underlying 1-d computational loop. +The output has the same shape as the input and each 1-D loop operates +over :math:`N` elements when the shape in the selected axis is :math:`N+1`. +Again, buffered loops take care to copy and cast the data before +calling the underlying 1-D computational loop. Reduceat @@ -645,21 +646,21 @@ loop implementation is handled using code that is very similar to the reduce code repeated as many times as there are elements in the indices input. In particular: the first input pointer passed to the -underlying 1-d computational loop points to the input array at the +underlying 1-D computational loop points to the input array at the correct location indicated by the index array. In addition, the output -pointer and the second input pointer passed to the underlying 1-d loop -point to the same position in memory. The size of the 1-d +pointer and the second input pointer passed to the underlying 1-D loop +point to the same position in memory. The size of the 1-D computational loop is fixed to be the difference between the current index and the next index (when the current index is the last index, then the next index is assumed to be the length of the array along the -selected dimension). In this way, the 1-d loop will implement a reduce +selected dimension). In this way, the 1-D loop will implement a reduce over the specified indices. Mis-aligned or a loop data-type that does not match the input and/or output data-type is handled using buffered code where-in data is copied to a temporary buffer and cast to the correct data-type if -necessary prior to calling the underlying 1-d function. The temporary +necessary prior to calling the underlying 1-D function. The temporary buffers are created in (element) sizes no bigger than the user settable buffer-size value. Thus, the loop must be flexible enough to -call the underlying 1-d computational loop enough times to complete +call the underlying 1-D computational loop enough times to complete the total calculation in chunks no bigger than the buffer-size. Modified: trunk/doc/source/reference/maskedarray.generic.rst =================================================================== --- trunk/doc/source/reference/maskedarray.generic.rst 2010-02-17 23:53:04 UTC (rev 8127) +++ trunk/doc/source/reference/maskedarray.generic.rst 2010-02-17 23:55:16 UTC (rev 8128) @@ -19,11 +19,19 @@ What is a masked array? ----------------------- -In many circumstances, datasets can be incomplete or tainted by the presence of invalid data. For example, a sensor may have failed to record a data, or -recorded an invalid value. -The :mod:`numpy.ma` module provides a convenient way to address this issue, by introducing masked arrays. +In many circumstances, datasets can be incomplete or tainted by the presence +of invalid data. For example, a sensor may have failed to record a data, or +recorded an invalid value. The :mod:`numpy.ma` module provides a convenient +way to address this issue, by introducing masked arrays. -A masked array is the combination of a standard :class:`numpy.ndarray` and a mask. A mask is either :attr:`nomask`, indicating that no value of the associated array is invalid, or an array of booleans that determines for each element of the associated array whether the value is valid or not. When an element of the mask is ``False``, the corresponding element of the associated array is valid and is said to be unmasked. When an element of the mask is ``True``, the corresponding element of the associated array is said to be masked (invalid). +A masked array is the combination of a standard :class:`numpy.ndarray` and a +mask. A mask is either :attr:`nomask`, indicating that no value of the +associated array is invalid, or an array of booleans that determines for each +element of the associated array whether the value is valid or not. When an +element of the mask is ``False``, the corresponding element of the associated +array is valid and is said to be unmasked. When an element of the mask is +``True``, the corresponding element of the associated array is said to be +masked (invalid). The package ensures that masked entries are not used in computations. @@ -38,7 +46,8 @@ >>> mx = ma.masked_array(x, mask=[0, 0, 0, 1, 0]) -We can now compute the mean of the dataset, without taking the invalid data into account:: +We can now compute the mean of the dataset, without taking the invalid data +into account:: >>> mx.mean() 2.75 @@ -48,8 +57,9 @@ -------------------------- -The main feature of the :mod:`numpy.ma` module is the :class:`MaskedArray` class, which is a subclass of :class:`numpy.ndarray`. -The class, its attributes and methods are described in more details in the +The main feature of the :mod:`numpy.ma` module is the :class:`MaskedArray` +class, which is a subclass of :class:`numpy.ndarray`. The class, its +attributes and methods are described in more details in the :ref:`MaskedArray class ` section. The :mod:`numpy.ma` module can be used as an addition to :mod:`numpy`: :: @@ -138,30 +148,40 @@ The underlying data of a masked array can be accessed in several ways: -* through the :attr:`~MaskedArray.data` attribute. The output is a view of the array as - a :class:`numpy.ndarray` or one of its subclasses, depending on the type - of the underlying data at the masked array creation. +* through the :attr:`~MaskedArray.data` attribute. The output is a view of the + array as a :class:`numpy.ndarray` or one of its subclasses, depending on the + type of the underlying data at the masked array creation. -* through the :meth:`~MaskedArray.__array__` method. The output is then a :class:`numpy.ndarray`. +* through the :meth:`~MaskedArray.__array__` method. The output is then a + :class:`numpy.ndarray`. -* by directly taking a view of the masked array as a :class:`numpy.ndarray` or one of its subclass (which is actually what using the :attr:`~MaskedArray.data` attribute does). +* by directly taking a view of the masked array as a :class:`numpy.ndarray` + or one of its subclass (which is actually what using the + :attr:`~MaskedArray.data` attribute does). * by using the :func:`getdata` function. -None of these methods is completely satisfactory if some entries have been marked as invalid. As a general rule, where a representation of the array is required without any masked entries, it is recommended to fill the array with the :meth:`filled` method. +None of these methods is completely satisfactory if some entries have been +marked as invalid. As a general rule, where a representation of the array is +required without any masked entries, it is recommended to fill the array with +the :meth:`filled` method. Accessing the mask ------------------ -The mask of a masked array is accessible through its :attr:`~MaskedArray.mask` attribute. -We must keep in mind that a ``True`` entry in the mask indicates an *invalid* data. +The mask of a masked array is accessible through its :attr:`~MaskedArray.mask` +attribute. We must keep in mind that a ``True`` entry in the mask indicates an +*invalid* data. -Another possibility is to use the :func:`getmask` and :func:`getmaskarray` functions. :func:`getmask(x)` outputs the mask of ``x`` if ``x`` is a masked array, and the special value :data:`nomask` otherwise. -:func:`getmaskarray(x)` outputs the mask of ``x`` if ``x`` is a masked array. -If ``x`` has no invalid entry or is not a masked array, the function outputs a boolean array of ``False`` with as many elements as ``x``. +Another possibility is to use the :func:`getmask` and :func:`getmaskarray` +functions. :func:`getmask(x)` outputs the mask of ``x`` if ``x`` is a masked +array, and the special value :data:`nomask` otherwise. :func:`getmaskarray(x)` +outputs the mask of ``x`` if ``x`` is a masked array. If ``x`` has no invalid +entry or is not a masked array, the function outputs a boolean array of +``False`` with as many elements as ``x``. @@ -169,7 +189,9 @@ Accessing only the valid entries --------------------------------- -To retrieve only the valid entries, we can use the inverse of the mask as an index. The inverse of the mask can be calculated with the :func:`numpy.logical_not` function or simply with the ``~`` operator:: +To retrieve only the valid entries, we can use the inverse of the mask as an +index. The inverse of the mask can be calculated with the +:func:`numpy.logical_not` function or simply with the ``~`` operator:: >>> x = ma.array([[1, 2], [3, 4]], mask=[[0, 1], [1, 0]]) >>> x[~x.mask] @@ -177,9 +199,10 @@ mask = [False False], fill_value = 999999) -Another way to retrieve the valid data is to use the :meth:`compressed` method, -which returns a one-dimensional :class:`~numpy.ndarray` (or one of its subclasses, -depending on the value of the :attr:`~MaskedArray.baseclass` attribute):: +Another way to retrieve the valid data is to use the :meth:`compressed` +method, which returns a one-dimensional :class:`~numpy.ndarray` (or one of its +subclasses, depending on the value of the :attr:`~MaskedArray.baseclass` +attribute):: >>> x.compressed() array([1, 4]) @@ -194,7 +217,8 @@ Masking an entry ~~~~~~~~~~~~~~~~ -The recommended way to mark one or several specific entries of a masked array as invalid is to assign the special value :attr:`masked` to them:: +The recommended way to mark one or several specific entries of a masked array +as invalid is to assign the special value :attr:`masked` to them:: >>> x = ma.array([1, 2, 3]) >>> x[0] = ma.masked @@ -226,10 +250,15 @@ but this usage is discouraged. .. note:: - When creating a new masked array with a simple, non-structured datatype, the mask is initially set to the special value :attr:`nomask`, that corresponds roughly to the boolean ``False``. Trying to set an element of :attr:`nomask` will fail with a :exc:`TypeError` exception, as a boolean does not support item assignment. + When creating a new masked array with a simple, non-structured datatype, + the mask is initially set to the special value :attr:`nomask`, that + corresponds roughly to the boolean ``False``. Trying to set an element of + :attr:`nomask` will fail with a :exc:`TypeError` exception, as a boolean + does not support item assignment. -All the entries of an array can be masked at once by assigning ``True`` to the mask:: +All the entries of an array can be masked at once by assigning ``True`` to the +mask:: >>> x = ma.array([1, 2, 3], mask=[0, 0, 1]) >>> x.mask = True @@ -238,7 +267,8 @@ mask = [ True True True], fill_value = 999999) -Finally, specific entries can be masked and/or unmasked by assigning to the mask a sequence of booleans:: +Finally, specific entries can be masked and/or unmasked by assigning to the +mask a sequence of booleans:: >>> x = ma.array([1, 2, 3]) >>> x.mask = [0, 1, 0] @@ -250,7 +280,8 @@ Unmasking an entry ~~~~~~~~~~~~~~~~~~ -To unmask one or several specific entries, we can just assign one or several new valid values to them:: +To unmask one or several specific entries, we can just assign one or several +new valid values to them:: >>> x = ma.array([1, 2, 3], mask=[0, 0, 1]) >>> x @@ -264,12 +295,12 @@ fill_value = 999999) .. note:: - Unmasking an entry by direct assignment will silently fail if the masked array - has a *hard* mask, as shown by the :attr:`hardmask` attribute. - This feature was introduced to prevent overwriting the mask. - To force the unmasking of an entry where the array has a hard mask, the mask must first - to be softened using the :meth:`soften_mask` method before the allocation. It can be re-hardened - with :meth:`harden_mask`:: + Unmasking an entry by direct assignment will silently fail if the masked + array has a *hard* mask, as shown by the :attr:`hardmask` attribute. This + feature was introduced to prevent overwriting the mask. To force the + unmasking of an entry where the array has a hard mask, the mask must first + to be softened using the :meth:`soften_mask` method before the allocation. + It can be re-hardened with :meth:`harden_mask`:: >>> x = ma.array([1, 2, 3], mask=[0, 0, 1], hard_mask=True) >>> x @@ -290,7 +321,9 @@ >>> x.harden_mask() -To unmask all masked entries of a masked array (provided the mask isn't a hard mask), the simplest solution is to assign the constant :attr:`nomask` to the mask:: +To unmask all masked entries of a masked array (provided the mask isn't a hard +mask), the simplest solution is to assign the constant :attr:`nomask` to the +mask:: >>> x = ma.array([1, 2, 3], mask=[0, 0, 1]) >>> x @@ -308,9 +341,13 @@ Indexing and slicing -------------------- -As a :class:`MaskedArray` is a subclass of :class:`numpy.ndarray`, it inherits its mechanisms for indexing and slicing. +As a :class:`MaskedArray` is a subclass of :class:`numpy.ndarray`, it inherits +its mechanisms for indexing and slicing. -When accessing a single entry of a masked array with no named fields, the output is either a scalar (if the corresponding entry of the mask is ``False``) or the special value :attr:`masked` (if the corresponding entry of the mask is ``True``):: +When accessing a single entry of a masked array with no named fields, the +output is either a scalar (if the corresponding entry of the mask is +``False``) or the special value :attr:`masked` (if the corresponding entry of +the mask is ``True``):: >>> x = ma.array([1, 2, 3], mask=[0, 0, 1]) >>> x[0] @@ -323,7 +360,9 @@ True If the masked array has named fields, accessing a single entry returns a -:class:`numpy.void` object if none of the fields are masked, or a 0d masked array with the same dtype as the initial array if at least one of the fields is masked. +:class:`numpy.void` object if none of the fields are masked, or a 0d masked +array with the same dtype as the initial array if at least one of the fields +is masked. >>> y = ma.masked_array([(1,2), (3, 4)], ... mask=[(0, 0), (0, 1)], @@ -337,7 +376,11 @@ dtype = [('a', '>> x = ma.array([1, 2, 3, 4, 5], mask=[0, 1, 0, 0, 1]) >>> mx = x[:3] @@ -356,31 +399,39 @@ array([ 1, -1, 3, 4, 5]) -Accessing a field of a masked array with structured datatype returns a :class:`MaskedArray`. +Accessing a field of a masked array with structured datatype returns a +:class:`MaskedArray`. - - Operations on masked arrays --------------------------- Arithmetic and comparison operations are supported by masked arrays. -As much as possible, invalid entries of a masked array are not processed, meaning that the -corresponding :attr:`data` entries *should* be the same before and after the operation. +As much as possible, invalid entries of a masked array are not processed, +meaning that the corresponding :attr:`data` entries *should* be the same +before and after the operation. .. warning:: - We need to stress that this behavior may not be systematic, that masked data may be affected - by the operation in some cases and therefore users should not rely on this data remaining unchanged. + We need to stress that this behavior may not be systematic, that masked + data may be affected by the operation in some cases and therefore users + should not rely on this data remaining unchanged. The :mod:`numpy.ma` module comes with a specific implementation of most -ufuncs. -Unary and binary functions that have a validity domain (such as :func:`~numpy.log` or :func:`~numpy.divide`) return the :data:`masked` constant whenever the input is masked or falls outside the validity domain:: +ufuncs. Unary and binary functions that have a validity domain (such as +:func:`~numpy.log` or :func:`~numpy.divide`) return the :data:`masked` +constant whenever the input is masked or falls outside the validity domain:: >>> ma.log([-1, 0, 1, 2]) masked_array(data = [-- -- 0.0 0.69314718056], mask = [ True True False False], fill_value = 1e+20) -Masked arrays also support standard numpy ufuncs. The output is then a masked array. The result of a unary ufunc is masked wherever the input is masked. The result of a binary ufunc is masked wherever any of the input is masked. If the ufunc also returns the optional context output (a 3-element tuple containing the name of the ufunc, its arguments and its domain), the context is processed and entries of the output masked array are masked wherever the corresponding input fall outside the validity domain:: +Masked arrays also support standard numpy ufuncs. The output is then a masked +array. The result of a unary ufunc is masked wherever the input is masked. The +result of a binary ufunc is masked wherever any of the input is masked. If the +ufunc also returns the optional context output (a 3-element tuple containing +the name of the ufunc, its arguments and its domain), the context is processed +and entries of the output masked array are masked wherever the corresponding +input fall outside the validity domain:: >>> x = ma.array([-1, 1, 0, 2, 3], mask=[0, 0, 0, 0, 1]) >>> np.log(x) @@ -396,8 +447,9 @@ Data with a given value representing missing data ------------------------------------------------- -Let's consider a list of elements, ``x``, where values of -9999. represent missing data. -We wish to compute the average value of the data and the vector of anomalies (deviations from the average):: +Let's consider a list of elements, ``x``, where values of -9999. represent +missing data. We wish to compute the average value of the data and the vector +of anomalies (deviations from the average):: >>> import numpy.ma as ma >>> x = [0.,1.,-9999.,3.,4.] @@ -423,7 +475,8 @@ Numerical operations -------------------- -Numerical operations can be easily performed without worrying about missing values, dividing by zero, square roots of negative numbers, etc.:: +Numerical operations can be easily performed without worrying about missing +values, dividing by zero, square roots of negative numbers, etc.:: >>> import numpy as np, numpy.ma as ma >>> x = ma.array([1., -1., 3., 4., 5., 6.], mask=[0,0,0,0,1,0]) @@ -431,13 +484,16 @@ >>> print np.sqrt(x/y) [1.0 -- -- 1.0 -- --] -Four values of the output are invalid: the first one comes from taking the square root of a negative number, the second from the division by zero, and the last two where the inputs were masked. +Four values of the output are invalid: the first one comes from taking the +square root of a negative number, the second from the division by zero, and +the last two where the inputs were masked. Ignoring extreme values ----------------------- -Let's consider an array ``d`` of random floats between 0 and 1. -We wish to compute the average of the values of ``d`` while ignoring any data outside the range ``[0.1, 0.9]``:: +Let's consider an array ``d`` of random floats between 0 and 1. We wish to +compute the average of the values of ``d`` while ignoring any data outside +the range ``[0.1, 0.9]``:: >>> print ma.masked_outside(d, 0.1, 0.9).mean() Modified: trunk/doc/source/reference/routines.array-creation.rst =================================================================== --- trunk/doc/source/reference/routines.array-creation.rst 2010-02-17 23:53:04 UTC (rev 8127) +++ trunk/doc/source/reference/routines.array-creation.rst 2010-02-17 23:55:16 UTC (rev 8128) @@ -44,7 +44,8 @@ Creating record arrays (:mod:`numpy.rec`) ----------------------------------------- -.. note:: :mod:`numpy.rec` is the preferred alias for :mod:`numpy.core.records`. +.. note:: :mod:`numpy.rec` is the preferred alias for + :mod:`numpy.core.records`. .. autosummary:: :toctree: generated/ @@ -60,7 +61,8 @@ Creating character arrays (:mod:`numpy.char`) --------------------------------------------- -.. note:: :mod:`numpy.char` is the preferred alias for :mod:`numpy.core.defchararray`. +.. note:: :mod:`numpy.char` is the preferred alias for + :mod:`numpy.core.defchararray`. .. autosummary:: :toctree: generated/ Modified: trunk/doc/source/reference/routines.rst =================================================================== --- trunk/doc/source/reference/routines.rst 2010-02-17 23:53:04 UTC (rev 8127) +++ trunk/doc/source/reference/routines.rst 2010-02-17 23:55:16 UTC (rev 8128) @@ -2,6 +2,16 @@ Routines ******** +In this chapter routine docstrings are presented, grouped by functionality. +Many docstrings contain example code, which demonstrates basic usage +of the routine. The examples assume that NumPy is imported with:: + + >>> import numpy as np + +A convenient way to execute examples is the ``%doctest_mode`` mode of +IPython, which allows for pasting of multi-line examples and preserves +indentation. + .. toctree:: :maxdepth: 2 Modified: trunk/doc/source/user/basics.indexing.rst =================================================================== --- trunk/doc/source/user/basics.indexing.rst 2010-02-17 23:53:04 UTC (rev 8127) +++ trunk/doc/source/user/basics.indexing.rst 2010-02-17 23:55:16 UTC (rev 8128) @@ -6,11 +6,4 @@ .. seealso:: :ref:`Indexing routines ` -.. note:: - - XXX: Combine ``numpy.doc.indexing`` with material - section 2.2 Basic indexing? - Or incorporate the material directly here? - - .. automodule:: numpy.doc.indexing Modified: trunk/doc/source/user/basics.rec.rst =================================================================== --- trunk/doc/source/user/basics.rec.rst 2010-02-17 23:53:04 UTC (rev 8127) +++ trunk/doc/source/user/basics.rec.rst 2010-02-17 23:55:16 UTC (rev 8128) @@ -1,3 +1,5 @@ +.. _structured_arrays: + *************************************** Structured arrays (aka "Record arrays") *************************************** Modified: trunk/doc/source/user/basics.rst =================================================================== --- trunk/doc/source/user/basics.rst 2010-02-17 23:53:04 UTC (rev 8127) +++ trunk/doc/source/user/basics.rst 2010-02-17 23:55:16 UTC (rev 8128) @@ -2,11 +2,6 @@ Numpy basics ************ -.. note:: - - XXX: there is overlap between this text extracted from ``numpy.doc`` - and "Guide to Numpy" chapter 2. Needs combining? - .. toctree:: :maxdepth: 2 Modified: trunk/doc/source/user/basics.types.rst =================================================================== --- trunk/doc/source/user/basics.types.rst 2010-02-17 23:53:04 UTC (rev 8127) +++ trunk/doc/source/user/basics.types.rst 2010-02-17 23:55:16 UTC (rev 8128) @@ -4,11 +4,4 @@ .. seealso:: :ref:`Data type objects ` -.. note:: - - XXX: Combine ``numpy.doc.indexing`` with material from - "Guide to Numpy" (section 2.1 Data-Type descriptors)? - Or incorporate the material directly here? - - .. automodule:: numpy.doc.basics Modified: trunk/doc/source/user/c-info.beyond-basics.rst =================================================================== --- trunk/doc/source/user/c-info.beyond-basics.rst 2010-02-17 23:53:04 UTC (rev 8127) +++ trunk/doc/source/user/c-info.beyond-basics.rst 2010-02-17 23:55:16 UTC (rev 8128) @@ -159,17 +159,18 @@ .. index:: single: broadcasting -When multiple arrays are involved in an operation, you may want to use the same -broadcasting rules that the math operations ( *i.e.* the ufuncs) use. This can -be done easily using the :ctype:`PyArrayMultiIterObject`. This is the object -returned from the Python command numpy.broadcast and it is almost as easy to -use from C. The function :cfunc:`PyArray_MultiIterNew` ( ``n``, ``...`` ) is -used (with ``n`` input objects in place of ``...`` ). The input objects can be -arrays or anything that can be converted into an array. A pointer to a -PyArrayMultiIterObject is returned. Broadcasting has already been accomplished -which adjusts the iterators so that all that needs to be done to advance to the -next element in each array is for PyArray_ITER_NEXT to be called for each of -the inputs. This incrementing is automatically performed by +When multiple arrays are involved in an operation, you may want to use the +same broadcasting rules that the math operations (*i.e.* the ufuncs) use. +This can be done easily using the :ctype:`PyArrayMultiIterObject`. This is +the object returned from the Python command numpy.broadcast and it is almost +as easy to use from C. The function +:cfunc:`PyArray_MultiIterNew` ( ``n``, ``...`` ) is used (with ``n`` input +objects in place of ``...`` ). The input objects can be arrays or anything +that can be converted into an array. A pointer to a PyArrayMultiIterObject is +returned. Broadcasting has already been accomplished which adjusts the +iterators so that all that needs to be done to advance to the next element in +each array is for PyArray_ITER_NEXT to be called for each of the inputs. This +incrementing is automatically performed by :cfunc:`PyArray_MultiIter_NEXT` ( ``obj`` ) macro (which can handle a multiterator ``obj`` as either a :ctype:`PyArrayMultiObject *` or a :ctype:`PyObject *`). The data from input number ``i`` is available using @@ -233,15 +234,19 @@ built-in data-types is given below. A different mechanism is used to register ufuncs for user-defined data-types. -.. cfunction:: PyObject *PyUFunc_FromFuncAndData( PyUFuncGenericFunction* func, void** data, char* types, int ntypes, int nin, int nout, int identity, char* name, char* doc, int check_return) +.. cfunction:: PyObject *PyUFunc_FromFuncAndData( PyUFuncGenericFunction* func, + void** data, char* types, int ntypes, int nin, int nout, int identity, + char* name, char* doc, int check_return) *func* A pointer to an array of 1-d functions to use. This array must be at - least ntypes long. Each entry in the array must be a ``PyUFuncGenericFunction`` function. This function has the following signature. An example of a - valid 1d loop function is also given. + least ntypes long. Each entry in the array must be a + ``PyUFuncGenericFunction`` function. This function has the following + signature. An example of a valid 1d loop function is also given. - .. cfunction:: void loop1d(char** args, npy_intp* dimensions, npy_intp* steps, void* data) + .. cfunction:: void loop1d(char** args, npy_intp* dimensions, + npy_intp* steps, void* data) *args* @@ -269,7 +274,8 @@ .. code-block:: c static void - double_add(char *args, npy_intp *dimensions, npy_intp *steps, void *extra) + double_add(char *args, npy_intp *dimensions, npy_intp *steps, + void *extra) { npy_intp i; npy_intp is1=steps[0], is2=steps[1]; @@ -320,9 +326,9 @@ *identity* - Either :cdata:`PyUFunc_One`, :cdata:`PyUFunc_Zero`, :cdata:`PyUFunc_None`. - This specifies what should be returned when an empty array is - passed to the reduce method of the ufunc. + Either :cdata:`PyUFunc_One`, :cdata:`PyUFunc_Zero`, + :cdata:`PyUFunc_None`. This specifies what should be returned when + an empty array is passed to the reduce method of the ufunc. *name* @@ -458,7 +464,8 @@ these functions with the data-type descriptor. A low-level casting function has the signature. -.. cfunction:: void castfunc( void* from, void* to, npy_intp n, void* fromarr, void* toarr) +.. cfunction:: void castfunc( void* from, void* to, npy_intp n, void* fromarr, + void* toarr) Cast ``n`` elements ``from`` one type ``to`` another. The data to cast from is in a contiguous, correctly-swapped and aligned chunk @@ -531,7 +538,8 @@ this function is ``0`` if the process was successful and ``-1`` with an error condition set if it was not successful. -.. cfunction:: int PyUFunc_RegisterLoopForType( PyUFuncObject* ufunc, int usertype, PyUFuncGenericFunction function, int* arg_types, void* data) +.. cfunction:: int PyUFunc_RegisterLoopForType( PyUFuncObject* ufunc, + int usertype, PyUFuncGenericFunction function, int* arg_types, void* data) *ufunc* @@ -661,10 +669,6 @@ Some special methods and attributes are used by arrays in order to facilitate the interoperation of sub-types with the base ndarray type. -.. note:: XXX: some of the documentation below needs to be moved to the - reference guide. - - The __array_finalize\__ method ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Modified: trunk/doc/source/user/c-info.python-as-glue.rst =================================================================== --- trunk/doc/source/user/c-info.python-as-glue.rst 2010-02-17 23:53:04 UTC (rev 8127) +++ trunk/doc/source/user/c-info.python-as-glue.rst 2010-02-17 23:55:16 UTC (rev 8128) @@ -13,7 +13,7 @@ Many people like to say that Python is a fantastic glue language. Hopefully, this Chapter will convince you that this is true. The first adopters of Python for science were typically people who used it to -glue together large applicaton codes running on super-computers. Not +glue together large application codes running on super-computers. Not only was it much nicer to code in Python than in a shell script or Perl, in addition, the ability to easily extend Python made it relatively easy to create new classes and types specifically adapted @@ -123,8 +123,7 @@ interfaces to routines in Fortran 77/90/95 code. It has the ability to parse Fortran 77/90/95 code and automatically generate Python signatures for the subroutines it encounters, or you can guide how the -subroutine interfaces with Python by constructing an interface- -defintion-file (or modifying the f2py-produced one). +subroutine interfaces with Python by constructing an interface-definition-file (or modifying the f2py-produced one). .. index:: single: f2py @@ -175,7 +174,7 @@ This command leaves a file named add.{ext} in the current directory (where {ext} is the appropriate extension for a python extension module on your platform --- so, pyd, *etc.* ). This module may then be -imported from Python. It will contain a method for each subroutin in +imported from Python. It will contain a method for each subroutine in add (zadd, cadd, dadd, sadd). The docstring of each method contains information about how the module method may be called: @@ -586,7 +585,7 @@ One final note about weave.inline: if you have additional code you want to include in the final extension module such as supporting -function calls, include statments, etc. you can pass this code in as a +function calls, include statements, etc. you can pass this code in as a string using the keyword support_code: ``weave.inline(code, variables, support_code=support)``. If you need the extension module to link against an additional library then you can also pass in @@ -784,7 +783,7 @@ Pyrex-filter ------------ -The two-dimensional example we created using weave is a bit uglierto +The two-dimensional example we created using weave is a bit uglier to implement in Pyrex because two-dimensional indexing using Pyrex is not as simple. But, it is straightforward (and possibly faster because of pre-computed indices). Here is the Pyrex-file I named image.pyx. @@ -873,7 +872,7 @@ 4. Multi-dimensional arrays are "bulky" to index (appropriate macros may be able to fix this). -5. The C-code generated by Prex is hard to read and modify (and typically +5. The C-code generated by Pyrex is hard to read and modify (and typically compiles with annoying but harmless warnings). Writing a good Pyrex extension module still takes a bit of effort @@ -1126,8 +1125,8 @@ area of an ndarray. You may still want to wrap the function in an additional Python wrapper to make it user-friendly (hiding some obvious arguments and making some arguments output arguments). In this -process, the **requires** function in NumPy may be useful to return the right kind of array from -a given input. +process, the **requires** function in NumPy may be useful to return the right +kind of array from a given input. Complete example Modified: trunk/doc/source/user/howtofind.rst =================================================================== --- trunk/doc/source/user/howtofind.rst 2010-02-17 23:53:04 UTC (rev 8127) +++ trunk/doc/source/user/howtofind.rst 2010-02-17 23:55:16 UTC (rev 8128) @@ -4,6 +4,4 @@ .. seealso:: :ref:`Numpy-specific help functions ` -.. note:: XXX: this part is not yet written. - .. automodule:: numpy.doc.howtofind Modified: trunk/doc/source/user/install.rst =================================================================== --- trunk/doc/source/user/install.rst 2010-02-17 23:53:04 UTC (rev 8127) +++ trunk/doc/source/user/install.rst 2010-02-17 23:55:16 UTC (rev 8128) @@ -12,29 +12,30 @@ ------- Good solutions for Windows are, The Enthought Python Distribution `(EPD) -`_ (which provides binary installers -for Windows, OS X and Redhat) and `Python (x, y) `_. -Both of these packages include Python, NumPy and many additional packages. -A lightweight alternative is to download the Python installer from -`www.python.org `_ and the NumPy installer for your -Python version from the Sourceforge `download site -`_ +`_ (which provides binary +installers for Windows, OS X and Redhat) and `Python (x, y) +`_. Both of these packages include Python, NumPy and +many additional packages. A lightweight alternative is to download the Python +installer from `www.python.org `_ and the NumPy +installer for your Python version from the Sourceforge `download site `_ Linux ----- Most of the major distributions provide packages for NumPy, but these can lag behind the most recent NumPy release. Pre-built binary packages for Ubuntu are -available on the `scipy ppa `_. -Redhat binaries are available in the `EPD -`_. +available on the `scipy ppa +`_. Redhat binaries are +available in the `EPD `_. Mac OS X -------- A universal binary installer for NumPy is available from the `download site -`_. -The `EPD `_ provides NumPy binaries. +`_. The `EPD `_ +provides NumPy binaries. Building from source ==================== @@ -62,21 +63,22 @@ 2) Compilers - To build any extension modules for Python, you'll need a C compiler. Various - NumPy modules use FORTRAN 77 libraries, so you'll also need a FORTRAN 77 - compiler installed. + To build any extension modules for Python, you'll need a C compiler. + Various NumPy modules use FORTRAN 77 libraries, so you'll also need a + FORTRAN 77 compiler installed. - Note that NumPy is developed mainly using GNU compilers. Compilers from other - vendors such as Intel, Absoft, Sun, NAG, Compaq, Vast, Porland, Lahey, HP, - IBM, Microsoft are only supported in the form of community feedback, and may - not work out of the box. GCC 3.x (and later) compilers are recommended. + Note that NumPy is developed mainly using GNU compilers. Compilers from + other vendors such as Intel, Absoft, Sun, NAG, Compaq, Vast, Porland, + Lahey, HP, IBM, Microsoft are only supported in the form of community + feedback, and may not work out of the box. GCC 3.x (and later) compilers + are recommended. 3) Linear Algebra libraries - NumPy does not require any external linear algebra libraries to be installed. - However, if these are available, NumPy's setup script can detect them and use - them for building. A number of different LAPACK library setups can be used, - including optimized LAPACK libraries such as ATLAS, MKL or the + NumPy does not require any external linear algebra libraries to be + installed. However, if these are available, NumPy's setup script can detect + them and use them for building. A number of different LAPACK library setups + can be used, including optimized LAPACK libraries such as ATLAS, MKL or the Accelerate/vecLib framework on OS X. FORTRAN ABI mismatch @@ -87,8 +89,8 @@ should avoid mixing libraries built with one with another. In particular, if your blas/lapack/atlas is built with g77, you *must* use g77 when building numpy and scipy; on the contrary, if your atlas is built with gfortran, you -*must* build numpy/scipy with gfortran. This applies for most other cases where -different FORTRAN compilers might have been used. +*must* build numpy/scipy with gfortran. This applies for most other cases +where different FORTRAN compilers might have been used. Choosing the fortran compiler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -110,9 +112,9 @@ One relatively simple and reliable way to check for the compiler used to build a library is to use ldd on the library. If libg2c.so is a dependency, this -means that g77 has been used. If libgfortran.so is a a dependency, gfortran has -been used. If both are dependencies, this means both have been used, which is -almost always a very bad idea. +means that g77 has been used. If libgfortran.so is a a dependency, gfortran +has been used. If both are dependencies, this means both have been used, which +is almost always a very bad idea. Building with ATLAS support --------------------------- Modified: trunk/doc/source/user/misc.rst =================================================================== --- trunk/doc/source/user/misc.rst 2010-02-17 23:53:04 UTC (rev 8127) +++ trunk/doc/source/user/misc.rst 2010-02-17 23:55:16 UTC (rev 8128) @@ -2,8 +2,6 @@ Miscellaneous ************* -.. note:: XXX: This section is not yet written. - .. automodule:: numpy.doc.misc .. automodule:: numpy.doc.methods_vs_functions Modified: trunk/doc/source/user/performance.rst =================================================================== --- trunk/doc/source/user/performance.rst 2010-02-17 23:53:04 UTC (rev 8127) +++ trunk/doc/source/user/performance.rst 2010-02-17 23:55:16 UTC (rev 8128) @@ -2,6 +2,4 @@ Performance *********** -.. note:: XXX: This section is not yet written. - .. automodule:: numpy.doc.performance Modified: trunk/numpy/add_newdocs.py =================================================================== --- trunk/numpy/add_newdocs.py 2010-02-17 23:53:04 UTC (rev 8127) +++ trunk/numpy/add_newdocs.py 2010-02-17 23:55:16 UTC (rev 8128) @@ -3985,6 +3985,12 @@ """ Functions that operate element by element on whole arrays. + To see the documentation for a specific ufunc, use np.info(). For + example, np.info(np.sin). Because ufuncs are written in C + (for speed) and linked into Python with NumPy's ufunc facility, + Python's help() function finds this page whenever help() is called + on a ufunc. + A detailed explanation of ufuncs can be found in the "ufuncs.rst" file in the NumPy reference guide. Modified: trunk/numpy/core/code_generators/ufunc_docstrings.py =================================================================== --- trunk/numpy/core/code_generators/ufunc_docstrings.py 2010-02-17 23:53:04 UTC (rev 8127) +++ trunk/numpy/core/code_generators/ufunc_docstrings.py 2010-02-17 23:55:16 UTC (rev 8128) @@ -1641,7 +1641,7 @@ x1 : array_like of integer type Input values. x2 : array_like of integer type - Number of zeros to append to `x1`. + Number of zeros to append to `x1`. Has to be non-negative. Returns ------- @@ -1849,6 +1849,16 @@ handles the floating-point negative zero as an infinitesimal negative number, conforming to the C99 standard. + Examples + -------- + >>> x = np.array([0, 1, 2, 2**4]) + >>> np.log2(x) + array([-Inf, 0., 1., 4.]) + + >>> xi = np.array([0+1.j, 1, 2+0.j, 4.j]) + >>> np.log2(xi) + array([ 0.+2.26618007j, 0.+0.j , 1.+0.j , 2.+2.26618007j]) + """) add_newdoc('numpy.core.umath', 'logaddexp', Modified: trunk/numpy/doc/constants.py =================================================================== --- trunk/numpy/doc/constants.py 2010-02-17 23:53:04 UTC (rev 8127) +++ trunk/numpy/doc/constants.py 2010-02-17 23:55:16 UTC (rev 8128) @@ -75,8 +75,8 @@ isnan : Shows which elements are Not a Number - isfinite : Shows which elements are finite (not one of - Not a Number, positive infinity and negative infinity) + isfinite : Shows which elements are finite (not one of Not a Number, + positive infinity and negative infinity) Notes ----- @@ -214,7 +214,7 @@ """ Euler's constant, base of natural logarithms, Napier's constant. - `e = 2.71828182845904523536028747135266249775724709369995...` + ``e = 2.71828182845904523536028747135266249775724709369995...`` See Also -------- @@ -246,8 +246,8 @@ isnan : Shows which elements are Not a Number - isfinite : Shows which elements are finite (not one of - Not a Number, positive infinity and negative infinity) + isfinite : Shows which elements are finite (not one of Not a Number, + positive infinity and negative infinity) Notes ----- @@ -322,20 +322,20 @@ Examples -------- - >>> np.newaxis is None + >>> newaxis is None True >>> x = np.arange(3) >>> x array([0, 1, 2]) - >>> x[:, np.newaxis] + >>> x[:, newaxis] array([[0], [1], [2]]) - >>> x[:, np.newaxis, np.newaxis] + >>> x[:, newaxis, newaxis] array([[[0]], [[1]], [[2]]]) - >>> x[:, np.newaxis] * x + >>> x[:, newaxis] * x array([[0, 0, 0], [0, 1, 2], [0, 2, 4]]) @@ -343,20 +343,20 @@ Outer product, same as ``outer(x, y)``: >>> y = np.arange(3, 6) - >>> x[:, np.newaxis] * y + >>> x[:, newaxis] * y array([[ 0, 0, 0], [ 3, 4, 5], [ 6, 8, 10]]) ``x[newaxis, :]`` is equivalent to ``x[newaxis]`` and ``x[None]``: - >>> x[np.newaxis, :].shape + >>> x[newaxis, :].shape (1, 3) - >>> x[np.newaxis].shape + >>> x[newaxis].shape (1, 3) >>> x[None].shape (1, 3) - >>> x[:, np.newaxis].shape + >>> x[:, newaxis].shape (3, 1) """) From numpy-svn at scipy.org Thu Feb 18 23:34:28 2010 From: numpy-svn at scipy.org (Genuine Pfizer VIAGRA) Date: Thu, 18 Feb 2010 22:34:28 -0600 (CST) Subject: [Numpy-svn] User numpy-svn Supersale, 80% Off Message-ID: <20100219043428.8B7F639CAFA@scipy.org> An HTML attachment was scrubbed... URL: From numpy-svn at scipy.org Fri Feb 19 01:35:46 2010 From: numpy-svn at scipy.org (VIAGRA ® Official Site) Date: Fri, 19 Feb 2010 00:35:46 -0600 (CST) Subject: [Numpy-svn] DISCOUNT ID22859 71% 0FF on Pfizer ! Message-ID: <20100219063546.9BA0B39CAF4@scipy.org> An HTML attachment was scrubbed... URL: From numpy-svn at scipy.org Fri Feb 19 01:52:32 2010 From: numpy-svn at scipy.org (Genuine Pfizer VIAGRA) Date: Fri, 19 Feb 2010 00:52:32 -0600 (CST) Subject: [Numpy-svn] User numpy-svn Supersale, 80% Off Message-ID: <20100219065232.F3DE739CAF8@scipy.org> An HTML attachment was scrubbed... URL: From numpy-svn at scipy.org Fri Feb 19 06:59:11 2010 From: numpy-svn at scipy.org (Pfizer (tm) VIAGRA (c)) Date: Fri, 19 Feb 2010 05:59:11 -0600 (CST) Subject: [Numpy-svn] Personal numpy-svn 80% Off Message-ID: <20100219115911.1542A39CAF8@scipy.org> An HTML attachment was scrubbed... URL: From numpy-svn at scipy.org Fri Feb 19 11:25:46 2010 From: numpy-svn at scipy.org (Pfizer (tm) Viagra Certified Seller) Date: Fri, 19 Feb 2010 10:25:46 -0600 (CST) Subject: [Numpy-svn] Mr. numpy-svn 78% less to pay Message-ID: <20100219162546.DF8BFC7C062@scipy.org> An HTML attachment was scrubbed... URL: From numpy-svn at scipy.org Fri Feb 19 11:54:05 2010 From: numpy-svn at scipy.org (VIAGRA from Pfizer) Date: Fri, 19 Feb 2010 10:54:05 -0600 (CST) Subject: [Numpy-svn] numpy-svn Winter -80% Deals Message-ID: <20100219165405.B3B8DC7C044@scipy.org> An HTML attachment was scrubbed... URL: From numpy-svn at scipy.org Sat Feb 20 05:32:34 2010 From: numpy-svn at scipy.org (Approved VIAGRA® Store) Date: Sat, 20 Feb 2010 04:32:34 -0600 (CST) Subject: [Numpy-svn] Electronic Discount Code 71% for numpy-svn@scipy.org Message-ID: <20100220103234.3BEC3C7C066@scipy.org> An HTML attachment was scrubbed... URL: From numpy-svn at scipy.org Sat Feb 20 10:37:56 2010 From: numpy-svn at scipy.org (Swiss Watch on-line) Date: Sat, 20 Feb 2010 09:37:56 -0600 (CST) Subject: [Numpy-svn] Hi, numpy-svn, unbelievable 80% off prices Message-ID: <20100220153756.9A4ECC7C084@scipy.org> An HTML attachment was scrubbed... URL: From numpy-svn at scipy.org Sat Feb 20 13:03:00 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:03:00 -0600 (CST) Subject: [Numpy-svn] r8129 - trunk/numpy/core/src/multiarray Message-ID: <20100220180300.683E7C7C060@scipy.org> Author: ptvirtan Date: 2010-02-20 12:03:00 -0600 (Sat, 20 Feb 2010) New Revision: 8129 Modified: trunk/numpy/core/src/multiarray/descriptor.c Log: 3K: BUG: bytes as dtype should map to 1-byte strings, not long Modified: trunk/numpy/core/src/multiarray/descriptor.c =================================================================== --- trunk/numpy/core/src/multiarray/descriptor.c 2010-02-17 23:55:16 UTC (rev 8128) +++ trunk/numpy/core/src/multiarray/descriptor.c 2010-02-20 18:03:00 UTC (rev 8129) @@ -1217,15 +1217,9 @@ else if (obj == (PyObject *)(&PyBool_Type)) { check_num = PyArray_BOOL; } -#if defined(NPY_PY3K) else if (obj == (PyObject *)(&PyBytes_Type)) { - check_num = PyArray_LONG; - } -#else - else if (obj == (PyObject *)(&PyBytes_Type)) { check_num = PyArray_STRING; } -#endif else if (obj == (PyObject *)(&PyUnicode_Type)) { check_num = PyArray_UNICODE; } From numpy-svn at scipy.org Sat Feb 20 13:03:14 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:03:14 -0600 (CST) Subject: [Numpy-svn] r8130 - trunk/numpy/core Message-ID: <20100220180314.B9071C7C060@scipy.org> Author: ptvirtan Date: 2010-02-20 12:03:14 -0600 (Sat, 20 Feb 2010) New Revision: 8130 Modified: trunk/numpy/core/_internal.py Log: 3K: core: sort using the key= method Modified: trunk/numpy/core/_internal.py =================================================================== --- trunk/numpy/core/_internal.py 2010-02-20 18:03:00 UTC (rev 8129) +++ trunk/numpy/core/_internal.py 2010-02-20 18:03:14 UTC (rev 8130) @@ -34,7 +34,7 @@ title = None allfields.append((fname, format, num, title)) # sort by offsets - allfields.sort(lambda x,y: cmp(x[2],y[2])) + allfields.sort(key=lambda x: x[2]) names = [x[0] for x in allfields] formats = [x[1] for x in allfields] offsets = [x[2] for x in allfields] From numpy-svn at scipy.org Sat Feb 20 13:03:36 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:03:36 -0600 (CST) Subject: [Numpy-svn] r8131 - in trunk/numpy/core: include/numpy src/multiarray Message-ID: <20100220180336.93918C7C060@scipy.org> Author: ptvirtan Date: 2010-02-20 12:03:36 -0600 (Sat, 20 Feb 2010) New Revision: 8131 Modified: trunk/numpy/core/include/numpy/ndarrayobject.h trunk/numpy/core/src/multiarray/buffer.c trunk/numpy/core/src/multiarray/ctors.c trunk/numpy/core/src/multiarray/descriptor.c Log: ENH: rewrite PEP 3118 interface without adding items to structs Implementing PEP 3118 is somewhat convoluted because of the desirata: - Don't add new members to ndarray or descr structs, to preserve binary compatibility. (Also, adding the items is actually not very useful, since mutability issues prevent an 1 to 1 relationship between arrays and buffer views.) - Don't use bf_releasebuffer, because it prevents PyArg_ParseTuple("s#", ...) from working. Breaking this would cause several backward compatibility issues already on Python 2.6. - Behave correctly when array is reshaped in-place, or it's dtype is altered. This commit works around these issues by keeping copies of buffer format strings and shape/stride information in a global dictionary. Elements in the dictionary are reused when possible, and cleared when an array is deallocated. Modified: trunk/numpy/core/include/numpy/ndarrayobject.h =================================================================== --- trunk/numpy/core/include/numpy/ndarrayobject.h 2010-02-20 18:03:14 UTC (rev 8130) +++ trunk/numpy/core/include/numpy/ndarrayobject.h 2010-02-20 18:03:36 UTC (rev 8131) @@ -526,8 +526,6 @@ basic data descriptor */ PyObject *metadata; /* Metadata about this dtype */ - - char *buffer_format; /* Buffer interface format string, or NULL */ } PyArray_Descr; typedef struct _arr_descr { @@ -559,7 +557,6 @@ PyArray_Descr *descr; /* Pointer to type structure */ int flags; /* Flags describing array -- see below*/ PyObject *weakreflist; /* For weakreferences */ - void *buffer_info; /* Data used by the buffer interface */ } PyArrayObject; #define NPY_AO PyArrayObject Modified: trunk/numpy/core/src/multiarray/buffer.c =================================================================== --- trunk/numpy/core/src/multiarray/buffer.c 2010-02-20 18:03:14 UTC (rev 8130) +++ trunk/numpy/core/src/multiarray/buffer.c 2010-02-20 18:03:36 UTC (rev 8131) @@ -74,35 +74,42 @@ /************************************************************************* * PEP 3118 buffer protocol + * + * Implementing PEP 3118 is somewhat convoluted because of the desirata: + * + * - Don't add new members to ndarray or descr structs, to preserve binary + * compatibility. (Also, adding the items is actually not very useful, + * since mutability issues prevent an 1 to 1 relationship between arrays + * and buffer views.) + * + * - Don't use bf_releasebuffer, because it prevents PyArg_ParseTuple("s#", ... + * from working. Breaking this would cause several backward compatibility + * issues already on Python 2.6. + * + * - Behave correctly when array is reshaped in-place, or it's dtype is + * altered. + * + * The solution taken below is to manually track memory allocated for + * Py_buffers. *************************************************************************/ - -/* - * Note: because for backward compatibility we cannot define bf_releasebuffer, - * we must go through some additional contortions in bf_getbuffer. - */ - #if PY_VERSION_HEX >= 0x02060000 /* * Format string translator + * + * Translate PyArray_Descr to a PEP 3118 format string. */ +/* Fast string 'class' */ typedef struct { char *s; int allocated; int pos; -} _tmp_string; +} _tmp_string_t; -typedef struct { - char *format; - int nd; - Py_ssize_t *strides; - Py_ssize_t *shape; -} _buffer_data; - static int -_append_char(_tmp_string *s, char c) +_append_char(_tmp_string_t *s, char c) { char *p; if (s->s == NULL) { @@ -125,20 +132,19 @@ } static int -_append_str(_tmp_string *s, char *c) +_append_str(_tmp_string_t *s, char *c) { while (*c != '\0') { if (_append_char(s, *c)) return -1; ++c; } + return 0; } static int -_buffer_format_string(PyArray_Descr *descr, _tmp_string *str, int *offset) +_buffer_format_string(PyArray_Descr *descr, _tmp_string_t *str, int *offset) { - PyObject *s; int k; - int zero_offset = 0; if (descr->subarray) { PyErr_SetString(PyExc_ValueError, @@ -251,7 +257,181 @@ return 0; } + /* + * Global information about all active buffers + * + * Note: because for backward compatibility we cannot define bf_releasebuffer, + * we must manually keep track of the additional data required by the buffers. + */ + +/* Additional per-array data required for providing the buffer interface */ +typedef struct { + char *format; + int ndim; + Py_ssize_t *strides; + Py_ssize_t *shape; +} _buffer_info_t; + +/* + * { id(array): [list of pointers to _buffer_info_t, the last one is latest] } + * + * Because shape, strides, and format can be different for different buffers, + * we may need to keep track of multiple buffer infos for each array. + * + * However, when none of them has changed, the same buffer info may be reused. + * + * Thread-safety is provided by GIL. + */ +static PyObject *_buffer_info_cache = NULL; + +/* Fill in the info structure */ +static _buffer_info_t* +_buffer_info_new(PyArrayObject *arr) +{ + _buffer_info_t *info; + int offset = 0; + _tmp_string_t fmt = {0,0,0}; + int k; + + info = (_buffer_info_t*)malloc(sizeof(_buffer_info_t)); + + /* Fill in format */ + if (_buffer_format_string(PyArray_DESCR(arr), &fmt, &offset) != 0) { + free(info); + return NULL; + } + _append_char(&fmt, '\0'); + info->format = fmt.s; + + /* Fill in shape and strides */ + info->ndim = PyArray_NDIM(arr); + info->shape = (Py_ssize_t*)malloc(sizeof(Py_ssize_t) + * PyArray_NDIM(arr) * 2 + 1); + info->strides = info->shape + PyArray_NDIM(arr); + for (k = 0; k < PyArray_NDIM(arr); ++k) { + info->shape[k] = PyArray_DIMS(arr)[k]; + info->strides[k] = PyArray_STRIDES(arr)[k]; + } + + return info; +} + +/* Compare two info structures */ +static Py_ssize_t +_buffer_info_cmp(_buffer_info_t *a, _buffer_info_t *b) +{ + Py_ssize_t c; + int k; + + c = strcmp(a->format, b->format); + if (c != 0) return c; + + c = a->ndim - b->ndim; + if (c != 0) return c; + + for (k = 0; k < a->ndim; ++k) { + c = a->shape[k] - b->shape[k]; + if (c != 0) return c; + c = a->strides[k] - b->strides[k]; + if (c != 0) return c; + } + + return 0; +} + +static void +_buffer_info_free(_buffer_info_t *info) +{ + if (info->format) { + free(info->format); + } + if (info->shape) { + free(info->shape); + } + free(info); +} + +/* Get buffer info from the global dictionary */ +static _buffer_info_t* +_buffer_get_info(PyObject *arr) +{ + PyObject *key, *item_list, *item; + _buffer_info_t *info = NULL, *old_info = NULL; + + if (_buffer_info_cache == NULL) { + _buffer_info_cache = PyDict_New(); + if (_buffer_info_cache == NULL) { + return NULL; + } + } + + /* Compute information */ + info = _buffer_info_new((PyArrayObject*)arr); + if (info == NULL) { + return NULL; + } + + /* Check if it is identical with an old one; reuse old one, if yes */ + key = PyLong_FromVoidPtr((void*)arr); + item_list = PyDict_GetItem(_buffer_info_cache, key); + + if (item_list != NULL) { + Py_INCREF(item_list); + if (PyList_GET_SIZE(item_list) > 0) { + item = PyList_GetItem(item_list, PyList_GET_SIZE(item_list) - 1); + old_info = (_buffer_info_t*)PyLong_AsVoidPtr(item); + + if (_buffer_info_cmp(info, old_info) == 0) { + _buffer_info_free(info); + info = old_info; + } + } + } + else { + item_list = PyList_New(0); + PyDict_SetItem(_buffer_info_cache, key, item_list); + } + + if (info != old_info) { + /* Needs insertion */ + item = PyLong_FromVoidPtr((void*)info); + PyList_Append(item_list, item); + Py_DECREF(item); + } + + Py_DECREF(item_list); + Py_DECREF(key); + return info; +} + +/* Clear buffer info from the global dictionary */ +static void +_buffer_clear_info(PyObject *arr) +{ + PyObject *key, *item_list, *item; + _buffer_info_t *info; + int k; + + if (_buffer_info_cache == NULL) { + return; + } + + key = PyLong_FromVoidPtr((void*)arr); + item_list = PyDict_GetItem(_buffer_info_cache, key); + if (item_list != NULL) { + for (k = 0; k < PyList_GET_SIZE(item_list); ++k) { + item = PyList_GET_ITEM(item_list, k); + info = (_buffer_info_t*)PyLong_AsVoidPtr(item); + _buffer_info_free(info); + } + PyDict_DelItem(_buffer_info_cache, key); + } + + Py_DECREF(key); +} + +/* * Retrieving buffers */ @@ -259,7 +439,7 @@ array_getbuffer(PyObject *obj, Py_buffer *view, int flags) { PyArrayObject *self; - _buffer_data *cache = NULL; + _buffer_info_t *info = NULL; self = (PyArrayObject*)obj; @@ -267,18 +447,6 @@ return -1; } - if (self->buffer_info == NULL) { - cache = (_buffer_data*)malloc(sizeof(_buffer_data)); - cache->nd = 0; - cache->format = NULL; - cache->strides = NULL; - cache->shape = NULL; - self->buffer_info = cache; - } - else { - cache = self->buffer_info; - } - view->format = NULL; view->shape = NULL; @@ -305,57 +473,22 @@ view->internal = NULL; view->len = PyArray_NBYTES(self); + info = _buffer_get_info(obj); + if (info == NULL) { + goto fail; + } + if ((flags & PyBUF_FORMAT) == PyBUF_FORMAT) { -#warning XXX -- assumes descriptors are immutable - if (PyArray_DESCR(self)->buffer_format == NULL) { - int offset = 0; - _tmp_string fmt = {0,0,0}; - if (_buffer_format_string(PyArray_DESCR(self), &fmt, &offset)) { - goto fail; - } - _append_char(&fmt, '\0'); - PyArray_DESCR(self)->buffer_format = fmt.s; - } - view->format = PyArray_DESCR(self)->buffer_format; + view->format = info->format; } else { view->format = NULL; } if ((flags & PyBUF_STRIDED) == PyBUF_STRIDED) { - int shape_changed = 0; - int k; - - if (cache->nd != PyArray_NDIM(self)) { - shape_changed = 1; - } - else { - for (k = 0; k < PyArray_NDIM(self); ++k) { - if (cache->shape[k] != PyArray_DIMS(self)[k] - || cache->strides[k] != PyArray_STRIDES(self)[k]) { - shape_changed = 1; - break; - } - } - } - - if (cache->strides == NULL || shape_changed) { - if (cache->shape != NULL) { - free(cache->shape); - } - cache->nd = PyArray_NDIM(self); - cache->shape = (Py_ssize_t*)malloc(sizeof(Py_ssize_t) - * PyArray_NDIM(self) * 2 + 1); - cache->strides = cache->shape + PyArray_NDIM(self); - for (k = 0; k < PyArray_NDIM(self); ++k) { - cache->shape[k] = PyArray_DIMS(self)[k]; - cache->strides[k] = PyArray_STRIDES(self)[k]; - } - } - - view->ndim = PyArray_NDIM(self); - view->shape = cache->shape; - view->strides = cache->strides; + view->ndim = info->ndim; + view->shape = info->shape; + view->strides = info->strides; } else if (PyArray_ISONESEGMENT(self)) { view->ndim = 0; @@ -367,7 +500,7 @@ goto fail; } - view->obj = self; + view->obj = (PyObject*)self; Py_INCREF(self); return 0; @@ -392,17 +525,7 @@ NPY_NO_EXPORT void _array_dealloc_buffer_info(PyArrayObject *self) { - _buffer_data *cache; - - cache = self->buffer_info; - - if (cache != NULL) { - if (cache->shape) { - free(cache->shape); - } - free(cache); - self->buffer_info = NULL; - } + _buffer_clear_info((PyObject*)self); } #else Modified: trunk/numpy/core/src/multiarray/ctors.c =================================================================== --- trunk/numpy/core/src/multiarray/ctors.c 2010-02-20 18:03:14 UTC (rev 8130) +++ trunk/numpy/core/src/multiarray/ctors.c 2010-02-20 18:03:36 UTC (rev 8131) @@ -1466,7 +1466,6 @@ self->descr = descr; self->base = (PyObject *)NULL; self->weakreflist = (PyObject *)NULL; - self->buffer_info = NULL; if (nd > 0) { self->dimensions = PyDimMem_NEW(2*nd); Modified: trunk/numpy/core/src/multiarray/descriptor.c =================================================================== --- trunk/numpy/core/src/multiarray/descriptor.c 2010-02-20 18:03:14 UTC (rev 8130) +++ trunk/numpy/core/src/multiarray/descriptor.c 2010-02-20 18:03:36 UTC (rev 8131) @@ -1490,9 +1490,6 @@ _pya_free(self->subarray); } Py_XDECREF(self->metadata); - if (self->buffer_format) { - free(self->buffer_format); - } Py_TYPE(self)->tp_free((PyObject *)self); } @@ -1999,8 +1996,6 @@ } } - conv->buffer_format = NULL; - return (PyObject *)conv; } From numpy-svn at scipy.org Sat Feb 20 13:03:53 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:03:53 -0600 (CST) Subject: [Numpy-svn] r8132 - trunk/numpy/core/src/multiarray Message-ID: <20100220180353.76E80C7C060@scipy.org> Author: ptvirtan Date: 2010-02-20 12:03:53 -0600 (Sat, 20 Feb 2010) New Revision: 8132 Modified: trunk/numpy/core/src/multiarray/buffer.c Log: ENH: core: support sub-arrays in PEP 3118 buffers Modified: trunk/numpy/core/src/multiarray/buffer.c =================================================================== --- trunk/numpy/core/src/multiarray/buffer.c 2010-02-20 18:03:36 UTC (rev 8131) +++ trunk/numpy/core/src/multiarray/buffer.c 2010-02-20 18:03:53 UTC (rev 8132) @@ -142,15 +142,36 @@ } static int -_buffer_format_string(PyArray_Descr *descr, _tmp_string_t *str, int *offset) +_buffer_format_string(PyArray_Descr *descr, _tmp_string_t *str, + Py_ssize_t *offset) { int k; if (descr->subarray) { - PyErr_SetString(PyExc_ValueError, - "data types with sub-arrays cannot be exported as " - "buffers"); - return -1; + PyObject *item, *repr; + Py_ssize_t total_count = 1; + Py_ssize_t dim_size; + char buf[128]; + int old_offset; + int ret; + + _append_char(str, '('); + for (k = 0; k < PyTuple_GET_SIZE(descr->subarray->shape); ++k) { + if (k > 0) { + _append_char(str, ','); + } + item = PyTuple_GET_ITEM(descr->subarray->shape, k); + dim_size = PyNumber_AsSsize_t(item, NULL); + + PyOS_snprintf(buf, sizeof(buf), "%ld", (long)dim_size); + _append_str(str, buf); + total_count *= dim_size; + } + _append_char(str, ')'); + old_offset = *offset; + ret = _buffer_format_string(descr->subarray->base, str, offset); + *offset = old_offset + (*offset - old_offset) * total_count; + return ret; } else if (PyDataType_HASFIELDS(descr)) { _append_str(str, "T{"); @@ -290,7 +311,7 @@ _buffer_info_new(PyArrayObject *arr) { _buffer_info_t *info; - int offset = 0; + Py_ssize_t offset = 0; _tmp_string_t fmt = {0,0,0}; int k; From numpy-svn at scipy.org Sat Feb 20 13:04:11 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:04:11 -0600 (CST) Subject: [Numpy-svn] r8133 - trunk/numpy/core/src/multiarray Message-ID: <20100220180411.51655C7C060@scipy.org> Author: ptvirtan Date: 2010-02-20 12:04:11 -0600 (Sat, 20 Feb 2010) New Revision: 8133 Modified: trunk/numpy/core/src/multiarray/buffer.c Log: ENH: core: cleanups in PEP 3118 provider Modified: trunk/numpy/core/src/multiarray/buffer.c =================================================================== --- trunk/numpy/core/src/multiarray/buffer.c 2010-02-20 18:03:53 UTC (rev 8132) +++ trunk/numpy/core/src/multiarray/buffer.c 2010-02-20 18:04:11 UTC (rev 8133) @@ -327,13 +327,20 @@ /* Fill in shape and strides */ info->ndim = PyArray_NDIM(arr); - info->shape = (Py_ssize_t*)malloc(sizeof(Py_ssize_t) - * PyArray_NDIM(arr) * 2 + 1); - info->strides = info->shape + PyArray_NDIM(arr); - for (k = 0; k < PyArray_NDIM(arr); ++k) { - info->shape[k] = PyArray_DIMS(arr)[k]; - info->strides[k] = PyArray_STRIDES(arr)[k]; + + if (info->ndim == 0) { + info->shape = NULL; + info->strides = NULL; } + else { + info->shape = (Py_ssize_t*)malloc(sizeof(Py_ssize_t) + * PyArray_NDIM(arr) * 2 + 1); + info->strides = info->shape + PyArray_NDIM(arr); + for (k = 0; k < PyArray_NDIM(arr); ++k) { + info->shape[k] = PyArray_DIMS(arr)[k]; + info->strides[k] = PyArray_STRIDES(arr)[k]; + } + } return info; } @@ -465,15 +472,13 @@ self = (PyArrayObject*)obj; if (view == NULL) { - return -1; + goto fail; } - view->format = NULL; - view->shape = NULL; - + /* Check whether we can provide the wanted properties */ if ((flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS && !PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)) { - PyErr_SetString(PyExc_ValueError, "ndarray is not C contiguous"); + PyErr_SetString(PyExc_ValueError, "ndarray is not C-contiguous"); goto fail; } if ((flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS && @@ -486,44 +491,41 @@ PyErr_SetString(PyExc_ValueError, "ndarray is not contiguous"); goto fail; } + if ((flags & PyBUF_STRIDES) != PyBUF_STRIDES && + !PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)) { + /* Non-strided buffers must be C-contiguous */ + PyErr_SetString(PyExc_ValueError, "ndarray is not C-contiguous"); + goto fail; + } + if ((flags & PyBUF_WRITEABLE) == PyBUF_WRITEABLE && + !PyArray_ISWRITEABLE(self)) { + PyErr_SetString(PyExc_ValueError, "ndarray is not writeable"); + goto fail; + } + /* Fill in information */ + info = _buffer_get_info(obj); + if (info == NULL) { + goto fail; + } + view->buf = PyArray_DATA(self); view->suboffsets = NULL; view->itemsize = PyArray_ITEMSIZE(self); view->readonly = !PyArray_ISWRITEABLE(self); view->internal = NULL; view->len = PyArray_NBYTES(self); - - info = _buffer_get_info(obj); - if (info == NULL) { - goto fail; - } - if ((flags & PyBUF_FORMAT) == PyBUF_FORMAT) { view->format = info->format; - } - else { + } else { view->format = NULL; } + view->ndim = info->ndim; + view->shape = info->shape; + view->strides = info->strides; + view->obj = (PyObject*)self; - if ((flags & PyBUF_STRIDED) == PyBUF_STRIDED) { - view->ndim = info->ndim; - view->shape = info->shape; - view->strides = info->strides; - } - else if (PyArray_ISONESEGMENT(self)) { - view->ndim = 0; - view->shape = NULL; - view->strides = NULL; - } - else { - PyErr_SetString(PyExc_ValueError, "ndarray is not single-segment"); - goto fail; - } - - view->obj = (PyObject*)self; Py_INCREF(self); - return 0; fail: From numpy-svn at scipy.org Sat Feb 20 13:04:27 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:04:27 -0600 (CST) Subject: [Numpy-svn] r8134 - trunk/numpy/core/src/multiarray Message-ID: <20100220180427.CBFAAC7C060@scipy.org> Author: ptvirtan Date: 2010-02-20 12:04:27 -0600 (Sat, 20 Feb 2010) New Revision: 8134 Modified: trunk/numpy/core/src/multiarray/buffer.c Log: ENH: core: require PEP 3118 buffer contiguity only with ND and not STRIDES Modified: trunk/numpy/core/src/multiarray/buffer.c =================================================================== --- trunk/numpy/core/src/multiarray/buffer.c 2010-02-20 18:04:11 UTC (rev 8133) +++ trunk/numpy/core/src/multiarray/buffer.c 2010-02-20 18:04:27 UTC (rev 8134) @@ -471,10 +471,6 @@ self = (PyArrayObject*)obj; - if (view == NULL) { - goto fail; - } - /* Check whether we can provide the wanted properties */ if ((flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS && !PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)) { @@ -492,8 +488,9 @@ goto fail; } if ((flags & PyBUF_STRIDES) != PyBUF_STRIDES && + (flags & PyBUF_ND) == PyBUF_ND && !PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)) { - /* Non-strided buffers must be C-contiguous */ + /* Non-strided N-dim buffers must be C-contiguous */ PyErr_SetString(PyExc_ValueError, "ndarray is not C-contiguous"); goto fail; } @@ -503,6 +500,11 @@ goto fail; } + if (view == NULL) { + PyErr_SetString(PyExc_ValueError, "NULL view in getbuffer"); + goto fail; + } + /* Fill in information */ info = _buffer_get_info(obj); if (info == NULL) { @@ -520,9 +522,20 @@ } else { view->format = NULL; } - view->ndim = info->ndim; - view->shape = info->shape; - view->strides = info->strides; + if ((flags & PyBUF_ND) == PyBUF_ND) { + view->ndim = info->ndim; + view->shape = info->shape; + } + else { + view->ndim = 0; + view->shape = NULL; + } + if ((flags & PyBUF_STRIDES) == PyBUF_STRIDES) { + view->strides = info->strides; + } + else { + view->strides = NULL; + } view->obj = (PyObject*)self; Py_INCREF(self); From numpy-svn at scipy.org Sat Feb 20 13:04:43 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:04:43 -0600 (CST) Subject: [Numpy-svn] r8135 - trunk/numpy/core/tests Message-ID: <20100220180443.B47BEC7C060@scipy.org> Author: ptvirtan Date: 2010-02-20 12:04:43 -0600 (Sat, 20 Feb 2010) New Revision: 8135 Modified: trunk/numpy/core/tests/test_multiarray.py Log: ENH: add some tests for PEP 3118 buffer interface Modified: trunk/numpy/core/tests/test_multiarray.py =================================================================== --- trunk/numpy/core/tests/test_multiarray.py 2010-02-20 18:04:27 UTC (rev 8134) +++ trunk/numpy/core/tests/test_multiarray.py 2010-02-20 18:04:43 UTC (rev 8135) @@ -1449,12 +1449,131 @@ assert_raises(np.ComplexWarning, x.__setitem__, slice(None), y) warnings.simplefilter("default", np.ComplexWarning) -if sys.version_info >= (2, 6): +if sys.version_info >= (2, 7): class TestNewBufferProtocol(object): - @dec.knownfailureif(True, "No tests for the new buffer interface yet.") - def test_there_are_no_tests_yet_so_fail(self): - raise AssertionError("Need tests for the new buffer interface! " - "For arrays and scalars.") + def _check_roundtrip(self, obj): + obj = np.asarray(obj) + x = memoryview(obj) + y = np.asarray(x) + assert y.dtype == obj.dtype, (obj, y) + assert_array_equal(obj, y) + def test_roundtrip(self): + x = np.array([1,2,3,4,5], dtype='i4') + self._check_roundtrip(x) + + x = np.array([[1,2],[3,4]], dtype=np.float64) + self._check_roundtrip(x) + + x = np.zeros((3,3,3), dtype=np.float32)[:,0,:] + self._check_roundtrip(x) + + dt = [('a', np.int8), + ('b', np.int16), + ('c', np.int32), + ('d', np.int64), + ('e', np.uint8), + ('f', np.uint16), + ('g', np.uint32), + ('h', np.uint64), + ('i', np.float), + ('j', np.double), + ('k', np.longdouble), + ('l', 'S4'), + ('m', 'U4')] + x = np.array([(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + asbytes('aaaa'), 'bbbb')], + dtype=dt) + self._check_roundtrip(x) + + x = np.array(([[1,2],[3,4]],), dtype=[('a', (int, (2,2)))]) + self._check_roundtrip(x) + + x = np.array([1,2,3], dtype='>i4') + self._check_roundtrip(x) + + x = np.array([1,2,3], dtype='l' + else: + assert y.format == '=l' + + x = np.array([1,2,3], dtype=' Author: ptvirtan Date: 2010-02-20 12:05:03 -0600 (Sat, 20 Feb 2010) New Revision: 8136 Modified: trunk/numpy/core/_internal.py trunk/numpy/core/src/multiarray/buffer.c trunk/numpy/core/src/multiarray/buffer.h trunk/numpy/core/src/multiarray/numpyos.c trunk/numpy/core/src/multiarray/numpyos.h Log: ENH: core: add some support routines needed for consuming PEP 3118 buffers Modified: trunk/numpy/core/_internal.py =================================================================== --- trunk/numpy/core/_internal.py 2010-02-20 18:04:43 UTC (rev 8135) +++ trunk/numpy/core/_internal.py 2010-02-20 18:05:03 UTC (rev 8136) @@ -347,3 +347,125 @@ return newarray +# Given a string containing a PEP 3118 format specifier, +# construct a Numpy dtype + +_pep3118_map = { + 'b': 'b', + 'B': 'B', + 'h': 'h', + 'H': 'H', + 'i': 'i', + 'I': 'I', + 'l': 'l', + 'L': 'L', + 'q': 'q', + 'Q': 'Q', + 'f': 'f', + 'd': 'd', + 'g': 'g', + 'Q': 'Q', + 'Zf': 'F', + 'Zd': 'D', + 'Zg': 'G', + 's': 'S', + 'w': 'U', + 'O': 'O', + 'x': 'V', # padding +} + +def _dtype_from_pep3118(spec, byteorder='=', is_subdtype=False): + from numpy.core.multiarray import dtype + + fields = {} + offset = 0 + findex = 0 + explicit_name = False + + while spec: + value = None + + # End of structure, bail out to upper level + if spec[0] == '}': + spec = spec[1:] + break + + # Sub-arrays (1) + shape = None + if spec[0] == '(': + j = spec.index(')') + shape = tuple(map(int, spec[1:j].split(','))) + spec = spec[j+1:] + + # Byte order + if spec[0] in ('=', '<', '>'): + byteorder = spec[0] + spec = spec[1:] + + # Item sizes + itemsize = 1 + if spec[0].isdigit(): + j = 1 + for j in xrange(1, len(spec)): + if not spec[j].isdigit(): + break + itemsize = int(spec[:j]) + spec = spec[j:] + + # Data types + is_padding = False + + if spec[:2] == 'T{': + value, spec = _dtype_from_pep3118(spec[2:], byteorder=byteorder, + is_subdtype=True) + if itemsize != 1: + # Not supported + raise ValueError("Non item-size 1 structures not supported") + elif spec[0].isalpha(): + j = 1 + for j in xrange(1, len(spec)): + if not spec[j].isalpha(): + break + typechar = spec[:j] + spec = spec[j:] + is_padding = (typechar == 'x') + dtypechar = _pep3118_map[typechar] + if dtypechar in 'USV': + dtypechar += '%d' % itemsize + itemsize = 1 + value = dtype(byteorder + dtypechar) + else: + raise ValueError("Unknown PEP 3118 data type specifier %r" % spec) + + # Convert itemsize to sub-array + if itemsize != 1: + value = dtype((value, (itemsize,))) + + # Sub-arrays (2) + if shape is not None: + value = dtype((value, shape)) + + # Field name + if spec and spec.startswith(':'): + i = spec[1:].index(':') + 1 + name = spec[1:i] + spec = spec[i+1:] + explicit_name = True + else: + name = 'f%d' % findex + findex += 1 + + if not is_padding: + fields[name] = (value, offset) + offset += value.itemsize + + + if len(fields.keys()) == 1 and not explicit_name and fields['f0'][1] == 0: + ret = fields['f0'][0] + else: + ret = dtype(fields) + + if is_subdtype: + return ret, spec + else: + return ret Modified: trunk/numpy/core/src/multiarray/buffer.c =================================================================== --- trunk/numpy/core/src/multiarray/buffer.c 2010-02-20 18:04:43 UTC (rev 8135) +++ trunk/numpy/core/src/multiarray/buffer.c 2010-02-20 18:05:03 UTC (rev 8136) @@ -594,3 +594,67 @@ (releasebufferproc)0, #endif }; + + +/************************************************************************* + * Convert PEP 3118 format string to PyArray_Descr + */ +#if PY_VERSION_HEX >= 0x02060000 + +NPY_NO_EXPORT PyArray_Descr* +_descriptor_from_pep3118_format(char *s) +{ + char *buf, *p; + int in_name = 0; + PyArray_Descr *descr; + PyObject *str; + PyObject *_numpy_internal; + + if (s == NULL) { + return PyArray_DescrNewFromType(PyArray_BYTE); + } + + /* Strip whitespace, except from field names */ + buf = (char*)malloc(strlen(s) + 1); + p = buf; + while (*s != '\0') { + if (*s == ':') { + in_name = !in_name; + *p = *s; + } + else if (in_name || !NumPyOS_ascii_isspace(*s)) { + *p = *s; + } + ++p; + ++s; + } + *p = '\0'; + + /* Convert */ + _numpy_internal = PyImport_ImportModule("numpy.core._internal"); + if (_numpy_internal == NULL) { + return NULL; + } + str = PyUString_FromStringAndSize(buf, strlen(buf)); + descr = PyObject_CallMethod(_numpy_internal, "_dtype_from_pep3118", + "O", str); + Py_DECREF(str); + if (descr == NULL) { + PyErr_Format(PyExc_ValueError, + "'%s' is not a valid PEP 3118 buffer format string", buf); + } + free(buf); + return descr; +} + +#else + +NPY_NO_EXPORT PyArray_Descr* +_descriptor_from_pep3118_format(char *s) +{ + PyErr_SetString(PyExc_RuntimeError, + "PEP 3118 is not supported on Python versions < 2.6"); + return NULL; +} + +#endif Modified: trunk/numpy/core/src/multiarray/buffer.h =================================================================== --- trunk/numpy/core/src/multiarray/buffer.h 2010-02-20 18:04:43 UTC (rev 8135) +++ trunk/numpy/core/src/multiarray/buffer.h 2010-02-20 18:05:03 UTC (rev 8136) @@ -10,4 +10,7 @@ NPY_NO_EXPORT void _array_dealloc_buffer_info(PyArrayObject *self); +NPY_NO_EXPORT PyArray_Descr* +_descriptor_from_pep3118_format(char *s); + #endif Modified: trunk/numpy/core/src/multiarray/numpyos.c =================================================================== --- trunk/numpy/core/src/multiarray/numpyos.c 2010-02-20 18:04:43 UTC (rev 8135) +++ trunk/numpy/core/src/multiarray/numpyos.c 2010-02-20 18:05:03 UTC (rev 8136) @@ -336,7 +336,7 @@ * * Same as isspace under C locale */ -static int +NPY_NO_EXPORT int NumPyOS_ascii_isspace(char c) { return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' Modified: trunk/numpy/core/src/multiarray/numpyos.h =================================================================== --- trunk/numpy/core/src/multiarray/numpyos.h 2010-02-20 18:04:43 UTC (rev 8135) +++ trunk/numpy/core/src/multiarray/numpyos.h 2010-02-20 18:05:03 UTC (rev 8136) @@ -22,4 +22,7 @@ NPY_NO_EXPORT int NumPyOS_ascii_ftolf(FILE *fp, double *value); +NPY_NO_EXPORT int +NumPyOS_ascii_isspace(char c); + #endif From numpy-svn at scipy.org Sat Feb 20 13:05:21 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:05:21 -0600 (CST) Subject: [Numpy-svn] r8137 - trunk/numpy/core/src/multiarray Message-ID: <20100220180521.6B3ECC7C060@scipy.org> Author: ptvirtan Date: 2010-02-20 12:05:21 -0600 (Sat, 20 Feb 2010) New Revision: 8137 Modified: trunk/numpy/core/src/multiarray/common.c trunk/numpy/core/src/multiarray/ctors.c Log: ENH: core: implement support for PEP 3118 buffer objects in asarray() and array() This is available only for Python >= 2.7, since the MemoryView object is not present in earlier versions of Python. (It makes releasing the buffer much easier, via garbage collection.) Modified: trunk/numpy/core/src/multiarray/common.c =================================================================== --- trunk/numpy/core/src/multiarray/common.c 2010-02-20 18:05:03 UTC (rev 8136) +++ trunk/numpy/core/src/multiarray/common.c 2010-02-20 18:05:21 UTC (rev 8137) @@ -153,6 +153,9 @@ PyObject *ip; PyArray_Descr *chktype = NULL; PyArray_Descr *outtype; +#if PY_VERSION_HEX >= 0x02070000 + Py_buffer buffer_view; +#endif /* * These need to come first because if op already carries @@ -192,6 +195,33 @@ goto finish; } +#if PY_VERSION_HEX >= 0x02070000 + /* PEP 3118 buffer interface */ + memset(&buffer_view, 0, sizeof(Py_buffer)); + if (PyObject_GetBuffer(op, &buffer_view, PyBUF_FORMAT|PyBUF_STRIDES) == 0 || + PyObject_GetBuffer(op, &buffer_view, PyBUF_FORMAT) == 0) { + + PyErr_Clear(); + chktype = _descriptor_from_pep3118_format(buffer_view.format); + PyBuffer_Release(&buffer_view); + if (chktype) { + goto finish; + } + } + else if (PyObject_GetBuffer(op, &buffer_view, PyBUF_STRIDES) == 0 || + PyObject_GetBuffer(op, &buffer_view, PyBUF_SIMPLE) == 0) { + + PyErr_Clear(); + chktype = PyArray_DescrNewFromType(PyArray_VOID); + chktype->elsize = buffer_view.itemsize; + PyBuffer_Release(&buffer_view); + goto finish; + } + else { + PyErr_Clear(); + } +#endif + if ((ip=PyObject_GetAttrString(op, "__array_interface__"))!=NULL) { if (PyDict_Check(ip)) { PyObject *new; @@ -243,16 +273,14 @@ goto finish; } -#if defined(NPY_PY3K) - if (PyMemoryView_Check(op)) { -#else +#if !defined(NPY_PY3K) if (PyBuffer_Check(op)) { -#endif chktype = PyArray_DescrNewFromType(PyArray_VOID); chktype->elsize = Py_TYPE(op)->tp_as_sequence->sq_length(op); PyErr_Clear(); goto finish; } +#endif if (PyObject_HasAttrString(op, "__array__")) { ip = PyObject_CallMethod(op, "__array__", NULL); Modified: trunk/numpy/core/src/multiarray/ctors.c =================================================================== --- trunk/numpy/core/src/multiarray/ctors.c 2010-02-20 18:05:03 UTC (rev 8136) +++ trunk/numpy/core/src/multiarray/ctors.c 2010-02-20 18:05:21 UTC (rev 8137) @@ -1083,6 +1083,9 @@ { int d = 0; PyObject *e; +#if PY_VERSION_HEX >= 0x02070000 + Py_buffer buffer_view; +#endif if(max < 1) { return -1; @@ -1105,7 +1108,6 @@ } if (PyString_Check(s) || #if defined(NPY_PY3K) - PyMemoryView_Check(s) || #else PyBuffer_Check(s) || #endif @@ -1115,6 +1117,23 @@ if (stop_at_tuple && PyTuple_Check(s)) { return 0; } +#if PY_VERSION_HEX >= 0x02070000 + /* PEP 3118 buffer interface */ + memset(&buffer_view, 0, sizeof(Py_buffer)); + if (PyObject_GetBuffer(s, &buffer_view, PyBUF_STRIDES) == 0 || + PyObject_GetBuffer(s, &buffer_view, PyBUF_ND) == 0) { + d = buffer_view.ndim; + PyBuffer_Release(&buffer_view); + return d; + } + else if (PyObject_GetBuffer(s, &buffer_view, PyBUF_SIMPLE) == 0) { + PyBuffer_Release(&buffer_view); + return 1; + } + else { + PyErr_Clear(); + } +#endif if ((e = PyObject_GetAttrString(s, "__array_struct__")) != NULL) { d = -1; if (PyCObject_Check(e)) { @@ -1608,6 +1627,94 @@ return new; } + +NPY_NO_EXPORT int +_array_from_buffer_3118(PyObject *obj, PyObject **out) +{ +#if PY_VERSION_HEX >= 0x02070000 + /* XXX: Pythons < 2.7 do not have the memory view object. This makes + * using buffers somewhat difficult, since one cannot release them + * using the garbage collection + */ + + /* PEP 3118 */ + PyObject *memoryview; + Py_buffer *view; + PyArray_Descr *descr = NULL; + PyObject *r; + int nd, flags, k; + Py_ssize_t d; + npy_intp shape[NPY_MAXDIMS], strides[NPY_MAXDIMS]; + + memoryview = PyMemoryView_FromObject(obj); + if (memoryview == NULL) { + PyErr_Clear(); + return -1; + } + + view = PyMemoryView_GET_BUFFER(memoryview); + if (view->format != NULL) { + descr = _descriptor_from_pep3118_format(view->format); + if (descr == NULL) { + goto fail; + } + } + else { + descr = PyArray_DescrNewFromType(PyArray_STRING); + descr->elsize = view->itemsize; + } + + if (view->shape != NULL) { + nd = view->ndim; + if (nd >= NPY_MAXDIMS || nd < 0) { + goto fail; + } + for (k = 0; k < nd; ++k) { + if (k >= NPY_MAXDIMS) { + goto fail; + } + shape[k] = view->shape[k]; + } + if (view->strides != NULL) { + for (k = 0; k < nd; ++k) { + strides[k] = view->strides[k]; + } + } + else { + d = view->len; + for (k = 0; k < nd; ++k) { + d /= view->shape[k]; + strides[k] = d; + } + } + } + else { + nd = 1; + shape[0] = view->len / view->itemsize; + strides[0] = view->itemsize; + } + + flags = (view->readonly ? 0 : NPY_WRITEABLE); + r = PyArray_NewFromDescr(&PyArray_Type, descr, + nd, shape, strides, view->buf, + flags, NULL); + ((PyArrayObject *)r)->base = memoryview; + PyArray_UpdateFlags((PyArrayObject *)r, UPDATE_ALL); + + *out = r; + return 0; + +fail: + Py_XDECREF(descr); + Py_DECREF(memoryview); + return -1; + +#else + return -1; +#endif +} + + /*NUMPY_API * Does not check for ENSURECOPY and NOTSWAPPED in flags * Steals a reference to newtype --- which can be NULL @@ -1645,6 +1752,11 @@ } r = Array_FromPyScalar(op, newtype); } +#if PY_VERSION_HEX >= 0x02070000 + else if (_array_from_buffer_3118(op, &r) == 0) { + r = r; + } +#endif else if (PyArray_HasArrayInterfaceType(op, newtype, context, r)) { PyObject *new; if (r == NULL) { From numpy-svn at scipy.org Sat Feb 20 13:05:41 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:05:41 -0600 (CST) Subject: [Numpy-svn] r8138 - in trunk/numpy: compat core/tests Message-ID: <20100220180541.8B54AC7C060@scipy.org> Author: ptvirtan Date: 2010-02-20 12:05:41 -0600 (Sat, 20 Feb 2010) New Revision: 8138 Modified: trunk/numpy/compat/py3k.py trunk/numpy/core/tests/test_multiarray.py Log: 3K: BUG: core: fix some tests for Py3 Modified: trunk/numpy/compat/py3k.py =================================================================== --- trunk/numpy/compat/py3k.py 2010-02-20 18:05:21 UTC (rev 8137) +++ trunk/numpy/compat/py3k.py 2010-02-20 18:05:41 UTC (rev 8138) @@ -3,7 +3,7 @@ """ -__all__ = ['bytes', 'asbytes', 'isfileobj', 'getexception'] +__all__ = ['bytes', 'asbytes', 'isfileobj', 'getexception', 'strchar'] import sys @@ -16,9 +16,11 @@ return s.encode('iso-8859-1') def isfileobj(f): return isinstance(f, io.IOBase) + strchar = 'U' else: bytes = str asbytes = str + strchar = 'S' def isfileobj(f): return isinstance(f, file) Modified: trunk/numpy/core/tests/test_multiarray.py =================================================================== --- trunk/numpy/core/tests/test_multiarray.py 2010-02-20 18:05:21 UTC (rev 8137) +++ trunk/numpy/core/tests/test_multiarray.py 2010-02-20 18:05:41 UTC (rev 8138) @@ -6,7 +6,7 @@ from numpy.core import * from numpy.core.multiarray_tests import test_neighborhood_iterator, test_neighborhood_iterator_oob -from numpy.compat import asbytes, getexception +from numpy.compat import asbytes, getexception, strchar from test_print import in_foreign_locale @@ -414,7 +414,7 @@ strtype = '>i2' else: strtype = ' Author: ptvirtan Date: 2010-02-20 12:06:00 -0600 (Sat, 20 Feb 2010) New Revision: 8139 Modified: trunk/numpy/core/src/multiarray/methods.c trunk/numpy/core/src/multiarray/multiarraymodule.c trunk/numpy/core/src/private/npy_3kcompat.h Log: 3K: BUG: fix tofile/fromfile on Py3 by dup-ing the file descriptor before fdopening -- works around issues in flushing data Modified: trunk/numpy/core/src/multiarray/methods.c =================================================================== --- trunk/numpy/core/src/multiarray/methods.c 2010-02-20 18:05:41 UTC (rev 8138) +++ trunk/numpy/core/src/multiarray/methods.c 2010-02-20 18:06:00 UTC (rev 8139) @@ -498,7 +498,11 @@ else { Py_INCREF(file); } - fd = npy_PyFile_AsFile(file, "wb"); +#if defined(NPY_PY3K) + fd = npy_PyFile_Dup(file, "wb"); +#else + fd = PyFile_AsFile(file); +#endif if (fd == NULL) { PyErr_SetString(PyExc_IOError, "first argument must be a " \ "string or open file"); @@ -506,6 +510,9 @@ return NULL; } ret = PyArray_ToFile(self, fd, sep, format); +#if defined(NPY_PY3K) + fclose(fd); +#endif Py_DECREF(file); if (ret < 0) { return NULL; Modified: trunk/numpy/core/src/multiarray/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarray/multiarraymodule.c 2010-02-20 18:05:41 UTC (rev 8138) +++ trunk/numpy/core/src/multiarray/multiarraymodule.c 2010-02-20 18:06:00 UTC (rev 8139) @@ -1723,7 +1723,11 @@ else { Py_INCREF(file); } - fp = npy_PyFile_AsFile(file, "rb"); +#if defined(NPY_PY3K) + fp = npy_PyFile_Dup(file, "rb"); +#else + fp = PyFile_AsFile(file); +#endif if (fp == NULL) { PyErr_SetString(PyExc_IOError, "first argument must be an open file"); @@ -1734,6 +1738,9 @@ type = PyArray_DescrFromType(PyArray_DEFAULT); } ret = PyArray_FromFile(fp, type, (intp) nin, sep); +#if defined(NPY_PY3K) + fclose(fp); +#endif Py_DECREF(file); return ret; } Modified: trunk/numpy/core/src/private/npy_3kcompat.h =================================================================== --- trunk/numpy/core/src/private/npy_3kcompat.h 2010-02-20 18:05:41 UTC (rev 8138) +++ trunk/numpy/core/src/private/npy_3kcompat.h 2010-02-20 18:06:00 UTC (rev 8139) @@ -134,18 +134,27 @@ */ #if defined(NPY_PY3K) static NPY_INLINE FILE* -npy_PyFile_AsFile(PyObject *file, char *mode) +npy_PyFile_Dup(PyObject *file, char *mode) { - int fd; + int fd, fd2; + PyObject *ret, *os; fd = PyObject_AsFileDescriptor(file); if (fd == -1) { return NULL; } -#warning XXX -- who releases the FILE* returned by fdopen? fclose() closes the file... - return fdopen(fd, mode); + os = PyImport_ImportModule("os"); + if (os == NULL) { + return NULL; + } + ret = PyObject_CallMethod(os, "dup", "i", fd); + Py_DECREF(os); + if (ret == NULL) { + return NULL; + } + fd2 = PyNumber_AsSsize_t(ret, NULL); + Py_DECREF(ret); + return fdopen(fd2, mode); } -#else -#define npy_PyFile_AsFile(file, mode) PyFile_AsFile(file) #endif static NPY_INLINE PyObject* From numpy-svn at scipy.org Sat Feb 20 13:06:15 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:06:15 -0600 (CST) Subject: [Numpy-svn] r8140 - trunk/numpy/core Message-ID: <20100220180615.57A46C7C081@scipy.org> Author: ptvirtan Date: 2010-02-20 12:06:15 -0600 (Sat, 20 Feb 2010) New Revision: 8140 Modified: trunk/numpy/core/records.py Log: 3K: core: fix one str/bytes issue in records.py Modified: trunk/numpy/core/records.py =================================================================== --- trunk/numpy/core/records.py 2010-02-20 18:06:00 UTC (rev 8139) +++ trunk/numpy/core/records.py 2010-02-20 18:06:15 UTC (rev 8140) @@ -44,7 +44,7 @@ import os import sys -from numpy.compat import isfileobj +from numpy.compat import isfileobj, bytes ndarray = sb.ndarray @@ -757,7 +757,8 @@ if shape is None: raise ValueError("Must define a shape if obj is None") return recarray(shape, dtype, buf=obj, offset=offset, strides=strides) - elif isinstance(obj, str): + + elif isinstance(obj, bytes): return fromstring(obj, dtype, shape=shape, offset=offset, **kwds) elif isinstance(obj, (list, tuple)): From numpy-svn at scipy.org Sat Feb 20 13:06:35 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:06:35 -0600 (CST) Subject: [Numpy-svn] r8141 - in trunk/numpy: compat core/tests Message-ID: <20100220180635.B6B1DC7C060@scipy.org> Author: ptvirtan Date: 2010-02-20 12:06:35 -0600 (Sat, 20 Feb 2010) New Revision: 8141 Modified: trunk/numpy/compat/py3k.py trunk/numpy/core/tests/test_multiarray.py trunk/numpy/core/tests/test_numerictypes.py trunk/numpy/core/tests/test_records.py trunk/numpy/core/tests/test_regression.py trunk/numpy/core/tests/test_unicode.py Log: 3K: core: adjust some tests vs. str/bytes and int inheritance issues Modified: trunk/numpy/compat/py3k.py =================================================================== --- trunk/numpy/compat/py3k.py 2010-02-20 18:06:15 UTC (rev 8140) +++ trunk/numpy/compat/py3k.py 2010-02-20 18:06:35 UTC (rev 8141) @@ -3,7 +3,8 @@ """ -__all__ = ['bytes', 'asbytes', 'isfileobj', 'getexception', 'strchar'] +__all__ = ['bytes', 'asbytes', 'isfileobj', 'getexception', 'strchar', + 'asunicode'] import sys @@ -14,6 +15,7 @@ if isinstance(s, bytes): return s return s.encode('iso-8859-1') + asunicode = str def isfileobj(f): return isinstance(f, io.IOBase) strchar = 'U' @@ -23,6 +25,10 @@ strchar = 'S' def isfileobj(f): return isinstance(f, file) + def asunicode(s): + if isinstance(s, unicode): + return s + return s.decode('iso-8859-1') def getexception(): return sys.exc_info()[1] Modified: trunk/numpy/core/tests/test_multiarray.py =================================================================== --- trunk/numpy/core/tests/test_multiarray.py 2010-02-20 18:06:15 UTC (rev 8140) +++ trunk/numpy/core/tests/test_multiarray.py 2010-02-20 18:06:35 UTC (rev 8141) @@ -545,7 +545,9 @@ class TestSubscripting(TestCase): def test_test_zero_rank(self): x = array([1,2,3]) - self.failUnless(isinstance(x[0], int)) + self.failUnless(isinstance(x[0], np.int_)) + if sys.version_info[0] < 3: + self.failUnless(isinstance(x[0], int)) self.failUnless(type(x[0, ...]) is ndarray) @@ -1087,8 +1089,8 @@ def test_unicode_field_names(self): # Unicode field names are not allowed on Py2 title = unicode('b') - assert_raises(ValueError, np.dtype, [(title, int)]) - assert_raises(ValueError, np.dtype, [(('a', title), int)]) + assert_raises(TypeError, np.dtype, [(title, int)]) + assert_raises(TypeError, np.dtype, [(('a', title), int)]) class TestView(TestCase): def test_basic(self): Modified: trunk/numpy/core/tests/test_numerictypes.py =================================================================== --- trunk/numpy/core/tests/test_numerictypes.py 2010-02-20 18:06:15 UTC (rev 8140) +++ trunk/numpy/core/tests/test_numerictypes.py 2010-02-20 18:06:35 UTC (rev 8141) @@ -1,5 +1,6 @@ import sys from numpy.testing import * +from numpy.compat import asbytes, asunicode import numpy as np # This is the structure of the table used for plain objects: @@ -57,8 +58,8 @@ # x Info color info y z # value y2 Info2 name z2 Name Value # name value y3 z3 - ([3,2], (6j, 6., ('nn', [6j,4j], [6.,4.], [1,2]), 'NN', True), 'cc', ('NN', 6j), [[6.,4.],[6.,4.]], 8), - ([4,3], (7j, 7., ('oo', [7j,5j], [7.,5.], [2,1]), 'OO', False), 'dd', ('OO', 7j), [[7.,5.],[7.,5.]], 9), + ([3,2], (6j, 6., (asbytes('nn'), [6j,4j], [6.,4.], [1,2]), asbytes('NN'), True), asbytes('cc'), (asunicode('NN'), 6j), [[6.,4.],[6.,4.]], 8), + ([4,3], (7j, 7., (asbytes('oo'), [7j,5j], [7.,5.], [2,1]), asbytes('OO'), False), asbytes('dd'), (asunicode('OO'), 7j), [[7.,5.],[7.,5.]], 9), ] Modified: trunk/numpy/core/tests/test_records.py =================================================================== --- trunk/numpy/core/tests/test_records.py 2010-02-20 18:06:15 UTC (rev 8140) +++ trunk/numpy/core/tests/test_records.py 2010-02-20 18:06:35 UTC (rev 8141) @@ -1,6 +1,7 @@ from os import path import numpy as np from numpy.testing import * +from numpy.compat import asbytes, asunicode class TestFromrecords(TestCase): def test_fromrecords(self): @@ -9,7 +10,7 @@ assert_equal(r[0].item(), (456, 'dbe', 1.2)) def test_method_array(self): - r = np.rec.array('abcdefg' * 100, formats='i2,a3,i4', shape=3, byteorder='big') + r = np.rec.array(asbytes('abcdefg') * 100, formats='i2,a3,i4', shape=3, byteorder='big') assert_equal(r[1].item(), (25444, 'efg', 1633837924)) def test_method_array2(self): @@ -34,7 +35,7 @@ def test_recarray_fromfile(self): data_dir = path.join(path.dirname(__file__), 'data') filename = path.join(data_dir, 'recarray_from_file.fits') - fd = open(filename) + fd = open(filename, 'rb') fd.seek(2880 * 2) r = np.rec.fromfile(fd, formats='f8,i4,a5', shape=3, byteorder='big') Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2010-02-20 18:06:15 UTC (rev 8140) +++ trunk/numpy/core/tests/test_regression.py 2010-02-20 18:06:35 UTC (rev 8141) @@ -6,6 +6,7 @@ from os import path from numpy.testing import * from numpy.testing.utils import _assert_valid_refcount +from numpy.compat import asbytes, asunicode import numpy as np rlevel = 1 @@ -793,7 +794,7 @@ """Ticket 702""" class MyFloat: def __float__(self): - return 1 + return 1.0 tmp = np.atleast_1d([MyFloat()]) tmp2 = tmp.astype(float) @@ -991,7 +992,7 @@ for i in range(1,9) : msg = 'unicode offset: %d chars'%i t = np.dtype([('a','S%d'%i),('b','U2')]) - x = np.array([('a',u'b')], dtype=t) + x = np.array([(asbytes('a'),u'b')], dtype=t) assert_equal(str(x), "[('a', u'b')]", err_msg=msg) def test_sign_for_complex_nan(self, level=rlevel): Modified: trunk/numpy/core/tests/test_unicode.py =================================================================== --- trunk/numpy/core/tests/test_unicode.py 2010-02-20 18:06:15 UTC (rev 8140) +++ trunk/numpy/core/tests/test_unicode.py 2010-02-20 18:06:35 UTC (rev 8141) @@ -2,17 +2,29 @@ from numpy.testing import * from numpy.core import * +from numpy.compat import asbytes # Guess the UCS length for this python interpreter if sys.version_info[0] >= 3: - import warnings - warnings.warn('XXX: how to detect UCS size on Py3?') - ucs4 = True + import array as _array + ucs4 = (_array.array('u').itemsize == 4) + def buffer_length(arr): + if isinstance(arr, unicode): + return _array.array('u').itemsize * len(arr) + v = memoryview(arr) + if v.shape is None: + return len(v) * v.itemsize + else: + return prod(v.shape) * v.itemsize else: if len(buffer(u'u')) == 4: ucs4 = True else: ucs4 = False + def buffer_length(arr): + if isinstance(arr, ndarray): + return len(arr.data) + return len(buffer(arr)) # Value that can be represented in UCS2 interpreters ucs2_value = u'\uFFFF' @@ -32,16 +44,16 @@ # Check the length of the unicode base type self.assert_(int(ua.dtype.str[2:]) == self.ulen) # Check the length of the data buffer - self.assert_(len(ua.data) == nbytes) + self.assert_(buffer_length(ua) == nbytes) # Small check that data in array element is ok self.assert_(ua_scalar == u'') # Encode to ascii and double check - self.assert_(ua_scalar.encode('ascii') == '') + self.assert_(ua_scalar.encode('ascii') == asbytes('')) # Check buffer lengths for scalars if ucs4: - self.assert_(len(buffer(ua_scalar)) == 0) + self.assert_(buffer_length(ua_scalar) == 0) else: - self.assert_(len(buffer(ua_scalar)) == 0) + self.assert_(buffer_length(ua_scalar) == 0) def test_zeros0D(self): """Check creation of 0-dimensional objects""" @@ -84,7 +96,7 @@ # Check the length of the unicode base type self.assert_(int(ua.dtype.str[2:]) == self.ulen) # Check the length of the data buffer - self.assert_(len(ua.data) == nbytes) + self.assert_(buffer_length(ua) == nbytes) # Small check that data in array element is ok self.assert_(ua_scalar == self.ucs_value*self.ulen) # Encode to UTF-8 and double check @@ -92,16 +104,16 @@ (self.ucs_value*self.ulen).encode('utf-8')) # Check buffer lengths for scalars if ucs4: - self.assert_(len(buffer(ua_scalar)) == 4*self.ulen) + self.assert_(buffer_length(ua_scalar) == 4*self.ulen) else: if self.ucs_value == ucs4_value: # In UCS2, the \U0010FFFF will be represented using a # surrogate *pair* - self.assert_(len(buffer(ua_scalar)) == 2*2*self.ulen) + self.assert_(buffer_length(ua_scalar) == 2*2*self.ulen) else: # In UCS2, the \uFFFF will be represented using a # regular 2-byte word - self.assert_(len(buffer(ua_scalar)) == 2*self.ulen) + self.assert_(buffer_length(ua_scalar) == 2*self.ulen) def test_values0D(self): """Check creation of 0-dimensional objects with values""" @@ -169,7 +181,7 @@ # Check the length of the unicode base type self.assert_(int(ua.dtype.str[2:]) == self.ulen) # Check the length of the data buffer - self.assert_(len(ua.data) == nbytes) + self.assert_(buffer_length(ua) == nbytes) # Small check that data in array element is ok self.assert_(ua_scalar == self.ucs_value*self.ulen) # Encode to UTF-8 and double check @@ -177,16 +189,16 @@ (self.ucs_value*self.ulen).encode('utf-8')) # Check buffer lengths for scalars if ucs4: - self.assert_(len(buffer(ua_scalar)) == 4*self.ulen) + self.assert_(buffer_length(ua_scalar) == 4*self.ulen) else: if self.ucs_value == ucs4_value: # In UCS2, the \U0010FFFF will be represented using a # surrogate *pair* - self.assert_(len(buffer(ua_scalar)) == 2*2*self.ulen) + self.assert_(buffer_length(ua_scalar) == 2*2*self.ulen) else: # In UCS2, the \uFFFF will be represented using a # regular 2-byte word - self.assert_(len(buffer(ua_scalar)) == 2*self.ulen) + self.assert_(buffer_length(ua_scalar) == 2*self.ulen) def test_values0D(self): """Check assignment of 0-dimensional objects with values""" From numpy-svn at scipy.org Sat Feb 20 13:06:53 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:06:53 -0600 (CST) Subject: [Numpy-svn] r8142 - in trunk: numpy/core/tests tools Message-ID: <20100220180653.6A6CCC7C060@scipy.org> Author: ptvirtan Date: 2010-02-20 12:06:53 -0600 (Sat, 20 Feb 2010) New Revision: 8142 Modified: trunk/numpy/core/tests/test_defchararray.py trunk/tools/py3tool.py Log: 3K: BUG: make test_defchararray convert properly via 2to3 Modified: trunk/numpy/core/tests/test_defchararray.py =================================================================== --- trunk/numpy/core/tests/test_defchararray.py 2010-02-20 18:06:35 UTC (rev 8141) +++ trunk/numpy/core/tests/test_defchararray.py 2010-02-20 18:06:53 UTC (rev 8142) @@ -4,6 +4,9 @@ import sys from numpy.core.multiarray import _vec_string +kw_unicode_true = {'unicode': True} +kw_unicode_false = {'unicode': False} + class TestBasic(TestCase): def test_from_object_array(self): A = np.array([['abc', 2], @@ -16,7 +19,7 @@ A = np.array([['abc', u'Sigma \u03a3'], ['long ', '0123456789']], dtype='O') self.failUnlessRaises(ValueError, np.char.array, (A,)) - B = np.char.array(A, unicode=True) + B = np.char.array(A, **kw_unicode_true) assert_equal(B.dtype.itemsize, 10 * np.array('a', 'U').dtype.itemsize) assert_array_equal(B, [['abc', u'Sigma \u03a3'], ['long', '0123456789']]) @@ -45,12 +48,12 @@ assert_array_equal(B, A) assert_equal(B.dtype, A.dtype) assert_equal(B.shape, A.shape) - B = np.char.array(A, unicode=True) + B = np.char.array(A, **kw_unicode_true) assert_array_equal(B, A) assert_equal(B.dtype, A.dtype) assert_equal(B.shape, A.shape) def fail(): - B = np.char.array(A, unicode=False) + B = np.char.array(A, **kw_unicode_false) self.failUnlessRaises(UnicodeEncodeError, fail) def test_unicode_upconvert(self): Modified: trunk/tools/py3tool.py =================================================================== --- trunk/tools/py3tool.py 2010-02-20 18:06:35 UTC (rev 8141) +++ trunk/tools/py3tool.py 2010-02-20 18:06:53 UTC (rev 8142) @@ -35,7 +35,6 @@ 'numpy/core/code_generators/generate_numpy_api.py': '-x import', 'numpy/core/code_generators/generate_ufunc_api.py': '-x import', 'numpy/core/defchararray.py': '-x unicode', - 'numpy/core/tests/test_defchararray.py': '-x unicode', 'numpy/compat/py3k.py': '-x unicode', } From numpy-svn at scipy.org Sat Feb 20 13:07:10 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:07:10 -0600 (CST) Subject: [Numpy-svn] r8143 - trunk/numpy/core/src/multiarray Message-ID: <20100220180710.64AA8C7C060@scipy.org> Author: ptvirtan Date: 2010-02-20 12:07:10 -0600 (Sat, 20 Feb 2010) New Revision: 8143 Modified: trunk/numpy/core/src/multiarray/arraytypes.c.src Log: 3K: BUG: cast any object to unicode/bytes in UNICODE/STRING_setitem also for Py3, similarly as it is done in Py2 This makes UNICODE_setitem and STRING_setitem work similarly as on Python 2 -- uses ASCII codec -- I judge this useful for compatibility reasons. Modified: trunk/numpy/core/src/multiarray/arraytypes.c.src =================================================================== --- trunk/numpy/core/src/multiarray/arraytypes.c.src 2010-02-20 18:06:53 UTC (rev 8142) +++ trunk/numpy/core/src/multiarray/arraytypes.c.src 2010-02-20 18:07:10 UTC (rev 8143) @@ -345,7 +345,14 @@ PyErr_Clear(); } #if defined(NPY_PY3K) - if ((temp=PyUnicode_FromObject(op)) == NULL) { + if (PyBytes_Check(op)) { + /* Try to decode from ASCII */ + temp = PyUnicode_FromEncodedObject(op, "ASCII", "strict"); + if (temp == NULL) { + return -1; + } + } + else if ((temp=PyObject_Str(op)) == NULL) { #else if ((temp=PyObject_Unicode(op)) == NULL) { #endif @@ -428,13 +435,36 @@ PyErr_Clear(); } #if defined(NPY_PY3K) - if ((temp = PyObject_Bytes(op)) == NULL) { + if (PyUnicode_Check(op)) { + /* Assume ASCII codec -- function similarly as Python 2 */ + temp = PyUnicode_AsASCIIString(op); + if (temp == NULL) return -1; + } + else if (PyBytes_Check(op)) { + temp = PyObject_Bytes(op); + if (temp == NULL) { + return -1; + } + } + else { + /* Emulate similar casting behavior as on Python 2 */ + PyObject *str; + str = PyObject_Str(op); + if (str == NULL) { + return -1; + } + temp = PyUnicode_AsASCIIString(str); + Py_DECREF(str); + if (temp == NULL) { + return -1; + } + } #else if ((temp = PyObject_Str(op)) == NULL) { -#endif return -1; } - if (PyString_AsStringAndSize(temp, &ptr, &len) == -1) { +#endif + if (PyBytes_AsStringAndSize(temp, &ptr, &len) == -1) { Py_DECREF(temp); return -1; } From numpy-svn at scipy.org Sat Feb 20 13:07:26 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:07:26 -0600 (CST) Subject: [Numpy-svn] r8144 - trunk/numpy/core/src/multiarray Message-ID: <20100220180726.E86A8C7C060@scipy.org> Author: ptvirtan Date: 2010-02-20 12:07:26 -0600 (Sat, 20 Feb 2010) New Revision: 8144 Modified: trunk/numpy/core/src/multiarray/ctors.c Log: ENH: core: make PyArray_FromAny error message more clear When building string/unicode arrays, PyArray_FromAny would try building a 0-d array as a last resort. If the object is a finite-length sequence, this always fails with an error "ValueError: setting an array element with a sequence", as STRING/UNICODE_setitem do not allow this. In some cases this message is confusing: for example on Py3, array([['a', 'b'], ['c', '\u03a3']], dtype='S2') would fail because of this, even though the real error is that '\u03a3' cannot be unambiguously cast to bytes(). Modified: trunk/numpy/core/src/multiarray/ctors.c =================================================================== --- trunk/numpy/core/src/multiarray/ctors.c 2010-02-20 18:07:10 UTC (rev 8143) +++ trunk/numpy/core/src/multiarray/ctors.c 2010-02-20 18:07:26 UTC (rev 8144) @@ -1797,14 +1797,27 @@ * If object was explicitly requested, * then try nested list object array creation */ - PyErr_Clear(); if (isobject) { + PyErr_Clear(); Py_INCREF(newtype); r = ObjectArray_FromNestedList (op, newtype, flags & FORTRAN); seq = TRUE; Py_DECREF(newtype); } + else if ((newtype->type_num == PyArray_STRING || + newtype->type_num == PyArray_UNICODE) + && PySequence_Size(op) > 0) + { + /* It is not possible to set a sequence into + * a string/unicode 0-d array item -- bail out early + * so that the error message is more clear. + */ + seq = TRUE; + } + else { + PyErr_Clear(); + } } else { seq = TRUE; From numpy-svn at scipy.org Sat Feb 20 13:07:43 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:07:43 -0600 (CST) Subject: [Numpy-svn] r8145 - trunk/numpy/core/src/multiarray Message-ID: <20100220180743.69738C7C0AA@scipy.org> Author: ptvirtan Date: 2010-02-20 12:07:43 -0600 (Sat, 20 Feb 2010) New Revision: 8145 Modified: trunk/numpy/core/src/multiarray/arraytypes.c.src Log: 3K: ENH: core: audit some PyString -> PyBytes conversions Modified: trunk/numpy/core/src/multiarray/arraytypes.c.src =================================================================== --- trunk/numpy/core/src/multiarray/arraytypes.c.src 2010-02-20 18:07:26 UTC (rev 8144) +++ trunk/numpy/core/src/multiarray/arraytypes.c.src 2010-02-20 18:07:43 UTC (rev 8145) @@ -334,7 +334,7 @@ char *buffer; #endif - if (!PyString_Check(op) && !PyUnicode_Check(op) && + if (!PyBytes_Check(op) && !PyUnicode_Check(op) && PySequence_Check(op) && PySequence_Size(op) > 0) { PyErr_SetString(PyExc_ValueError, "setting an array element with a sequence"); @@ -414,7 +414,7 @@ while (*ptr-- == '\0' && size > 0) { size--; } - return PyString_FromStringAndSize(ip,size); + return PyBytes_FromStringAndSize(ip,size); } static int @@ -424,7 +424,7 @@ Py_ssize_t len; PyObject *temp = NULL; - if (!PyString_Check(op) && !PyUnicode_Check(op) + if (!PyBytes_Check(op) && !PyUnicode_Check(op) && PySequence_Check(op) && PySequence_Size(op) > 0) { PyErr_SetString(PyExc_ValueError, "setting an array element with a sequence"); From numpy-svn at scipy.org Sat Feb 20 13:07:57 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:07:57 -0600 (CST) Subject: [Numpy-svn] r8146 - trunk/numpy/core Message-ID: <20100220180757.E81B2C7C0AA@scipy.org> Author: ptvirtan Date: 2010-02-20 12:07:57 -0600 (Sat, 20 Feb 2010) New Revision: 8146 Modified: trunk/numpy/core/defchararray.py Log: 3K: BUG: core: fix some bytes/str issues in defchararray.py Modified: trunk/numpy/core/defchararray.py =================================================================== --- trunk/numpy/core/defchararray.py 2010-02-20 18:07:43 UTC (rev 8145) +++ trunk/numpy/core/defchararray.py 2010-02-20 18:07:57 UTC (rev 8146) @@ -38,8 +38,10 @@ _globalvar = 0 if sys.version_info[0] >= 3: _unicode = str + _bytes = bytes else: _unicode = unicode + _bytes = str _len = len def _use_unicode(*args): @@ -2583,7 +2585,7 @@ be in any order (either C-, Fortran-contiguous, or even discontiguous). """ - if isinstance(obj, (str, _unicode)): + if isinstance(obj, (_bytes, _unicode)): if unicode is None: if isinstance(obj, _unicode): unicode = True @@ -2621,7 +2623,7 @@ else: # Let the default Unicode -> string encoding (if any) take # precedence. - obj = str(obj) + obj = _bytes(obj) return chararray(shape, itemsize=itemsize, unicode=unicode, buffer=obj, order=order) From numpy-svn at scipy.org Sat Feb 20 13:08:14 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:08:14 -0600 (CST) Subject: [Numpy-svn] r8147 - trunk/numpy/core/src/multiarray Message-ID: <20100220180814.E8064C7C083@scipy.org> Author: ptvirtan Date: 2010-02-20 12:08:14 -0600 (Sat, 20 Feb 2010) New Revision: 8147 Modified: trunk/numpy/core/src/multiarray/common.c Log: BUG: core: prefer byte strings over PEP 3118 buffers when determining array type in _array_find_type Modified: trunk/numpy/core/src/multiarray/common.c =================================================================== --- trunk/numpy/core/src/multiarray/common.c 2010-02-20 18:07:57 UTC (rev 8146) +++ trunk/numpy/core/src/multiarray/common.c 2010-02-20 18:08:14 UTC (rev 8147) @@ -195,6 +195,21 @@ goto finish; } + if (PyBytes_Check(op)) { + chktype = PyArray_DescrNewFromType(PyArray_STRING); + chktype->elsize = PyString_GET_SIZE(op); + goto finish; + } + + if (PyUnicode_Check(op)) { + chktype = PyArray_DescrNewFromType(PyArray_UNICODE); + chktype->elsize = PyUnicode_GET_DATA_SIZE(op); +#ifndef Py_UNICODE_WIDE + chktype->elsize <<= 1; +#endif + goto finish; + } + #if PY_VERSION_HEX >= 0x02070000 /* PEP 3118 buffer interface */ memset(&buffer_view, 0, sizeof(Py_buffer)); @@ -258,21 +273,6 @@ PyErr_Clear(); } - if (PyString_Check(op)) { - chktype = PyArray_DescrNewFromType(PyArray_STRING); - chktype->elsize = PyString_GET_SIZE(op); - goto finish; - } - - if (PyUnicode_Check(op)) { - chktype = PyArray_DescrNewFromType(PyArray_UNICODE); - chktype->elsize = PyUnicode_GET_DATA_SIZE(op); -#ifndef Py_UNICODE_WIDE - chktype->elsize <<= 1; -#endif - goto finish; - } - #if !defined(NPY_PY3K) if (PyBuffer_Check(op)) { chktype = PyArray_DescrNewFromType(PyArray_VOID); From numpy-svn at scipy.org Sat Feb 20 13:08:28 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:08:28 -0600 (CST) Subject: [Numpy-svn] r8148 - trunk/doc Message-ID: <20100220180828.0DF68C7C083@scipy.org> Author: ptvirtan Date: 2010-02-20 12:08:27 -0600 (Sat, 20 Feb 2010) New Revision: 8148 Modified: trunk/doc/Py3K.txt Log: 3K: doc: update Py3K port documentation Modified: trunk/doc/Py3K.txt =================================================================== --- trunk/doc/Py3K.txt 2010-02-20 18:08:14 UTC (rev 8147) +++ trunk/doc/Py3K.txt 2010-02-20 18:08:27 UTC (rev 8148) @@ -59,6 +59,15 @@ * Only unicode dtype field titles are included in fields dict. +* :pep:`3118` buffer objects will behave differently from Py2 buffer objects + when used as an argument to `array(...)`, `asarray(...)`. + + In Py2, they would cast to an object array. + + In Py3, they cast similarly as objects having an + ``__array_interface__`` attribute, ie., they behave as if they were + an ndarray view on the data. + .. todo:: Check for any other changes ... This we want in the end to include @@ -317,8 +326,8 @@ Py_TPFLAGS_HAVE_CLASS in the type flag. -PyBuffer --------- +PyBuffer (provider) +------------------- PyBuffer usage is widely spread in multiarray: @@ -335,33 +344,13 @@ for generic array scalars. The generic array scalar exporter, however, doesn't currently produce format strings, which needs to be fixed. -Currently, the format string and some of the memory is cached in the -PyArrayObject structure. This is partly needed because of Python bug #7433. - Also some code also stops working when ``bf_releasebuffer`` is defined. Most importantly, ``PyArg_ParseTuple("s#", ...)`` refuses to return a buffer if ``bf_releasebuffer`` is present. For this reason, the buffer interface for arrays is implemented currently *without* defining ``bf_releasebuffer`` at all. This forces us to go through -some additional contortions. But basically, since the strides and shape -of an array are locked when references to it are held, we can do with -a single allocated ``Py_ssize_t`` shape+strides buffer. +some additional work. -The buffer format string is currently cached in the ``dtype`` object. -Currently, there's a slight problem as dtypes are not immutable -- -the names of the fields can be changed. Right now, this issue is -just ignored, and the field names in the buffer format string are -not updated. - -From the consumer side, the new buffer protocol is mostly backward -compatible with the old one, so little needs to be done here to retain -basic functionality. However, we *do* want to make use of the new -features, at least in `multiarray.frombuffer` and maybe in `multiarray.array`. - -Since there is a native buffer object in Py3, the `memoryview`, the -`newbuffer` and `getbuffer` functions are removed from `multiarray` in -Py3: their functionality is taken over by the new `memoryview` object. - There are a couple of places that need further attention: - VOID_getitem @@ -401,7 +390,10 @@ #endif }; +.. todo:: + Produce PEP 3118 format strings for array scalar objects. + .. todo:: Is there a cleaner way out of the ``bf_releasebuffer`` issue? It @@ -411,50 +403,90 @@ It seems we should submit patches to Python on this. At least "s#" implementation on Py3 won't work at all, since the old buffer - interface is no more present. + interface is no more present. But perhaps Py3 users should just give + up using "s#" in ParseTuple, and use the 3118 interface instead. .. todo:: - Find a way around the dtype mutability issue. + Make ndarray shape and strides natively Py_ssize_t? - Note that we cannot just realloc the format string when the names - are changed: this would invalidate any existing buffer - interfaces. And since we can't define ``bf_releasebuffer``, we - don't know if there are any buffer interfaces present. - One solution would be to alloc a "big enough" buffer at the - beginning, and not change it after that. We could also make the - strides etc. in the ``buffer_info`` structure static size. There's - MAXDIMS present after all. +PyBuffer (consumer) +------------------- -.. todo:: +There are two places in which we may want to be able to consume buffer +objects and cast them to ndarrays: - Take a second look at places that used PyBuffer_FromMemory and - PyBuffer_FromReadWriteMemory -- what can be done with these? +1) `multiarray.frombuffer`, ie., ``PyArray_FromAny`` -.. todo:: + The frombuffer returns only arrays of a fixed dtype. It does not + make sense to support PEP 3118 at this location, since not much + would be gained from that -- the backward compatibility functions + using the old array interface still work. - Implement support for consuming new buffer objects. - Probably in multiarray.frombuffer? Perhaps also in multiarray.array? + So no changes needed here. -.. todo:: +2) `multiarray.array`, ie., ``PyArray_FromAny`` - make ndarray shape and strides natively Py_ssize_t + In general, we would like to handle :pep:`3118` buffers in the same way + as ``__array_interface__`` objects. Hence, we want to be able to cast + them to arrays already in ``PyArray_FromAny``. + Hence, ``PyArray_FromAny`` needs additions. + +There are a few caveats in allowing :pep:`3118` buffers in +``PyArray_FromAny``: + +a) `bytes` (and `str` on Py2) objects offer a buffer interface that + specifies them as 1-D array of bytes. + + Previously ``PyArray_FromAny`` has cast these to 'S#' dtypes. We + don't want to change this, since will cause problems in many places. + + We do, however, want to allow other objects that provide 1-D byte arrays + to be cast to 1-D ndarrays and not 'S#' arrays -- for instance, 'S#' + arrays tend to strip trailing NUL characters. + +So what is done in ``PyArray_FromAny`` currently is that: + +- Presence of :pep:`3118` buffer interface is checked before checking + for array interface. If it is present *and* the object is not + `bytes` object, then it is used for creating a view on the buffer. + +- We also check in ``discover_depth`` and ``_array_find_type`` for the + 3118 buffers, so that:: + + array([some_3118_object]) + + will treat the object similarly as it would handle an `ndarray`. + + However, again, bytes (and unicode) have priority and will not be + handled as buffer objects. + +This amounts to possible semantic changes: + +- ``array(buffer)`` will no longer create an object array + ``array([buffer], dtype='O')``, but will instead expand to a view + on the buffer. + .. todo:: - Revise the decision on where to cache the format string -- dtype - would be a better place for this. + Take a second look at places that used PyBuffer_FromMemory and + PyBuffer_FromReadWriteMemory -- what can be done with these? .. todo:: There's some buffer code in numarray/_capi.c that needs to be addressed. -.. todo:: - Does altering the PyArrayObject structure require bumping the ABI? +PyBuffer (object) +----------------- +Since there is a native buffer object in Py3, the `memoryview`, the +`newbuffer` and `getbuffer` functions are removed from `multiarray` in +Py3: their functionality is taken over by the new `memoryview` object. + PyString -------- From numpy-svn at scipy.org Sat Feb 20 13:08:44 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:08:44 -0600 (CST) Subject: [Numpy-svn] r8149 - trunk/numpy/core/src/multiarray Message-ID: <20100220180844.E0D79C7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:08:44 -0600 (Sat, 20 Feb 2010) New Revision: 8149 Modified: trunk/numpy/core/src/multiarray/ctors.c Log: 3K: BUG: do not convert Bytes/Unicode via PEP 3118 buffers -- use 'S/U#' instead Modified: trunk/numpy/core/src/multiarray/ctors.c =================================================================== --- trunk/numpy/core/src/multiarray/ctors.c 2010-02-20 18:08:27 UTC (rev 8148) +++ trunk/numpy/core/src/multiarray/ctors.c 2010-02-20 18:08:44 UTC (rev 8149) @@ -1752,11 +1752,11 @@ } r = Array_FromPyScalar(op, newtype); } -#if PY_VERSION_HEX >= 0x02070000 - else if (_array_from_buffer_3118(op, &r) == 0) { + else if (!PyBytes_Check(op) && !PyUnicode_Check(op) && + _array_from_buffer_3118(op, &r) == 0) { + /* PEP 3118 buffer -- but don't accept Bytes objects here */ r = r; } -#endif else if (PyArray_HasArrayInterfaceType(op, newtype, context, r)) { PyObject *new; if (r == NULL) { @@ -3231,8 +3231,6 @@ Py_INCREF(buf); } -#warning XXX: Should implement support for the new buffer interface here! - if (PyObject_AsWriteBuffer(buf, (void *)&data, &ts) == -1) { write = 0; PyErr_Clear(); From numpy-svn at scipy.org Sat Feb 20 13:09:00 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:09:00 -0600 (CST) Subject: [Numpy-svn] r8150 - trunk/numpy/compat Message-ID: <20100220180900.5EA0AC7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:09:00 -0600 (Sat, 20 Feb 2010) New Revision: 8150 Modified: trunk/numpy/compat/_inspect.py trunk/numpy/compat/py3k.py Log: ENH: Add some tools to numpy.compat Modified: trunk/numpy/compat/_inspect.py =================================================================== --- trunk/numpy/compat/_inspect.py 2010-02-20 18:08:44 UTC (rev 8149) +++ trunk/numpy/compat/_inspect.py 2010-02-20 18:09:00 UTC (rev 8150) @@ -7,7 +7,7 @@ import types -__all__ = ['getarspec', 'formatargspec'] +__all__ = ['getargspec', 'formatargspec'] # ----------------------------------------------------------- type-checking def ismethod(object): Modified: trunk/numpy/compat/py3k.py =================================================================== --- trunk/numpy/compat/py3k.py 2010-02-20 18:08:44 UTC (rev 8149) +++ trunk/numpy/compat/py3k.py 2010-02-20 18:09:00 UTC (rev 8150) @@ -4,23 +4,25 @@ """ __all__ = ['bytes', 'asbytes', 'isfileobj', 'getexception', 'strchar', - 'asunicode'] + 'unicode', 'asunicode', 'asbytes_nested', 'asunicode_nested'] import sys if sys.version_info[0] >= 3: import io bytes = bytes + unicode = str + asunicode = str def asbytes(s): if isinstance(s, bytes): return s return s.encode('iso-8859-1') - asunicode = str def isfileobj(f): return isinstance(f, io.IOBase) strchar = 'U' else: bytes = str + unicode = unicode asbytes = str strchar = 'S' def isfileobj(f): @@ -33,3 +35,14 @@ def getexception(): return sys.exc_info()[1] +def asbytes_nested(x): + if hasattr(x, '__iter__') and not isinstance(x, (bytes, unicode)): + return [asbytes_nested(y) for y in x] + else: + return asbytes(x) + +def asunicode_nested(x): + if hasattr(x, '__iter__') and not isinstance(x, (bytes, unicode)): + return [asunicode_nested(y) for y in x] + else: + return asunicode(x) From numpy-svn at scipy.org Sat Feb 20 13:09:17 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:09:17 -0600 (CST) Subject: [Numpy-svn] r8151 - in trunk/numpy/core: . tests Message-ID: <20100220180917.334BCC7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:09:17 -0600 (Sat, 20 Feb 2010) New Revision: 8151 Modified: trunk/numpy/core/defchararray.py trunk/numpy/core/tests/test_defchararray.py Log: 3K: ENH: make defchararray work on Py3, and make its tests Py3 compliant There were mainly issues in mixing bytes/unicode on Py3. Modified: trunk/numpy/core/defchararray.py =================================================================== --- trunk/numpy/core/defchararray.py 2010-02-20 18:09:00 UTC (rev 8150) +++ trunk/numpy/core/defchararray.py 2010-02-20 18:09:17 UTC (rev 8151) @@ -21,6 +21,7 @@ from numeric import ndarray, compare_chararrays from numeric import array as narray from numpy.core.multiarray import _vec_string +from numpy.compat import asbytes import numpy __all__ = ['chararray', @@ -397,6 +398,8 @@ a_arr = numpy.asarray(a) width_arr = numpy.asarray(width) size = long(numpy.max(width_arr.flat)) + if numpy.issubdtype(a_arr.dtype, numpy.string_): + fillchar = asbytes(fillchar) return _vec_string( a_arr, (a_arr.dtype.type, size), 'center', (width_arr, fillchar)) else: @@ -917,6 +920,8 @@ a_arr = numpy.asarray(a) width_arr = numpy.asarray(width) size = long(numpy.max(width_arr.flat)) + if numpy.issubdtype(a_arr.dtype, numpy.string_): + fillchar = asbytes(fillchar) return _vec_string( a_arr, (a_arr.dtype.type, size), 'ljust', (width_arr, fillchar)) else: @@ -1183,6 +1188,8 @@ a_arr = numpy.asarray(a) width_arr = numpy.asarray(width) size = long(numpy.max(width_arr.flat)) + if numpy.issubdtype(a_arr.dtype, numpy.string_): + fillchar = asbytes(fillchar) return _vec_string( a_arr, (a_arr.dtype.type, size), 'rjust', (width_arr, fillchar)) else: @@ -1841,6 +1848,13 @@ # strings in the new array. itemsize = long(itemsize) + if sys.version_info[0] >= 3 and isinstance(buffer, _unicode): + # On Py3, unicode objects do not have the buffer interface + filler = buffer + buffer = None + else: + filler = None + _globalvar = 1 if buffer is None: self = ndarray.__new__(subtype, shape, (dtype, itemsize), @@ -1850,6 +1864,8 @@ buffer=buffer, offset=offset, strides=strides, order=order) + if filler is not None: + self[...] = filler _globalvar = 0 return self @@ -2594,7 +2610,7 @@ if itemsize is None: itemsize = _len(obj) - shape = _len(obj) / itemsize + shape = _len(obj) // itemsize if unicode: if sys.maxunicode == 0xffff: Modified: trunk/numpy/core/tests/test_defchararray.py =================================================================== --- trunk/numpy/core/tests/test_defchararray.py 2010-02-20 18:09:00 UTC (rev 8150) +++ trunk/numpy/core/tests/test_defchararray.py 2010-02-20 18:09:17 UTC (rev 8151) @@ -4,7 +4,9 @@ import sys from numpy.core.multiarray import _vec_string -kw_unicode_true = {'unicode': True} +from numpy.compat import asbytes, asbytes_nested + +kw_unicode_true = {'unicode': True} # make 2to3 work properly kw_unicode_false = {'unicode': False} class TestBasic(TestCase): @@ -13,7 +15,8 @@ ['long ', '0123456789']], dtype='O') B = np.char.array(A) assert_equal(B.dtype.itemsize, 10) - assert_array_equal(B, [['abc', '2'], ['long', '0123456789']]) + assert_array_equal(B, asbytes_nested([['abc', '2'], + ['long', '0123456789']])) def test_from_object_array_unicode(self): A = np.array([['abc', u'Sigma \u03a3'], @@ -21,11 +24,12 @@ self.failUnlessRaises(ValueError, np.char.array, (A,)) B = np.char.array(A, **kw_unicode_true) assert_equal(B.dtype.itemsize, 10 * np.array('a', 'U').dtype.itemsize) - assert_array_equal(B, [['abc', u'Sigma \u03a3'], ['long', '0123456789']]) + assert_array_equal(B, [['abc', u'Sigma \u03a3'], + ['long', '0123456789']]) def test_from_string_array(self): - A = np.array([['abc', 'foo'], - ['long ', '0123456789']]) + A = np.array(asbytes_nested([['abc', 'foo'], + ['long ', '0123456789']])) assert_equal(A.dtype.type, np.string_) B = np.char.array(A) assert_array_equal(B, A) @@ -62,7 +66,7 @@ assert issubclass((A + B).dtype.type, np.unicode_) def test_from_string(self): - A = np.char.array('abc') + A = np.char.array(asbytes('abc')) assert_equal(len(A), 1) assert_equal(len(A[0]), 3) assert issubclass(A.dtype.type, np.string_) @@ -132,7 +136,7 @@ def test_it(self): assert_equal(self.A.shape, (4,)) - assert_equal(self.A.upper()[:2].tostring(), 'AB') + assert_equal(self.A.upper()[:2].tostring(), asbytes('AB')) class TestComparisons(TestCase): def setUp(self): @@ -277,17 +281,18 @@ def setUp(self): self.A = np.array([[' abc ', ''], ['12345', 'MixedCase'], - ['123 \t 345 \0 ', 'UPPER']]).view(np.chararray) + ['123 \t 345 \0 ', 'UPPER']], + dtype='S').view(np.chararray) self.B = np.array([[u' \u03a3 ', u''], [u'12345', u'MixedCase'], [u'123 \t 345 \0 ', u'UPPER']]).view(np.chararray) def test_capitalize(self): assert issubclass(self.A.capitalize().dtype.type, np.string_) - assert_array_equal(self.A.capitalize(), [ + assert_array_equal(self.A.capitalize(), asbytes_nested([ [' abc ', ''], ['12345', 'Mixedcase'], - ['123 \t 345 \0 ', 'Upper']]) + ['123 \t 345 \0 ', 'Upper']])) assert issubclass(self.B.capitalize().dtype.type, np.unicode_) assert_array_equal(self.B.capitalize(), [ [u' \u03c3 ', ''], @@ -299,56 +304,71 @@ widths = np.array([[10, 20]]) C = self.A.center([10, 20]) assert_array_equal(np.char.str_len(C), [[10, 20], [10, 20], [12, 20]]) - C = self.A.center(20, '#') - assert np.all(C.startswith('#')) - assert np.all(C.endswith('#')) - C = np.char.center('FOO', [[10, 20], [15, 8]]) + C = self.A.center(20, asbytes('#')) + assert np.all(C.startswith(asbytes('#'))) + assert np.all(C.endswith(asbytes('#'))) + C = np.char.center(asbytes('FOO'), [[10, 20], [15, 8]]) assert issubclass(C.dtype.type, np.string_) - assert_array_equal(C, [ + assert_array_equal(C, asbytes_nested([ [' FOO ', ' FOO '], - [' FOO ', ' FOO ']]) + [' FOO ', ' FOO ']])) def test_decode(self): - A = np.char.array(['736563726574206d657373616765']) - assert A.decode('hex_codec')[0] == 'secret message' + if sys.version_info[0] >= 3: + A = np.char.array([asbytes('\\u03a3')]) + assert A.decode('unicode-escape')[0] == '\u03a3' + else: + A = np.char.array(['736563726574206d657373616765']) + assert A.decode('hex_codec')[0] == 'secret message' def test_encode(self): B = self.B.encode('unicode_escape') - assert B[0][0] == r' \u03a3 ' + assert B[0][0] == asbytes(r' \u03a3 ') def test_expandtabs(self): T = self.A.expandtabs() - assert T[2][0] == '123 345' + assert T[2][0] == asbytes('123 345') def test_join(self): - A = np.char.join([',', '#'], self.A) - assert issubclass(A.dtype.type, np.string_) - assert_array_equal(np.char.join([',', '#'], self.A), [ - [' ,a,b,c, ', ''], - ['1,2,3,4,5', 'M#i#x#e#d#C#a#s#e'], - ['1,2,3, ,\t, ,3,4,5, ,\x00, ', 'U#P#P#E#R']]) + if sys.version_info[0] >= 3: + # NOTE: list(b'123') == [49, 50, 51] + # so that b','.join(b'123') results to an error on Py3 + A0 = self.A.decode('ascii') + else: + A0 = self.A + A = np.char.join([',', '#'], A0) + if sys.version_info[0] >= 3: + assert issubclass(A.dtype.type, np.unicode_) + else: + assert issubclass(A.dtype.type, np.string_) + assert_array_equal(np.char.join([',', '#'], A0), + [ + [' ,a,b,c, ', ''], + ['1,2,3,4,5', 'M#i#x#e#d#C#a#s#e'], + ['1,2,3, ,\t, ,3,4,5, ,\x00, ', 'U#P#P#E#R']]) + def test_ljust(self): assert issubclass(self.A.ljust(10).dtype.type, np.string_) widths = np.array([[10, 20]]) C = self.A.ljust([10, 20]) assert_array_equal(np.char.str_len(C), [[10, 20], [10, 20], [12, 20]]) - C = self.A.ljust(20, '#') - assert_array_equal(C.startswith('#'), [ + C = self.A.ljust(20, asbytes('#')) + assert_array_equal(C.startswith(asbytes('#')), [ [False, True], [False, False], [False, False]]) - assert np.all(C.endswith('#')) - C = np.char.ljust('FOO', [[10, 20], [15, 8]]) + assert np.all(C.endswith(asbytes('#'))) + C = np.char.ljust(asbytes('FOO'), [[10, 20], [15, 8]]) assert issubclass(C.dtype.type, np.string_) - assert_array_equal(C, [ + assert_array_equal(C, asbytes_nested([ ['FOO ', 'FOO '], - ['FOO ', 'FOO ']]) + ['FOO ', 'FOO ']])) def test_lower(self): assert issubclass(self.A.lower().dtype.type, np.string_) - assert_array_equal(self.A.lower(), [ + assert_array_equal(self.A.lower(), asbytes_nested([ [' abc ', ''], ['12345', 'mixedcase'], - ['123 \t 345 \0 ', 'upper']]) + ['123 \t 345 \0 ', 'upper']])) assert issubclass(self.B.lower().dtype.type, np.unicode_) assert_array_equal(self.B.lower(), [ [u' \u03c3 ', u''], @@ -357,14 +377,15 @@ def test_lstrip(self): assert issubclass(self.A.lstrip().dtype.type, np.string_) - assert_array_equal(self.A.lstrip(), [ + assert_array_equal(self.A.lstrip(), asbytes_nested([ ['abc ', ''], ['12345', 'MixedCase'], - ['123 \t 345 \0 ', 'UPPER']]) - assert_array_equal(self.A.lstrip(['1', 'M']), [ + ['123 \t 345 \0 ', 'UPPER']])) + assert_array_equal(self.A.lstrip(asbytes_nested(['1', 'M'])), + asbytes_nested([ [' abc', ''], ['2345', 'ixedCase'], - ['23 \t 345 \x00', 'UPPER']]) + ['23 \t 345 \x00', 'UPPER']])) assert issubclass(self.B.lstrip().dtype.type, np.unicode_) assert_array_equal(self.B.lstrip(), [ [u'\u03a3 ', ''], @@ -373,68 +394,74 @@ def test_partition(self): if sys.version_info >= (2, 5): - P = self.A.partition(['3', 'M']) + P = self.A.partition(asbytes_nested(['3', 'M'])) assert issubclass(P.dtype.type, np.string_) - assert_array_equal(P, [ + assert_array_equal(P, asbytes_nested([ [(' abc ', '', ''), ('', '', '')], [('12', '3', '45'), ('', 'M', 'ixedCase')], - [('12', '3', ' \t 345 \0 '), ('UPPER', '', '')]]) + [('12', '3', ' \t 345 \0 '), ('UPPER', '', '')]])) def test_replace(self): - R = self.A.replace(['3', 'a'], ['##########', '@']) + R = self.A.replace(asbytes_nested(['3', 'a']), + asbytes_nested(['##########', '@'])) assert issubclass(R.dtype.type, np.string_) - assert_array_equal(R, [ + assert_array_equal(R, asbytes_nested([ [' abc ', ''], ['12##########45', 'MixedC at se'], - ['12########## \t ##########45 \x00', 'UPPER']]) - R = self.A.replace('a', u'\u03a3') - assert issubclass(R.dtype.type, np.unicode_) - assert_array_equal(R, [ - [u' \u03a3bc ', ''], - ['12345', u'MixedC\u03a3se'], - ['123 \t 345 \x00', 'UPPER']]) + ['12########## \t ##########45 \x00', 'UPPER']])) + if sys.version_info[0] < 3: + # NOTE: b'abc'.replace(b'a', 'b') is not allowed on Py3 + R = self.A.replace(asbytes('a'), u'\u03a3') + assert issubclass(R.dtype.type, np.unicode_) + assert_array_equal(R, [ + [u' \u03a3bc ', ''], + ['12345', u'MixedC\u03a3se'], + ['123 \t 345 \x00', 'UPPER']]) + def test_rjust(self): assert issubclass(self.A.rjust(10).dtype.type, np.string_) widths = np.array([[10, 20]]) C = self.A.rjust([10, 20]) assert_array_equal(np.char.str_len(C), [[10, 20], [10, 20], [12, 20]]) - C = self.A.rjust(20, '#') - assert np.all(C.startswith('#')) - assert_array_equal(C.endswith('#'), [[False, True], [False, False], [False, False]]) - C = np.char.rjust('FOO', [[10, 20], [15, 8]]) + C = self.A.rjust(20, asbytes('#')) + assert np.all(C.startswith(asbytes('#'))) + assert_array_equal(C.endswith(asbytes('#')), + [[False, True], [False, False], [False, False]]) + C = np.char.rjust(asbytes('FOO'), [[10, 20], [15, 8]]) assert issubclass(C.dtype.type, np.string_) - assert_array_equal(C, [ + assert_array_equal(C, asbytes_nested([ [' FOO', ' FOO'], - [' FOO', ' FOO']]) + [' FOO', ' FOO']])) def test_rpartition(self): if sys.version_info >= (2, 5): - P = self.A.rpartition(['3', 'M']) + P = self.A.rpartition(asbytes_nested(['3', 'M'])) assert issubclass(P.dtype.type, np.string_) - assert_array_equal(P, [ + assert_array_equal(P, asbytes_nested([ [('', '', ' abc '), ('', '', '')], [('12', '3', '45'), ('', 'M', 'ixedCase')], - [('123 \t ', '3', '45 \0 '), ('', '', 'UPPER')]]) + [('123 \t ', '3', '45 \0 '), ('', '', 'UPPER')]])) def test_rsplit(self): - A = self.A.rsplit('3') + A = self.A.rsplit(asbytes('3')) assert issubclass(A.dtype.type, np.object_) - assert_equal(A.tolist(), [ + assert_equal(A.tolist(), asbytes_nested([ [[' abc '], ['']], [['12', '45'], ['MixedCase']], - [['12', ' \t ', '45 \x00 '], ['UPPER']]]) + [['12', ' \t ', '45 \x00 '], ['UPPER']]])) def test_rstrip(self): assert issubclass(self.A.rstrip().dtype.type, np.string_) - assert_array_equal(self.A.rstrip(), [ + assert_array_equal(self.A.rstrip(), asbytes_nested([ [' abc', ''], ['12345', 'MixedCase'], - ['123 \t 345', 'UPPER']]) - assert_array_equal(self.A.rstrip(['5', 'ER']), [ + ['123 \t 345', 'UPPER']])) + assert_array_equal(self.A.rstrip(asbytes_nested(['5', 'ER'])), + asbytes_nested([ [' abc ', ''], ['1234', 'MixedCase'], - ['123 \t 345 \x00', 'UPP']]) + ['123 \t 345 \x00', 'UPP']])) assert issubclass(self.B.rstrip().dtype.type, np.unicode_) assert_array_equal(self.B.rstrip(), [ [u' \u03a3', ''], @@ -443,14 +470,15 @@ def test_strip(self): assert issubclass(self.A.strip().dtype.type, np.string_) - assert_array_equal(self.A.strip(), [ + assert_array_equal(self.A.strip(), asbytes_nested([ ['abc', ''], ['12345', 'MixedCase'], - ['123 \t 345', 'UPPER']]) - assert_array_equal(self.A.strip(['15', 'EReM']), [ + ['123 \t 345', 'UPPER']])) + assert_array_equal(self.A.strip(asbytes_nested(['15', 'EReM'])), + asbytes_nested([ [' abc ', ''], ['234', 'ixedCas'], - ['23 \t 345 \x00', 'UPP']]) + ['23 \t 345 \x00', 'UPP']])) assert issubclass(self.B.strip().dtype.type, np.unicode_) assert_array_equal(self.B.strip(), [ [u'\u03a3', ''], @@ -458,12 +486,12 @@ ['123 \t 345', 'UPPER']]) def test_split(self): - A = self.A.split('3') + A = self.A.split(asbytes('3')) assert issubclass(A.dtype.type, np.object_) - assert_equal(A.tolist(), [ + assert_equal(A.tolist(), asbytes_nested([ [[' abc '], ['']], [['12', '45'], ['MixedCase']], - [['12', ' \t ', '45 \x00 '], ['UPPER']]]) + [['12', ' \t ', '45 \x00 '], ['UPPER']]])) def test_splitlines(self): A = np.char.array(['abc\nfds\nwer']).splitlines() @@ -473,10 +501,10 @@ def test_swapcase(self): assert issubclass(self.A.swapcase().dtype.type, np.string_) - assert_array_equal(self.A.swapcase(), [ + assert_array_equal(self.A.swapcase(), asbytes_nested([ [' ABC ', ''], ['12345', 'mIXEDcASE'], - ['123 \t 345 \0 ', 'upper']]) + ['123 \t 345 \0 ', 'upper']])) assert issubclass(self.B.swapcase().dtype.type, np.unicode_) assert_array_equal(self.B.swapcase(), [ [u' \u03c3 ', u''], @@ -485,10 +513,10 @@ def test_title(self): assert issubclass(self.A.title().dtype.type, np.string_) - assert_array_equal(self.A.title(), [ + assert_array_equal(self.A.title(), asbytes_nested([ [' Abc ', ''], ['12345', 'Mixedcase'], - ['123 \t 345 \0 ', 'Upper']]) + ['123 \t 345 \0 ', 'Upper']])) assert issubclass(self.B.title().dtype.type, np.unicode_) assert_array_equal(self.B.title(), [ [u' \u03a3 ', u''], @@ -497,10 +525,10 @@ def test_upper(self): assert issubclass(self.A.upper().dtype.type, np.string_) - assert_array_equal(self.A.upper(), [ + assert_array_equal(self.A.upper(), asbytes_nested([ [' ABC ', ''], ['12345', 'MIXEDCASE'], - ['123 \t 345 \0 ', 'UPPER']]) + ['123 \t 345 \0 ', 'UPPER']])) assert issubclass(self.B.upper().dtype.type, np.unicode_) assert_array_equal(self.B.upper(), [ [u' \u03a3 ', u''], From numpy-svn at scipy.org Sat Feb 20 13:09:46 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:09:46 -0600 (CST) Subject: [Numpy-svn] r8152 - in trunk/numpy/core: . src/multiarray tests Message-ID: <20100220180946.1C992C7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:09:45 -0600 (Sat, 20 Feb 2010) New Revision: 8152 Added: trunk/numpy/core/src/multiarray/numpymemoryview.c trunk/numpy/core/src/multiarray/numpymemoryview.h Modified: trunk/numpy/core/SConscript trunk/numpy/core/setup.py trunk/numpy/core/src/multiarray/arrayobject.c trunk/numpy/core/src/multiarray/buffer.c trunk/numpy/core/src/multiarray/common.c trunk/numpy/core/src/multiarray/ctors.c trunk/numpy/core/src/multiarray/multiarraymodule.c trunk/numpy/core/tests/test_multiarray.py Log: ENH: implement PEP 3118 buffer consumer on Py2.6, adding a simple Memoryview object To use PEP 3118 buffers as ndarray bases, we need to have a way to release the buffers on garbage collection. The easiest way to do this is to use a Memoryview object -- but they are not available on Python 2.6. Hence, we implement a minimal memory view object that only handles the garbage collection, and use it on Python 2.6. It also implements the new buffer protocol, to allow testing the functionality. Modified: trunk/numpy/core/SConscript =================================================================== --- trunk/numpy/core/SConscript 2010-02-20 18:09:17 UTC (rev 8151) +++ trunk/numpy/core/SConscript 2010-02-20 18:09:45 UTC (rev 8152) @@ -447,6 +447,7 @@ pjoin('src', 'multiarray', 'conversion_utils.c'), pjoin('src', 'multiarray', 'usertypes.c'), pjoin('src', 'multiarray', 'buffer.c'), + pjoin('src', 'multiarray', 'numpymemoryview.c'), pjoin('src', 'multiarray', 'scalarapi.c')] multiarray_src.extend(arraytypes_src) multiarray_src.extend(scalartypes_src) Modified: trunk/numpy/core/setup.py =================================================================== --- trunk/numpy/core/setup.py 2010-02-20 18:09:17 UTC (rev 8151) +++ trunk/numpy/core/setup.py 2010-02-20 18:09:45 UTC (rev 8152) @@ -703,6 +703,7 @@ join('src', 'multiarray', 'mapping.h'), join('src', 'multiarray', 'methods.h'), join('src', 'multiarray', 'multiarraymodule.h'), + join('src', 'multiarray', 'numpymemoryview.h'), join('src', 'multiarray', 'number.h'), join('src', 'multiarray', 'numpyos.h'), join('src', 'multiarray', 'refcount.h'), @@ -715,6 +716,7 @@ multiarray_src = [join('src', 'multiarray', 'multiarraymodule.c'), join('src', 'multiarray', 'hashdescr.c'), join('src', 'multiarray', 'arrayobject.c'), + join('src', 'multiarray', 'numpymemoryview.c'), join('src', 'multiarray', 'buffer.c'), join('src', 'multiarray', 'datetime.c'), join('src', 'multiarray', 'numpyos.c'), Modified: trunk/numpy/core/src/multiarray/arrayobject.c =================================================================== --- trunk/numpy/core/src/multiarray/arrayobject.c 2010-02-20 18:09:17 UTC (rev 8151) +++ trunk/numpy/core/src/multiarray/arrayobject.c 2010-02-20 18:09:45 UTC (rev 8152) @@ -1317,6 +1317,9 @@ #if !defined(NPY_PY3K) | Py_TPFLAGS_CHECKTYPES #endif +#if (PY_VERSION_HEX >= 0x02060000) && (PY_VERSION_HEX < 0x03000000) + | Py_TPFLAGS_HAVE_NEWBUFFER +#endif | Py_TPFLAGS_BASETYPE), /* tp_flags */ 0, /* tp_doc */ Modified: trunk/numpy/core/src/multiarray/buffer.c =================================================================== --- trunk/numpy/core/src/multiarray/buffer.c 2010-02-20 18:09:17 UTC (rev 8151) +++ trunk/numpy/core/src/multiarray/buffer.c 2010-02-20 18:09:45 UTC (rev 8152) @@ -636,8 +636,8 @@ return NULL; } str = PyUString_FromStringAndSize(buf, strlen(buf)); - descr = PyObject_CallMethod(_numpy_internal, "_dtype_from_pep3118", - "O", str); + descr = (PyArray_Descr*)PyObject_CallMethod( + _numpy_internal, "_dtype_from_pep3118", "O", str); Py_DECREF(str); if (descr == NULL) { PyErr_Format(PyExc_ValueError, Modified: trunk/numpy/core/src/multiarray/common.c =================================================================== --- trunk/numpy/core/src/multiarray/common.c 2010-02-20 18:09:17 UTC (rev 8151) +++ trunk/numpy/core/src/multiarray/common.c 2010-02-20 18:09:45 UTC (rev 8152) @@ -153,7 +153,7 @@ PyObject *ip; PyArray_Descr *chktype = NULL; PyArray_Descr *outtype; -#if PY_VERSION_HEX >= 0x02070000 +#if PY_VERSION_HEX >= 0x02060000 Py_buffer buffer_view; #endif @@ -210,7 +210,7 @@ goto finish; } -#if PY_VERSION_HEX >= 0x02070000 +#if PY_VERSION_HEX >= 0x02060000 /* PEP 3118 buffer interface */ memset(&buffer_view, 0, sizeof(Py_buffer)); if (PyObject_GetBuffer(op, &buffer_view, PyBUF_FORMAT|PyBUF_STRIDES) == 0 || Modified: trunk/numpy/core/src/multiarray/ctors.c =================================================================== --- trunk/numpy/core/src/multiarray/ctors.c 2010-02-20 18:09:17 UTC (rev 8151) +++ trunk/numpy/core/src/multiarray/ctors.c 2010-02-20 18:09:45 UTC (rev 8152) @@ -17,6 +17,8 @@ #include "ctors.h" +#include "numpymemoryview.h" + /* * Reading from a file or a string. * @@ -1083,7 +1085,7 @@ { int d = 0; PyObject *e; -#if PY_VERSION_HEX >= 0x02070000 +#if PY_VERSION_HEX >= 0x02060000 Py_buffer buffer_view; #endif @@ -1117,7 +1119,7 @@ if (stop_at_tuple && PyTuple_Check(s)) { return 0; } -#if PY_VERSION_HEX >= 0x02070000 +#if PY_VERSION_HEX >= 0x02060000 /* PEP 3118 buffer interface */ memset(&buffer_view, 0, sizeof(Py_buffer)); if (PyObject_GetBuffer(s, &buffer_view, PyBUF_STRIDES) == 0 || @@ -1631,12 +1633,7 @@ NPY_NO_EXPORT int _array_from_buffer_3118(PyObject *obj, PyObject **out) { -#if PY_VERSION_HEX >= 0x02070000 - /* XXX: Pythons < 2.7 do not have the memory view object. This makes - * using buffers somewhat difficult, since one cannot release them - * using the garbage collection - */ - +#if PY_VERSION_HEX >= 0x02060000 /* PEP 3118 */ PyObject *memoryview; Py_buffer *view; @@ -1654,7 +1651,7 @@ view = PyMemoryView_GET_BUFFER(memoryview); if (view->format != NULL) { - descr = _descriptor_from_pep3118_format(view->format); + descr = (PyObject*)_descriptor_from_pep3118_format(view->format); if (descr == NULL) { goto fail; } Modified: trunk/numpy/core/src/multiarray/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarray/multiarraymodule.c 2010-02-20 18:09:17 UTC (rev 8151) +++ trunk/numpy/core/src/multiarray/multiarraymodule.c 2010-02-20 18:09:45 UTC (rev 8152) @@ -41,6 +41,7 @@ #include "calculation.h" #include "number.h" #include "scalartypes.h" +#include "numpymemoryview.h" /*NUMPY_API * Get Priority from object @@ -3051,6 +3052,14 @@ goto err; } + /* Initialize types in numpymemoryview.c */ + if (_numpymemoryview_init(&s) < 0) { + return RETVAL; + } + if (s != NULL) { + PyDict_SetItemString(d, "memorysimpleview", s); + } + /* * PyExc_Exception should catch all the standard errors that are * now raised instead of the string exception "multiarray.error" Added: trunk/numpy/core/src/multiarray/numpymemoryview.c =================================================================== --- trunk/numpy/core/src/multiarray/numpymemoryview.c (rev 0) +++ trunk/numpy/core/src/multiarray/numpymemoryview.c 2010-02-20 18:09:45 UTC (rev 8152) @@ -0,0 +1,310 @@ +/* + * Simple PyMemoryView'ish object for Python 2.6 compatibility. + * + * On Python >= 2.7, we can use the actual PyMemoryView objects. + * + * Some code copied from the CPython implementation. + */ + +#define PY_SSIZE_T_CLEAN +#include +#include "structmember.h" + +#define _MULTIARRAYMODULE +#define NPY_NO_PREFIX +#include "numpy/arrayobject.h" +#include "numpy/arrayscalars.h" + +#include "npy_config.h" +#include "npy_3kcompat.h" + +#include "numpymemoryview.h" + + +#if (PY_VERSION_HEX >= 0x02060000) && (PY_VERSION_HEX < 0x02070000) + +/* + * Memory allocation + */ + +static int +memorysimpleview_traverse(PyMemorySimpleViewObject *self, + visitproc visit, void *arg) +{ + if (self->base != NULL) + Py_VISIT(self->base); + if (self->view.obj != NULL) + Py_VISIT(self->view.obj); + return 0; +} + +static int +memorysimpleview_clear(PyMemorySimpleViewObject *self) +{ + Py_CLEAR(self->base); + PyBuffer_Release(&self->view); + self->view.obj = NULL; + return 0; +} + +static void +memorysimpleview_dealloc(PyMemorySimpleViewObject *self) +{ + PyObject_GC_UnTrack(self); + Py_CLEAR(self->base); + if (self->view.obj != NULL) { + PyBuffer_Release(&self->view); + self->view.obj = NULL; + } + PyObject_GC_Del(self); +} + +static PyObject * +memorysimpleview_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) +{ + PyObject *obj; + static char *kwlist[] = {"object", 0}; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:memorysimpleview", kwlist, + &obj)) { + return NULL; + } + return PyMemorySimpleView_FromObject(obj); +} + + +/* + * Buffer interface + */ + +static int +memorysimpleview_getbuffer(PyMemorySimpleViewObject *self, + Py_buffer *view, int flags) +{ + return PyObject_GetBuffer(self->base, view, flags); +} + +static void +memorysimpleview_releasebuffer(PyMemorySimpleViewObject *self, + Py_buffer *view) +{ + PyBuffer_Release(view); +} + +static PyBufferProcs memorysimpleview_as_buffer = { + (readbufferproc)0, /*bf_getreadbuffer*/ + (writebufferproc)0, /*bf_getwritebuffer*/ + (segcountproc)0, /*bf_getsegcount*/ + (charbufferproc)0, /*bf_getcharbuffer*/ + (getbufferproc)memorysimpleview_getbuffer, /* bf_getbuffer */ + (releasebufferproc)memorysimpleview_releasebuffer, /* bf_releasebuffer */ +}; + + +/* + * Getters + */ + +static PyObject * +_IntTupleFromSsizet(int len, Py_ssize_t *vals) +{ + int i; + PyObject *o; + PyObject *intTuple; + + if (vals == NULL) { + Py_INCREF(Py_None); + return Py_None; + } + intTuple = PyTuple_New(len); + if (!intTuple) return NULL; + for(i=0; iview.format); +} + +static PyObject * +memorysimpleview_itemsize_get(PyMemorySimpleViewObject *self) +{ + return PyLong_FromSsize_t(self->view.itemsize); +} + +static PyObject * +memorysimpleview_shape_get(PyMemorySimpleViewObject *self) +{ + return _IntTupleFromSsizet(self->view.ndim, self->view.shape); +} + +static PyObject * +memorysimpleview_strides_get(PyMemorySimpleViewObject *self) +{ + return _IntTupleFromSsizet(self->view.ndim, self->view.strides); +} + +static PyObject * +memorysimpleview_suboffsets_get(PyMemorySimpleViewObject *self) +{ + return _IntTupleFromSsizet(self->view.ndim, self->view.suboffsets); +} + +static PyObject * +memorysimpleview_readonly_get(PyMemorySimpleViewObject *self) +{ + return PyBool_FromLong(self->view.readonly); +} + +static PyObject * +memorysimpleview_ndim_get(PyMemorySimpleViewObject *self) +{ + return PyLong_FromLong(self->view.ndim); +} + + +static PyGetSetDef memorysimpleview_getsets[] = +{ + {"format", (getter)memorysimpleview_format_get, NULL, NULL, NULL}, + {"itemsize", (getter)memorysimpleview_itemsize_get, NULL, NULL, NULL}, + {"shape", (getter)memorysimpleview_shape_get, NULL, NULL, NULL}, + {"strides", (getter)memorysimpleview_strides_get, NULL, NULL, NULL}, + {"suboffsets", (getter)memorysimpleview_suboffsets_get, NULL, NULL, NULL}, + {"readonly", (getter)memorysimpleview_readonly_get, NULL, NULL, NULL}, + {"ndim", (getter)memorysimpleview_ndim_get, NULL, NULL, NULL}, + {NULL, NULL, NULL, NULL} +}; + +NPY_NO_EXPORT PyTypeObject PyMemorySimpleView_Type = { +#if defined(NPY_PY3K) + PyVarObject_HEAD_INIT(NULL, 0) +#else + PyObject_HEAD_INIT(NULL) + 0, /* ob_size */ +#endif + "numpy.memorysimpleview", + sizeof(PyMemorySimpleViewObject), + 0, /* tp_itemsize */ + /* methods */ + (destructor)memorysimpleview_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ +#if defined(NPY_PY3K) + 0, /* tp_reserved */ +#else + (cmpfunc)0, /* tp_compare */ +#endif + (reprfunc)0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + (reprfunc)0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + &memorysimpleview_as_buffer, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC + | Py_TPFLAGS_HAVE_NEWBUFFER, /* tp_flags */ + 0, /* tp_doc */ + (traverseproc)memorysimpleview_traverse, /* tp_traverse */ + (inquiry)memorysimpleview_clear, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + memorysimpleview_getsets, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + memorysimpleview_new, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ + 0, /* tp_del */ +#if PY_VERSION_HEX >= 0x02060000 + 0, /* tp_version_tag */ +#endif +}; + + +/* + * Factory + */ +NPY_NO_EXPORT PyObject * +PyMemorySimpleView_FromObject(PyObject *base) +{ + PyMemorySimpleViewObject *mview = NULL; + Py_buffer view; + + if (Py_TYPE(base)->tp_as_buffer == NULL || + Py_TYPE(base)->tp_as_buffer->bf_getbuffer == NULL) { + + PyErr_SetString(PyExc_TypeError, + "cannot make memory view because object does " + "not have the buffer interface"); + return NULL; + } + + memset(&view, 0, sizeof(Py_buffer)); + if (PyObject_GetBuffer(base, &view, PyBUF_FULL_RO) < 0) + return NULL; + + mview = (PyMemorySimpleViewObject *) + PyObject_GC_New(PyMemorySimpleViewObject, &PyMemorySimpleView_Type); + if (mview == NULL) { + PyBuffer_Release(&view); + return NULL; + } + memcpy(&mview->view, &view, sizeof(Py_buffer)); + mview->base = base; + Py_INCREF(base); + + PyObject_GC_Track(mview); + return (PyObject *)mview; +} + + +/* + * Module initialization + */ + +NPY_NO_EXPORT int +_numpymemoryview_init(PyObject **typeobject) +{ + if (PyType_Ready(&PyMemorySimpleView_Type) < 0) { + return -1; + } + *typeobject = (PyObject*)&PyMemorySimpleView_Type; + return 0; +} + +#else + +NPY_NO_EXPORT int +_numpymemoryview_init(PyObject **typeobject) +{ + *typeobject = NULL; + return 0; +} + +#endif Property changes on: trunk/numpy/core/src/multiarray/numpymemoryview.c ___________________________________________________________________ Name: svn:keywords + Id Author Name: svn:eol-style + native Added: trunk/numpy/core/src/multiarray/numpymemoryview.h =================================================================== --- trunk/numpy/core/src/multiarray/numpymemoryview.h (rev 0) +++ trunk/numpy/core/src/multiarray/numpymemoryview.h 2010-02-20 18:09:45 UTC (rev 8152) @@ -0,0 +1,29 @@ +#ifndef _NPY_PRIVATE_NUMPYMEMORYVIEW_H_ +#define _NPY_PRIVATE_NUMPYMEMORYVIEW_H_ + +/* + * Memoryview is introduced to 2.x series only in 2.7, so for supporting 2.6, + * we need to have a minimal implementation here. + */ +#if (PY_VERSION_HEX >= 0x02060000) && (PY_VERSION_HEX < 0x02070000) + +typedef struct { + PyObject_HEAD + PyObject *base; + Py_buffer view; +} PyMemorySimpleViewObject; + +NPY_NO_EXPORT PyObject * +PyMemorySimpleView_FromObject(PyObject *base); + +#define PyMemorySimpleView_GET_BUFFER(op) (&((PyMemorySimpleViewObject *)(op))->view) + +#define PyMemoryView_FromObject PyMemorySimpleView_FromObject +#define PyMemoryView_GET_BUFFER PyMemorySimpleView_GET_BUFFER + +#endif + +NPY_NO_EXPORT int +_numpymemoryview_init(PyObject **typeobject); + +#endif Property changes on: trunk/numpy/core/src/multiarray/numpymemoryview.h ___________________________________________________________________ Name: svn:keywords + Id Author Name: svn:eol-style + native Modified: trunk/numpy/core/tests/test_multiarray.py =================================================================== --- trunk/numpy/core/tests/test_multiarray.py 2010-02-20 18:09:17 UTC (rev 8151) +++ trunk/numpy/core/tests/test_multiarray.py 2010-02-20 18:09:45 UTC (rev 8152) @@ -1451,7 +1451,11 @@ assert_raises(np.ComplexWarning, x.__setitem__, slice(None), y) warnings.simplefilter("default", np.ComplexWarning) -if sys.version_info >= (2, 7): +if sys.version_info >= (2, 6): + + if sys.version_info[:2] == (2, 6): + from numpy.core.multiarray import memorysimpleview as memoryview + class TestNewBufferProtocol(object): def _check_roundtrip(self, obj): obj = np.asarray(obj) @@ -1556,9 +1560,9 @@ x = np.array(([[1,2],[3,4]],), dtype=[('a', (int, (2,2)))]) y = memoryview(x) assert y.format == 'T{(2,2)=l:a:}' - assert y.shape == () + assert y.shape is None assert y.ndim == 0 - assert y.strides == () + assert y.strides is None assert y.suboffsets is None assert y.itemsize == 16 From numpy-svn at scipy.org Sat Feb 20 13:10:05 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:10:05 -0600 (CST) Subject: [Numpy-svn] r8153 - in trunk/numpy/core: src/multiarray tests Message-ID: <20100220181005.114BCC7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:10:04 -0600 (Sat, 20 Feb 2010) New Revision: 8153 Modified: trunk/numpy/core/src/multiarray/ctors.c trunk/numpy/core/tests/test_multiarray.py Log: BUG: core: make sure PyArray_FromAny respects wanted type and flags also for PEP 3118 objects Modified: trunk/numpy/core/src/multiarray/ctors.c =================================================================== --- trunk/numpy/core/src/multiarray/ctors.c 2010-02-20 18:09:45 UTC (rev 8152) +++ trunk/numpy/core/src/multiarray/ctors.c 2010-02-20 18:10:04 UTC (rev 8153) @@ -1691,7 +1691,7 @@ strides[0] = view->itemsize; } - flags = (view->readonly ? 0 : NPY_WRITEABLE); + flags = BEHAVED & (view->readonly ? ~NPY_WRITEABLE : ~0); r = PyArray_NewFromDescr(&PyArray_Type, descr, nd, shape, strides, view->buf, flags, NULL); @@ -1752,7 +1752,12 @@ else if (!PyBytes_Check(op) && !PyUnicode_Check(op) && _array_from_buffer_3118(op, &r) == 0) { /* PEP 3118 buffer -- but don't accept Bytes objects here */ - r = r; + PyObject *new; + if (newtype != NULL || flags != 0) { + new = PyArray_FromArray((PyArrayObject *)r, newtype, flags); + Py_DECREF(r); + r = new; + } } else if (PyArray_HasArrayInterfaceType(op, newtype, context, r)) { PyObject *new; Modified: trunk/numpy/core/tests/test_multiarray.py =================================================================== --- trunk/numpy/core/tests/test_multiarray.py 2010-02-20 18:09:45 UTC (rev 8152) +++ trunk/numpy/core/tests/test_multiarray.py 2010-02-20 18:10:04 UTC (rev 8153) @@ -1461,8 +1461,13 @@ obj = np.asarray(obj) x = memoryview(obj) y = np.asarray(x) + y2 = np.array(x) + assert not y.flags.owndata + assert y2.flags.owndata assert y.dtype == obj.dtype, (obj, y) assert_array_equal(obj, y) + assert y2.dtype == obj.dtype, (obj, y2) + assert_array_equal(obj, y2) def test_roundtrip(self): x = np.array([1,2,3,4,5], dtype='i4') From numpy-svn at scipy.org Sat Feb 20 13:10:21 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:10:21 -0600 (CST) Subject: [Numpy-svn] r8154 - trunk/numpy/core/src/multiarray Message-ID: <20100220181021.ABBEFC7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:10:21 -0600 (Sat, 20 Feb 2010) New Revision: 8154 Modified: trunk/numpy/core/src/multiarray/scalartypes.c.src Log: 3K: ENH: on py3k, rename scalar type display names as unicode_ -> str_ and string_ -> bytes_ Modified: trunk/numpy/core/src/multiarray/scalartypes.c.src =================================================================== --- trunk/numpy/core/src/multiarray/scalartypes.c.src 2010-02-20 18:10:04 UTC (rev 8153) +++ trunk/numpy/core/src/multiarray/scalartypes.c.src 2010-02-20 18:10:21 UTC (rev 8154) @@ -2912,6 +2912,16 @@ } +#define NAME_bool "bool" +#define NAME_void "void" +#if defined(NPY_PY3K) +#define NAME_string "bytes" +#define NAME_unicode "str" +#else +#define NAME_string "string" +#define NAME_unicode "unicode" +#endif + /**begin repeat * #name = bool, string, unicode, void# * #NAME = Bool, String, Unicode, Void# @@ -2924,7 +2934,7 @@ PyObject_HEAD_INIT(NULL) 0, /* ob_size */ #endif - "numpy. at name@@ex@", /* tp_name*/ + "numpy." NAME_ at name@ "@ex@", /* tp_name*/ sizeof(Py at NAME@ScalarObject), /* tp_basicsize*/ 0, /* tp_itemsize */ 0, /* tp_dealloc */ @@ -2979,6 +2989,11 @@ }; /**end repeat**/ +#undef NAME_bool +#undef NAME_void +#undef NAME_string +#undef NAME_unicode + /**begin repeat * #NAME = Byte, Short, Int, Long, LongLong, UByte, UShort, UInt, ULong, * ULongLong, Float, Double, LongDouble, Datetime, Timedelta# From numpy-svn at scipy.org Sat Feb 20 13:10:36 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:10:36 -0600 (CST) Subject: [Numpy-svn] r8155 - trunk/numpy/core Message-ID: <20100220181036.0A6DCC7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:10:35 -0600 (Sat, 20 Feb 2010) New Revision: 8155 Modified: trunk/numpy/core/numerictypes.py Log: 3K: ENH: core/numerictypes: Update string/unicode aliases for Py3 Modified: trunk/numpy/core/numerictypes.py =================================================================== --- trunk/numpy/core/numerictypes.py 2010-02-20 18:10:21 UTC (rev 8154) +++ trunk/numpy/core/numerictypes.py 2010-02-20 18:10:35 UTC (rev 8155) @@ -74,10 +74,14 @@ | clongfloat (longcomplex) +-> flexible | character - | str_ (string_) (kind=S) - | unicode_ (kind=U) | void (kind=V) | + | str_ (string_, bytes_) (kind=S) [Python 2] + | unicode_ (kind=U) [Python 2] + | + | bytes_ (string_) (kind=S) [Python 3] + | str_ (unicode_) (kind=U) [Python 3] + | \\-> object_ (not used much) (kind=O) """ @@ -90,11 +94,19 @@ from numpy.core.multiarray import typeinfo, ndarray, array, empty, dtype import types as _types +import sys # we don't export these for import *, but we do want them accessible # as numerictypes.bool, etc. from __builtin__ import bool, int, long, float, complex, object, unicode, str +if sys.version_info[0] >= 3: + # Py3K + from builtins import bytes + class long(int): + # Placeholder class -- this will not escape outside numerictypes.py + pass + # String-handling utilities to avoid locale-dependence. # "import string" is costly to import! @@ -237,12 +249,6 @@ if name == 'bool_': char = 'b' base = 'bool' - elif name=='string_': - char = 'S' - base = 'string' - elif name=='unicode_': - char = 'U' - base = 'unicode' elif name=='void': char = 'V' base = 'void' @@ -251,6 +257,21 @@ base = 'object' bits = 0 + if sys.version_info[0] >= 3: + if name=='bytes_': + char = 'S' + base = 'bytes' + elif name=='str_': + char = 'U' + base = 'str' + else: + if name=='string_': + char = 'S' + base = 'string' + elif name=='unicode_': + char = 'U' + base = 'unicode' + bytes = bits // 8 if char != '' and bytes != 0: @@ -375,17 +396,30 @@ ('longcomplex', 'clongdouble'), ('bool_', 'bool'), ('unicode_', 'unicode'), - ('str_', 'string'), - ('string_', 'string'), ('object_', 'object'), ('timedelta_', 'timedelta'), ('datetime_', 'datetime')] + if sys.version_info[0] >= 3: + type_pairs.extend([('bytes_', 'string'), + ('str_', 'unicode'), + ('string_', 'string')]) + else: + type_pairs.extend([('str_', 'string'), + ('string_', 'string'), + ('bytes_', 'string')]) for alias, t in type_pairs: allTypes[alias] = allTypes[t] sctypeDict[alias] = sctypeDict[t] # Remove aliases overriding python types and modules - for t in ['ulong', 'object', 'unicode', 'int', 'long', 'float', - 'complex', 'bool', 'string', 'datetime', 'timedelta']: + to_remove = ['ulong', 'object', 'unicode', 'int', 'long', 'float', + 'complex', 'bool', 'string', 'datetime', 'timedelta'] + if sys.version_info[0] >= 3: + # Py3K + to_remove.append('bytes') + to_remove.append('str') + to_remove.remove('unicode') + to_remove.remove('long') + for t in to_remove: try: del allTypes[t] del sctypeDict[t] @@ -738,7 +772,8 @@ _types.StringType, _types.UnicodeType, _types.BufferType] except AttributeError: # Py3K - ScalarType = [int, float, complex, int, bool, bytes, str, memoryview] + ScalarType = [int, float, complex, long, bool, bytes, str, memoryview] + ScalarType.extend(_sctype2char_dict.keys()) ScalarType = tuple(ScalarType) for key in _sctype2char_dict.keys(): @@ -759,8 +794,13 @@ # Add additional strings to the sctypeDict -_toadd = ['int', 'float', 'complex', 'bool', 'object', 'string', ('str', allTypes['string_']), - 'unicode', 'object', ('a', allTypes['string_'])] +if sys.version_info[0] >= 3: + _toadd = ['int', 'float', 'complex', 'bool', 'object', + 'str', 'bytes', 'object', ('a', allTypes['bytes_'])] +else: + _toadd = ['int', 'float', 'complex', 'bool', 'object', 'string', + ('str', allTypes['string_']), + 'unicode', 'object', ('a', allTypes['string_'])] for name in _toadd: if isinstance(name, tuple): From numpy-svn at scipy.org Sat Feb 20 13:10:52 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:10:52 -0600 (CST) Subject: [Numpy-svn] r8156 - trunk/doc Message-ID: <20100220181052.9471AC7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:10:52 -0600 (Sat, 20 Feb 2010) New Revision: 8156 Modified: trunk/doc/Py3K.txt Log: 3K: doc: update porting documentation Modified: trunk/doc/Py3K.txt =================================================================== --- trunk/doc/Py3K.txt 2010-02-20 18:10:35 UTC (rev 8155) +++ trunk/doc/Py3K.txt 2010-02-20 18:10:52 UTC (rev 8156) @@ -45,9 +45,13 @@ As a side effect, the Py3 adaptation has caused the following semantic changes that are visible on Py2. -* There are no known semantic changes. +* Objects (non-string, non-unicode) that implement the PEP 3118 array interface + will behave as ndarrays in `array(...)` and `asarray(...)`; the same way + as if they had ``__array_interface__`` defined. +* Otherwise, there are no known semantic changes. + Known semantic changes on Py3 ============================= @@ -188,7 +192,25 @@ BufferType should probably be replaced with `memoryview` in most places. This was currently changed in a couple of places. +numpy.core.numerictypes +----------------------- +In numerictypes, types on Python 3 were changed so that: + +=========== ============ +Scalar type Value +=========== ============ +str_ This is the basic Unicode string type on Py3 +bytes_ This is the basic Byte-string type on Py3 +string_ bytes_ alias +unicode_ str_ alias +=========== ============ + +.. todo:: + + Check if I missed something here. + + C Code ====== From numpy-svn at scipy.org Sat Feb 20 13:11:07 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:11:07 -0600 (CST) Subject: [Numpy-svn] r8157 - trunk/numpy/core/tests Message-ID: <20100220181107.A7EDBC7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:11:07 -0600 (Sat, 20 Feb 2010) New Revision: 8157 Modified: trunk/numpy/core/tests/test_regression.py Log: 3K: core: fix up some tests Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2010-02-20 18:10:52 UTC (rev 8156) +++ trunk/numpy/core/tests/test_regression.py 2010-02-20 18:11:07 UTC (rev 8157) @@ -525,8 +525,8 @@ def test_junk_in_string_fields_of_recarray(self, level=rlevel): """Ticket #483""" - r = np.array([['abc']], dtype=[('var1', '|S20')]) - assert str(r['var1'][0][0]) == 'abc' + r = np.array([[asbytes('abc')]], dtype=[('var1', '|S20')]) + assert asbytes(r['var1'][0][0]) == asbytes('abc') def test_take_output(self, level=rlevel): """Ensure that 'take' honours output parameter.""" From numpy-svn at scipy.org Sat Feb 20 13:11:21 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:11:21 -0600 (CST) Subject: [Numpy-svn] r8158 - trunk/numpy/linalg Message-ID: <20100220181121.A6544C7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:11:21 -0600 (Sat, 20 Feb 2010) New Revision: 8158 Modified: trunk/numpy/linalg/linalg.py Log: 3K: linalg: fix some str/bytes issues Modified: trunk/numpy/linalg/linalg.py =================================================================== --- trunk/numpy/linalg/linalg.py 2010-02-20 18:11:07 UTC (rev 8157) +++ trunk/numpy/linalg/linalg.py 2010-02-20 18:11:21 UTC (rev 8158) @@ -22,7 +22,15 @@ from numpy.lib import triu from numpy.linalg import lapack_lite from numpy.matrixlib.defmatrix import matrix_power +from numpy.compat import asbytes +# For Python2/3 compatibility +_N = asbytes('N') +_V = asbytes('V') +_A = asbytes('A') +_S = asbytes('S') +_L = asbytes('L') + fortran_int = intc # Error object @@ -503,7 +511,7 @@ lapack_routine = lapack_lite.zpotrf else: lapack_routine = lapack_lite.dpotrf - results = lapack_routine('L', n, a, m, 0) + results = lapack_routine(_L, n, a, m, 0) if results['info'] > 0: raise LinAlgError, 'Matrix is not positive definite - \ Cholesky decomposition cannot be computed' @@ -762,11 +770,11 @@ rwork = zeros((n,), real_t) lwork = 1 work = zeros((lwork,), t) - results = lapack_routine('N', 'N', n, a, n, w, + results = lapack_routine(_N, _N, n, a, n, w, dummy, 1, dummy, 1, work, -1, rwork, 0) lwork = int(abs(work[0])) work = zeros((lwork,), t) - results = lapack_routine('N', 'N', n, a, n, w, + results = lapack_routine(_N, _N, n, a, n, w, dummy, 1, dummy, 1, work, lwork, rwork, 0) else: lapack_routine = lapack_lite.dgeev @@ -774,11 +782,11 @@ wi = zeros((n,), t) lwork = 1 work = zeros((lwork,), t) - results = lapack_routine('N', 'N', n, a, n, wr, wi, + results = lapack_routine(_N, _N, n, a, n, wr, wi, dummy, 1, dummy, 1, work, -1, 0) lwork = int(work[0]) work = zeros((lwork,), t) - results = lapack_routine('N', 'N', n, a, n, wr, wi, + results = lapack_routine(_N, _N, n, a, n, wr, wi, dummy, 1, dummy, 1, work, lwork, 0) if all(wi == 0.): w = wr @@ -838,6 +846,7 @@ array([ 0.17157288+0.j, 5.82842712+0.j]) """ + UPLO = asbytes(UPLO) a, wrap = _makearray(a) _assertRank2(a) _assertSquareness(a) @@ -854,24 +863,24 @@ work = zeros((lwork,), t) lrwork = 1 rwork = zeros((lrwork,), real_t) - results = lapack_routine('N', UPLO, n, a, n, w, work, -1, + results = lapack_routine(_N, UPLO, n, a, n, w, work, -1, rwork, -1, iwork, liwork, 0) lwork = int(abs(work[0])) work = zeros((lwork,), t) lrwork = int(rwork[0]) rwork = zeros((lrwork,), real_t) - results = lapack_routine('N', UPLO, n, a, n, w, work, lwork, + results = lapack_routine(_N, UPLO, n, a, n, w, work, lwork, rwork, lrwork, iwork, liwork, 0) else: lapack_routine = lapack_lite.dsyevd w = zeros((n,), t) lwork = 1 work = zeros((lwork,), t) - results = lapack_routine('N', UPLO, n, a, n, w, work, -1, + results = lapack_routine(_N, UPLO, n, a, n, w, work, -1, iwork, liwork, 0) lwork = int(work[0]) work = zeros((lwork,), t) - results = lapack_routine('N', UPLO, n, a, n, w, work, lwork, + results = lapack_routine(_N, UPLO, n, a, n, w, work, lwork, iwork, liwork, 0) if results['info'] > 0: raise LinAlgError, 'Eigenvalues did not converge' @@ -1010,11 +1019,11 @@ lwork = 1 work = zeros((lwork,), t) rwork = zeros((2*n,), real_t) - results = lapack_routine('N', 'V', n, a, n, w, + results = lapack_routine(_N, _V, n, a, n, w, dummy, 1, v, n, work, -1, rwork, 0) lwork = int(abs(work[0])) work = zeros((lwork,), t) - results = lapack_routine('N', 'V', n, a, n, w, + results = lapack_routine(_N, _V, n, a, n, w, dummy, 1, v, n, work, lwork, rwork, 0) else: lapack_routine = lapack_lite.dgeev @@ -1023,11 +1032,11 @@ vr = zeros((n, n), t) lwork = 1 work = zeros((lwork,), t) - results = lapack_routine('N', 'V', n, a, n, wr, wi, + results = lapack_routine(_N, _V, n, a, n, wr, wi, dummy, 1, vr, n, work, -1, 0) lwork = int(work[0]) work = zeros((lwork,), t) - results = lapack_routine('N', 'V', n, a, n, wr, wi, + results = lapack_routine(_N, _V, n, a, n, wr, wi, dummy, 1, vr, n, work, lwork, 0) if all(wi == 0.0): w = wr @@ -1128,6 +1137,7 @@ [ 0.00000000+0.38268343j, 0.00000000-0.92387953j]]) """ + UPLO = asbytes(UPLO) a, wrap = _makearray(a) _assertRank2(a) _assertSquareness(a) @@ -1144,24 +1154,24 @@ work = zeros((lwork,), t) lrwork = 1 rwork = zeros((lrwork,), real_t) - results = lapack_routine('V', UPLO, n, a, n, w, work, -1, + results = lapack_routine(_V, UPLO, n, a, n, w, work, -1, rwork, -1, iwork, liwork, 0) lwork = int(abs(work[0])) work = zeros((lwork,), t) lrwork = int(rwork[0]) rwork = zeros((lrwork,), real_t) - results = lapack_routine('V', UPLO, n, a, n, w, work, lwork, + results = lapack_routine(_V, UPLO, n, a, n, w, work, lwork, rwork, lrwork, iwork, liwork, 0) else: lapack_routine = lapack_lite.dsyevd w = zeros((n,), t) lwork = 1 work = zeros((lwork,), t) - results = lapack_routine('V', UPLO, n, a, n, w, work, -1, + results = lapack_routine(_V, UPLO, n, a, n, w, work, -1, iwork, liwork, 0) lwork = int(work[0]) work = zeros((lwork,), t) - results = lapack_routine('V', UPLO, n, a, n, w, work, lwork, + results = lapack_routine(_V, UPLO, n, a, n, w, work, lwork, iwork, liwork, 0) if results['info'] > 0: raise LinAlgError, 'Eigenvalues did not converge' @@ -1249,15 +1259,15 @@ if full_matrices: nu = m nvt = n - option = 'A' + option = _A else: nu = min(n, m) nvt = min(n, m) - option = 'S' + option = _S u = zeros((nu, m), t) vt = zeros((n, nvt), t) else: - option = 'N' + option = _N nu = 1 nvt = 1 u = empty((1, 1), t) From numpy-svn at scipy.org Sat Feb 20 13:11:39 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:11:39 -0600 (CST) Subject: [Numpy-svn] r8159 - trunk/numpy/core/src/multiarray Message-ID: <20100220181139.1461CC7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:11:38 -0600 (Sat, 20 Feb 2010) New Revision: 8159 Modified: trunk/numpy/core/src/multiarray/ctors.c Log: 3K: core: allow unicode type strings in __array_interface__ since we allow those also in dtypes Modified: trunk/numpy/core/src/multiarray/ctors.c =================================================================== --- trunk/numpy/core/src/multiarray/ctors.c 2010-02-20 18:11:21 UTC (rev 8158) +++ trunk/numpy/core/src/multiarray/ctors.c 2010-02-20 18:11:38 UTC (rev 8159) @@ -2260,11 +2260,22 @@ } } attr = tstr; - if (!PyString_Check(attr)) { +#if defined(NPY_PY3K) + if (PyUnicode_Check(tstr)) { + /* Allow unicode type strings */ + attr = PyUnicode_AsASCIIString(tstr); + } +#endif + if (!PyBytes_Check(attr)) { PyErr_SetString(PyExc_TypeError, "typestr must be a string"); goto fail; } type = _array_typedescr_fromstr(PyString_AS_STRING(attr)); +#if defined(NPY_PY3K) + if (attr != tstr) { + Py_DECREF(attr); + } +#endif if (type == NULL) { goto fail; } From numpy-svn at scipy.org Sat Feb 20 13:11:55 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:11:55 -0600 (CST) Subject: [Numpy-svn] r8160 - trunk/numpy/core/src/multiarray Message-ID: <20100220181155.C2133C7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:11:55 -0600 (Sat, 20 Feb 2010) New Revision: 8160 Modified: trunk/numpy/core/src/multiarray/methods.c Log: ENH: core: allow unicode file names in PyArray_Dump Modified: trunk/numpy/core/src/multiarray/methods.c =================================================================== --- trunk/numpy/core/src/multiarray/methods.c 2010-02-20 18:11:38 UTC (rev 8159) +++ trunk/numpy/core/src/multiarray/methods.c 2010-02-20 18:11:55 UTC (rev 8160) @@ -1539,7 +1539,7 @@ if (cpick == NULL) { return -1; } - if (PyString_Check(file)) { + if (PyBytes_Check(file) || PyUnicode_Check(file)) { file = npy_PyFile_OpenFile(file, "wb"); if (file == NULL) { return -1; From numpy-svn at scipy.org Sat Feb 20 13:12:14 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:12:14 -0600 (CST) Subject: [Numpy-svn] r8161 - trunk/numpy/core/tests Message-ID: <20100220181214.39D77C7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:12:14 -0600 (Sat, 20 Feb 2010) New Revision: 8161 Modified: trunk/numpy/core/tests/test_regression.py Log: 3K: core: use BytesIO instead of StringIO in test_regressions on Py3 Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2010-02-20 18:11:55 UTC (rev 8160) +++ trunk/numpy/core/tests/test_regression.py 2010-02-20 18:12:14 UTC (rev 8161) @@ -9,6 +9,10 @@ from numpy.compat import asbytes, asunicode import numpy as np +if sys.version_info[0] >= 3: + import io + StringIO = io.BytesIO + rlevel = 1 class TestRegression(TestCase): From numpy-svn at scipy.org Sat Feb 20 13:12:29 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:12:29 -0600 (CST) Subject: [Numpy-svn] r8162 - trunk/numpy/lib Message-ID: <20100220181229.88D00C7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:12:29 -0600 (Sat, 20 Feb 2010) New Revision: 8162 Modified: trunk/numpy/lib/format.py trunk/numpy/lib/io.py Log: 3K: lib: bytes vs. str fixes in lib.format and lib.io Modified: trunk/numpy/lib/format.py =================================================================== --- trunk/numpy/lib/format.py 2010-02-20 18:12:14 UTC (rev 8161) +++ trunk/numpy/lib/format.py 2010-02-20 18:12:29 UTC (rev 8162) @@ -141,7 +141,7 @@ from numpy.lib.utils import safe_eval from numpy.compat import asbytes, isfileobj -MAGIC_PREFIX = '\x93NUMPY' +MAGIC_PREFIX = asbytes('\x93NUMPY') MAGIC_LEN = len(MAGIC_PREFIX) + 2 def magic(major, minor): @@ -164,7 +164,7 @@ raise ValueError("major version must be 0 <= major < 256") if minor < 0 or minor > 255: raise ValueError("minor version must be 0 <= minor < 256") - return '%s%s%s' % (MAGIC_PREFIX, chr(major), chr(minor)) + return asbytes('%s%s%s' % (MAGIC_PREFIX, chr(major), chr(minor))) def read_magic(fp): """ Read the magic string to get the version of the file format. @@ -271,12 +271,12 @@ # advantage of our premature optimization. current_header_len = MAGIC_LEN + 2 + len(header) + 1 # 1 for the newline topad = 16 - (current_header_len % 16) - header = '%s%s\n' % (header, ' '*topad) + header = asbytes('%s%s\n' % (header, ' '*topad)) if len(header) >= (256*256): raise ValueError("header does not fit inside %s bytes" % (256*256)) header_len_str = struct.pack(' Author: ptvirtan Date: 2010-02-20 12:12:46 -0600 (Sat, 20 Feb 2010) New Revision: 8163 Modified: trunk/numpy/core/src/multiarray/scalartypes.c.src Log: 3K: core: fix pickling of unicode scalars on Py3 -- they do not have buffer interface, so we need to get the buffer via the standard route Modified: trunk/numpy/core/src/multiarray/scalartypes.c.src =================================================================== --- trunk/numpy/core/src/multiarray/scalartypes.c.src 2010-02-20 18:12:29 UTC (rev 8162) +++ trunk/numpy/core/src/multiarray/scalartypes.c.src 2010-02-20 18:12:46 UTC (rev 8163) @@ -1328,6 +1328,14 @@ if (ret == NULL) { return NULL; } +#if defined(NPY_PY3K) + if (PyArray_IsScalar(self, Unicode)) { + /* Unicode on Python 3 does not expose the buffer interface */ + buffer = PyUnicode_AS_DATA(self); + buflen = PyUnicode_GET_DATA_SIZE(self); + } + else +#endif if (PyObject_AsReadBuffer(self, (const void **)&buffer, &buflen)<0) { Py_DECREF(ret); return NULL; From numpy-svn at scipy.org Sat Feb 20 13:13:09 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:13:09 -0600 (CST) Subject: [Numpy-svn] r8164 - trunk/numpy/core/tests Message-ID: <20100220181309.133C5C7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:13:08 -0600 (Sat, 20 Feb 2010) New Revision: 8164 Modified: trunk/numpy/core/tests/test_regression.py Log: ENH: core: Fix the test for #99 -- np.long == raw Python long. The test should test np.intp instead Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2010-02-20 18:12:46 UTC (rev 8163) +++ trunk/numpy/core/tests/test_regression.py 2010-02-20 18:13:08 UTC (rev 8164) @@ -139,11 +139,11 @@ def test_intp(self,level=rlevel): """Ticket #99""" i_width = np.int_(0).nbytes*2 - 1 - long('0x' + 'f'*i_width,16) - #self.failUnlessRaises(OverflowError,np.intp,'0x' + 'f'*(i_width+1),16) - #self.failUnlessRaises(ValueError,np.intp,'0x1',32) - assert_equal(255,np.long('0xFF',16)) - assert_equal(1024,np.long(1024)) + np.intp('0x' + 'f'*i_width,16) + self.failUnlessRaises(OverflowError,np.intp,'0x' + 'f'*(i_width+1),16) + self.failUnlessRaises(ValueError,np.intp,'0x1',32) + assert_equal(255,np.intp('0xFF',16)) + assert_equal(1024,np.intp(1024)) def test_endian_bool_indexing(self,level=rlevel): """Ticket #105""" From numpy-svn at scipy.org Sat Feb 20 13:13:24 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:13:24 -0600 (CST) Subject: [Numpy-svn] r8165 - trunk/doc Message-ID: <20100220181324.035E0C7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:13:23 -0600 (Sat, 20 Feb 2010) New Revision: 8165 Modified: trunk/doc/Py3K.txt Log: 3K: doc: note in Py3K porting log that intp('0xff', 16) does not work any more Modified: trunk/doc/Py3K.txt =================================================================== --- trunk/doc/Py3K.txt 2010-02-20 18:13:08 UTC (rev 8164) +++ trunk/doc/Py3K.txt 2010-02-20 18:13:23 UTC (rev 8165) @@ -682,7 +682,13 @@ Audit the automatic dtype decision -- did I plug all the cases? +.. todo:: + Not inheriting from `int` on Python 3 makes the following not work: + ``np.intp("0xff", 16)`` -- because the Numpy type does not take + the second argument. This could perhaps be fixed... + + Divide ------ From numpy-svn at scipy.org Sat Feb 20 13:13:41 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:13:41 -0600 (CST) Subject: [Numpy-svn] r8166 - trunk/numpy/core/src/multiarray Message-ID: <20100220181341.7012DC7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:13:40 -0600 (Sat, 20 Feb 2010) New Revision: 8166 Modified: trunk/numpy/core/src/multiarray/scalartypes.c.src Log: 3K: ENH: core: alias __round__ -> round for the generic scalar type, for the round() builtin Modified: trunk/numpy/core/src/multiarray/scalartypes.c.src =================================================================== --- trunk/numpy/core/src/multiarray/scalartypes.c.src 2010-02-20 18:13:23 UTC (rev 8165) +++ trunk/numpy/core/src/multiarray/scalartypes.c.src 2010-02-20 18:13:40 UTC (rev 8166) @@ -1625,6 +1625,12 @@ {"round", (PyCFunction)gentype_round, METH_VARARGS | METH_KEYWORDS, NULL}, +#if defined(NPY_PY3K) + /* Hook for the round() builtin */ + {"__round__", + (PyCFunction)gentype_round, + METH_VARARGS | METH_KEYWORDS, NULL}, +#endif {"setflags", (PyCFunction)gentype_setflags, METH_VARARGS | METH_KEYWORDS, NULL}, From numpy-svn at scipy.org Sat Feb 20 13:13:57 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:13:57 -0600 (CST) Subject: [Numpy-svn] r8167 - trunk/numpy/f2py Message-ID: <20100220181357.80EB8C7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:13:57 -0600 (Sat, 20 Feb 2010) New Revision: 8167 Modified: trunk/numpy/f2py/cb_rules.py trunk/numpy/f2py/f90mod_rules.py Log: 3K: f2py: break cyclic imports (which are not allowed on Py3) by moving them to functions Modified: trunk/numpy/f2py/cb_rules.py =================================================================== --- trunk/numpy/f2py/cb_rules.py 2010-02-20 18:13:40 UTC (rev 8166) +++ trunk/numpy/f2py/cb_rules.py 2010-02-20 18:13:57 UTC (rev 8167) @@ -27,7 +27,6 @@ show=pprint.pprint from auxfuncs import * -import capi_maps import cfuncs ################## Rules for callback function ############## @@ -415,6 +414,8 @@ def buildcallback(rout,um): global cb_map + import capi_maps + outmess('\tConstructing call-back function "cb_%s_in_%s"\n'%(rout['name'],um)) args,depargs=getargs(rout) capi_maps.depargs=depargs Modified: trunk/numpy/f2py/f90mod_rules.py =================================================================== --- trunk/numpy/f2py/f90mod_rules.py 2010-02-20 18:13:40 UTC (rev 8166) +++ trunk/numpy/f2py/f90mod_rules.py 2010-02-20 18:13:57 UTC (rev 8167) @@ -26,7 +26,6 @@ from auxfuncs import * import numpy as np import capi_maps -import rules import func2subr from crackfortran import undo_rmbadname, undo_rmbadname1 @@ -83,6 +82,7 @@ def buildhooks(pymod): global fgetdims1,fgetdims2 + import rules ret = {'f90modhooks':[],'initf90modhooks':[],'body':[], 'need':['F_FUNC','arrayobject.h'], 'separatorsfor':{'includes0':'\n','includes':'\n'}, From numpy-svn at scipy.org Sat Feb 20 13:14:11 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:14:11 -0600 (CST) Subject: [Numpy-svn] r8168 - trunk/numpy/f2py Message-ID: <20100220181411.AF7DAC7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:14:11 -0600 (Sat, 20 Feb 2010) New Revision: 8168 Modified: trunk/numpy/f2py/auxfuncs.py Log: 3K: f2py: use integer division to avoid problems with string multiplication Modified: trunk/numpy/f2py/auxfuncs.py =================================================================== --- trunk/numpy/f2py/auxfuncs.py 2010-02-20 18:13:57 UTC (rev 8167) +++ trunk/numpy/f2py/auxfuncs.py 2010-02-20 18:14:11 UTC (rev 8168) @@ -575,7 +575,7 @@ return rout['f2pymultilines'].get(k,None) def gentitle(name): - l=(80-len(name)-6)/2 + l=(80-len(name)-6)//2 return '/*%s %s %s*/'%(l*'*',name,l*'*') def flatlist(l): From numpy-svn at scipy.org Sat Feb 20 13:14:31 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:14:31 -0600 (CST) Subject: [Numpy-svn] r8169 - trunk/numpy/fft Message-ID: <20100220181431.13A82C7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:14:30 -0600 (Sat, 20 Feb 2010) New Revision: 8169 Modified: trunk/numpy/fft/helper.py Log: 3K: fft: fix integer division in (i)fftshift Modified: trunk/numpy/fft/helper.py =================================================================== --- trunk/numpy/fft/helper.py 2010-02-20 18:14:11 UTC (rev 8168) +++ trunk/numpy/fft/helper.py 2010-02-20 18:14:30 UTC (rev 8169) @@ -60,7 +60,7 @@ y = tmp for k in axes: n = tmp.shape[k] - p2 = (n+1)/2 + p2 = (n+1)//2 mylist = concatenate((arange(p2,n),arange(p2))) y = take(y,mylist,k) return y @@ -106,7 +106,7 @@ y = tmp for k in axes: n = tmp.shape[k] - p2 = n-(n+1)/2 + p2 = n-(n+1)//2 mylist = concatenate((arange(p2,n),arange(p2))) y = take(y,mylist,k) return y From numpy-svn at scipy.org Sat Feb 20 13:14:51 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:14:51 -0600 (CST) Subject: [Numpy-svn] r8170 - in trunk/numpy/lib: . tests Message-ID: <20100220181451.D4F96C7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:14:51 -0600 (Sat, 20 Feb 2010) New Revision: 8170 Modified: trunk/numpy/lib/_datasource.py trunk/numpy/lib/tests/test__datasource.py Log: 3K: lib: Make _datasource and its tests Py3 compatible + slight cleanup of the code Modified: trunk/numpy/lib/_datasource.py =================================================================== --- trunk/numpy/lib/_datasource.py 2010-02-20 18:14:30 UTC (rev 8169) +++ trunk/numpy/lib/_datasource.py 2010-02-20 18:14:51 UTC (rev 8170) @@ -35,8 +35,10 @@ __docformat__ = "restructuredtext en" import os -from shutil import rmtree +from shutil import rmtree, copyfile, copyfileobj +_open = open + # Using a class instead of a module-level dictionary # to reduce the inital 'import numpy' overhead by # deferring the import of bz2 and gzip until needed @@ -281,16 +283,15 @@ if self._isurl(path): try: openedurl = urlopen(path) - file(upath, 'w').write(openedurl.read()) + f = _open(upath, 'wb') + try: + copyfileobj(openedurl, f) + finally: + f.close() except URLError: raise URLError("URL not found: %s" % path) else: - try: - # TODO: Why not just copy the file with shutils.copyfile? - fp = file(path, 'r') - file(upath, 'w').write(fp.read()) - except IOError: - raise IOError("File not found: %s" % path) + shutil.copyfile(path, upath) return upath def _findfile(self, path): Modified: trunk/numpy/lib/tests/test__datasource.py =================================================================== --- trunk/numpy/lib/tests/test__datasource.py 2010-02-20 18:14:30 UTC (rev 8169) +++ trunk/numpy/lib/tests/test__datasource.py 2010-02-20 18:14:51 UTC (rev 8170) @@ -7,6 +7,8 @@ from numpy.testing import * +from numpy.compat import asbytes + import numpy.lib._datasource as datasource def urlopen_stub(url, data=None): @@ -36,7 +38,7 @@ malicious_files = ['/etc/shadow', '../../shadow', '..\\system.dat', 'c:\\windows\\system.dat'] -magic_line = 'three is the magic number' +magic_line = asbytes('three is the magic number') # Utility functions used by many TestCases From numpy-svn at scipy.org Sat Feb 20 13:15:06 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:15:06 -0600 (CST) Subject: [Numpy-svn] r8171 - trunk/numpy/lib Message-ID: <20100220181506.41B83C7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:15:06 -0600 (Sat, 20 Feb 2010) New Revision: 8171 Modified: trunk/numpy/lib/_iotools.py Log: 3K: lib: do not slice range() in _iotools needlessly Modified: trunk/numpy/lib/_iotools.py =================================================================== --- trunk/numpy/lib/_iotools.py 2010-02-20 18:14:51 UTC (rev 8170) +++ trunk/numpy/lib/_iotools.py 2010-02-20 18:15:06 UTC (rev 8171) @@ -190,7 +190,7 @@ if not line: return [] fixed = self.delimiter - slices = [slice(i, i + fixed) for i in range(len(line))[::fixed]] + slices = [slice(i, i + fixed) for i in range(0, len(line), fixed)] return [line[s] for s in slices] # def _variablewidth_splitter(self, line): From numpy-svn at scipy.org Sat Feb 20 13:15:20 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:15:20 -0600 (CST) Subject: [Numpy-svn] r8172 - trunk/numpy/compat Message-ID: <20100220181520.56270C7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:15:20 -0600 (Sat, 20 Feb 2010) New Revision: 8172 Modified: trunk/numpy/compat/py3k.py Log: 3K: compat: make isfileobj recognize only real file objects with FILE* pointers as file objects Modified: trunk/numpy/compat/py3k.py =================================================================== --- trunk/numpy/compat/py3k.py 2010-02-20 18:15:06 UTC (rev 8171) +++ trunk/numpy/compat/py3k.py 2010-02-20 18:15:20 UTC (rev 8172) @@ -18,7 +18,7 @@ return s return s.encode('iso-8859-1') def isfileobj(f): - return isinstance(f, io.IOBase) + return isinstance(f, io.FileIO) strchar = 'U' else: bytes = str From numpy-svn at scipy.org Sat Feb 20 13:15:34 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:15:34 -0600 (CST) Subject: [Numpy-svn] r8173 - trunk/numpy/lib Message-ID: <20100220181534.C8023C7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:15:34 -0600 (Sat, 20 Feb 2010) New Revision: 8173 Modified: trunk/numpy/lib/utils.py Log: 3K: lib: adapt safe_eval for Py3 ast module Modified: trunk/numpy/lib/utils.py =================================================================== --- trunk/numpy/lib/utils.py 2010-02-20 18:15:20 UTC (rev 8172) +++ trunk/numpy/lib/utils.py 2010-02-20 18:15:34 UTC (rev 8173) @@ -991,46 +991,99 @@ """ - def visit(self, node, **kw): - cls = node.__class__ - meth = getattr(self,'visit'+cls.__name__,self.default) - return meth(node, **kw) + if sys.version_info[0] < 3: + def visit(self, node, **kw): + cls = node.__class__ + meth = getattr(self,'visit'+cls.__name__,self.default) + return meth(node, **kw) - def default(self, node, **kw): - raise SyntaxError("Unsupported source construct: %s" % node.__class__) + def default(self, node, **kw): + raise SyntaxError("Unsupported source construct: %s" + % node.__class__) - def visitExpression(self, node, **kw): - for child in node.getChildNodes(): - return self.visit(child, **kw) + def visitExpression(self, node, **kw): + for child in node.getChildNodes(): + return self.visit(child, **kw) - def visitConst(self, node, **kw): - return node.value + def visitConst(self, node, **kw): + return node.value - def visitDict(self, node,**kw): - return dict([(self.visit(k),self.visit(v)) for k,v in node.items]) + def visitDict(self, node,**kw): + return dict([(self.visit(k),self.visit(v)) for k,v in node.items]) - def visitTuple(self, node, **kw): - return tuple([self.visit(i) for i in node.nodes]) + def visitTuple(self, node, **kw): + return tuple([self.visit(i) for i in node.nodes]) - def visitList(self, node, **kw): - return [self.visit(i) for i in node.nodes] + def visitList(self, node, **kw): + return [self.visit(i) for i in node.nodes] - def visitUnaryAdd(self, node, **kw): - return +self.visit(node.getChildNodes()[0]) + def visitUnaryAdd(self, node, **kw): + return +self.visit(node.getChildNodes()[0]) - def visitUnarySub(self, node, **kw): - return -self.visit(node.getChildNodes()[0]) + def visitUnarySub(self, node, **kw): + return -self.visit(node.getChildNodes()[0]) - def visitName(self, node, **kw): - if node.name == 'False': - return False - elif node.name == 'True': - return True - elif node.name == 'None': - return None - else: - raise SyntaxError("Unknown name: %s" % node.name) + def visitName(self, node, **kw): + if node.name == 'False': + return False + elif node.name == 'True': + return True + elif node.name == 'None': + return None + else: + raise SyntaxError("Unknown name: %s" % node.name) + else: + def visit(self, node): + cls = node.__class__ + meth = getattr(self, 'visit' + cls.__name__, self.default) + return meth(node) + + def default(self, node): + raise SyntaxError("Unsupported source construct: %s" + % node.__class__) + + def visitExpression(self, node): + return self.visit(node.body) + + def visitNum(self, node): + return node.n + + def visitStr(self, node): + return node.s + + def visitBytes(self, node): + return node.s + + def visitDict(self, node,**kw): + return dict([(self.visit(k), self.visit(v)) + for k, v in zip(node.keys, node.values)]) + + def visitTuple(self, node): + return tuple([self.visit(i) for i in node.elts]) + + def visitList(self, node): + return [self.visit(i) for i in node.elts] + + def visitUnaryOp(self, node): + import ast + if isinstance(node.op, ast.UAdd): + return +self.visit(node.operand) + elif isinstance(node.op, ast.USub): + return -self.visit(node.operand) + else: + raise SyntaxError("Unknown unary op: %r" % node.op) + + def visitName(self, node): + if node.id == 'False': + return False + elif node.id == 'True': + return True + elif node.id == 'None': + return None + else: + raise SyntaxError("Unknown name: %s" % node.id) + def safe_eval(source): """ Protected string evaluation. @@ -1075,10 +1128,13 @@ """ # Local import to speed up numpy's import time. - import compiler + try: + import compiler + except ImportError: + import ast as compiler walker = SafeEval() try: - ast = compiler.parse(source, "eval") + ast = compiler.parse(source, mode="eval") except SyntaxError, err: raise try: From numpy-svn at scipy.org Sat Feb 20 13:15:51 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:15:51 -0600 (CST) Subject: [Numpy-svn] r8174 - trunk/numpy/core/src/private Message-ID: <20100220181551.91F7DC7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:15:51 -0600 (Sat, 20 Feb 2010) New Revision: 8174 Modified: trunk/numpy/core/src/private/npy_3kcompat.h Log: 3K: core: in tofile etc., ensure the file is flushed before switching to FILE* I/O Modified: trunk/numpy/core/src/private/npy_3kcompat.h =================================================================== --- trunk/numpy/core/src/private/npy_3kcompat.h 2010-02-20 18:15:34 UTC (rev 8173) +++ trunk/numpy/core/src/private/npy_3kcompat.h 2010-02-20 18:15:51 UTC (rev 8174) @@ -138,6 +138,11 @@ { int fd, fd2; PyObject *ret, *os; + /* Flush first to ensure things end up in the file in the correct order */ + ret = PyObject_CallMethod(file, "flush", ""); + if (ret == NULL) { + return NULL; + } fd = PyObject_AsFileDescriptor(file); if (fd == -1) { return NULL; From numpy-svn at scipy.org Sat Feb 20 13:16:06 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:16:06 -0600 (CST) Subject: [Numpy-svn] r8175 - trunk/numpy/lib Message-ID: <20100220181606.0C221C7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:16:05 -0600 (Sat, 20 Feb 2010) New Revision: 8175 Modified: trunk/numpy/lib/format.py Log: ENH: lib: write fortran-contiguous data to files using arr.T.tofile instead of arr.data (required for Py3 compatibility) The issue is that when passing a buffer object to Python's io.BufferedWriter.write, it will try to obtain the buffer using PyBUF_ND | PyBUF_C_CONTIGUOUS. This will fail for strided arrays -- seems to be an issue in Python, as it probably should try to obtain a SIMPLE buffer. Modified: trunk/numpy/lib/format.py =================================================================== --- trunk/numpy/lib/format.py 2010-02-20 18:15:51 UTC (rev 8174) +++ trunk/numpy/lib/format.py 2010-02-20 18:16:05 UTC (rev 8175) @@ -393,9 +393,10 @@ # Instead, we will pickle it out with version 2 of the pickle protocol. cPickle.dump(array, fp, protocol=2) elif array.flags.f_contiguous and not array.flags.c_contiguous: - # Use a suboptimal, possibly memory-intensive, but correct way to - # handle Fortran-contiguous arrays. - fp.write(array.data) + if isfileobj(fp): + array.T.tofile(fp) + else: + fp.write(array.T.tostring('C')) else: if isfileobj(fp): array.tofile(fp) @@ -447,7 +448,7 @@ # This is not a real file. We have to read it the memory-intensive # way. # XXX: we can probably chunk this to avoid the memory hit. - data = fp.read(count * dtype.itemsize) + data = fp.read(int(count * dtype.itemsize)) array = numpy.fromstring(data, dtype=dtype, count=count) if fortran_order: From numpy-svn at scipy.org Sat Feb 20 13:16:22 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:16:22 -0600 (CST) Subject: [Numpy-svn] r8176 - in trunk/numpy/lib: . tests Message-ID: <20100220181622.4D816C7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:16:22 -0600 (Sat, 20 Feb 2010) New Revision: 8176 Modified: trunk/numpy/lib/format.py trunk/numpy/lib/tests/test_format.py Log: 3K: lib: fix some bytes/str issues in _format.py and its tests Modified: trunk/numpy/lib/format.py =================================================================== --- trunk/numpy/lib/format.py 2010-02-20 18:16:05 UTC (rev 8175) +++ trunk/numpy/lib/format.py 2010-02-20 18:16:22 UTC (rev 8176) @@ -138,6 +138,7 @@ import cPickle import numpy +import sys from numpy.lib.utils import safe_eval from numpy.compat import asbytes, isfileobj @@ -164,7 +165,10 @@ raise ValueError("major version must be 0 <= major < 256") if minor < 0 or minor > 255: raise ValueError("minor version must be 0 <= minor < 256") - return asbytes('%s%s%s' % (MAGIC_PREFIX, chr(major), chr(minor))) + if sys.version_info[0] < 3: + return MAGIC_PREFIX + chr(major) + chr(minor) + else: + return MAGIC_PREFIX + bytes([major, minor]) def read_magic(fp): """ Read the magic string to get the version of the file format. @@ -185,7 +189,10 @@ if magic_str[:-2] != MAGIC_PREFIX: msg = "the magic string is not correct; expected %r, got %r" raise ValueError(msg % (MAGIC_PREFIX, magic_str[:-2])) - major, minor = map(ord, magic_str[-2:]) + if sys.version_info[0] < 3: + major, minor = map(ord, magic_str[-2:]) + else: + major, minor = magic_str[-2:] return major, minor def dtype_to_descr(dtype): @@ -271,7 +278,7 @@ # advantage of our premature optimization. current_header_len = MAGIC_LEN + 2 + len(header) + 1 # 1 for the newline topad = 16 - (current_header_len % 16) - header = asbytes('%s%s\n' % (header, ' '*topad)) + header = asbytes(header + ' '*topad + '\n') if len(header) >= (256*256): raise ValueError("header does not fit inside %s bytes" % (256*256)) header_len_str = struct.pack('>> from cStringIO import StringIO + >>> import sys + >>> if sys.version_info[0] >= 3: + ... from io import BytesIO as StringIO + ... else: + ... from cStringIO import StringIO >>> from numpy.lib import format >>> >>> scalars = [ @@ -275,11 +279,15 @@ import sys -from cStringIO import StringIO import os import shutil import tempfile +if sys.version_info[0] >= 3: + from io import BytesIO as StringIO +else: + from cStringIO import StringIO + import numpy as np from numpy.testing import * From numpy-svn at scipy.org Sat Feb 20 13:16:25 2010 From: numpy-svn at scipy.org (Authorized Pillstore) Date: Sat, 20 Feb 2010 12:16:25 -0600 (CST) Subject: [Numpy-svn] Hello, numpy-svn, check our 80% Sale Message-ID: <20100220181625.F0110C7C054@scipy.org> An HTML attachment was scrubbed... URL: From numpy-svn at scipy.org Sat Feb 20 13:16:37 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:16:37 -0600 (CST) Subject: [Numpy-svn] r8177 - trunk/numpy/lib/tests Message-ID: <20100220181637.B6B2BC7C083@scipy.org> Author: ptvirtan Date: 2010-02-20 12:16:37 -0600 (Sat, 20 Feb 2010) New Revision: 8177 Modified: trunk/numpy/lib/tests/test_io.py Log: 3K: lib: use BytesIO in test_io Modified: trunk/numpy/lib/tests/test_io.py =================================================================== --- trunk/numpy/lib/tests/test_io.py 2010-02-20 18:16:22 UTC (rev 8176) +++ trunk/numpy/lib/tests/test_io.py 2010-02-20 18:16:37 UTC (rev 8177) @@ -3,13 +3,19 @@ from numpy.ma.testutils import * from numpy.testing import assert_warns -import StringIO +import sys + +if sys.version_info[0] >= 3: + from io import BytesIO as StringIO +else: + from StringIO import StringIO + import gzip import os import threading from tempfile import mkstemp, NamedTemporaryFile -import sys, time +import time from datetime import datetime from numpy.lib._iotools import ConverterError, ConverterLockError, \ @@ -56,7 +62,7 @@ target_file = NamedTemporaryFile() load_file = target_file.name else: - target_file = StringIO.StringIO() + target_file = StringIO() load_file = target_file arr = args @@ -65,7 +71,7 @@ target_file.flush() target_file.seek(0) - if sys.platform == 'win32' and not isinstance(target_file, StringIO.StringIO): + if sys.platform == 'win32' and not isinstance(target_file, StringIO): target_file.close() arr_reloaded = np.load(load_file, **load_kwds) @@ -118,7 +124,7 @@ def test_named_arrays(self): a = np.array([[1, 2], [3, 4]], float) b = np.array([[1 + 2j, 2 + 7j], [3 - 6j, 4 + 12j]], complex) - c = StringIO.StringIO() + c = StringIO() np.savez(c, file_a=a, file_b=b) c.seek(0) l = np.load(c) @@ -156,7 +162,7 @@ def test_array(self): a = np.array([[1, 2], [3, 4]], float) fmt = "%.18e" - c = StringIO.StringIO() + c = StringIO() np.savetxt(c, a, fmt=fmt) c.seek(0) assert_equal(c.readlines(), @@ -164,14 +170,14 @@ (fmt + ' ' + fmt + '\n') % (3, 4)]) a = np.array([[1, 2], [3, 4]], int) - c = StringIO.StringIO() + c = StringIO() np.savetxt(c, a, fmt='%d') c.seek(0) assert_equal(c.readlines(), ['1 2\n', '3 4\n']) def test_1D(self): a = np.array([1, 2, 3, 4], int) - c = StringIO.StringIO() + c = StringIO() np.savetxt(c, a, fmt='%d') c.seek(0) lines = c.readlines() @@ -179,35 +185,35 @@ def test_record(self): a = np.array([(1, 2), (3, 4)], dtype=[('x', 'i4'), ('y', 'i4')]) - c = StringIO.StringIO() + c = StringIO() np.savetxt(c, a, fmt='%d') c.seek(0) assert_equal(c.readlines(), ['1 2\n', '3 4\n']) def test_delimiter(self): a = np.array([[1., 2.], [3., 4.]]) - c = StringIO.StringIO() + c = StringIO() np.savetxt(c, a, delimiter=',', fmt='%d') c.seek(0) assert_equal(c.readlines(), ['1,2\n', '3,4\n']) def test_format(self): a = np.array([(1, 2), (3, 4)]) - c = StringIO.StringIO() + c = StringIO() # Sequence of formats np.savetxt(c, a, fmt=['%02d', '%3.1f']) c.seek(0) assert_equal(c.readlines(), ['01 2.0\n', '03 4.0\n']) # A single multiformat string - c = StringIO.StringIO() + c = StringIO() np.savetxt(c, a, fmt='%02d : %3.1f') c.seek(0) lines = c.readlines() assert_equal(lines, ['01 : 2.0\n', '03 : 4.0\n']) # Specify delimiter, should be overiden - c = StringIO.StringIO() + c = StringIO() np.savetxt(c, a, fmt='%02d : %3.1f', delimiter=',') c.seek(0) lines = c.readlines() @@ -216,14 +222,14 @@ class TestLoadTxt(TestCase): def test_record(self): - c = StringIO.StringIO() + c = StringIO() c.write('1 2\n3 4') c.seek(0) x = np.loadtxt(c, dtype=[('x', np.int32), ('y', np.int32)]) a = np.array([(1, 2), (3, 4)], dtype=[('x', 'i4'), ('y', 'i4')]) assert_array_equal(x, a) - d = StringIO.StringIO() + d = StringIO() d.write('M 64.0 75.0\nF 25.0 60.0') d.seek(0) mydescriptor = {'names': ('gender', 'age', 'weight'), @@ -235,7 +241,7 @@ assert_array_equal(y, b) def test_array(self): - c = StringIO.StringIO() + c = StringIO() c.write('1 2\n3 4') c.seek(0) @@ -249,14 +255,14 @@ assert_array_equal(x, a) def test_1D(self): - c = StringIO.StringIO() + c = StringIO() c.write('1\n2\n3\n4\n') c.seek(0) x = np.loadtxt(c, dtype=int) a = np.array([1, 2, 3, 4], int) assert_array_equal(x, a) - c = StringIO.StringIO() + c = StringIO() c.write('1,2,3,4\n') c.seek(0) x = np.loadtxt(c, dtype=int, delimiter=',') @@ -264,7 +270,7 @@ assert_array_equal(x, a) def test_missing(self): - c = StringIO.StringIO() + c = StringIO() c.write('1,2,3,,5\n') c.seek(0) x = np.loadtxt(c, dtype=int, delimiter=',', \ @@ -273,7 +279,7 @@ assert_array_equal(x, a) def test_converters_with_usecols(self): - c = StringIO.StringIO() + c = StringIO() c.write('1,2,3,,5\n6,7,8,9,10\n') c.seek(0) x = np.loadtxt(c, dtype=int, delimiter=',', \ @@ -283,7 +289,7 @@ assert_array_equal(x, a) def test_comments(self): - c = StringIO.StringIO() + c = StringIO() c.write('# comment\n1,2,3,5\n') c.seek(0) x = np.loadtxt(c, dtype=int, delimiter=',', \ @@ -292,7 +298,7 @@ assert_array_equal(x, a) def test_skiprows(self): - c = StringIO.StringIO() + c = StringIO() c.write('comment\n1,2,3,5\n') c.seek(0) x = np.loadtxt(c, dtype=int, delimiter=',', \ @@ -300,7 +306,7 @@ a = np.array([1, 2, 3, 5], int) assert_array_equal(x, a) - c = StringIO.StringIO() + c = StringIO() c.write('# comment\n1,2,3,5\n') c.seek(0) x = np.loadtxt(c, dtype=int, delimiter=',', \ @@ -310,14 +316,14 @@ def test_usecols(self): a = np.array([[1, 2], [3, 4]], float) - c = StringIO.StringIO() + c = StringIO() np.savetxt(c, a) c.seek(0) x = np.loadtxt(c, dtype=float, usecols=(1,)) assert_array_equal(x, a[:, 1]) a = np.array([[1, 2, 3], [3, 4, 5]], float) - c = StringIO.StringIO() + c = StringIO() np.savetxt(c, a) c.seek(0) x = np.loadtxt(c, dtype=float, usecols=(1, 2)) @@ -332,7 +338,7 @@ data = '''JOE 70.1 25.3 BOB 60.5 27.9 ''' - c = StringIO.StringIO(data) + c = StringIO(data) names = ['stid', 'temp'] dtypes = ['S4', 'f8'] arr = np.loadtxt(c, usecols=(0, 2), dtype=zip(names, dtypes)) @@ -340,7 +346,7 @@ assert_equal(arr['temp'], [25.3, 27.9]) def test_fancy_dtype(self): - c = StringIO.StringIO() + c = StringIO() c.write('1,2,3.0\n4,5,6.0\n') c.seek(0) dt = np.dtype([('x', int), ('y', [('t', int), ('s', float)])]) @@ -349,7 +355,7 @@ assert_array_equal(x, a) def test_shaped_dtype(self): - c = StringIO.StringIO("aaaa 1.0 8.0 1 2 3 4 5 6") + c = StringIO("aaaa 1.0 8.0 1 2 3 4 5 6") dt = np.dtype([('name', 'S4'), ('x', float), ('y', float), ('block', int, (2, 3))]) x = np.loadtxt(c, dtype=dt) @@ -358,11 +364,11 @@ assert_array_equal(x, a) def test_empty_file(self): - c = StringIO.StringIO() + c = StringIO() assert_raises(IOError, np.loadtxt, c) def test_unused_converter(self): - c = StringIO.StringIO() + c = StringIO() c.writelines(['1 21\n', '3 42\n']) c.seek(0) data = np.loadtxt(c, usecols=(1,), @@ -385,7 +391,7 @@ ndtype = [('idx', int), ('code', np.object)] func = lambda s: strptime(s.strip(), "%Y-%m-%d") converters = {1: func} - test = np.loadtxt(StringIO.StringIO(data), delimiter=";", dtype=ndtype, + test = np.loadtxt(StringIO(data), delimiter=";", dtype=ndtype, converters=converters) control = np.array([(1, datetime(2001, 1, 1)), (2, datetime(2002, 1, 31))], dtype=ndtype) @@ -395,7 +401,7 @@ class Testfromregex(TestCase): def test_record(self): - c = StringIO.StringIO() + c = StringIO() c.write('1.312 foo\n1.534 bar\n4.444 qux') c.seek(0) @@ -406,7 +412,7 @@ assert_array_equal(x, a) def test_record_2(self): - c = StringIO.StringIO() + c = StringIO() c.write('1312 foo\n1534 bar\n4444 qux') c.seek(0) @@ -417,7 +423,7 @@ assert_array_equal(x, a) def test_record_3(self): - c = StringIO.StringIO() + c = StringIO() c.write('1312 foo\n1534 bar\n4444 qux') c.seek(0) @@ -434,13 +440,13 @@ # def test_record(self): "Test w/ explicit dtype" - data = StringIO.StringIO('1 2\n3 4') + data = StringIO('1 2\n3 4') # data.seek(0) test = np.ndfromtxt(data, dtype=[('x', np.int32), ('y', np.int32)]) control = np.array([(1, 2), (3, 4)], dtype=[('x', 'i4'), ('y', 'i4')]) assert_equal(test, control) # - data = StringIO.StringIO('M 64.0 75.0\nF 25.0 60.0') + data = StringIO('M 64.0 75.0\nF 25.0 60.0') # data.seek(0) descriptor = {'names': ('gender', 'age', 'weight'), 'formats': ('S1', 'i4', 'f4')} @@ -451,7 +457,7 @@ def test_array(self): "Test outputing a standard ndarray" - data = StringIO.StringIO('1 2\n3 4') + data = StringIO('1 2\n3 4') control = np.array([[1, 2], [3, 4]], dtype=int) test = np.ndfromtxt(data, dtype=int) assert_array_equal(test, control) @@ -465,11 +471,11 @@ "Test squeezing to 1D" control = np.array([1, 2, 3, 4], int) # - data = StringIO.StringIO('1\n2\n3\n4\n') + data = StringIO('1\n2\n3\n4\n') test = np.ndfromtxt(data, dtype=int) assert_array_equal(test, control) # - data = StringIO.StringIO('1,2,3,4\n') + data = StringIO('1,2,3,4\n') test = np.ndfromtxt(data, dtype=int, delimiter=',') assert_array_equal(test, control) @@ -477,11 +483,11 @@ "Test the stripping of comments" control = np.array([1, 2, 3, 5], int) # Comment on its own line - data = StringIO.StringIO('# comment\n1,2,3,5\n') + data = StringIO('# comment\n1,2,3,5\n') test = np.ndfromtxt(data, dtype=int, delimiter=',', comments='#') assert_equal(test, control) # Comment at the end of a line - data = StringIO.StringIO('1,2,3,5# comment\n') + data = StringIO('1,2,3,5# comment\n') test = np.ndfromtxt(data, dtype=int, delimiter=',', comments='#') assert_equal(test, control) @@ -490,11 +496,11 @@ control = np.array([1, 2, 3, 5], int) kwargs = dict(dtype=int, delimiter=',') # - data = StringIO.StringIO('comment\n1,2,3,5\n') + data = StringIO('comment\n1,2,3,5\n') test = np.ndfromtxt(data, skip_header=1, **kwargs) assert_equal(test, control) # - data = StringIO.StringIO('# comment\n1,2,3,5\n') + data = StringIO('# comment\n1,2,3,5\n') test = np.loadtxt(data, skiprows=1, **kwargs) assert_equal(test, control) @@ -504,14 +510,14 @@ data.extend(["%i,%3.1f,%03s" % (i, i, i) for i in range(51)]) data[-1] = "99,99" kwargs = dict(delimiter=",", names=True, skip_header=5, skip_footer=10) - test = np.genfromtxt(StringIO.StringIO("\n".join(data)), **kwargs) + test = np.genfromtxt(StringIO("\n".join(data)), **kwargs) ctrl = np.array([("%f" % i, "%f" % i, "%f" % i) for i in range(40)], dtype=[(_, float) for _ in "ABC"]) assert_equal(test, ctrl) def test_header(self): "Test retrieving a header" - data = StringIO.StringIO('gender age weight\nM 64.0 75.0\nF 25.0 60.0') + data = StringIO('gender age weight\nM 64.0 75.0\nF 25.0 60.0') test = np.ndfromtxt(data, dtype=None, names=True) control = {'gender': np.array(['M', 'F']), 'age': np.array([64.0, 25.0]), @@ -522,7 +528,7 @@ def test_auto_dtype(self): "Test the automatic definition of the output dtype" - data = StringIO.StringIO('A 64 75.0 3+4j True\nBCD 25 60.0 5+6j False') + data = StringIO('A 64 75.0 3+4j True\nBCD 25 60.0 5+6j False') test = np.ndfromtxt(data, dtype=None) control = [np.array(['A', 'BCD']), np.array([64, 25]), @@ -536,7 +542,7 @@ def test_auto_dtype_uniform(self): "Tests whether the output dtype can be uniformized" - data = StringIO.StringIO('1 2 3 4\n5 6 7 8\n') + data = StringIO('1 2 3 4\n5 6 7 8\n') test = np.ndfromtxt(data, dtype=None) control = np.array([[1, 2, 3, 4], [5, 6, 7, 8]]) assert_equal(test, control) @@ -544,7 +550,7 @@ def test_fancy_dtype(self): "Check that a nested dtype isn't MIA" - data = StringIO.StringIO('1,2,3.0\n4,5,6.0\n') + data = StringIO('1,2,3.0\n4,5,6.0\n') fancydtype = np.dtype([('x', int), ('y', [('t', int), ('s', float)])]) test = np.ndfromtxt(data, dtype=fancydtype, delimiter=',') control = np.array([(1, (2, 3.0)), (4, (5, 6.0))], dtype=fancydtype) @@ -555,7 +561,7 @@ "Test overwriting the names of the dtype" descriptor = {'names': ('g', 'a', 'w'), 'formats': ('S1', 'i4', 'f4')} - data = StringIO.StringIO('M 64.0 75.0\nF 25.0 60.0') + data = StringIO('M 64.0 75.0\nF 25.0 60.0') names = ('gender', 'age', 'weight') test = np.ndfromtxt(data, dtype=descriptor, names=names) descriptor['names'] = names @@ -566,7 +572,7 @@ def test_commented_header(self): "Check that names can be retrieved even if the line is commented out." - data = StringIO.StringIO(""" + data = StringIO(""" #gender age weight M 21 72.100000 F 35 58.330000 @@ -578,7 +584,7 @@ dtype=[('gender', '|S1'), ('age', int), ('weight', float)]) assert_equal(test, ctrl) # Ditto, but we should get rid of the first element - data = StringIO.StringIO(""" + data = StringIO(""" # gender age weight M 21 72.100000 F 35 58.330000 @@ -590,7 +596,7 @@ def test_autonames_and_usecols(self): "Tests names and usecols" - data = StringIO.StringIO('A B C D\n aaaa 121 45 9.1') + data = StringIO('A B C D\n aaaa 121 45 9.1') test = np.ndfromtxt(data, usecols=('A', 'C', 'D'), names=True, dtype=None) control = np.array(('aaaa', 45, 9.1), @@ -600,7 +606,7 @@ def test_converters_with_usecols(self): "Test the combination user-defined converters and usecol" - data = StringIO.StringIO('1,2,3,,5\n6,7,8,9,10\n') + data = StringIO('1,2,3,,5\n6,7,8,9,10\n') test = np.ndfromtxt(data, dtype=int, delimiter=',', converters={3:lambda s: int(s or - 999)}, usecols=(1, 3,)) @@ -609,7 +615,7 @@ def test_converters_with_usecols_and_names(self): "Tests names and usecols" - data = StringIO.StringIO('A B C D\n aaaa 121 45 9.1') + data = StringIO('A B C D\n aaaa 121 45 9.1') test = np.ndfromtxt(data, usecols=('A', 'C', 'D'), names=True, dtype=None, converters={'C':lambda s: 2 * int(s)}) control = np.array(('aaaa', 90, 9.1), @@ -619,7 +625,7 @@ def test_converters_cornercases(self): "Test the conversion to datetime." converter = {'date': lambda s: strptime(s, '%Y-%m-%d %H:%M:%SZ')} - data = StringIO.StringIO('2009-02-03 12:00:00Z, 72214.0') + data = StringIO('2009-02-03 12:00:00Z, 72214.0') test = np.ndfromtxt(data, delimiter=',', dtype=None, names=['date', 'stid'], converters=converter) control = np.array((datetime(2009, 02, 03), 72214.), @@ -629,7 +635,7 @@ def test_unused_converter(self): "Test whether unused converters are forgotten" - data = StringIO.StringIO("1 21\n 3 42\n") + data = StringIO("1 21\n 3 42\n") test = np.ndfromtxt(data, usecols=(1,), converters={0: lambda s: int(s, 16)}) assert_equal(test, [21, 42]) @@ -645,7 +651,7 @@ (not 'r' in x.lower() and x.strip() or 0.0)) strip_per = lambda x : float(('%' in x.lower() and x.split()[0]) or (not '%' in x.lower() and x.strip() or 0.0)) - s = StringIO.StringIO("D01N01,10/1/2003 ,1 %,R 75,400,600\r\n" \ + s = StringIO("D01N01,10/1/2003 ,1 %,R 75,400,600\r\n" \ "L24U05,12/5/2003, 2 %,1,300, 150.5\r\n" "D02N03,10/10/2004,R 1,,7,145.55") kwargs = dict(converters={2 : strip_per, 3 : strip_rand}, delimiter=",", @@ -655,12 +661,12 @@ def test_dtype_with_converters(self): dstr = "2009; 23; 46" - test = np.ndfromtxt(StringIO.StringIO(dstr,), + test = np.ndfromtxt(StringIO(dstr,), delimiter=";", dtype=float, converters={0:str}) control = np.array([('2009', 23., 46)], dtype=[('f0', '|S4'), ('f1', float), ('f2', float)]) assert_equal(test, control) - test = np.ndfromtxt(StringIO.StringIO(dstr,), + test = np.ndfromtxt(StringIO(dstr,), delimiter=";", dtype=float, converters={0:float}) control = np.array([2009., 23., 46],) assert_equal(test, control) @@ -677,7 +683,7 @@ ndtype = [('idx', int), ('code', np.object)] func = lambda s: strptime(s.strip(), "%Y-%m-%d") converters = {1: func} - test = np.genfromtxt(StringIO.StringIO(data), delimiter=";", dtype=ndtype, + test = np.genfromtxt(StringIO(data), delimiter=";", dtype=ndtype, converters=converters) control = np.array([(1, datetime(2001, 1, 1)), (2, datetime(2002, 1, 31))], dtype=ndtype) @@ -685,7 +691,7 @@ # ndtype = [('nest', [('idx', int), ('code', np.object)])] try: - test = np.genfromtxt(StringIO.StringIO(data), delimiter=";", + test = np.genfromtxt(StringIO(data), delimiter=";", dtype=ndtype, converters=converters) except NotImplementedError: pass @@ -696,7 +702,7 @@ def test_userconverters_with_explicit_dtype(self): "Test user_converters w/ explicit (standard) dtype" - data = StringIO.StringIO('skip,skip,2001-01-01,1.0,skip') + data = StringIO('skip,skip,2001-01-01,1.0,skip') test = np.genfromtxt(data, delimiter=",", names=None, dtype=float, usecols=(2, 3), converters={2: str}) control = np.array([('2001-01-01', 1.)], @@ -706,7 +712,7 @@ def test_spacedelimiter(self): "Test space delimiter" - data = StringIO.StringIO("1 2 3 4 5\n6 7 8 9 10") + data = StringIO("1 2 3 4 5\n6 7 8 9 10") test = np.ndfromtxt(data) control = np.array([[ 1., 2., 3., 4., 5.], [ 6., 7., 8., 9., 10.]]) @@ -714,7 +720,7 @@ def test_missing(self): - data = StringIO.StringIO('1,2,3,,5\n') + data = StringIO('1,2,3,,5\n') test = np.ndfromtxt(data, dtype=int, delimiter=',', \ converters={3:lambda s: int(s or - 999)}) control = np.array([1, 2, 3, -999, 5], int) @@ -724,7 +730,7 @@ def test_missing_with_tabs(self): "Test w/ a delimiter tab" txt = "1\t2\t3\n\t2\t\n1\t\t3" - test = np.genfromtxt(StringIO.StringIO(txt), delimiter="\t", + test = np.genfromtxt(StringIO(txt), delimiter="\t", usemask=True,) ctrl_d = np.array([(1, 2, 3), (np.nan, 2, np.nan), (1, np.nan, 3)],) ctrl_m = np.array([(0, 0, 0), (1, 0, 1), (0, 1, 0)], dtype=bool) @@ -736,14 +742,14 @@ "Test the selection of columns" # Select 1 column control = np.array([[1, 2], [3, 4]], float) - data = StringIO.StringIO() + data = StringIO() np.savetxt(data, control) data.seek(0) test = np.ndfromtxt(data, dtype=float, usecols=(1,)) assert_equal(test, control[:, 1]) # control = np.array([[1, 2, 3], [3, 4, 5]], float) - data = StringIO.StringIO() + data = StringIO() np.savetxt(data, control) data.seek(0) test = np.ndfromtxt(data, dtype=float, usecols=(1, 2)) @@ -756,14 +762,14 @@ def test_usecols_as_css(self): "Test giving usecols with a comma-separated string" data = "1 2 3\n4 5 6" - test = np.genfromtxt(StringIO.StringIO(data), + test = np.genfromtxt(StringIO(data), names="a, b, c", usecols="a, c") ctrl = np.array([(1, 3), (4, 6)], dtype=[(_, float) for _ in "ac"]) assert_equal(test, ctrl) def test_usecols_with_structured_dtype(self): "Test usecols with an explicit structured dtype" - data = StringIO.StringIO("""JOE 70.1 25.3\nBOB 60.5 27.9""") + data = StringIO("""JOE 70.1 25.3\nBOB 60.5 27.9""") names = ['stid', 'temp'] dtypes = ['S4', 'f8'] test = np.ndfromtxt(data, usecols=(0, 2), dtype=zip(names, dtypes)) @@ -772,7 +778,7 @@ def test_usecols_with_integer(self): "Test usecols with an integer" - test = np.genfromtxt(StringIO.StringIO("1 2 3\n4 5 6"), usecols=0) + test = np.genfromtxt(StringIO("1 2 3\n4 5 6"), usecols=0) assert_equal(test, np.array([1., 4.])) def test_usecols_with_named_columns(self): @@ -780,22 +786,22 @@ ctrl = np.array([(1, 3), (4, 6)], dtype=[('a', float), ('c', float)]) data = "1 2 3\n4 5 6" kwargs = dict(names="a, b, c") - test = np.genfromtxt(StringIO.StringIO(data), usecols=(0, -1), **kwargs) + test = np.genfromtxt(StringIO(data), usecols=(0, -1), **kwargs) assert_equal(test, ctrl) - test = np.genfromtxt(StringIO.StringIO(data), + test = np.genfromtxt(StringIO(data), usecols=('a', 'c'), **kwargs) assert_equal(test, ctrl) def test_empty_file(self): "Test that an empty file raises the proper exception" - data = StringIO.StringIO() + data = StringIO() assert_raises(IOError, np.ndfromtxt, data) def test_fancy_dtype_alt(self): "Check that a nested dtype isn't MIA" - data = StringIO.StringIO('1,2,3.0\n4,5,6.0\n') + data = StringIO('1,2,3.0\n4,5,6.0\n') fancydtype = np.dtype([('x', int), ('y', [('t', int), ('s', float)])]) test = np.mafromtxt(data, dtype=fancydtype, delimiter=',') control = ma.array([(1, (2, 3.0)), (4, (5, 6.0))], dtype=fancydtype) @@ -803,7 +809,7 @@ def test_shaped_dtype(self): - c = StringIO.StringIO("aaaa 1.0 8.0 1 2 3 4 5 6") + c = StringIO("aaaa 1.0 8.0 1 2 3 4 5 6") dt = np.dtype([('name', 'S4'), ('x', float), ('y', float), ('block', int, (2, 3))]) x = np.ndfromtxt(c, dtype=dt) @@ -813,7 +819,7 @@ def test_withmissing(self): - data = StringIO.StringIO('A,B\n0,1\n2,N/A') + data = StringIO('A,B\n0,1\n2,N/A') kwargs = dict(delimiter=",", missing_values="N/A", names=True) test = np.mafromtxt(data, dtype=None, **kwargs) control = ma.array([(0, 1), (2, -1)], @@ -836,7 +842,7 @@ basekwargs = dict(dtype=None, delimiter=",", names=True,) mdtype = [('A', int), ('B', float), ('C', complex)] # - test = np.mafromtxt(StringIO.StringIO(data), missing_values="N/A", + test = np.mafromtxt(StringIO(data), missing_values="N/A", **basekwargs) control = ma.array([(0, 0.0, 0j), (1, -999, 1j), (-9, 2.2, -999j), (3, -99, 3j)], @@ -845,7 +851,7 @@ assert_equal(test, control) # basekwargs['dtype'] = mdtype - test = np.mafromtxt(StringIO.StringIO(data), + test = np.mafromtxt(StringIO(data), missing_values={0:-9, 1:-99, 2:-999j}, **basekwargs) control = ma.array([(0, 0.0, 0j), (1, -999, 1j), (-9, 2.2, -999j), (3, -99, 3j)], @@ -853,7 +859,7 @@ dtype=mdtype) assert_equal(test, control) # - test = np.mafromtxt(StringIO.StringIO(data), + test = np.mafromtxt(StringIO(data), missing_values={0:-9, 'B':-99, 'C':-999j}, **basekwargs) control = ma.array([(0, 0.0, 0j), (1, -999, 1j), @@ -871,18 +877,18 @@ names="a,b,c", missing_values={0:"N/A", 'b':" ", 2:"???"}, filling_values={0:0, 'b':0, 2:-999}) - test = np.genfromtxt(StringIO.StringIO(data), **kwargs) + test = np.genfromtxt(StringIO(data), **kwargs) ctrl = np.array([(0, 2, 3), (4, 0, -999)], dtype=[(_, int) for _ in "abc"]) assert_equal(test, ctrl) # - test = np.genfromtxt(StringIO.StringIO(data), usecols=(0, -1), **kwargs) + test = np.genfromtxt(StringIO(data), usecols=(0, -1), **kwargs) ctrl = np.array([(0, 3), (4, -999)], dtype=[(_, int) for _ in "ac"]) assert_equal(test, ctrl) def test_withmissing_float(self): - data = StringIO.StringIO('A,B\n0,1.5\n2,-999.00') + data = StringIO('A,B\n0,1.5\n2,-999.00') test = np.mafromtxt(data, dtype=None, delimiter=',', missing_values='-999.0', names=True,) control = ma.array([(0, 1.5), (2, -1.)], @@ -894,7 +900,7 @@ def test_with_masked_column_uniform(self): "Test masked column" - data = StringIO.StringIO('1 2 3\n4 5 6\n') + data = StringIO('1 2 3\n4 5 6\n') test = np.genfromtxt(data, dtype=None, missing_values='2,5', usemask=True) control = ma.array([[1, 2, 3], [4, 5, 6]], mask=[[0, 1, 0], [0, 1, 0]]) @@ -902,7 +908,7 @@ def test_with_masked_column_various(self): "Test masked column" - data = StringIO.StringIO('True 2 3\nFalse 5 6\n') + data = StringIO('True 2 3\nFalse 5 6\n') test = np.genfromtxt(data, dtype=None, missing_values='2,5', usemask=True) control = ma.array([(1, 2, 3), (0, 5, 6)], @@ -917,7 +923,7 @@ for i in range(5): data[10 * i] = "2, 2, 2, 2 2" data.insert(0, "a, b, c, d, e") - mdata = StringIO.StringIO("\n".join(data)) + mdata = StringIO("\n".join(data)) # kwargs = dict(delimiter=",", dtype=None, names=True) # XXX: is there a better way to get the return value of the callable in @@ -940,7 +946,7 @@ for i in range(5): data[10 * i] = "2, 2, 2, 2 2" data.insert(0, "a, b, c, d, e") - mdata = StringIO.StringIO("\n".join(data)) + mdata = StringIO("\n".join(data)) kwargs = dict(delimiter=",", dtype=None, names=True, invalid_raise=False) # XXX: is there a better way to get the return value of the callable in @@ -964,7 +970,7 @@ def test_inconsistent_dtype(self): "Test inconsistent dtype" data = ["1, 1, 1, 1, -1.1"] * 50 - mdata = StringIO.StringIO("\n".join(data)) + mdata = StringIO("\n".join(data)) converters = {4: lambda x:"(%s)" % x} kwargs = dict(delimiter=",", converters=converters, @@ -975,7 +981,7 @@ def test_default_field_format(self): "Test default format" data = "0, 1, 2.3\n4, 5, 6.7" - mtest = np.ndfromtxt(StringIO.StringIO(data), + mtest = np.ndfromtxt(StringIO(data), delimiter=",", dtype=None, defaultfmt="f%02i") ctrl = np.array([(0, 1, 2.3), (4, 5, 6.7)], dtype=[("f00", int), ("f01", int), ("f02", float)]) @@ -984,7 +990,7 @@ def test_single_dtype_wo_names(self): "Test single dtype w/o names" data = "0, 1, 2.3\n4, 5, 6.7" - mtest = np.ndfromtxt(StringIO.StringIO(data), + mtest = np.ndfromtxt(StringIO(data), delimiter=",", dtype=float, defaultfmt="f%02i") ctrl = np.array([[0., 1., 2.3], [4., 5., 6.7]], dtype=float) assert_equal(mtest, ctrl) @@ -992,7 +998,7 @@ def test_single_dtype_w_explicit_names(self): "Test single dtype w explicit names" data = "0, 1, 2.3\n4, 5, 6.7" - mtest = np.ndfromtxt(StringIO.StringIO(data), + mtest = np.ndfromtxt(StringIO(data), delimiter=",", dtype=float, names="a, b, c") ctrl = np.array([(0., 1., 2.3), (4., 5., 6.7)], dtype=[(_, float) for _ in "abc"]) @@ -1001,7 +1007,7 @@ def test_single_dtype_w_implicit_names(self): "Test single dtype w implicit names" data = "a, b, c\n0, 1, 2.3\n4, 5, 6.7" - mtest = np.ndfromtxt(StringIO.StringIO(data), + mtest = np.ndfromtxt(StringIO(data), delimiter=",", dtype=float, names=True) ctrl = np.array([(0., 1., 2.3), (4., 5., 6.7)], dtype=[(_, float) for _ in "abc"]) @@ -1010,7 +1016,7 @@ def test_easy_structured_dtype(self): "Test easy structured dtype" data = "0, 1, 2.3\n4, 5, 6.7" - mtest = np.ndfromtxt(StringIO.StringIO(data), delimiter=",", + mtest = np.ndfromtxt(StringIO(data), delimiter=",", dtype=(int, float, float), defaultfmt="f_%02i") ctrl = np.array([(0, 1., 2.3), (4, 5., 6.7)], dtype=[("f_00", int), ("f_01", float), ("f_02", float)]) @@ -1020,11 +1026,11 @@ "Test autostrip" data = "01/01/2003 , 1.3, abcde" kwargs = dict(delimiter=",", dtype=None) - mtest = np.ndfromtxt(StringIO.StringIO(data), **kwargs) + mtest = np.ndfromtxt(StringIO(data), **kwargs) ctrl = np.array([('01/01/2003 ', 1.3, ' abcde')], dtype=[('f0', '|S12'), ('f1', float), ('f2', '|S8')]) assert_equal(mtest, ctrl) - mtest = np.ndfromtxt(StringIO.StringIO(data), autostrip=True, **kwargs) + mtest = np.ndfromtxt(StringIO(data), autostrip=True, **kwargs) ctrl = np.array([('01/01/2003', 1.3, 'abcde')], dtype=[('f0', '|S10'), ('f1', float), ('f2', '|S5')]) assert_equal(mtest, ctrl) @@ -1036,17 +1042,17 @@ # w/ dtype=None ctrl = np.array([(0, 1, 2), (3, 4, 5)], dtype=[(_, int) for _ in ('A', 'f0', 'C')]) - test = np.ndfromtxt(StringIO.StringIO(data), dtype=None, **kwargs) + test = np.ndfromtxt(StringIO(data), dtype=None, **kwargs) assert_equal(test, ctrl) # w/ default dtype ctrl = np.array([(0, 1, 2), (3, 4, 5)], dtype=[(_, float) for _ in ('A', 'f0', 'C')]) - test = np.ndfromtxt(StringIO.StringIO(data), **kwargs) + test = np.ndfromtxt(StringIO(data), **kwargs) def test_names_auto_completion(self): "Make sure that names are properly completed" data = "1 2 3\n 4 5 6" - test = np.genfromtxt(StringIO.StringIO(data), + test = np.genfromtxt(StringIO(data), dtype=(int, float, int), names="a") ctrl = np.array([(1, 2, 3), (4, 5, 6)], dtype=[('a', int), ('f0', float), ('f1', int)]) @@ -1058,13 +1064,13 @@ kwargs = dict(delimiter=(5, 5, 4), names=True, dtype=None) ctrl = np.array([(0, 1, 2.3), (45, 67, 9.)], dtype=[('A', int), ('B', int), ('C', float)]) - test = np.ndfromtxt(StringIO.StringIO(data), **kwargs) + test = np.ndfromtxt(StringIO(data), **kwargs) assert_equal(test, ctrl) # kwargs = dict(delimiter=5, names=True, dtype=None) ctrl = np.array([(0, 1, 2.3), (45, 67, 9.)], dtype=[('A', int), ('B', int), ('C', float)]) - test = np.ndfromtxt(StringIO.StringIO(data), **kwargs) + test = np.ndfromtxt(StringIO(data), **kwargs) assert_equal(test, ctrl) def test_filling_values(self): @@ -1072,13 +1078,13 @@ data = "1, 2, 3\n1, , 5\n0, 6, \n" kwargs = dict(delimiter=",", dtype=None, filling_values= -999) ctrl = np.array([[1, 2, 3], [1, -999, 5], [0, 6, -999]], dtype=int) - test = np.ndfromtxt(StringIO.StringIO(data), **kwargs) + test = np.ndfromtxt(StringIO(data), **kwargs) assert_equal(test, ctrl) def test_recfromtxt(self): # - data = StringIO.StringIO('A,B\n0,1\n2,3') + data = StringIO('A,B\n0,1\n2,3') kwargs = dict(delimiter=",", missing_values="N/A", names=True) test = np.recfromtxt(data, **kwargs) control = np.array([(0, 1), (2, 3)], @@ -1086,7 +1092,7 @@ self.failUnless(isinstance(test, np.recarray)) assert_equal(test, control) # - data = StringIO.StringIO('A,B\n0,1\n2,N/A') + data = StringIO('A,B\n0,1\n2,N/A') test = np.recfromtxt(data, dtype=None, usemask=True, **kwargs) control = ma.array([(0, 1), (2, -1)], mask=[(False, False), (False, True)], @@ -1098,7 +1104,7 @@ def test_recfromcsv(self): # - data = StringIO.StringIO('A,B\n0,1\n2,3') + data = StringIO('A,B\n0,1\n2,3') kwargs = dict(missing_values="N/A", names=True, case_sensitive=True) test = np.recfromcsv(data, dtype=None, **kwargs) control = np.array([(0, 1), (2, 3)], @@ -1106,7 +1112,7 @@ self.failUnless(isinstance(test, np.recarray)) assert_equal(test, control) # - data = StringIO.StringIO('A,B\n0,1\n2,N/A') + data = StringIO('A,B\n0,1\n2,N/A') test = np.recfromcsv(data, dtype=None, usemask=True, **kwargs) control = ma.array([(0, 1), (2, -1)], mask=[(False, False), (False, True)], @@ -1115,7 +1121,7 @@ assert_equal(test.mask, control.mask) assert_equal(test.A, [0, 2]) # - data = StringIO.StringIO('A,B\n0,1\n2,3') + data = StringIO('A,B\n0,1\n2,3') test = np.recfromcsv(data, missing_values='N/A',) control = np.array([(0, 1), (2, 3)], dtype=[('a', np.int), ('b', np.int)]) @@ -1126,7 +1132,7 @@ def test_gzip_load(): a = np.random.random((5, 5)) - s = StringIO.StringIO() + s = StringIO() f = gzip.GzipFile(fileobj=s, mode="w") np.save(f, a) @@ -1143,7 +1149,7 @@ # reopened by another open call. So we first put the gzipped string # of the test reference array, write it to a securely opened file, # which is then read from by the loadtxt function - s = StringIO.StringIO() + s = StringIO() g = gzip.GzipFile(fileobj=s, mode='w') g.write('1 2 3\n') g.close() @@ -1159,7 +1165,7 @@ os.unlink(name) def test_gzip_loadtxt_from_string(): - s = StringIO.StringIO() + s = StringIO() f = gzip.GzipFile(fileobj=s, mode="w") f.write('1 2 3\n') f.close() @@ -1169,7 +1175,7 @@ assert_array_equal(np.loadtxt(f), [1, 2, 3]) def test_npzfile_dict(): - s = StringIO.StringIO() + s = StringIO() x = np.zeros((3, 3)) y = np.zeros((3, 3)) From numpy-svn at scipy.org Sat Feb 20 13:16:53 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:16:53 -0600 (CST) Subject: [Numpy-svn] r8178 - trunk/numpy/lib/tests Message-ID: <20100220181653.0325FC7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:16:52 -0600 (Sat, 20 Feb 2010) New Revision: 8178 Modified: trunk/numpy/lib/tests/test_format.py Log: 3K: lib: even more bytes/str fixes in format.py tests Modified: trunk/numpy/lib/tests/test_format.py =================================================================== --- trunk/numpy/lib/tests/test_format.py 2010-02-20 18:16:37 UTC (rev 8177) +++ trunk/numpy/lib/tests/test_format.py 2010-02-20 18:16:52 UTC (rev 8178) @@ -293,7 +293,9 @@ from numpy.lib import format +from numpy.compat import asbytes, asbytes_nested + tempdir = None # Module-level setup. @@ -489,15 +491,15 @@ raise AssertionError("we should have raised a ValueError for the bad version %r" % (version,)) -bad_version_magic = [ +bad_version_magic = asbytes_nested([ '\x93NUMPY\x01\x01', '\x93NUMPY\x00\x00', '\x93NUMPY\x00\x01', '\x93NUMPY\x02\x00', '\x93NUMPY\x02\x02', '\x93NUMPY\xff\xff', -] -malformed_magic = [ +]) +malformed_magic = asbytes_nested([ '\x92NUMPY\x01\x00', '\x00NUMPY\x01\x00', '\x93numpy\x01\x00', @@ -505,7 +507,7 @@ '\x93NUMPY\x01', '\x93NUMPY', '', -] +]) def test_read_magic_bad_magic(): for magic in malformed_magic: @@ -536,11 +538,11 @@ # header of length less than 2 should fail s = StringIO() assert_raises(ValueError, format.read_array_header_1_0, s) - s = StringIO('1') + s = StringIO(asbytes('1')) assert_raises(ValueError, format.read_array_header_1_0, s) # header shorter than indicated size should fail - s = StringIO('\x01\x00') + s = StringIO(asbytes('\x01\x00')) assert_raises(ValueError, format.read_array_header_1_0, s) # headers without the exact keys required should fail From numpy-svn at scipy.org Sat Feb 20 13:17:14 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:17:14 -0600 (CST) Subject: [Numpy-svn] r8179 - in trunk: doc numpy/lib numpy/lib/tests Message-ID: <20100220181714.C4727C7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:17:14 -0600 (Sat, 20 Feb 2010) New Revision: 8179 Modified: trunk/doc/Py3K.txt trunk/numpy/lib/_iotools.py trunk/numpy/lib/function_base.py trunk/numpy/lib/io.py trunk/numpy/lib/tests/test__iotools.py trunk/numpy/lib/tests/test_io.py Log: 3K: lib: fix some bytes vs. str issues in _iotools.py and io.py -- mainly genfromtxt Modified: trunk/doc/Py3K.txt =================================================================== --- trunk/doc/Py3K.txt 2010-02-20 18:16:52 UTC (rev 8178) +++ trunk/doc/Py3K.txt 2010-02-20 18:17:14 UTC (rev 8179) @@ -211,6 +211,16 @@ Check if I missed something here. +numpy.loadtxt et al +------------------- + +These routines are difficult to duck-type to read both Unicode and +Bytes input. + +I assume they are meant for reading Bytes streams -- this is probably +the far more common use case with scientific data. + + C Code ====== Modified: trunk/numpy/lib/_iotools.py =================================================================== --- trunk/numpy/lib/_iotools.py 2010-02-20 18:16:52 UTC (rev 8178) +++ trunk/numpy/lib/_iotools.py 2010-02-20 18:17:14 UTC (rev 8179) @@ -1,11 +1,22 @@ """A collection of functions designed to help I/O with ascii files.""" __docformat__ = "restructuredtext en" +import sys import numpy as np import numpy.core.numeric as nx from __builtin__ import bool, int, long, float, complex, object, unicode, str +from numpy.compat import asbytes, bytes +if sys.version_info[0] >= 3: + def _bytes_to_complex(s): + return complex(s.decode('ascii')) + def _bytes_to_name(s): + return s.decode('ascii') +else: + _bytes_to_complex = complex + _bytes_to_name = str + def _is_string_like(obj): """ Check whether obj behaves like a string. @@ -16,7 +27,17 @@ return False return True +def _is_bytes_like(obj): + """ + Check whether obj behaves like a bytes object. + """ + try: + obj + asbytes('') + except (TypeError, ValueError): + return False + return True + def _to_filehandle(fname, flag='r', return_opened=False): """ Returns the filehandle corresponding to a string or a file. @@ -157,10 +178,12 @@ """ return lambda input: [_.strip() for _ in method(input)] # - def __init__(self, delimiter=None, comments='#', autostrip=True): + def __init__(self, delimiter=None, comments=asbytes('#'), autostrip=True): self.comments = comments # Delimiter is a character - if (delimiter is None) or _is_string_like(delimiter): + if isinstance(delimiter, unicode): + delimiter = delimiter.encode('ascii') + if (delimiter is None) or _is_bytes_like(delimiter): delimiter = delimiter or None _handyman = self._delimited_splitter # Delimiter is a list of field widths @@ -180,7 +203,7 @@ self._handyman = _handyman # def _delimited_splitter(self, line): - line = line.split(self.comments)[0].strip(" \r\n") + line = line.split(self.comments)[0].strip(asbytes(" \r\n")) if not line: return [] return line.split(self.delimiter) @@ -382,9 +405,9 @@ """ value = value.upper() - if value == 'TRUE': + if value == asbytes('TRUE'): return True - elif value == 'FALSE': + elif value == asbytes('FALSE'): return False else: raise ValueError("Invalid boolean") @@ -468,8 +491,8 @@ _mapper = [(nx.bool_, str2bool, False), (nx.integer, int, -1), (nx.floating, float, nx.nan), - (complex, complex, nx.nan + 0j), - (nx.string_, str, '???')] + (complex, _bytes_to_complex, nx.nan + 0j), + (nx.string_, bytes, asbytes('???'))] (_defaulttype, _defaultfunc, _defaultfill) = zip(*_mapper) # @classmethod @@ -570,11 +593,11 @@ self.func = lambda x : int(float(x)) # Store the list of strings corresponding to missing values. if missing_values is None: - self.missing_values = set(['']) + self.missing_values = set([asbytes('')]) else: if isinstance(missing_values, basestring): - missing_values = missing_values.split(",") - self.missing_values = set(list(missing_values) + ['']) + missing_values = missing_values.split(asbytes(",")) + self.missing_values = set(list(missing_values) + [asbytes('')]) # self._callingfunction = self._strict_call self.type = ttype @@ -672,7 +695,8 @@ self._status = _status self.iterupgrade(value) - def update(self, func, default=None, missing_values='', locked=False): + def update(self, func, default=None, missing_values=asbytes(''), + locked=False): """ Set StringConverter attributes directly. @@ -711,7 +735,7 @@ self.type = self._getsubdtype(tester) # Add the missing values to the existing set if missing_values is not None: - if _is_string_like(missing_values): + if _is_bytes_like(missing_values): self.missing_values.add(missing_values) elif hasattr(missing_values, '__iter__'): for val in missing_values: Modified: trunk/numpy/lib/function_base.py =================================================================== --- trunk/numpy/lib/function_base.py 2010-02-20 18:16:52 UTC (rev 8178) +++ trunk/numpy/lib/function_base.py 2010-02-20 18:17:14 UTC (rev 8179) @@ -13,6 +13,7 @@ import warnings import types +import sys import numpy.core.numeric as _nx from numpy.core import linspace from numpy.core.numeric import ones, zeros, arange, concatenate, array, \ @@ -1596,7 +1597,18 @@ def _get_nargs(obj): if not callable(obj): raise TypeError, "Object is not callable." - if hasattr(obj,'func_code'): + if sys.version_info[0] >= 3: + import inspect + spec = inspect.getargspec(obj) + nargs = len(spec.args) + if spec.defaults: + ndefaults = len(spec.defaults) + else: + ndefaults = 0 + if inspect.ismethod(obj): + nargs -= 1 + return nargs, ndefaults + elif hasattr(obj,'func_code'): fcode = obj.func_code nargs = fcode.co_argcount if obj.func_defaults is not None: Modified: trunk/numpy/lib/io.py =================================================================== --- trunk/numpy/lib/io.py 2010-02-20 18:16:52 UTC (rev 8178) +++ trunk/numpy/lib/io.py 2010-02-20 18:17:14 UTC (rev 8179) @@ -21,7 +21,7 @@ from _iotools import LineSplitter, NameValidator, StringConverter, \ ConverterError, ConverterLockError, ConversionWarning, \ _is_string_like, has_nested_fields, flatten_dtype, \ - easy_dtype + easy_dtype, _bytes_to_name from numpy.compat import asbytes @@ -478,8 +478,8 @@ -def loadtxt(fname, dtype=float, comments='#', delimiter=None, converters=None, - skiprows=0, usecols=None, unpack=False): +def loadtxt(fname, dtype=float, comments=asbytes('#'), delimiter=None, + converters=None, skiprows=0, usecols=None, unpack=False): """ Load data from a text file. @@ -613,7 +613,7 @@ first_vals = None while not first_vals: first_line = fh.readline() - if first_line == '': # EOF reached + if not first_line: # EOF reached raise IOError('End-of-file reached before encountering data.') first_vals = split_line(first_line) N = len(usecols or first_vals) @@ -891,9 +891,9 @@ -def genfromtxt(fname, dtype=float, comments='#', delimiter=None, +def genfromtxt(fname, dtype=float, comments=asbytes('#'), delimiter=None, skiprows=0, skip_header=0, skip_footer=0, converters=None, - missing='', missing_values=None, filling_values=None, + missing=asbytes(''), missing_values=None, filling_values=None, usecols=None, names=None, excludelist=None, deletechars=None, autostrip=False, case_sensitive=True, defaultfmt="f%i", unpack=None, usemask=False, loose=True, invalid_raise=True): @@ -1065,11 +1065,11 @@ first_values = None while not first_values: first_line = fhd.readline() - if first_line == '': + if not first_line: raise IOError('End-of-file reached before encountering data.') if names is True: if comments in first_line: - first_line = ''.join(first_line.split(comments)[1]) + first_line = asbytes('').join(first_line.split(comments)[1:]) first_values = split_line(first_line) # Should we take the first values as names ? if names is True: @@ -1090,8 +1090,9 @@ # Check the names and overwrite the dtype.names if needed if names is True: - names = validate_names([_.strip() for _ in first_values]) - first_line = '' + names = validate_names([_bytes_to_name(_.strip()) + for _ in first_values]) + first_line = asbytes('') elif _is_string_like(names): names = validate_names([_.strip() for _ in names.split(',')]) elif names: @@ -1127,7 +1128,7 @@ user_missing_values = missing_values or () # Define the list of missing_values (one column: one list) - missing_values = [list(['']) for _ in range(nbcols)] + missing_values = [list([asbytes('')]) for _ in range(nbcols)] # We have a dictionary: process it field by field if isinstance(user_missing_values, dict): @@ -1176,7 +1177,7 @@ entry.extend([str(user_missing_values)]) # Process the deprecated `missing` - if missing != '': + if missing != asbytes(''): warnings.warn("The use of `missing` is deprecated.\n"\ "Please use `missing_values` instead.", DeprecationWarning) @@ -1451,7 +1452,8 @@ names = output.dtype.names if usemask and names: for (name, conv) in zip(names or (), converters): - missing_values = [conv(_) for _ in conv.missing_values if _ != ''] + missing_values = [conv(_) for _ in conv.missing_values + if _ != asbytes('')] for mval in missing_values: outputmask[name] |= (output[name] == mval) # Construct the final array Modified: trunk/numpy/lib/tests/test__iotools.py =================================================================== --- trunk/numpy/lib/tests/test__iotools.py 2010-02-20 18:16:52 UTC (rev 8178) +++ trunk/numpy/lib/tests/test__iotools.py 2010-02-20 18:17:14 UTC (rev 8179) @@ -1,71 +1,78 @@ +import sys +if sys.version_info[0] >= 3: + from io import BytesIO + def StringIO(s=""): + return BytesIO(asbytes(s)) +else: + from StringIO import StringIO -import StringIO - import numpy as np from numpy.lib._iotools import LineSplitter, NameValidator, StringConverter,\ has_nested_fields, easy_dtype from numpy.testing import * +from numpy.compat import asbytes, asbytes_nested + class TestLineSplitter(TestCase): "Tests the LineSplitter class." # def test_no_delimiter(self): "Test LineSplitter w/o delimiter" - strg = " 1 2 3 4 5 # test" + strg = asbytes(" 1 2 3 4 5 # test") test = LineSplitter()(strg) - assert_equal(test, ['1', '2', '3', '4', '5']) + assert_equal(test, asbytes_nested(['1', '2', '3', '4', '5'])) test = LineSplitter('')(strg) - assert_equal(test, ['1', '2', '3', '4', '5']) + assert_equal(test, asbytes_nested(['1', '2', '3', '4', '5'])) def test_space_delimiter(self): "Test space delimiter" - strg = " 1 2 3 4 5 # test" - test = LineSplitter(' ')(strg) - assert_equal(test, ['1', '2', '3', '4', '', '5']) - test = LineSplitter(' ')(strg) - assert_equal(test, ['1 2 3 4', '5']) + strg = asbytes(" 1 2 3 4 5 # test") + test = LineSplitter(asbytes(' '))(strg) + assert_equal(test, asbytes_nested(['1', '2', '3', '4', '', '5'])) + test = LineSplitter(asbytes(' '))(strg) + assert_equal(test, asbytes_nested(['1 2 3 4', '5'])) def test_tab_delimiter(self): "Test tab delimiter" - strg= " 1\t 2\t 3\t 4\t 5 6" - test = LineSplitter('\t')(strg) - assert_equal(test, ['1', '2', '3', '4', '5 6']) - strg= " 1 2\t 3 4\t 5 6" - test = LineSplitter('\t')(strg) - assert_equal(test, ['1 2', '3 4', '5 6']) + strg= asbytes(" 1\t 2\t 3\t 4\t 5 6") + test = LineSplitter(asbytes('\t'))(strg) + assert_equal(test, asbytes_nested(['1', '2', '3', '4', '5 6'])) + strg= asbytes(" 1 2\t 3 4\t 5 6") + test = LineSplitter(asbytes('\t'))(strg) + assert_equal(test, asbytes_nested(['1 2', '3 4', '5 6'])) def test_other_delimiter(self): "Test LineSplitter on delimiter" - strg = "1,2,3,4,,5" - test = LineSplitter(',')(strg) - assert_equal(test, ['1', '2', '3', '4', '', '5']) + strg = asbytes("1,2,3,4,,5") + test = LineSplitter(asbytes(','))(strg) + assert_equal(test, asbytes_nested(['1', '2', '3', '4', '', '5'])) # - strg = " 1,2,3,4,,5 # test" - test = LineSplitter(',')(strg) - assert_equal(test, ['1', '2', '3', '4', '', '5']) + strg = asbytes(" 1,2,3,4,,5 # test") + test = LineSplitter(asbytes(','))(strg) + assert_equal(test, asbytes_nested(['1', '2', '3', '4', '', '5'])) def test_constant_fixed_width(self): "Test LineSplitter w/ fixed-width fields" - strg = " 1 2 3 4 5 # test" + strg = asbytes(" 1 2 3 4 5 # test") test = LineSplitter(3)(strg) - assert_equal(test, ['1', '2', '3', '4', '', '5', '']) + assert_equal(test, asbytes_nested(['1', '2', '3', '4', '', '5', ''])) # - strg = " 1 3 4 5 6# test" + strg = asbytes(" 1 3 4 5 6# test") test = LineSplitter(20)(strg) - assert_equal(test, ['1 3 4 5 6']) + assert_equal(test, asbytes_nested(['1 3 4 5 6'])) # - strg = " 1 3 4 5 6# test" + strg = asbytes(" 1 3 4 5 6# test") test = LineSplitter(30)(strg) - assert_equal(test, ['1 3 4 5 6']) + assert_equal(test, asbytes_nested(['1 3 4 5 6'])) def test_variable_fixed_width(self): - strg = " 1 3 4 5 6# test" + strg = asbytes(" 1 3 4 5 6# test") test = LineSplitter((3,6,6,3))(strg) - assert_equal(test, ['1', '3', '4 5', '6']) + assert_equal(test, asbytes_nested(['1', '3', '4 5', '6'])) # - strg = " 1 3 4 5 6# test" + strg = asbytes(" 1 3 4 5 6# test") test = LineSplitter((6,6,9))(strg) - assert_equal(test, ['1', '3 4', '5 6']) + assert_equal(test, asbytes_nested(['1', '3 4', '5 6'])) #------------------------------------------------------------------------------- @@ -136,23 +143,24 @@ "Tests the upgrade method." converter = StringConverter() assert_equal(converter._status, 0) - converter.upgrade('0') + converter.upgrade(asbytes('0')) assert_equal(converter._status, 1) - converter.upgrade('0.') + converter.upgrade(asbytes('0.')) assert_equal(converter._status, 2) - converter.upgrade('0j') + converter.upgrade(asbytes('0j')) assert_equal(converter._status, 3) - converter.upgrade('a') + converter.upgrade(asbytes('a')) assert_equal(converter._status, len(converter._mapper)-1) # def test_missing(self): "Tests the use of missing values." - converter = StringConverter(missing_values=('missing','missed')) - converter.upgrade('0') - assert_equal(converter('0'), 0) - assert_equal(converter(''), converter.default) - assert_equal(converter('missing'), converter.default) - assert_equal(converter('missed'), converter.default) + converter = StringConverter(missing_values=(asbytes('missing'), + asbytes('missed'))) + converter.upgrade(asbytes('0')) + assert_equal(converter(asbytes('0')), 0) + assert_equal(converter(asbytes('')), converter.default) + assert_equal(converter(asbytes('missing')), converter.default) + assert_equal(converter(asbytes('missed')), converter.default) try: converter('miss') except ValueError: @@ -162,7 +170,11 @@ "Tests updatemapper" from datetime import date import time - dateparser = lambda s : date(*time.strptime(s, "%Y-%m-%d")[:3]) + if sys.version_info[0] >= 3: + dateparser = lambda s : date(*time.strptime(s.decode('latin1'), + "%Y-%m-%d")[:3]) + else: + dateparser = lambda s : date(*time.strptime(s, "%Y-%m-%d")[:3]) StringConverter.upgrade_mapper(dateparser, date(2000,1,1)) convert = StringConverter(dateparser, date(2000, 1, 1)) test = convert('2001-01-01') @@ -182,25 +194,28 @@ # def test_keep_default(self): "Make sure we don't lose an explicit default" - converter = StringConverter(None, missing_values='', default=-999) - converter.upgrade('3.14159265') + converter = StringConverter(None, missing_values=asbytes(''), + default=-999) + converter.upgrade(asbytes('3.14159265')) assert_equal(converter.default, -999) assert_equal(converter.type, np.dtype(float)) # - converter = StringConverter(None, missing_values='', default=0) - converter.upgrade('3.14159265') + converter = StringConverter(None, missing_values=asbytes(''), default=0) + converter.upgrade(asbytes('3.14159265')) assert_equal(converter.default, 0) assert_equal(converter.type, np.dtype(float)) # def test_keep_default_zero(self): "Check that we don't lose a default of 0" - converter = StringConverter(int, default=0, missing_values="N/A") + converter = StringConverter(int, default=0, + missing_values=asbytes("N/A")) assert_equal(converter.default, 0) # def test_keep_missing_values(self): "Check that we're not losing missing values" - converter = StringConverter(int, default=0, missing_values="N/A") - assert_equal(converter.missing_values, set(['', 'N/A'])) + converter = StringConverter(int, default=0, + missing_values=asbytes("N/A")) + assert_equal(converter.missing_values, set(asbytes_nested(['', 'N/A']))) #------------------------------------------------------------------------------- Modified: trunk/numpy/lib/tests/test_io.py =================================================================== --- trunk/numpy/lib/tests/test_io.py 2010-02-20 18:16:52 UTC (rev 8178) +++ trunk/numpy/lib/tests/test_io.py 2010-02-20 18:17:14 UTC (rev 8179) @@ -5,11 +5,6 @@ import sys -if sys.version_info[0] >= 3: - from io import BytesIO as StringIO -else: - from StringIO import StringIO - import gzip import os import threading @@ -20,7 +15,14 @@ from numpy.lib._iotools import ConverterError, ConverterLockError, \ ConversionWarning +from numpy.compat import asbytes +if sys.version_info[0] >= 3: + from io import BytesIO + def StringIO(s=""): + return BytesIO(asbytes(s)) +else: + from StringIO import StringIO MAJVER, MINVER = sys.version_info[:2] @@ -193,7 +195,7 @@ def test_delimiter(self): a = np.array([[1., 2.], [3., 4.]]) c = StringIO() - np.savetxt(c, a, delimiter=',', fmt='%d') + np.savetxt(c, a, delimiter=asbytes(','), fmt='%d') c.seek(0) assert_equal(c.readlines(), ['1,2\n', '3,4\n']) @@ -440,7 +442,7 @@ # def test_record(self): "Test w/ explicit dtype" - data = StringIO('1 2\n3 4') + data = StringIO(asbytes('1 2\n3 4')) # data.seek(0) test = np.ndfromtxt(data, dtype=[('x', np.int32), ('y', np.int32)]) control = np.array([(1, 2), (3, 4)], dtype=[('x', 'i4'), ('y', 'i4')]) @@ -476,7 +478,7 @@ assert_array_equal(test, control) # data = StringIO('1,2,3,4\n') - test = np.ndfromtxt(data, dtype=int, delimiter=',') + test = np.ndfromtxt(data, dtype=int, delimiter=asbytes(',')) assert_array_equal(test, control) def test_comments(self): @@ -484,17 +486,17 @@ control = np.array([1, 2, 3, 5], int) # Comment on its own line data = StringIO('# comment\n1,2,3,5\n') - test = np.ndfromtxt(data, dtype=int, delimiter=',', comments='#') + test = np.ndfromtxt(data, dtype=int, delimiter=asbytes(','), comments=asbytes('#')) assert_equal(test, control) # Comment at the end of a line data = StringIO('1,2,3,5# comment\n') - test = np.ndfromtxt(data, dtype=int, delimiter=',', comments='#') + test = np.ndfromtxt(data, dtype=int, delimiter=asbytes(','), comments=asbytes('#')) assert_equal(test, control) def test_skiprows(self): "Test row skipping" control = np.array([1, 2, 3, 5], int) - kwargs = dict(dtype=int, delimiter=',') + kwargs = dict(dtype=int, delimiter=asbytes(',')) # data = StringIO('comment\n1,2,3,5\n') test = np.ndfromtxt(data, skip_header=1, **kwargs) @@ -510,7 +512,7 @@ data.extend(["%i,%3.1f,%03s" % (i, i, i) for i in range(51)]) data[-1] = "99,99" kwargs = dict(delimiter=",", names=True, skip_header=5, skip_footer=10) - test = np.genfromtxt(StringIO("\n".join(data)), **kwargs) + test = np.genfromtxt(StringIO(asbytes("\n".join(data))), **kwargs) ctrl = np.array([("%f" % i, "%f" % i, "%f" % i) for i in range(40)], dtype=[(_, float) for _ in "ABC"]) assert_equal(test, ctrl) From numpy-svn at scipy.org Sat Feb 20 13:17:29 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:17:29 -0600 (CST) Subject: [Numpy-svn] r8180 - trunk/numpy/lib Message-ID: <20100220181729.7A8C5C7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:17:29 -0600 (Sat, 20 Feb 2010) New Revision: 8180 Modified: trunk/numpy/lib/io.py Log: 3K: lib: fix savetxt This will make savetxt open files in the 'wb' mode on Python 3. To allow using any sort of newlines (which are different e.g. on Windows), add a new 'newline' keyword. Modified: trunk/numpy/lib/io.py =================================================================== --- trunk/numpy/lib/io.py 2010-02-20 18:17:14 UTC (rev 8179) +++ trunk/numpy/lib/io.py 2010-02-20 18:17:29 UTC (rev 8180) @@ -10,6 +10,7 @@ import format import cStringIO import os +import sys import itertools import warnings from operator import itemgetter @@ -23,7 +24,7 @@ _is_string_like, has_nested_fields, flatten_dtype, \ easy_dtype, _bytes_to_name -from numpy.compat import asbytes +from numpy.compat import asbytes, asstr _file = open _string_like = _is_string_like @@ -676,7 +677,7 @@ return X -def savetxt(fname, X, fmt='%.18e', delimiter=' '): +def savetxt(fname, X, fmt='%.18e', delimiter=' ', newline='\n'): """ Save an array to a text file. @@ -694,7 +695,12 @@ case `delimiter` is ignored. delimiter : str Character separating columns. + newline : str + .. versionadded:: 2.0 + Character separating lines. + + See Also -------- save : Save an array to a binary file in NumPy ``.npy`` format @@ -761,12 +767,20 @@ """ + # Py3 conversions first + if isinstance(format, bytes): + format = asstr(format) + delimiter = asbytes(delimiter) + if _is_string_like(fname): if fname.endswith('.gz'): import gzip fh = gzip.open(fname, 'wb') else: - fh = file(fname, 'w') + if sys.version_info[0] >= 3: + fh = file(fname, 'wb') + else: + fh = file(fname, 'w') elif hasattr(fname, 'seek'): fh = fname else: @@ -792,7 +806,7 @@ if type(fmt) in (list, tuple): if len(fmt) != ncol: raise AttributeError('fmt has wrong shape. %s' % str(fmt)) - format = delimiter.join(fmt) + format = asstr(delimiter).join(map(asstr, fmt)) elif type(fmt) is str: if fmt.count('%') == 1: fmt = [fmt, ]*ncol @@ -804,7 +818,7 @@ format = fmt for row in X: - fh.write(format % tuple(row) + '\n') + fh.write(asbytes(format % tuple(row) + newline)) import re def fromregex(file, regexp, dtype): @@ -1355,11 +1369,11 @@ # rows[i] = tuple([convert(val) # for (convert, val) in zip(conversionfuncs, vals)]) if loose: - rows = zip(*(map(converter._loose_call, map(itemgetter(i), rows)) - for (i, converter) in enumerate(converters))) + rows = zip(*[map(converter._loose_call, map(itemgetter(i), rows)) + for (i, converter) in enumerate(converters)]) else: - rows = zip(*(map(converter._strict_call, map(itemgetter(i), rows)) - for (i, converter) in enumerate(converters))) + rows = zip(*[map(converter._strict_call, map(itemgetter(i), rows)) + for (i, converter) in enumerate(converters)]) # Reset the dtype data = rows if dtype is None: From numpy-svn at scipy.org Sat Feb 20 13:17:51 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:17:51 -0600 (CST) Subject: [Numpy-svn] r8181 - trunk/numpy/compat Message-ID: <20100220181751.8FB2DC7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:17:51 -0600 (Sat, 20 Feb 2010) New Revision: 8181 Modified: trunk/numpy/compat/py3k.py Log: ENH: compat: additional Py3 convenience functions Modified: trunk/numpy/compat/py3k.py =================================================================== --- trunk/numpy/compat/py3k.py 2010-02-20 18:17:29 UTC (rev 8180) +++ trunk/numpy/compat/py3k.py 2010-02-20 18:17:51 UTC (rev 8181) @@ -4,7 +4,8 @@ """ __all__ = ['bytes', 'asbytes', 'isfileobj', 'getexception', 'strchar', - 'unicode', 'asunicode', 'asbytes_nested', 'asunicode_nested'] + 'unicode', 'asunicode', 'asbytes_nested', 'asunicode_nested', + 'asstr'] import sys @@ -16,7 +17,11 @@ def asbytes(s): if isinstance(s, bytes): return s - return s.encode('iso-8859-1') + return s.encode('latin1') + def asstr(s): + if isinstance(s, str): + return s + return bytes.decode('latin1') def isfileobj(f): return isinstance(f, io.FileIO) strchar = 'U' @@ -24,13 +29,14 @@ bytes = str unicode = unicode asbytes = str + asstr = str strchar = 'S' def isfileobj(f): return isinstance(f, file) def asunicode(s): if isinstance(s, unicode): return s - return s.decode('iso-8859-1') + return s.decode('ascii') def getexception(): return sys.exc_info()[1] From numpy-svn at scipy.org Sat Feb 20 13:18:18 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:18:18 -0600 (CST) Subject: [Numpy-svn] r8182 - in trunk/numpy: compat lib lib/tests Message-ID: <20100220181818.C4207C7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:18:18 -0600 (Sat, 20 Feb 2010) New Revision: 8182 Modified: trunk/numpy/compat/py3k.py trunk/numpy/lib/_iotools.py trunk/numpy/lib/io.py trunk/numpy/lib/tests/test__iotools.py trunk/numpy/lib/tests/test_io.py Log: 3K: lib: more str vs bytes issues in the lib/io loadtxt, savetxt and genfromtxt Modified: trunk/numpy/compat/py3k.py =================================================================== --- trunk/numpy/compat/py3k.py 2010-02-20 18:17:51 UTC (rev 8181) +++ trunk/numpy/compat/py3k.py 2010-02-20 18:18:18 UTC (rev 8182) @@ -21,7 +21,7 @@ def asstr(s): if isinstance(s, str): return s - return bytes.decode('latin1') + return s.decode('latin1') def isfileobj(f): return isinstance(f, io.FileIO) strchar = 'U' Modified: trunk/numpy/lib/_iotools.py =================================================================== --- trunk/numpy/lib/_iotools.py 2010-02-20 18:17:51 UTC (rev 8181) +++ trunk/numpy/lib/_iotools.py 2010-02-20 18:18:18 UTC (rev 8182) @@ -6,7 +6,7 @@ import numpy.core.numeric as nx from __builtin__ import bool, int, long, float, complex, object, unicode, str -from numpy.compat import asbytes, bytes +from numpy.compat import asbytes, bytes, asbytes_nested if sys.version_info[0] >= 3: def _bytes_to_complex(s): @@ -542,6 +542,11 @@ # def __init__(self, dtype_or_func=None, default=None, missing_values=None, locked=False): + # Convert unicode (for Py3) + if isinstance(missing_values, unicode): + missing_values = asbytes(missing_values) + elif isinstance(missing_values, (list, tuple)): + missing_values = asbytes_nested(missing_values) # Defines a lock for upgrade self._locked = bool(locked) # No input dtype: minimal initialization @@ -566,7 +571,7 @@ # If we don't have a default, try to guess it or set it to None if default is None: try: - default = self.func('0') + default = self.func(asbytes('0')) except ValueError: default = None ttype = self._getsubdtype(default) @@ -729,7 +734,7 @@ self.type = self._getsubdtype(default) else: try: - tester = func('1') + tester = func(asbytes('1')) except (TypeError, ValueError): tester = None self.type = self._getsubdtype(tester) Modified: trunk/numpy/lib/io.py =================================================================== --- trunk/numpy/lib/io.py 2010-02-20 18:17:51 UTC (rev 8181) +++ trunk/numpy/lib/io.py 2010-02-20 18:18:18 UTC (rev 8182) @@ -8,7 +8,7 @@ import numpy as np import format -import cStringIO +import sys import os import sys import itertools @@ -24,8 +24,14 @@ _is_string_like, has_nested_fields, flatten_dtype, \ easy_dtype, _bytes_to_name -from numpy.compat import asbytes, asstr +from numpy.compat import asbytes, asstr, asbytes_nested +if sys.version_info[0] >= 3: + import io + BytesIO = io.BytesIO +else: + from cStringIO import StringIO as BytesIO + _file = open _string_like = _is_string_like @@ -34,7 +40,7 @@ import on gzip. """ - import gzip, new + import gzip def seek(self, offset, whence=0): # figure out new position (we can only seek forwards) @@ -58,8 +64,14 @@ if isinstance(f, str): f = gzip.GzipFile(f) - f.seek = new.instancemethod(seek, f) - f.tell = new.instancemethod(tell, f) + if sys.version_info[0] >= 3: + import types + f.seek = types.MethodType(seek, f) + f.tell = types.MethodType(tell, f) + else: + import new + f.seek = new.instancemethod(seek, f) + f.tell = new.instancemethod(tell, f) return f @@ -180,7 +192,7 @@ if member: bytes = self.zip.read(key) if bytes.startswith(format.MAGIC_PREFIX): - value = cStringIO.StringIO(bytes) + value = BytesIO(bytes) return format.read_array(value) else: return bytes @@ -474,12 +486,14 @@ return float elif issubclass(typ, np.complex): return complex + elif issubclass(typ, np.bytes_): + return bytes else: return str -def loadtxt(fname, dtype=float, comments=asbytes('#'), delimiter=None, +def loadtxt(fname, dtype=float, comments='#', delimiter=None, converters=None, skiprows=0, usecols=None, unpack=False): """ Load data from a text file. @@ -555,6 +569,11 @@ array([ 2., 4.]) """ + # Type conversions for Py3 convenience + comments = asbytes(comments) + if delimiter is not None: + delimiter = asbytes(delimiter) + user_converters = converters if usecols is not None: @@ -768,9 +787,9 @@ """ # Py3 conversions first - if isinstance(format, bytes): - format = asstr(format) - delimiter = asbytes(delimiter) + if isinstance(fmt, bytes): + fmt = asstr(fmt) + delimiter = asstr(delimiter) if _is_string_like(fname): if fname.endswith('.gz'): @@ -877,9 +896,9 @@ """ if not hasattr(file, "read"): - file = open(file, 'r') + file = open(file, 'rb') if not hasattr(regexp, 'match'): - regexp = re.compile(regexp) + regexp = re.compile(asbytes(regexp)) if not isinstance(dtype, np.dtype): dtype = np.dtype(dtype) @@ -905,9 +924,9 @@ -def genfromtxt(fname, dtype=float, comments=asbytes('#'), delimiter=None, +def genfromtxt(fname, dtype=float, comments='#', delimiter=None, skiprows=0, skip_header=0, skip_footer=0, converters=None, - missing=asbytes(''), missing_values=None, filling_values=None, + missing='', missing_values=None, filling_values=None, usecols=None, names=None, excludelist=None, deletechars=None, autostrip=False, case_sensitive=True, defaultfmt="f%i", unpack=None, usemask=False, loose=True, invalid_raise=True): @@ -1042,6 +1061,15 @@ dtype=[('intvar', '= 3: + return date(*time.strptime(s.decode('latin1'), "%Y-%m-%d")[:3]) + else: + return date(*time.strptime(s, "%Y-%m-%d")[:3]) + class TestStringConverter(TestCase): "Test StringConverter" # @@ -168,27 +177,19 @@ # def test_upgrademapper(self): "Tests updatemapper" - from datetime import date - import time - if sys.version_info[0] >= 3: - dateparser = lambda s : date(*time.strptime(s.decode('latin1'), - "%Y-%m-%d")[:3]) - else: - dateparser = lambda s : date(*time.strptime(s, "%Y-%m-%d")[:3]) + dateparser = _bytes_to_date StringConverter.upgrade_mapper(dateparser, date(2000,1,1)) convert = StringConverter(dateparser, date(2000, 1, 1)) - test = convert('2001-01-01') + test = convert(asbytes('2001-01-01')) assert_equal(test, date(2001, 01, 01)) - test = convert('2009-01-01') + test = convert(asbytes('2009-01-01')) assert_equal(test, date(2009, 01, 01)) - test = convert('') + test = convert(asbytes('')) assert_equal(test, date(2000, 01, 01)) # def test_string_to_object(self): "Make sure that string-to-object functions are properly recognized" - from datetime import date - import time - conv = StringConverter(lambda s: date(*(time.strptime(s)[:3]))) + conv = StringConverter(_bytes_to_date) assert_equal(conv._mapper[-2][0](0), 0j) assert(hasattr(conv, 'default')) # Modified: trunk/numpy/lib/tests/test_io.py =================================================================== --- trunk/numpy/lib/tests/test_io.py 2010-02-20 18:17:51 UTC (rev 8181) +++ trunk/numpy/lib/tests/test_io.py 2010-02-20 18:18:18 UTC (rev 8182) @@ -15,7 +15,7 @@ from numpy.lib._iotools import ConverterError, ConverterLockError, \ ConversionWarning -from numpy.compat import asbytes +from numpy.compat import asbytes, asbytes_nested if sys.version_info[0] >= 3: from io import BytesIO @@ -31,7 +31,10 @@ from Python >= 2.5. """ - return datetime(*time.strptime(s, fmt)[:3]) + if sys.version_info[0] >= 3: + return datetime(*time.strptime(s.decode('latin1'), fmt)[:3]) + else: + return datetime(*time.strptime(s, fmt)[:3]) class RoundtripTest(object): def roundtrip(self, save_func, *args, **kwargs): @@ -175,7 +178,7 @@ c = StringIO() np.savetxt(c, a, fmt='%d') c.seek(0) - assert_equal(c.readlines(), ['1 2\n', '3 4\n']) + assert_equal(c.readlines(), asbytes_nested(['1 2\n', '3 4\n'])) def test_1D(self): a = np.array([1, 2, 3, 4], int) @@ -190,7 +193,7 @@ c = StringIO() np.savetxt(c, a, fmt='%d') c.seek(0) - assert_equal(c.readlines(), ['1 2\n', '3 4\n']) + assert_equal(c.readlines(), asbytes_nested(['1 2\n', '3 4\n'])) def test_delimiter(self): a = np.array([[1., 2.], [3., 4.]]) @@ -205,34 +208,34 @@ # Sequence of formats np.savetxt(c, a, fmt=['%02d', '%3.1f']) c.seek(0) - assert_equal(c.readlines(), ['01 2.0\n', '03 4.0\n']) + assert_equal(c.readlines(), asbytes_nested(['01 2.0\n', '03 4.0\n'])) # A single multiformat string c = StringIO() np.savetxt(c, a, fmt='%02d : %3.1f') c.seek(0) lines = c.readlines() - assert_equal(lines, ['01 : 2.0\n', '03 : 4.0\n']) + assert_equal(lines, asbytes_nested(['01 : 2.0\n', '03 : 4.0\n'])) # Specify delimiter, should be overiden c = StringIO() np.savetxt(c, a, fmt='%02d : %3.1f', delimiter=',') c.seek(0) lines = c.readlines() - assert_equal(lines, ['01 : 2.0\n', '03 : 4.0\n']) + assert_equal(lines, asbytes_nested(['01 : 2.0\n', '03 : 4.0\n'])) class TestLoadTxt(TestCase): def test_record(self): c = StringIO() - c.write('1 2\n3 4') + c.write(asbytes('1 2\n3 4')) c.seek(0) x = np.loadtxt(c, dtype=[('x', np.int32), ('y', np.int32)]) a = np.array([(1, 2), (3, 4)], dtype=[('x', 'i4'), ('y', 'i4')]) assert_array_equal(x, a) d = StringIO() - d.write('M 64.0 75.0\nF 25.0 60.0') + d.write(asbytes('M 64.0 75.0\nF 25.0 60.0')) d.seek(0) mydescriptor = {'names': ('gender', 'age', 'weight'), 'formats': ('S1', @@ -244,7 +247,7 @@ def test_array(self): c = StringIO() - c.write('1 2\n3 4') + c.write(asbytes('1 2\n3 4')) c.seek(0) x = np.loadtxt(c, dtype=int) @@ -258,14 +261,14 @@ def test_1D(self): c = StringIO() - c.write('1\n2\n3\n4\n') + c.write(asbytes('1\n2\n3\n4\n')) c.seek(0) x = np.loadtxt(c, dtype=int) a = np.array([1, 2, 3, 4], int) assert_array_equal(x, a) c = StringIO() - c.write('1,2,3,4\n') + c.write(asbytes('1,2,3,4\n')) c.seek(0) x = np.loadtxt(c, dtype=int, delimiter=',') a = np.array([1, 2, 3, 4], int) @@ -273,7 +276,7 @@ def test_missing(self): c = StringIO() - c.write('1,2,3,,5\n') + c.write(asbytes('1,2,3,,5\n')) c.seek(0) x = np.loadtxt(c, dtype=int, delimiter=',', \ converters={3:lambda s: int(s or - 999)}) @@ -282,7 +285,7 @@ def test_converters_with_usecols(self): c = StringIO() - c.write('1,2,3,,5\n6,7,8,9,10\n') + c.write(asbytes('1,2,3,,5\n6,7,8,9,10\n')) c.seek(0) x = np.loadtxt(c, dtype=int, delimiter=',', \ converters={3:lambda s: int(s or - 999)}, \ @@ -292,7 +295,7 @@ def test_comments(self): c = StringIO() - c.write('# comment\n1,2,3,5\n') + c.write(asbytes('# comment\n1,2,3,5\n')) c.seek(0) x = np.loadtxt(c, dtype=int, delimiter=',', \ comments='#') @@ -301,7 +304,7 @@ def test_skiprows(self): c = StringIO() - c.write('comment\n1,2,3,5\n') + c.write(asbytes('comment\n1,2,3,5\n')) c.seek(0) x = np.loadtxt(c, dtype=int, delimiter=',', \ skiprows=1) @@ -309,7 +312,7 @@ assert_array_equal(x, a) c = StringIO() - c.write('# comment\n1,2,3,5\n') + c.write(asbytes('# comment\n1,2,3,5\n')) c.seek(0) x = np.loadtxt(c, dtype=int, delimiter=',', \ skiprows=1) @@ -344,12 +347,12 @@ names = ['stid', 'temp'] dtypes = ['S4', 'f8'] arr = np.loadtxt(c, usecols=(0, 2), dtype=zip(names, dtypes)) - assert_equal(arr['stid'], ["JOE", "BOB"]) + assert_equal(arr['stid'], asbytes_nested(["JOE", "BOB"])) assert_equal(arr['temp'], [25.3, 27.9]) def test_fancy_dtype(self): c = StringIO() - c.write('1,2,3.0\n4,5,6.0\n') + c.write(asbytes('1,2,3.0\n4,5,6.0\n')) c.seek(0) dt = np.dtype([('x', int), ('y', [('t', int), ('s', float)])]) x = np.loadtxt(c, dtype=dt, delimiter=',') @@ -371,7 +374,7 @@ def test_unused_converter(self): c = StringIO() - c.writelines(['1 21\n', '3 42\n']) + c.writelines([asbytes('1 21\n'), asbytes('3 42\n')]) c.seek(0) data = np.loadtxt(c, usecols=(1,), converters={0: lambda s: int(s, 16)}) @@ -404,7 +407,7 @@ class Testfromregex(TestCase): def test_record(self): c = StringIO() - c.write('1.312 foo\n1.534 bar\n4.444 qux') + c.write(asbytes('1.312 foo\n1.534 bar\n4.444 qux')) c.seek(0) dt = [('num', np.float64), ('val', 'S3')] @@ -415,7 +418,7 @@ def test_record_2(self): c = StringIO() - c.write('1312 foo\n1534 bar\n4444 qux') + c.write(asbytes('1312 foo\n1534 bar\n4444 qux')) c.seek(0) dt = [('num', np.int32), ('val', 'S3')] @@ -426,7 +429,7 @@ def test_record_3(self): c = StringIO() - c.write('1312 foo\n1534 bar\n4444 qux') + c.write(asbytes('1312 foo\n1534 bar\n4444 qux')) c.seek(0) dt = [('num', np.float64)] @@ -521,7 +524,7 @@ "Test retrieving a header" data = StringIO('gender age weight\nM 64.0 75.0\nF 25.0 60.0') test = np.ndfromtxt(data, dtype=None, names=True) - control = {'gender': np.array(['M', 'F']), + control = {'gender': np.array(asbytes_nested(['M', 'F'])), 'age': np.array([64.0, 25.0]), 'weight': np.array([75.0, 60.0])} assert_equal(test['gender'], control['gender']) @@ -532,7 +535,7 @@ "Test the automatic definition of the output dtype" data = StringIO('A 64 75.0 3+4j True\nBCD 25 60.0 5+6j False') test = np.ndfromtxt(data, dtype=None) - control = [np.array(['A', 'BCD']), + control = [np.array(asbytes_nested(['A', 'BCD'])), np.array([64, 25]), np.array([75.0, 60.0]), np.array([3 + 4j, 5 + 6j]), @@ -649,10 +652,10 @@ def test_invalid_converter(self): - strip_rand = lambda x : float(('r' in x.lower() and x.split()[-1]) or - (not 'r' in x.lower() and x.strip() or 0.0)) - strip_per = lambda x : float(('%' in x.lower() and x.split()[0]) or - (not '%' in x.lower() and x.strip() or 0.0)) + strip_rand = lambda x : float((asbytes('r') in x.lower() and x.split()[-1]) or + (not asbytes('r') in x.lower() and x.strip() or 0.0)) + strip_per = lambda x : float((asbytes('%') in x.lower() and x.split()[0]) or + (not asbytes('%') in x.lower() and x.strip() or 0.0)) s = StringIO("D01N01,10/1/2003 ,1 %,R 75,400,600\r\n" \ "L24U05,12/5/2003, 2 %,1,300, 150.5\r\n" "D02N03,10/10/2004,R 1,,7,145.55") @@ -678,10 +681,10 @@ "Test using an explicit dtype with an object" from datetime import date import time - data = """ + data = asbytes(""" 1; 2001-01-01 2; 2002-01-31 - """ + """) ndtype = [('idx', int), ('code', np.object)] func = lambda s: strptime(s.strip(), "%Y-%m-%d") converters = {1: func} @@ -775,7 +778,7 @@ names = ['stid', 'temp'] dtypes = ['S4', 'f8'] test = np.ndfromtxt(data, usecols=(0, 2), dtype=zip(names, dtypes)) - assert_equal(test['stid'], ["JOE", "BOB"]) + assert_equal(test['stid'], asbytes_nested(["JOE", "BOB"])) assert_equal(test['temp'], [25.3, 27.9]) def test_usecols_with_integer(self): @@ -1153,7 +1156,7 @@ # which is then read from by the loadtxt function s = StringIO() g = gzip.GzipFile(fileobj=s, mode='w') - g.write('1 2 3\n') + g.write(asbytes('1 2 3\n')) g.close() s.seek(0) @@ -1169,7 +1172,7 @@ def test_gzip_loadtxt_from_string(): s = StringIO() f = gzip.GzipFile(fileobj=s, mode="w") - f.write('1 2 3\n') + f.write(asbytes('1 2 3\n')) f.close() s.seek(0) From numpy-svn at scipy.org Sat Feb 20 13:18:36 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:18:36 -0600 (CST) Subject: [Numpy-svn] r8183 - in trunk/numpy/core: blasdot src Message-ID: <20100220181836.E1AC3C7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:18:36 -0600 (Sat, 20 Feb 2010) New Revision: 8183 Modified: trunk/numpy/core/blasdot/_dotblas.c trunk/numpy/core/src/scalarmathmodule.c.src Log: 3K: Some remaining Py_TYPE issues Modified: trunk/numpy/core/blasdot/_dotblas.c =================================================================== --- trunk/numpy/core/blasdot/_dotblas.c 2010-02-20 18:18:18 UTC (rev 8182) +++ trunk/numpy/core/blasdot/_dotblas.c 2010-02-20 18:18:36 UTC (rev 8183) @@ -401,7 +401,7 @@ } /* Choose which subtype to return */ - if (Py_Type(ap1) != Py_Type(ap2)) { + if (Py_TYPE(ap1) != Py_TYPE(ap2)) { prior2 = PyArray_GetPriority((PyObject *)ap2, 0.0); prior1 = PyArray_GetPriority((PyObject *)ap1, 0.0); subtype = (prior2 > prior1 ? Py_TYPE(ap2) : Py_TYPE(ap1)); Modified: trunk/numpy/core/src/scalarmathmodule.c.src =================================================================== --- trunk/numpy/core/src/scalarmathmodule.c.src 2010-02-20 18:18:18 UTC (rev 8182) +++ trunk/numpy/core/src/scalarmathmodule.c.src 2010-02-20 18:18:36 UTC (rev 8183) @@ -556,7 +556,7 @@ if (!PyArray_IsScalar(a, Number)) { return -1; } - descr1 = PyArray_DescrFromTypeObject((PyObject *)(a->ob_type)); + descr1 = PyArray_DescrFromTypeObject((PyObject *)Py_TYPE(a)); if (PyArray_CanCastSafely(descr1->type_num, PyArray_ at NAME@)) { PyArray_CastScalarDirect(a, descr1, arg1, PyArray_ at NAME@); Py_DECREF(descr1); From numpy-svn at scipy.org Sat Feb 20 13:18:53 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:18:53 -0600 (CST) Subject: [Numpy-svn] r8184 - trunk/numpy/core/src/multiarray Message-ID: <20100220181853.878F9C7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:18:53 -0600 (Sat, 20 Feb 2010) New Revision: 8184 Modified: trunk/numpy/core/src/multiarray/common.c Log: 3K: core: fix single-file compilation Modified: trunk/numpy/core/src/multiarray/common.c =================================================================== --- trunk/numpy/core/src/multiarray/common.c 2010-02-20 18:18:36 UTC (rev 8183) +++ trunk/numpy/core/src/multiarray/common.c 2010-02-20 18:18:53 UTC (rev 8184) @@ -11,6 +11,7 @@ #include "usertypes.h" #include "common.h" +#include "buffer.h" /* * new reference From numpy-svn at scipy.org Sat Feb 20 13:19:08 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:19:08 -0600 (CST) Subject: [Numpy-svn] r8185 - trunk/numpy/lib Message-ID: <20100220181908.1EB33C7C09D@scipy.org> Author: ptvirtan Date: 2010-02-20 12:19:07 -0600 (Sat, 20 Feb 2010) New Revision: 8185 Modified: trunk/numpy/lib/io.py Log: BUG: lib: ensure 'bytes' is imported in io.py Modified: trunk/numpy/lib/io.py =================================================================== --- trunk/numpy/lib/io.py 2010-02-20 18:18:53 UTC (rev 8184) +++ trunk/numpy/lib/io.py 2010-02-20 18:19:07 UTC (rev 8185) @@ -24,7 +24,7 @@ _is_string_like, has_nested_fields, flatten_dtype, \ easy_dtype, _bytes_to_name -from numpy.compat import asbytes, asstr, asbytes_nested +from numpy.compat import asbytes, asstr, asbytes_nested, bytes if sys.version_info[0] >= 3: import io From numpy-svn at scipy.org Sat Feb 20 13:19:24 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:19:24 -0600 (CST) Subject: [Numpy-svn] r8186 - trunk/numpy/core/src/multiarray Message-ID: <20100220181924.9CEF9C7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:19:24 -0600 (Sat, 20 Feb 2010) New Revision: 8186 Modified: trunk/numpy/core/src/multiarray/multiarraymodule_onefile.c Log: BUG: another single-file compilation fix Modified: trunk/numpy/core/src/multiarray/multiarraymodule_onefile.c =================================================================== --- trunk/numpy/core/src/multiarray/multiarraymodule_onefile.c 2010-02-20 18:19:07 UTC (rev 8185) +++ trunk/numpy/core/src/multiarray/multiarraymodule_onefile.c 2010-02-20 18:19:24 UTC (rev 8186) @@ -42,4 +42,6 @@ #include "arrayobject.c" +#include "numpymemoryview.c" + #include "multiarraymodule.c" From numpy-svn at scipy.org Sat Feb 20 13:19:37 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:19:37 -0600 (CST) Subject: [Numpy-svn] r8187 - trunk/tools Message-ID: <20100220181937.BFC03C7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:19:37 -0600 (Sat, 20 Feb 2010) New Revision: 8187 Modified: trunk/tools/py3tool.py Log: 3K: py3tool: use lib2to3 for the conversions This ensures that the Py3 version of 2to3 is always used, and that failures in conversion result to an immediate build failure. Modified: trunk/tools/py3tool.py =================================================================== --- trunk/tools/py3tool.py 2010-02-20 18:19:24 UTC (rev 8186) +++ trunk/tools/py3tool.py 2010-02-20 18:19:37 UTC (rev 8187) @@ -29,6 +29,8 @@ BASE = os.path.normpath(os.path.join(os.path.dirname(__file__), '..')) TEMP = os.path.normpath(os.path.join(BASE, '_py3k')) +SCRIPT_2TO3 = os.path.join(BASE, 'tools', '2to3.py') + EXTRA_2TO3_FLAGS = { '*/setup.py': '-x import', 'numpy/core/code_generators/generate_umath.py': '-x import', @@ -36,6 +38,7 @@ 'numpy/core/code_generators/generate_ufunc_api.py': '-x import', 'numpy/core/defchararray.py': '-x unicode', 'numpy/compat/py3k.py': '-x unicode', + 'numpy/ma/timer_comparison.py': 'skip', } def main(): @@ -192,6 +195,9 @@ yield root1, root2, dirs, files def sync_2to3(src, dst, patchfile=None, clean=False): + import lib2to3.main + from io import StringIO + to_convert = [] for src_dir, dst_dir, dirs, files in walk_sync(src, dst): @@ -253,9 +259,16 @@ p = open(os.devnull, 'wb') for flags, filenames in flag_sets.items(): - subprocess.call(['2to3', '-w'] + flags.split() + filenames, - stdout=p) + if flags == 'skip': + continue + _old_stdout = sys.stdout + try: + sys.stdout = StringIO() + lib2to3.main.main("lib2to3.fixes", ['-w'] + flags.split()+filenames) + finally: + sys.stdout = _old_stdout + for fn, dst_fn in to_convert: # perform custom mangling custom_mangling(dst_fn) From numpy-svn at scipy.org Sat Feb 20 13:20:10 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:20:10 -0600 (CST) Subject: [Numpy-svn] r8188 - in trunk: numpy/core numpy/distutils numpy/f2py numpy/lib numpy/lib/tests numpy/ma numpy/ma/tests numpy/oldnumeric tools Message-ID: <20100220182010.4D529C7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:20:10 -0600 (Sat, 20 Feb 2010) New Revision: 8188 Modified: trunk/numpy/core/arrayprint.py trunk/numpy/distutils/system_info.py trunk/numpy/f2py/auxfuncs.py trunk/numpy/lib/arrayterator.py trunk/numpy/lib/tests/test_arrayterator.py trunk/numpy/ma/core.py trunk/numpy/ma/tests/test_core.py trunk/numpy/ma/tests/test_old_ma.py trunk/numpy/ma/timer_comparison.py trunk/numpy/oldnumeric/ma.py trunk/tools/py3tool.py Log: 3K: BUG: work around bugs in Python 3.1.1 2to3 by not using fixes_reduce Instead, manually import reduce where necessary. Modified: trunk/numpy/core/arrayprint.py =================================================================== --- trunk/numpy/core/arrayprint.py 2010-02-20 18:19:37 UTC (rev 8187) +++ trunk/numpy/core/arrayprint.py 2010-02-20 18:20:10 UTC (rev 8188) @@ -29,6 +29,8 @@ _nan_str = 'NaN' _inf_str = 'Inf' +if sys.version_info[0] >= 3: + from functools import reduce def set_printoptions(precision=None, threshold=None, edgeitems=None, linewidth=None, suppress=None, Modified: trunk/numpy/distutils/system_info.py =================================================================== --- trunk/numpy/distutils/system_info.py 2010-02-20 18:19:37 UTC (rev 8187) +++ trunk/numpy/distutils/system_info.py 2010-02-20 18:20:10 UTC (rev 8188) @@ -132,6 +132,9 @@ from numpy.distutils.command.config import config as cmd_config from numpy.distutils.compat import get_exception +if sys.version_info[0] >= 3: + from functools import reduce + # Determine number of bits import platform _bits = {'32bit':32,'64bit':64} Modified: trunk/numpy/f2py/auxfuncs.py =================================================================== --- trunk/numpy/f2py/auxfuncs.py 2010-02-20 18:19:37 UTC (rev 8187) +++ trunk/numpy/f2py/auxfuncs.py 2010-02-20 18:20:10 UTC (rev 8188) @@ -32,6 +32,9 @@ debugoptions=[] wrapfuncs = 1 +if sys.version_info[0] >= 3: + from functools import reduce + def outmess(t): if options.get('verbose',1): sys.stdout.write(t) Modified: trunk/numpy/lib/arrayterator.py =================================================================== --- trunk/numpy/lib/arrayterator.py 2010-02-20 18:19:37 UTC (rev 8187) +++ trunk/numpy/lib/arrayterator.py 2010-02-20 18:20:10 UTC (rev 8188) @@ -14,6 +14,10 @@ __all__ = ['Arrayterator'] +import sys +if sys.version_info[0] >= 3: + from functools import reduce + class Arrayterator(object): """ Buffered iterator for big arrays. Modified: trunk/numpy/lib/tests/test_arrayterator.py =================================================================== --- trunk/numpy/lib/tests/test_arrayterator.py 2010-02-20 18:19:37 UTC (rev 8187) +++ trunk/numpy/lib/tests/test_arrayterator.py 2010-02-20 18:20:10 UTC (rev 8188) @@ -4,6 +4,10 @@ from numpy.random import randint from numpy.lib import Arrayterator +import sys +if sys.version_info[0] >= 3: + from functools import reduce + def test(): np.random.seed(np.arange(10)) Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2010-02-20 18:19:37 UTC (rev 8187) +++ trunk/numpy/ma/core.py 2010-02-20 18:20:10 UTC (rev 8188) @@ -79,6 +79,9 @@ from numpy import expand_dims as n_expand_dims import warnings +import sys +if sys.version_info[0] >= 3: + from functools import reduce MaskType = np.bool_ nomask = MaskType(0) Modified: trunk/numpy/ma/tests/test_core.py =================================================================== --- trunk/numpy/ma/tests/test_core.py 2010-02-20 18:19:37 UTC (rev 8187) +++ trunk/numpy/ma/tests/test_core.py 2010-02-20 18:20:10 UTC (rev 8188) @@ -19,6 +19,10 @@ pi = np.pi +import sys +if sys.version_info[0] >= 3: + from functools import reduce + #.............................................................................. class TestMaskedArray(TestCase): "Base test class for MaskedArrays." Modified: trunk/numpy/ma/tests/test_old_ma.py =================================================================== --- trunk/numpy/ma/tests/test_old_ma.py 2010-02-20 18:19:37 UTC (rev 8187) +++ trunk/numpy/ma/tests/test_old_ma.py 2010-02-20 18:20:10 UTC (rev 8188) @@ -5,6 +5,10 @@ from numpy.ma.core import umath from numpy.testing import * +import sys +if sys.version_info[0] >= 3: + from functools import reduce + pi = numpy.pi def eq(v,w, msg=''): result = allclose(v,w) Modified: trunk/numpy/ma/timer_comparison.py =================================================================== --- trunk/numpy/ma/timer_comparison.py 2010-02-20 18:19:37 UTC (rev 8187) +++ trunk/numpy/ma/timer_comparison.py 2010-02-20 18:20:10 UTC (rev 8188) @@ -1,5 +1,6 @@ import timeit +import sys import numpy as np from numpy import float_ import np.core.fromnumeric as fromnumeric @@ -10,8 +11,10 @@ pi = np.pi +if sys.version_info[0] >= 3: + from functools import reduce + class moduletester: - #----------------------------------- def __init__(self, module): self.module = module self.allequal = module.allequal @@ -46,7 +49,7 @@ except AttributeError: self.umath = module.core.umath self.testnames = [] - #........................ + def assert_array_compare(self, comparison, x, y, err_msg='', header='', fill_value=True): """Asserts that a comparison relation between two masked arrays is satisfied @@ -100,19 +103,19 @@ except ValueError: msg = build_err_msg([x, y], err_msg, header=header, names=('x', 'y')) raise ValueError(msg) - #............................ + def assert_array_equal(self, x, y, err_msg=''): """Checks the elementwise equality of two masked arrays.""" self.assert_array_compare(self.equal, x, y, err_msg=err_msg, header='Arrays are not equal') - #---------------------------------- + def test_0(self): "Tests creation" x = np.array([1.,1.,1.,-2., pi/2.0, 4., 5., -10., 10., 1., 2., 3.]) m = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0] xm = self.masked_array(x, mask=m) xm[0] - #---------------------------------- + def test_1(self): "Tests creation" x = np.array([1.,1.,1.,-2., pi/2.0, 4., 5., -10., 10., 1., 2., 3.]) @@ -126,13 +129,13 @@ zm = self.masked_array(z, mask=[0,1,0,0]) xf = np.where(m1, 1.e+20, x) xm.set_fill_value(1.e+20) - #..... + assert((xm-ym).filled(0).any()) #fail_if_equal(xm.mask.astype(int_), ym.mask.astype(int_)) s = x.shape assert(xm.size == reduce(lambda x,y:x*y, s)) assert(self.count(xm) == len(m1) - reduce(lambda x,y:x+y, m1)) - #..... + for s in [(4,3), (6,2)]: x.shape = s y.shape = s @@ -141,7 +144,7 @@ xf.shape = s assert(self.count(xm) == len(m1) - reduce(lambda x,y:x+y, m1)) - #---------------------------------- + def test_2(self): "Tests conversions and indexing" x1 = np.array([1,2,4,3]) @@ -193,7 +196,7 @@ m3 = self.make_mask(m, copy=1) assert(m is not m3) - #---------------------------------- + def test_3(self): "Tests resize/repeat" x4 = self.arange(4) Modified: trunk/numpy/oldnumeric/ma.py =================================================================== --- trunk/numpy/oldnumeric/ma.py 2010-02-20 18:19:37 UTC (rev 8187) +++ trunk/numpy/oldnumeric/ma.py 2010-02-20 18:20:10 UTC (rev 8188) @@ -18,6 +18,9 @@ import numpy.core.numeric as numeric import warnings +if sys.version_info[0] >= 3: + from functools import reduce + # Ufunc domain lookup for __array_wrap__ ufunc_domain = {} # Ufunc fills lookup for __array__ Modified: trunk/tools/py3tool.py =================================================================== --- trunk/tools/py3tool.py 2010-02-20 18:19:37 UTC (rev 8187) +++ trunk/tools/py3tool.py 2010-02-20 18:20:10 UTC (rev 8188) @@ -39,6 +39,15 @@ 'numpy/core/defchararray.py': '-x unicode', 'numpy/compat/py3k.py': '-x unicode', 'numpy/ma/timer_comparison.py': 'skip', + 'numpy/distutils/system_info.py': '-x reduce', + 'numpy/f2py/auxfuncs.py': '-x reduce', + 'numpy/lib/arrayterator.py': '-x reduce', + 'numpy/lib/tests/test_arrayterator.py': '-x reduce', + 'numpy/ma/core.py': '-x reduce', + 'numpy/ma/tests/test_core.py': '-x reduce', + 'numpy/ma/tests/test_old_ma.py': '-x reduce', + 'numpy/ma/timer_comparison.py': '-x reduce', + 'numpy/oldnumeric/ma.py': '-x reduce', } def main(): From numpy-svn at scipy.org Sat Feb 20 13:20:27 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:20:27 -0600 (CST) Subject: [Numpy-svn] r8189 - trunk/numpy/core/src/multiarray Message-ID: <20100220182027.95DB9C7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:20:27 -0600 (Sat, 20 Feb 2010) New Revision: 8189 Modified: trunk/numpy/core/src/multiarray/mapping.c Log: BUG: fix a crash due to mixing PyUnicode and PyString Modified: trunk/numpy/core/src/multiarray/mapping.c =================================================================== --- trunk/numpy/core/src/multiarray/mapping.c 2010-02-20 18:20:10 UTC (rev 8188) +++ trunk/numpy/core/src/multiarray/mapping.c 2010-02-20 18:20:27 UTC (rev 8189) @@ -543,6 +543,8 @@ PyObject *obj; if (PyString_Check(op) || PyUnicode_Check(op)) { + PyObject *temp; + if (self->descr->names) { obj = PyDict_GetItem(self->descr->fields, op); if (obj != NULL) { @@ -557,9 +559,16 @@ } } + temp = op; + if (PyUnicode_Check(op)) { + temp = PyUnicode_AsUnicodeEscapeString(op); + } PyErr_Format(PyExc_ValueError, "field named %s not found.", - PyString_AsString(op)); + PyBytes_AsString(temp)); + if (temp != op) { + Py_DECREF(temp); + } return NULL; } From numpy-svn at scipy.org Sat Feb 20 13:20:47 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:20:47 -0600 (CST) Subject: [Numpy-svn] r8190 - trunk/numpy/core/src/multiarray Message-ID: <20100220182047.E7C5BC7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:20:47 -0600 (Sat, 20 Feb 2010) New Revision: 8190 Modified: trunk/numpy/core/src/multiarray/ucsnarrow.c Log: 3K: BUG: core: fix ucsnarrow.c:MyPyUnicode_New to work correctly on Py3 Modified: trunk/numpy/core/src/multiarray/ucsnarrow.c =================================================================== --- trunk/numpy/core/src/multiarray/ucsnarrow.c 2010-02-20 18:20:27 UTC (rev 8189) +++ trunk/numpy/core/src/multiarray/ucsnarrow.c 2010-02-20 18:20:47 UTC (rev 8190) @@ -102,6 +102,9 @@ unicode->length = length; unicode->hash = -1; unicode->defenc = NULL; +#if defined(NPY_PY3K) + unicode->state = 0; /* Not interned */ +#endif return (PyObject *)unicode; } From numpy-svn at scipy.org Sat Feb 20 13:21:12 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:21:12 -0600 (CST) Subject: [Numpy-svn] r8191 - trunk/numpy/core/src/multiarray Message-ID: <20100220182112.88443C7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:21:12 -0600 (Sat, 20 Feb 2010) New Revision: 8191 Modified: trunk/numpy/core/src/multiarray/buffer.c Log: BUG: properly check the return value of numpy.core._internal._dtype_from_pep3118 Modified: trunk/numpy/core/src/multiarray/buffer.c =================================================================== --- trunk/numpy/core/src/multiarray/buffer.c 2010-02-20 18:20:47 UTC (rev 8190) +++ trunk/numpy/core/src/multiarray/buffer.c 2010-02-20 18:21:12 UTC (rev 8191) @@ -606,7 +606,7 @@ { char *buf, *p; int in_name = 0; - PyArray_Descr *descr; + PyObject *descr; PyObject *str; PyObject *_numpy_internal; @@ -636,15 +636,22 @@ return NULL; } str = PyUString_FromStringAndSize(buf, strlen(buf)); + free(buf); descr = (PyArray_Descr*)PyObject_CallMethod( _numpy_internal, "_dtype_from_pep3118", "O", str); Py_DECREF(str); if (descr == NULL) { PyErr_Format(PyExc_ValueError, "'%s' is not a valid PEP 3118 buffer format string", buf); + return NULL; } - free(buf); - return descr; + if (!PyArray_DescrCheck(descr)) { + PyErr_Format(PyExc_RuntimeError, + "internal error: numpy.core._internal._dtype_from_pep3118 " + "did not return a valid dtype", buf); + return NULL; + } + return (PyArray_Descr*)descr; } #else From numpy-svn at scipy.org Sat Feb 20 13:21:29 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:21:29 -0600 (CST) Subject: [Numpy-svn] r8192 - trunk/numpy/core/src/private Message-ID: <20100220182129.79E7AC7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:21:29 -0600 (Sat, 20 Feb 2010) New Revision: 8192 Modified: trunk/numpy/core/src/private/npy_3kcompat.h Log: 3K: BUG: fix refcount error in npy_PyFile_Dup Modified: trunk/numpy/core/src/private/npy_3kcompat.h =================================================================== --- trunk/numpy/core/src/private/npy_3kcompat.h 2010-02-20 18:21:12 UTC (rev 8191) +++ trunk/numpy/core/src/private/npy_3kcompat.h 2010-02-20 18:21:29 UTC (rev 8192) @@ -143,6 +143,7 @@ if (ret == NULL) { return NULL; } + Py_DECREF(ret); fd = PyObject_AsFileDescriptor(file); if (fd == -1) { return NULL; From numpy-svn at scipy.org Sat Feb 20 13:21:48 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:21:48 -0600 (CST) Subject: [Numpy-svn] r8193 - trunk/numpy/core/src/multiarray Message-ID: <20100220182148.AE199C7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:21:48 -0600 (Sat, 20 Feb 2010) New Revision: 8193 Modified: trunk/numpy/core/src/multiarray/buffer.c trunk/numpy/core/src/multiarray/ctors.c trunk/numpy/core/src/multiarray/scalarapi.c Log: BUG: fix a few missing includes that may cause problems on 64-bit Modified: trunk/numpy/core/src/multiarray/buffer.c =================================================================== --- trunk/numpy/core/src/multiarray/buffer.c 2010-02-20 18:21:29 UTC (rev 8192) +++ trunk/numpy/core/src/multiarray/buffer.c 2010-02-20 18:21:48 UTC (rev 8193) @@ -12,6 +12,7 @@ #include "npy_3kcompat.h" #include "buffer.h" +#include "numpyos.h" /************************************************************************* **************** Implement Buffer Protocol **************************** Modified: trunk/numpy/core/src/multiarray/ctors.c =================================================================== --- trunk/numpy/core/src/multiarray/ctors.c 2010-02-20 18:21:29 UTC (rev 8192) +++ trunk/numpy/core/src/multiarray/ctors.c 2010-02-20 18:21:48 UTC (rev 8193) @@ -17,6 +17,8 @@ #include "ctors.h" +#include "buffer.h" + #include "numpymemoryview.h" /* Modified: trunk/numpy/core/src/multiarray/scalarapi.c =================================================================== --- trunk/numpy/core/src/multiarray/scalarapi.c 2010-02-20 18:21:29 UTC (rev 8192) +++ trunk/numpy/core/src/multiarray/scalarapi.c 2010-02-20 18:21:48 UTC (rev 8193) @@ -17,6 +17,8 @@ #include "descriptor.h" #include "scalartypes.h" +#include "common.h" + static PyArray_Descr * _descr_from_subtype(PyObject *type) { From numpy-svn at scipy.org Sat Feb 20 13:22:04 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 12:22:04 -0600 (CST) Subject: [Numpy-svn] r8194 - trunk/numpy/core/blasdot Message-ID: <20100220182204.AEC06C7C054@scipy.org> Author: ptvirtan Date: 2010-02-20 12:22:04 -0600 (Sat, 20 Feb 2010) New Revision: 8194 Modified: trunk/numpy/core/blasdot/_dotblas.c Log: BUG: ensure Py_TYPE is available in _dotblas.c on Python 2.4 and 2.5 Modified: trunk/numpy/core/blasdot/_dotblas.c =================================================================== --- trunk/numpy/core/blasdot/_dotblas.c 2010-02-20 18:21:48 UTC (rev 8193) +++ trunk/numpy/core/blasdot/_dotblas.c 2010-02-20 18:22:04 UTC (rev 8194) @@ -10,6 +10,12 @@ #include +#if (PY_VERSION_HEX < 0x02060000) +#define Py_TYPE(o) (((PyObject*)(o))->ob_type) +#define Py_REFCNT(o) (((PyObject*)(o))->ob_refcnt) +#define Py_SIZE(o) (((PyVarObject*)(o))->ob_size) +#endif + static PyArray_DotFunc *oldFunctions[PyArray_NTYPES]; static void From numpy-svn at scipy.org Sat Feb 20 17:31:25 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 16:31:25 -0600 (CST) Subject: [Numpy-svn] r8195 - in trunk/numpy: lib/tests ma/tests matrixlib/tests testing/tests Message-ID: <20100220223125.C0FE5C7C054@scipy.org> Author: charris Date: 2010-02-20 16:31:25 -0600 (Sat, 20 Feb 2010) New Revision: 8195 Modified: trunk/numpy/lib/tests/test_io.py trunk/numpy/lib/tests/test_recfunctions.py trunk/numpy/lib/tests/test_regression.py trunk/numpy/lib/tests/test_twodim_base.py trunk/numpy/ma/tests/test_core.py trunk/numpy/ma/tests/test_extras.py trunk/numpy/ma/tests/test_mrecords.py trunk/numpy/ma/tests/test_old_ma.py trunk/numpy/ma/tests/test_subclassing.py trunk/numpy/matrixlib/tests/test_regression.py trunk/numpy/testing/tests/test_utils.py Log: DEP: Fix deprecation warnings in Python 3.1. The warnings come from the unittest module. The fix should be good for Python >= 2.4 and used the following sed script: s/\/assertTrue/g s/\/assertFalse/g s/\/assertEqual/g s/\/assertRaises/g Modified: trunk/numpy/lib/tests/test_io.py =================================================================== --- trunk/numpy/lib/tests/test_io.py 2010-02-20 18:22:04 UTC (rev 8194) +++ trunk/numpy/lib/tests/test_io.py 2010-02-20 22:31:25 UTC (rev 8195) @@ -1094,7 +1094,7 @@ test = np.recfromtxt(data, **kwargs) control = np.array([(0, 1), (2, 3)], dtype=[('A', np.int), ('B', np.int)]) - self.failUnless(isinstance(test, np.recarray)) + self.assertTrue(isinstance(test, np.recarray)) assert_equal(test, control) # data = StringIO('A,B\n0,1\n2,N/A') @@ -1114,7 +1114,7 @@ test = np.recfromcsv(data, dtype=None, **kwargs) control = np.array([(0, 1), (2, 3)], dtype=[('A', np.int), ('B', np.int)]) - self.failUnless(isinstance(test, np.recarray)) + self.assertTrue(isinstance(test, np.recarray)) assert_equal(test, control) # data = StringIO('A,B\n0,1\n2,N/A') @@ -1130,7 +1130,7 @@ test = np.recfromcsv(data, missing_values='N/A',) control = np.array([(0, 1), (2, 3)], dtype=[('a', np.int), ('b', np.int)]) - self.failUnless(isinstance(test, np.recarray)) + self.assertTrue(isinstance(test, np.recarray)) assert_equal(test, control) Modified: trunk/numpy/lib/tests/test_recfunctions.py =================================================================== --- trunk/numpy/lib/tests/test_recfunctions.py 2010-02-20 18:22:04 UTC (rev 8194) +++ trunk/numpy/lib/tests/test_recfunctions.py 2010-02-20 22:31:25 UTC (rev 8195) @@ -399,11 +399,11 @@ (_, x, _, _) = self.data test = stack_arrays((x,)) assert_equal(test, x) - self.failUnless(test is x) + self.assertTrue(test is x) # test = stack_arrays(x) assert_equal(test, x) - self.failUnless(test is x) + self.assertTrue(test is x) # def test_unnamed_fields(self): "Tests combinations of arrays w/o named fields" Modified: trunk/numpy/lib/tests/test_regression.py =================================================================== --- trunk/numpy/lib/tests/test_regression.py 2010-02-20 18:22:04 UTC (rev 8194) +++ trunk/numpy/lib/tests/test_regression.py 2010-02-20 22:31:25 UTC (rev 8195) @@ -48,7 +48,7 @@ def test_poly1d_nan_roots(self, level=rlevel): """Ticket #396""" p = np.poly1d([np.nan,np.nan,1], r=0) - self.failUnlessRaises(np.linalg.LinAlgError,getattr,p,"r") + self.assertRaises(np.linalg.LinAlgError,getattr,p,"r") def test_mem_polymul(self, level=rlevel): """Ticket #448""" @@ -146,8 +146,8 @@ a = np.ones((n,)*5) i = np.random.randint(0,n,size=thesize) g = a[np.ix_(i,i,i,i,i)] - self.failUnlessRaises(ValueError, dp) - self.failUnlessRaises(ValueError, dp2) + self.assertRaises(ValueError, dp) + self.assertRaises(ValueError, dp2) def test_void_coercion(self, level=rlevel): dt = np.dtype([('a','f4'),('b','i4')]) Modified: trunk/numpy/lib/tests/test_twodim_base.py =================================================================== --- trunk/numpy/lib/tests/test_twodim_base.py 2010-02-20 18:22:04 UTC (rev 8194) +++ trunk/numpy/lib/tests/test_twodim_base.py 2010-02-20 22:31:25 UTC (rev 8195) @@ -114,11 +114,11 @@ assert_equal(diag(A, k=-3), []) def test_failure(self): - self.failUnlessRaises(ValueError, diag, [[[1]]]) + self.assertRaises(ValueError, diag, [[[1]]]) class TestFliplr(TestCase): def test_basic(self): - self.failUnlessRaises(ValueError, fliplr, ones(4)) + self.assertRaises(ValueError, fliplr, ones(4)) a = get_mat(4) b = a[:,::-1] assert_equal(fliplr(a),b) @@ -141,7 +141,7 @@ class TestRot90(TestCase): def test_basic(self): - self.failUnlessRaises(ValueError, rot90, ones(4)) + self.assertRaises(ValueError, rot90, ones(4)) a = [[0,1,2], [3,4,5]] Modified: trunk/numpy/ma/tests/test_core.py =================================================================== --- trunk/numpy/ma/tests/test_core.py 2010-02-20 18:22:04 UTC (rev 8194) +++ trunk/numpy/ma/tests/test_core.py 2010-02-20 22:31:25 UTC (rev 8195) @@ -64,14 +64,14 @@ x = masked_array(0, mask=False) assert_equal(str(x), '0') x = array(0, mask=1) - self.failUnless(x.filled().dtype is x._data.dtype) + self.assertTrue(x.filled().dtype is x._data.dtype) def test_basic1d(self): "Test of basic array creation and properties in 1 dimension." (x, y, a10, m1, m2, xm, ym, z, zm, xf) = self.d - self.failUnless(not isMaskedArray(x)) - self.failUnless(isMaskedArray(xm)) - self.failUnless((xm - ym).filled(0).any()) + self.assertTrue(not isMaskedArray(x)) + self.assertTrue(isMaskedArray(xm)) + self.assertTrue((xm - ym).filled(0).any()) fail_if_equal(xm.mask.astype(int), ym.mask.astype(int)) s = x.shape assert_equal(np.shape(xm), s) @@ -95,8 +95,8 @@ ym.shape = s xf.shape = s # - self.failUnless(not isMaskedArray(x)) - self.failUnless(isMaskedArray(xm)) + self.assertTrue(not isMaskedArray(x)) + self.assertTrue(isMaskedArray(xm)) assert_equal(shape(xm), s) assert_equal(xm.shape, s) assert_equal(xm.size , reduce(lambda x, y:x * y, s)) @@ -180,7 +180,7 @@ x.mask = nomask data = array((x, x[::-1])) assert_equal(data, [[0, 1, 2, 3, 4], [4, 3, 2, 1, 0]]) - self.failUnless(data.mask is nomask) + self.assertTrue(data.mask is nomask) def test_asarray(self): (x, y, a10, m1, m2, xm, ym, z, zm, xf) = self.d @@ -203,14 +203,14 @@ "Test of masked element" x = arange(6) x[1] = masked - self.failUnless(str(masked) == '--') - self.failUnless(x[1] is masked) + self.assertTrue(str(masked) == '--') + self.assertTrue(x[1] is masked) assert_equal(filled(x[1], 0), 0) # don't know why these should raise an exception... - #self.failUnlessRaises(Exception, lambda x,y: x+y, masked, masked) - #self.failUnlessRaises(Exception, lambda x,y: x+y, masked, 2) - #self.failUnlessRaises(Exception, lambda x,y: x+y, masked, xx) - #self.failUnlessRaises(Exception, lambda x,y: x+y, xx, masked) + #self.assertRaises(Exception, lambda x,y: x+y, masked, masked) + #self.assertRaises(Exception, lambda x,y: x+y, masked, 2) + #self.assertRaises(Exception, lambda x,y: x+y, masked, xx) + #self.assertRaises(Exception, lambda x,y: x+y, xx, masked) def test_set_element_as_object(self): """Tests setting elements with object""" @@ -218,12 +218,12 @@ x = (1, 2, 3, 4, 5) a[0] = x assert_equal(a[0], x) - self.failUnless(a[0] is x) + self.assertTrue(a[0] is x) # import datetime dt = datetime.datetime.now() a[0] = dt - self.failUnless(a[0] is dt) + self.assertTrue(a[0] is dt) def test_indexing(self): @@ -282,39 +282,39 @@ n = [0, 0, 1, 0, 0] m = make_mask(n) m2 = make_mask(m) - self.failUnless(m is m2) + self.assertTrue(m is m2) m3 = make_mask(m, copy=1) - self.failUnless(m is not m3) + self.assertTrue(m is not m3) warnings.simplefilter('ignore', DeprecationWarning) x1 = np.arange(5) y1 = array(x1, mask=m) - #self.failUnless( y1._data is x1) + #self.assertTrue( y1._data is x1) assert_equal(y1._data.__array_interface__, x1.__array_interface__) - self.failUnless(allequal(x1, y1.raw_data())) - #self.failUnless( y1.mask is m) + self.assertTrue(allequal(x1, y1.raw_data())) + #self.assertTrue( y1.mask is m) assert_equal(y1._mask.__array_interface__, m.__array_interface__) warnings.simplefilter('default', DeprecationWarning) y1a = array(y1) - #self.failUnless( y1a.raw_data() is y1.raw_data()) - self.failUnless(y1a._data.__array_interface__ == y1._data.__array_interface__) - self.failUnless(y1a.mask is y1.mask) + #self.assertTrue( y1a.raw_data() is y1.raw_data()) + self.assertTrue(y1a._data.__array_interface__ == y1._data.__array_interface__) + self.assertTrue(y1a.mask is y1.mask) y2 = array(x1, mask=m) - #self.failUnless( y2.raw_data() is x1) - self.failUnless(y2._data.__array_interface__ == x1.__array_interface__) - #self.failUnless( y2.mask is m) - self.failUnless(y2._mask.__array_interface__ == m.__array_interface__) - self.failUnless(y2[2] is masked) + #self.assertTrue( y2.raw_data() is x1) + self.assertTrue(y2._data.__array_interface__ == x1.__array_interface__) + #self.assertTrue( y2.mask is m) + self.assertTrue(y2._mask.__array_interface__ == m.__array_interface__) + self.assertTrue(y2[2] is masked) y2[2] = 9 - self.failUnless(y2[2] is not masked) - #self.failUnless( y2.mask is not m) - self.failUnless(y2._mask.__array_interface__ != m.__array_interface__) - self.failUnless(allequal(y2.mask, 0)) + self.assertTrue(y2[2] is not masked) + #self.assertTrue( y2.mask is not m) + self.assertTrue(y2._mask.__array_interface__ != m.__array_interface__) + self.assertTrue(allequal(y2.mask, 0)) y3 = array(x1 * 1.0, mask=m) - self.failUnless(filled(y3).dtype is (x1 * 1.0).dtype) + self.assertTrue(filled(y3).dtype is (x1 * 1.0).dtype) x4 = arange(4) x4[2] = masked @@ -380,7 +380,7 @@ a_pickled = cPickle.loads(a.dumps()) assert_equal(a_pickled._mask, a._mask) assert_equal(a_pickled, a) - self.failUnless(isinstance(a_pickled._data, np.matrix)) + self.assertTrue(isinstance(a_pickled._data, np.matrix)) def test_pickling_wstructured(self): "Tests pickling w/ structured array" @@ -431,7 +431,7 @@ a = array([1, 2, 3], mask=[1, 0, 0]) self.assertRaises(TypeError, lambda:float(a)) assert_equal(float(a[-1]), 3.) - self.failUnless(np.isnan(float(a[0]))) + self.assertTrue(np.isnan(float(a[0]))) self.assertRaises(TypeError, int, a) assert_equal(int(a[-1]), 3) self.assertRaises(MAError, lambda:int(a[0])) @@ -610,14 +610,14 @@ a = masked_array([(1, 2,), (3, 4)], mask=[(0, 0), (1, 0)], dtype=ndtype) # w/o mask f = a[0] - self.failUnless(isinstance(f, np.void)) + self.assertTrue(isinstance(f, np.void)) assert_equal((f[0], f['a']), (1, 1)) assert_equal(f['b'], 2) # w/ mask f = a[1] - self.failUnless(isinstance(f, mvoid)) - self.failUnless(f[0] is masked) - self.failUnless(f['a'] is masked) + self.assertTrue(isinstance(f, mvoid)) + self.assertTrue(f[0] is masked) + self.assertTrue(f['a'] is masked) assert_equal(f[1], 4) def test_mvoid_iter(self): @@ -710,8 +710,8 @@ "Tests mixed arithmetics." na = np.array([1]) ma = array([1]) - self.failUnless(isinstance(na + ma, MaskedArray)) - self.failUnless(isinstance(ma + na, MaskedArray)) + self.assertTrue(isinstance(na + ma, MaskedArray)) + self.assertTrue(isinstance(ma + na, MaskedArray)) def test_limits_arithmetic(self): @@ -725,11 +725,11 @@ "Tests some scalar arithmetics on MaskedArrays." # Masked singleton should remain masked no matter what xm = array(0, mask=1) - self.failUnless((1 / array(0)).mask) - self.failUnless((1 + xm).mask) - self.failUnless((-xm).mask) - self.failUnless(maximum(xm, xm).mask) - self.failUnless(minimum(xm, xm).mask) + self.assertTrue((1 / array(0)).mask) + self.assertTrue((1 + xm).mask) + self.assertTrue((-xm).mask) + self.assertTrue(maximum(xm, xm).mask) + self.assertTrue(minimum(xm, xm).mask) def test_masked_singleton_equality(self): @@ -801,7 +801,7 @@ def test_count_func (self): "Tests count" ott = array([0., 1., 2., 3.], mask=[1, 0, 0, 0]) - self.failUnless(isinstance(count(ott), int)) + self.assertTrue(isinstance(count(ott), int)) assert_equal(3, count(ott)) assert_equal(1, count(1)) assert_equal(0, array(1, mask=[1])) @@ -840,19 +840,19 @@ def test_minimummaximum_func(self): a = np.ones((2, 2)) aminimum = minimum(a, a) - self.failUnless(isinstance(aminimum, MaskedArray)) + self.assertTrue(isinstance(aminimum, MaskedArray)) assert_equal(aminimum, np.minimum(a, a)) # aminimum = minimum.outer(a, a) - self.failUnless(isinstance(aminimum, MaskedArray)) + self.assertTrue(isinstance(aminimum, MaskedArray)) assert_equal(aminimum, np.minimum.outer(a, a)) # amaximum = maximum(a, a) - self.failUnless(isinstance(amaximum, MaskedArray)) + self.assertTrue(isinstance(amaximum, MaskedArray)) assert_equal(amaximum, np.maximum(a, a)) # amaximum = maximum.outer(a, a) - self.failUnless(isinstance(amaximum, MaskedArray)) + self.assertTrue(isinstance(amaximum, MaskedArray)) assert_equal(amaximum, np.maximum.outer(a, a)) @@ -879,11 +879,11 @@ pass nout = np.empty((4,), dtype=float) result = npfunc(xm, axis=0, out=nout) - self.failUnless(result is nout) + self.assertTrue(result is nout) # Use the ma version nout.fill(-999) result = mafunc(xm, axis=0, out=nout) - self.failUnless(result is nout) + self.assertTrue(result is nout) def test_minmax_methods(self): @@ -891,22 +891,22 @@ (_, _, _, _, _, xm, _, _, _, _) = self.d xm.shape = (xm.size,) assert_equal(xm.max(), 10) - self.failUnless(xm[0].max() is masked) - self.failUnless(xm[0].max(0) is masked) - self.failUnless(xm[0].max(-1) is masked) + self.assertTrue(xm[0].max() is masked) + self.assertTrue(xm[0].max(0) is masked) + self.assertTrue(xm[0].max(-1) is masked) assert_equal(xm.min(), -10.) - self.failUnless(xm[0].min() is masked) - self.failUnless(xm[0].min(0) is masked) - self.failUnless(xm[0].min(-1) is masked) + self.assertTrue(xm[0].min() is masked) + self.assertTrue(xm[0].min(0) is masked) + self.assertTrue(xm[0].min(-1) is masked) assert_equal(xm.ptp(), 20.) - self.failUnless(xm[0].ptp() is masked) - self.failUnless(xm[0].ptp(0) is masked) - self.failUnless(xm[0].ptp(-1) is masked) + self.assertTrue(xm[0].ptp() is masked) + self.assertTrue(xm[0].ptp(0) is masked) + self.assertTrue(xm[0].ptp(-1) is masked) # x = array([1, 2, 3], mask=True) - self.failUnless(x.min() is masked) - self.failUnless(x.max() is masked) - self.failUnless(x.ptp() is masked) + self.assertTrue(x.min() is masked) + self.assertTrue(x.max() is masked) + self.assertTrue(x.ptp() is masked) def test_addsumprod (self): @@ -1081,13 +1081,13 @@ output.fill(-9999) result = npfunc(xm, axis=0, out=output) # ... the result should be the given output - self.failUnless(result is output) + self.assertTrue(result is output) assert_equal(result, xmmeth(axis=0, out=output)) # output = empty(4, dtype=int) result = xmmeth(axis=0, out=output) - self.failUnless(result is output) - self.failUnless(output[0] is masked) + self.assertTrue(result is output) + self.assertTrue(output[0] is masked) def test_eq_on_structured(self): @@ -1173,8 +1173,8 @@ assert_equal(xs._data, [0, 10, 2, 3, 40]) #assert_equal(xh.mask.ctypes._data, m.ctypes._data) assert_equal(xs.mask, [0, 0, 0, 1, 0]) - self.failUnless(xh._hardmask) - self.failUnless(not xs._hardmask) + self.assertTrue(xh._hardmask) + self.assertTrue(not xs._hardmask) xh[1:4] = [10, 20, 30] xs[1:4] = [10, 20, 30] assert_equal(xh._data, [0, 10, 20, 3, 4]) @@ -1306,39 +1306,39 @@ ndtype = [('a', int), ('b', float), ('c', "|S3")] # A check on a list should return a single record fval = _check_fill_value([-999, -999.9, "???"], ndtype) - self.failUnless(isinstance(fval, ndarray)) + self.assertTrue(isinstance(fval, ndarray)) assert_equal(fval.item(), [-999, -999.9, "???"]) # A check on None should output the defaults fval = _check_fill_value(None, ndtype) - self.failUnless(isinstance(fval, ndarray)) + self.assertTrue(isinstance(fval, ndarray)) assert_equal(fval.item(), [default_fill_value(0), default_fill_value(0.), default_fill_value("0")]) #.....Using a structured type as fill_value should work fill_val = np.array((-999, -999.9, "???"), dtype=ndtype) fval = _check_fill_value(fill_val, ndtype) - self.failUnless(isinstance(fval, ndarray)) + self.assertTrue(isinstance(fval, ndarray)) assert_equal(fval.item(), [-999, -999.9, "???"]) #.....Using a flexible type w/ a different type shouldn't matter fill_val = np.array((-999, -999.9, "???"), dtype=[("A", int), ("B", float), ("C", "|S3")]) fval = _check_fill_value(fill_val, ndtype) - self.failUnless(isinstance(fval, ndarray)) + self.assertTrue(isinstance(fval, ndarray)) assert_equal(fval.item(), [-999, -999.9, "???"]) #.....Using an object-array shouldn't matter either fill_value = np.array((-999, -999.9, "???"), dtype=object) fval = _check_fill_value(fill_val, ndtype) - self.failUnless(isinstance(fval, ndarray)) + self.assertTrue(isinstance(fval, ndarray)) assert_equal(fval.item(), [-999, -999.9, "???"]) # fill_value = np.array((-999, -999.9, "???")) fval = _check_fill_value(fill_val, ndtype) - self.failUnless(isinstance(fval, ndarray)) + self.assertTrue(isinstance(fval, ndarray)) assert_equal(fval.item(), [-999, -999.9, "???"]) #.....One-field-only flexible type should work as well ndtype = [("a", int)] fval = _check_fill_value(-999, ndtype) - self.failUnless(isinstance(fval, ndarray)) + self.assertTrue(isinstance(fval, ndarray)) assert_equal(fval.item(), (-999,)) @@ -1518,8 +1518,8 @@ def test_reduce(self): "Tests reduce on MaskedArrays." a = self.d[0] - self.failUnless(not alltrue(a, axis=0)) - self.failUnless(sometrue(a, axis=0)) + self.assertTrue(not alltrue(a, axis=0)) + self.assertTrue(sometrue(a, axis=0)) assert_equal(sum(a[:3], axis=0), 0) assert_equal(product(a, axis=0), 0) assert_equal(add.reduce(a), pi) @@ -1532,8 +1532,8 @@ assert_equal(amask.min(), 5) assert_equal(amask.max(0), a.max(0)) assert_equal(amask.min(0), [5, 6, 7, 8]) - self.failUnless(amask.max(1)[0].mask) - self.failUnless(amask.min(1)[0].mask) + self.assertTrue(amask.max(1)[0].mask) + self.assertTrue(amask.min(1)[0].mask) def test_ndarray_mask(self): "Check that the mask of the result is a ndarray (not a MaskedArray...)" @@ -1543,7 +1543,7 @@ mask=[1, 0, 0, 0, 1]) assert_equal(test, control) assert_equal(test.mask, control.mask) - self.failUnless(not isinstance(test.mask, MaskedArray)) + self.assertTrue(not isinstance(test.mask, MaskedArray)) #------------------------------------------------------------------------------ @@ -1892,21 +1892,21 @@ "Tests allclose on arrays" a = np.random.rand(10) b = a + np.random.rand(10) * 1e-8 - self.failUnless(allclose(a, b)) + self.assertTrue(allclose(a, b)) # Test allclose w/ infs a[0] = np.inf - self.failUnless(not allclose(a, b)) + self.assertTrue(not allclose(a, b)) b[0] = np.inf - self.failUnless(allclose(a, b)) + self.assertTrue(allclose(a, b)) # Test all close w/ masked a = masked_array(a) a[-1] = masked - self.failUnless(allclose(a, b, masked_equal=True)) - self.failUnless(not allclose(a, b, masked_equal=False)) + self.assertTrue(allclose(a, b, masked_equal=True)) + self.assertTrue(not allclose(a, b, masked_equal=False)) # Test comparison w/ scalar a *= 1e-8 a[0] = 0 - self.failUnless(allclose(a, 0, masked_equal=True)) + self.assertTrue(allclose(a, 0, masked_equal=True)) def test_allany(self): @@ -1971,18 +1971,18 @@ store = empty(1, dtype=bool) full = array([1, 2, 3], mask=True) # - self.failUnless(full.all() is masked) + self.assertTrue(full.all() is masked) full.all(out=store) - self.failUnless(store) - self.failUnless(store._mask, True) - self.failUnless(store is not masked) + self.assertTrue(store) + self.assertTrue(store._mask, True) + self.assertTrue(store is not masked) # store = empty(1, dtype=bool) - self.failUnless(full.any() is masked) + self.assertTrue(full.any() is masked) full.any(out=store) - self.failUnless(not store) - self.failUnless(store._mask, True) - self.failUnless(store is not masked) + self.assertTrue(not store) + self.assertTrue(store._mask, True) + self.assertTrue(store is not masked) def test_argmax_argmin(self): @@ -2070,7 +2070,7 @@ a = array(np.matrix([1, 2, 3, 4]), mask=[0, 0, 0, 0]) b = a.compressed() assert_equal(b, a) - self.failUnless(isinstance(b, np.matrix)) + self.assertTrue(isinstance(b, np.matrix)) a[0, 0] = masked b = a.compressed() assert_equal(b, [[2, 3, 4]]) @@ -2098,12 +2098,12 @@ n = [0, 0, 0, 1, 1] m = make_mask(n) x = array(d, mask=m) - self.failUnless(x[3] is masked) - self.failUnless(x[4] is masked) + self.assertTrue(x[3] is masked) + self.assertTrue(x[4] is masked) x[[1, 4]] = [10, 40] -# self.failUnless( x.mask is not m) - self.failUnless(x[3] is masked) - self.failUnless(x[4] is not masked) +# self.assertTrue( x.mask is not m) + self.assertTrue(x[3] is masked) + self.assertTrue(x[4] is not masked) assert_equal(x, [0, 10, 2, -1, 40]) # x = masked_array(arange(10), mask=[1, 0, 0, 0, 0] * 2) @@ -2223,7 +2223,7 @@ # x = [1, 4, 2, 3] sortedx = sort(x) - self.failUnless(not isinstance(sorted, MaskedArray)) + self.assertTrue(not isinstance(sorted, MaskedArray)) # x = array([0, 1, -1, -2, 2], mask=nomask, dtype=np.int8) sortedx = sort(x, endwith=False) @@ -2309,7 +2309,7 @@ assert_equal(data.squeeze(), [1, 2, 3]) assert_equal(data.squeeze()._mask, [1, 1, 1]) data = masked_array([[1]], mask=True) - self.failUnless(data.squeeze() is masked) + self.assertTrue(data.squeeze() is masked) def test_swapaxes(self): @@ -2357,8 +2357,8 @@ x = array(np.arange(12)) x[[1, -2]] = masked xlist = x.tolist() - self.failUnless(xlist[1] is None) - self.failUnless(xlist[-2] is None) + self.assertTrue(xlist[1] is None) + self.assertTrue(xlist[-2] is None) # ... on 2D x.shape = (3, 4) xlist = x.tolist() @@ -2528,12 +2528,12 @@ output.fill(-9999) result = npfunc(xm, axis=0, out=output) # ... the result should be the given output - self.failUnless(result is output) + self.assertTrue(result is output) assert_equal(result, xmmeth(axis=0, out=output)) # output = empty((3, 4), dtype=int) result = xmmeth(axis=0, out=output) - self.failUnless(result is output) + self.assertTrue(result is output) def test_ptp(self): @@ -2609,31 +2609,31 @@ x = array(arange(10), mask=True) for methodname in ('var', 'std'): method = getattr(x, methodname) - self.failUnless(method() is masked) - self.failUnless(method(0) is masked) - self.failUnless(method(-1) is masked) + self.assertTrue(method() is masked) + self.assertTrue(method(0) is masked) + self.assertTrue(method(-1) is masked) # Using a masked array as explicit output _ = method(out=mout) - self.failUnless(mout is not masked) + self.assertTrue(mout is not masked) assert_equal(mout.mask, True) # Using a ndarray as explicit output _ = method(out=nout) - self.failUnless(np.isnan(nout)) + self.assertTrue(np.isnan(nout)) # x = array(arange(10), mask=True) x[-1] = 9 for methodname in ('var', 'std'): method = getattr(x, methodname) - self.failUnless(method(ddof=1) is masked) - self.failUnless(method(0, ddof=1) is masked) - self.failUnless(method(-1, ddof=1) is masked) + self.assertTrue(method(ddof=1) is masked) + self.assertTrue(method(0, ddof=1) is masked) + self.assertTrue(method(-1, ddof=1) is masked) # Using a masked array as explicit output _ = method(out=mout, ddof=1) - self.failUnless(mout is not masked) + self.assertTrue(mout is not masked) assert_equal(mout.mask, True) # Using a ndarray as explicit output _ = method(out=nout, ddof=1) - self.failUnless(np.isnan(nout)) + self.assertTrue(np.isnan(nout)) def test_diag(self): @@ -2841,24 +2841,24 @@ output.fill(-9999) result = np.round(xm, decimals=2, out=output) # ... the result should be the given output - self.failUnless(result is output) + self.assertTrue(result is output) assert_equal(result, xm.round(decimals=2, out=output)) # output = empty((3, 4), dtype=float) result = xm.round(decimals=2, out=output) - self.failUnless(result is output) + self.assertTrue(result is output) def test_identity(self): a = identity(5) - self.failUnless(isinstance(a, MaskedArray)) + self.assertTrue(isinstance(a, MaskedArray)) assert_equal(a, np.identity(5)) def test_power(self): x = -1.1 assert_almost_equal(power(x, 2.), 1.21) - self.failUnless(power(x, masked) is masked) + self.assertTrue(power(x, masked) is masked) x = array([-1.1, -1.1, 1.1, 1.1, 0.]) b = array([0.5, 2., 0.5, 2., -1.], mask=[0, 0, 0, 0, 1]) y = power(x, b) @@ -3000,7 +3000,7 @@ store = empty(4, dtype=int) chosen = choose([2, 3, 1, 0], choices, out=store) assert_equal(store, array([20, 31, 12, 3])) - self.failUnless(store is chosen) + self.assertTrue(store is chosen) # Check with some masked indices + out store = empty(4, dtype=int) indices_ = array([2, 3, 1, 0], mask=[1, 0, 0, 1]) @@ -3022,25 +3022,25 @@ # Try the default b = a.reshape((5, 2)) assert_equal(b.shape, (5, 2)) - self.failUnless(b.flags['C']) + self.assertTrue(b.flags['C']) # Try w/ arguments as list instead of tuple b = a.reshape(5, 2) assert_equal(b.shape, (5, 2)) - self.failUnless(b.flags['C']) + self.assertTrue(b.flags['C']) # Try w/ order b = a.reshape((5, 2), order='F') assert_equal(b.shape, (5, 2)) - self.failUnless(b.flags['F']) + self.assertTrue(b.flags['F']) # Try w/ order b = a.reshape(5, 2, order='F') assert_equal(b.shape, (5, 2)) - self.failUnless(b.flags['F']) + self.assertTrue(b.flags['F']) # c = np.reshape(a, (2, 5)) - self.failUnless(isinstance(c, MaskedArray)) + self.assertTrue(isinstance(c, MaskedArray)) assert_equal(c.shape, (2, 5)) - self.failUnless(c[0, 0] is masked) - self.failUnless(c.flags['C']) + self.assertTrue(c[0, 0] is masked) + self.assertTrue(c.flags['C']) def test_make_mask_descr(self): @@ -3271,7 +3271,7 @@ # test = a.view((float, 2), np.matrix) assert_equal(test, data) - self.failUnless(isinstance(test, np.matrix)) + self.assertTrue(isinstance(test, np.matrix)) # def test_getitem(self): ndtype = [('a', float), ('b', float)] @@ -3280,13 +3280,13 @@ [1, 0, 0, 0, 0, 0, 0, 0, 1, 0]), dtype=[('a', bool), ('b', bool)]) # No mask - self.failUnless(isinstance(a[1], np.void)) + self.assertTrue(isinstance(a[1], np.void)) # One element masked - self.failUnless(isinstance(a[0], MaskedArray)) + self.assertTrue(isinstance(a[0], MaskedArray)) assert_equal_records(a[0]._data, a._data[0]) assert_equal_records(a[0]._mask, a._mask[0]) # All element masked - self.failUnless(isinstance(a[-2], MaskedArray)) + self.assertTrue(isinstance(a[-2], MaskedArray)) assert_equal_records(a[-2]._data, a._data[-2]) assert_equal_records(a[-2]._mask, a._mask[-2]) @@ -3306,7 +3306,7 @@ def test_view_to_nothing(self): (data, a, controlmask) = self.data test = a.view() - self.failUnless(isinstance(test, MaskedArray)) + self.assertTrue(isinstance(test, MaskedArray)) assert_equal(test._data, a._data) assert_equal(test._mask, a._mask) @@ -3314,7 +3314,7 @@ def test_view_to_type(self): (data, a, controlmask) = self.data test = a.view(np.ndarray) - self.failUnless(not isinstance(test, MaskedArray)) + self.assertTrue(not isinstance(test, MaskedArray)) assert_equal(test, a._data) assert_equal_records(test, data.view(a.dtype).squeeze()) # @@ -3322,7 +3322,7 @@ (data, a, controlmask) = self.data # View globally test = a.view(float) - self.failUnless(isinstance(test, MaskedArray)) + self.assertTrue(isinstance(test, MaskedArray)) assert_equal(test, data.ravel()) assert_equal(test.mask, controlmask) # @@ -3335,13 +3335,13 @@ assert_equal(test['B'], a['b']) # test = a[0].view([('A', float), ('B', float)]) - self.failUnless(isinstance(test, MaskedArray)) + self.assertTrue(isinstance(test, MaskedArray)) assert_equal(test.mask.dtype.names, ('A', 'B')) assert_equal(test['A'], a['a'][0]) assert_equal(test['B'], a['b'][0]) # test = a[-1].view([('A', float), ('B', float)]) - self.failUnless(not isinstance(test, MaskedArray)) + self.assertTrue(not isinstance(test, MaskedArray)) assert_equal(test.dtype.names, ('A', 'B')) assert_equal(test['A'], a['a'][-1]) assert_equal(test['B'], a['b'][-1]) @@ -3351,17 +3351,17 @@ (data, a, controlmask) = self.data # View globally test = a.view((float, 2)) - self.failUnless(isinstance(test, MaskedArray)) + self.assertTrue(isinstance(test, MaskedArray)) assert_equal(test, data) assert_equal(test.mask, controlmask.reshape(-1, 2)) # View on 1 masked element test = a[0].view((float, 2)) - self.failUnless(isinstance(test, MaskedArray)) + self.assertTrue(isinstance(test, MaskedArray)) assert_equal(test, data[0]) assert_equal(test.mask, (1, 0)) # View on 1 unmasked element test = a[-1].view((float, 2)) - self.failUnless(not isinstance(test, MaskedArray)) + self.assertTrue(not isinstance(test, MaskedArray)) assert_equal(test, data[-1]) # def test_view_to_dtype_and_type(self): @@ -3369,8 +3369,8 @@ # test = a.view((float, 2), np.matrix) assert_equal(test, data) - self.failUnless(isinstance(test, np.matrix)) - self.failUnless(not isinstance(test, MaskedArray)) + self.assertTrue(isinstance(test, np.matrix)) + self.assertTrue(not isinstance(test, MaskedArray)) def test_masked_array(): a = np.ma.array([0, 1, 2, 3], mask=[0, 0, 1, 0]) Modified: trunk/numpy/ma/tests/test_extras.py =================================================================== --- trunk/numpy/ma/tests/test_extras.py 2010-02-20 18:22:04 UTC (rev 8194) +++ trunk/numpy/ma/tests/test_extras.py 2010-02-20 22:31:25 UTC (rev 8195) @@ -99,7 +99,7 @@ assert_equal(2.0, average(ott, weights=[1., 1., 2., 1.])) result, wts = average(ott, weights=[1., 1., 2., 1.], returned=1) assert_equal(2.0, result) - self.failUnless(wts == 4.0) + self.assertTrue(wts == 4.0) ott[:] = masked assert_equal(average(ott, axis=0).mask, [True]) ott = array([0., 1., 2., 3.], mask=[True, False, False, False]) @@ -189,7 +189,7 @@ m = [1,0,0,0,0] d = masked_array(b,mask=m) c = mr_[d,0,0,d] - self.failUnless(isinstance(c,MaskedArray) or isinstance(c,core.MaskedArray)) + self.assertTrue(isinstance(c,MaskedArray) or isinstance(c,core.MaskedArray)) assert_array_equal(c,[1,1,1,1,1,0,0,1,1,1,1,1]) assert_array_equal(c.mask, mr_[m,0,0,m]) @@ -202,12 +202,12 @@ b_1 = masked_array(a_1,mask=m_1) b_2 = masked_array(a_2,mask=m_2) d = mr_['1',b_1,b_2] # append columns - self.failUnless(d.shape == (5,10)) + self.assertTrue(d.shape == (5,10)) assert_array_equal(d[:,:5],b_1) assert_array_equal(d[:,5:],b_2) assert_array_equal(d.mask, np.r_['1',m_1,m_2]) d = mr_[b_1,b_2] - self.failUnless(d.shape == (10,5)) + self.assertTrue(d.shape == (10,5)) assert_array_equal(d[:5,:],b_1) assert_array_equal(d[5:,:],b_2) assert_array_equal(d.mask, np.r_[m_1,m_2]) @@ -266,14 +266,14 @@ assert_equal(tmp[-3], slice(0,3,None)) # tmp = notmasked_contiguous(a, 0) - self.failUnless(len(tmp[-1]) == 1) - self.failUnless(tmp[-2] is None) + self.assertTrue(len(tmp[-1]) == 1) + self.assertTrue(tmp[-2] is None) assert_equal(tmp[-3],tmp[-1]) - self.failUnless(len(tmp[0]) == 2) + self.assertTrue(len(tmp[0]) == 2) # tmp = notmasked_contiguous(a, 1) assert_equal(tmp[0][-1], slice(0,3,None)) - self.failUnless(tmp[1] is None) + self.assertTrue(tmp[1] is None) assert_equal(tmp[2][-1], slice(7,7,None)) assert_equal(tmp[2][-2], slice(0,5,None)) @@ -315,12 +315,12 @@ assert_equal(mask_rowcols(x,0).mask, [[1,1,1],[1,1,1],[0,0,0]] ) assert_equal(mask_rowcols(x,1,).mask, [[1,1,0],[1,1,0],[1,1,0]] ) x = array(x._data, mask=[[1,0,0],[0,1,0],[0,0,1]]) - self.failUnless(mask_rowcols(x).all() is masked) - self.failUnless(mask_rowcols(x,0).all() is masked) - self.failUnless(mask_rowcols(x,1).all() is masked) - self.failUnless(mask_rowcols(x).mask.all()) - self.failUnless(mask_rowcols(x,0).mask.all()) - self.failUnless(mask_rowcols(x,1).mask.all()) + self.assertTrue(mask_rowcols(x).all() is masked) + self.assertTrue(mask_rowcols(x,0).all() is masked) + self.assertTrue(mask_rowcols(x,1).all() is masked) + self.assertTrue(mask_rowcols(x).mask.all()) + self.assertTrue(mask_rowcols(x,0).mask.all()) + self.assertTrue(mask_rowcols(x,1).mask.all()) # def test_dot(self): "Tests dot product" @@ -607,7 +607,7 @@ "Test unique on list" data = [1, 1, 1, 2, 2, 3] test = unique(data, return_index=True, return_inverse=True) - self.failUnless(isinstance(test[0], MaskedArray)) + self.assertTrue(isinstance(test[0], MaskedArray)) assert_equal(test[0], masked_array([1, 2, 3], mask=[0, 0, 0])) assert_equal(test[1], [0, 3, 5]) assert_equal(test[2], [0, 0, 0, 1, 1, 2]) @@ -703,13 +703,13 @@ test = ediff1d(x) control = array([1, 1, 1, 1], mask=[0, 0, 0, 0]) assert_equal(test, control) - self.failUnless(isinstance(test, MaskedArray)) + self.assertTrue(isinstance(test, MaskedArray)) assert_equal(test.data, control.data) assert_equal(test.mask, control.mask) # test = ediff1d(x, to_end=masked, to_begin=masked) control = array([0, 1, 1, 1, 1, 0], mask=[1, 0, 0, 0, 0, 1]) - self.failUnless(isinstance(test, MaskedArray)) + self.assertTrue(isinstance(test, MaskedArray)) assert_equal(test.data, control.data) assert_equal(test.mask, control.mask) Modified: trunk/numpy/ma/tests/test_mrecords.py =================================================================== --- trunk/numpy/ma/tests/test_mrecords.py 2010-02-20 18:22:04 UTC (rev 8194) +++ trunk/numpy/ma/tests/test_mrecords.py 2010-02-20 22:31:25 UTC (rev 8195) @@ -268,16 +268,16 @@ base = self.base.copy() mbase = base.view(mrecarray) mbase.harden_mask() - self.failUnless(mbase._hardmask) + self.assertTrue(mbase._hardmask) mbase.mask = nomask assert_equal_records(mbase._mask, base._mask) mbase.soften_mask() - self.failUnless(not mbase._hardmask) + self.assertTrue(not mbase._hardmask) mbase.mask = nomask # So, the mask of a field is no longer set to nomask... assert_equal_records(mbase._mask, ma.make_mask_none(base.shape,base.dtype)) - self.failUnless(ma.make_mask(mbase['b']._mask) is nomask) + self.assertTrue(ma.make_mask(mbase['b']._mask) is nomask) assert_equal(mbase['a']._mask,mbase['b']._mask) # def test_pickling(self): @@ -360,7 +360,7 @@ def test_view_by_itself(self): (mrec, a, b, arr) = self.data test = mrec.view() - self.failUnless(isinstance(test, MaskedRecords)) + self.assertTrue(isinstance(test, MaskedRecords)) assert_equal_records(test, mrec) assert_equal_records(test._mask, mrec._mask) # @@ -368,19 +368,19 @@ (mrec, a, b, arr) = self.data ntype = (np.float, 2) test = mrec.view(ntype) - self.failUnless(isinstance(test, ma.MaskedArray)) + self.assertTrue(isinstance(test, ma.MaskedArray)) assert_equal(test, np.array(zip(a,b), dtype=np.float)) - self.failUnless(test[3,1] is ma.masked) + self.assertTrue(test[3,1] is ma.masked) # def test_view_flexible_type(self): (mrec, a, b, arr) = self.data alttype = [('A',np.float), ('B',np.float)] test = mrec.view(alttype) - self.failUnless(isinstance(test, MaskedRecords)) + self.assertTrue(isinstance(test, MaskedRecords)) assert_equal_records(test, arr.view(alttype)) - self.failUnless(test['B'][3] is masked) + self.assertTrue(test['B'][3] is masked) assert_equal(test.dtype, np.dtype(alttype)) - self.failUnless(test._fill_value is None) + self.assertTrue(test._fill_value is None) ################################################################################ @@ -480,7 +480,7 @@ mrectxt = fromtextfile(tmp_fl, delimitor=',',varnames='ABCDEFG') os.remove(tmp_fl) # - self.failUnless(isinstance(mrectxt, MaskedRecords)) + self.assertTrue(isinstance(mrectxt, MaskedRecords)) assert_equal(mrectxt.F, [1,1,1,1]) assert_equal(mrectxt.E._mask, [1,1,1,1]) assert_equal(mrectxt.C, [1,2,3.e+5,-1e-10]) Modified: trunk/numpy/ma/tests/test_old_ma.py =================================================================== --- trunk/numpy/ma/tests/test_old_ma.py 2010-02-20 18:22:04 UTC (rev 8194) +++ trunk/numpy/ma/tests/test_old_ma.py 2010-02-20 22:31:25 UTC (rev 8195) @@ -38,16 +38,16 @@ def test_testBasic1d(self): "Test of basic array creation and properties in 1 dimension." (x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d - self.failIf(isMaskedArray(x)) - self.failUnless(isMaskedArray(xm)) + self.assertFalse(isMaskedArray(x)) + self.assertTrue(isMaskedArray(xm)) self.assertEqual(shape(xm), s) self.assertEqual(xm.shape, s) self.assertEqual(xm.dtype, x.dtype) self.assertEqual( xm.size , reduce(lambda x,y:x*y, s)) self.assertEqual(count(xm) , len(m1) - reduce(lambda x,y:x+y, m1)) - self.failUnless(eq(xm, xf)) - self.failUnless(eq(filled(xm, 1.e20), xf)) - self.failUnless(eq(x, xm)) + self.assertTrue(eq(xm, xf)) + self.assertTrue(eq(filled(xm, 1.e20), xf)) + self.assertTrue(eq(x, xm)) def test_testBasic2d(self): "Test of basic array creation and properties in 2 dimensions." @@ -59,15 +59,15 @@ ym.shape = s xf.shape = s - self.failIf(isMaskedArray(x)) - self.failUnless(isMaskedArray(xm)) + self.assertFalse(isMaskedArray(x)) + self.assertTrue(isMaskedArray(xm)) self.assertEqual(shape(xm), s) self.assertEqual(xm.shape, s) self.assertEqual( xm.size , reduce(lambda x,y:x*y, s)) self.assertEqual( count(xm) , len(m1) - reduce(lambda x,y:x+y, m1)) - self.failUnless(eq(xm, xf)) - self.failUnless(eq(filled(xm, 1.e20), xf)) - self.failUnless(eq(x, xm)) + self.assertTrue(eq(xm, xf)) + self.assertTrue(eq(filled(xm, 1.e20), xf)) + self.assertTrue(eq(x, xm)) self.setUp() def test_testArithmetic (self): @@ -75,94 +75,94 @@ (x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d a2d = array([[1,2],[0,4]]) a2dm = masked_array(a2d, [[0,0],[1,0]]) - self.failUnless(eq (a2d * a2d, a2d * a2dm)) - self.failUnless(eq (a2d + a2d, a2d + a2dm)) - self.failUnless(eq (a2d - a2d, a2d - a2dm)) + self.assertTrue(eq (a2d * a2d, a2d * a2dm)) + self.assertTrue(eq (a2d + a2d, a2d + a2dm)) + self.assertTrue(eq (a2d - a2d, a2d - a2dm)) for s in [(12,), (4,3), (2,6)]: x = x.reshape(s) y = y.reshape(s) xm = xm.reshape(s) ym = ym.reshape(s) xf = xf.reshape(s) - self.failUnless(eq(-x, -xm)) - self.failUnless(eq(x + y, xm + ym)) - self.failUnless(eq(x - y, xm - ym)) - self.failUnless(eq(x * y, xm * ym)) + self.assertTrue(eq(-x, -xm)) + self.assertTrue(eq(x + y, xm + ym)) + self.assertTrue(eq(x - y, xm - ym)) + self.assertTrue(eq(x * y, xm * ym)) olderr = numpy.seterr(divide='ignore', invalid='ignore') - self.failUnless(eq(x / y, xm / ym)) + self.assertTrue(eq(x / y, xm / ym)) numpy.seterr(**olderr) - self.failUnless(eq(a10 + y, a10 + ym)) - self.failUnless(eq(a10 - y, a10 - ym)) - self.failUnless(eq(a10 * y, a10 * ym)) + self.assertTrue(eq(a10 + y, a10 + ym)) + self.assertTrue(eq(a10 - y, a10 - ym)) + self.assertTrue(eq(a10 * y, a10 * ym)) olderr = numpy.seterr(divide='ignore', invalid='ignore') - self.failUnless(eq(a10 / y, a10 / ym)) + self.assertTrue(eq(a10 / y, a10 / ym)) numpy.seterr(**olderr) - self.failUnless(eq(x + a10, xm + a10)) - self.failUnless(eq(x - a10, xm - a10)) - self.failUnless(eq(x * a10, xm * a10)) - self.failUnless(eq(x / a10, xm / a10)) - self.failUnless(eq(x**2, xm**2)) - self.failUnless(eq(abs(x)**2.5, abs(xm) **2.5)) - self.failUnless(eq(x**y, xm**ym)) - self.failUnless(eq(numpy.add(x,y), add(xm, ym))) - self.failUnless(eq(numpy.subtract(x,y), subtract(xm, ym))) - self.failUnless(eq(numpy.multiply(x,y), multiply(xm, ym))) + self.assertTrue(eq(x + a10, xm + a10)) + self.assertTrue(eq(x - a10, xm - a10)) + self.assertTrue(eq(x * a10, xm * a10)) + self.assertTrue(eq(x / a10, xm / a10)) + self.assertTrue(eq(x**2, xm**2)) + self.assertTrue(eq(abs(x)**2.5, abs(xm) **2.5)) + self.assertTrue(eq(x**y, xm**ym)) + self.assertTrue(eq(numpy.add(x,y), add(xm, ym))) + self.assertTrue(eq(numpy.subtract(x,y), subtract(xm, ym))) + self.assertTrue(eq(numpy.multiply(x,y), multiply(xm, ym))) olderr = numpy.seterr(divide='ignore', invalid='ignore') - self.failUnless(eq(numpy.divide(x,y), divide(xm, ym))) + self.assertTrue(eq(numpy.divide(x,y), divide(xm, ym))) numpy.seterr(**olderr) def test_testMixedArithmetic(self): na = numpy.array([1]) ma = array([1]) - self.failUnless(isinstance(na + ma, MaskedArray)) - self.failUnless(isinstance(ma + na, MaskedArray)) + self.assertTrue(isinstance(na + ma, MaskedArray)) + self.assertTrue(isinstance(ma + na, MaskedArray)) def test_testUfuncs1 (self): "Test various functions such as sin, cos." (x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d - self.failUnless (eq(numpy.cos(x), cos(xm))) - self.failUnless (eq(numpy.cosh(x), cosh(xm))) - self.failUnless (eq(numpy.sin(x), sin(xm))) - self.failUnless (eq(numpy.sinh(x), sinh(xm))) - self.failUnless (eq(numpy.tan(x), tan(xm))) - self.failUnless (eq(numpy.tanh(x), tanh(xm))) + self.assertTrue (eq(numpy.cos(x), cos(xm))) + self.assertTrue (eq(numpy.cosh(x), cosh(xm))) + self.assertTrue (eq(numpy.sin(x), sin(xm))) + self.assertTrue (eq(numpy.sinh(x), sinh(xm))) + self.assertTrue (eq(numpy.tan(x), tan(xm))) + self.assertTrue (eq(numpy.tanh(x), tanh(xm))) olderr = numpy.seterr(divide='ignore', invalid='ignore') - self.failUnless (eq(numpy.sqrt(abs(x)), sqrt(xm))) - self.failUnless (eq(numpy.log(abs(x)), log(xm))) - self.failUnless (eq(numpy.log10(abs(x)), log10(xm))) + self.assertTrue (eq(numpy.sqrt(abs(x)), sqrt(xm))) + self.assertTrue (eq(numpy.log(abs(x)), log(xm))) + self.assertTrue (eq(numpy.log10(abs(x)), log10(xm))) numpy.seterr(**olderr) - self.failUnless (eq(numpy.exp(x), exp(xm))) - self.failUnless (eq(numpy.arcsin(z), arcsin(zm))) - self.failUnless (eq(numpy.arccos(z), arccos(zm))) - self.failUnless (eq(numpy.arctan(z), arctan(zm))) - self.failUnless (eq(numpy.arctan2(x, y), arctan2(xm, ym))) - self.failUnless (eq(numpy.absolute(x), absolute(xm))) - self.failUnless (eq(numpy.equal(x,y), equal(xm, ym))) - self.failUnless (eq(numpy.not_equal(x,y), not_equal(xm, ym))) - self.failUnless (eq(numpy.less(x,y), less(xm, ym))) - self.failUnless (eq(numpy.greater(x,y), greater(xm, ym))) - self.failUnless (eq(numpy.less_equal(x,y), less_equal(xm, ym))) - self.failUnless (eq(numpy.greater_equal(x,y), greater_equal(xm, ym))) - self.failUnless (eq(numpy.conjugate(x), conjugate(xm))) - self.failUnless (eq(numpy.concatenate((x,y)), concatenate((xm,ym)))) - self.failUnless (eq(numpy.concatenate((x,y)), concatenate((x,y)))) - self.failUnless (eq(numpy.concatenate((x,y)), concatenate((xm,y)))) - self.failUnless (eq(numpy.concatenate((x,y,x)), concatenate((x,ym,x)))) + self.assertTrue (eq(numpy.exp(x), exp(xm))) + self.assertTrue (eq(numpy.arcsin(z), arcsin(zm))) + self.assertTrue (eq(numpy.arccos(z), arccos(zm))) + self.assertTrue (eq(numpy.arctan(z), arctan(zm))) + self.assertTrue (eq(numpy.arctan2(x, y), arctan2(xm, ym))) + self.assertTrue (eq(numpy.absolute(x), absolute(xm))) + self.assertTrue (eq(numpy.equal(x,y), equal(xm, ym))) + self.assertTrue (eq(numpy.not_equal(x,y), not_equal(xm, ym))) + self.assertTrue (eq(numpy.less(x,y), less(xm, ym))) + self.assertTrue (eq(numpy.greater(x,y), greater(xm, ym))) + self.assertTrue (eq(numpy.less_equal(x,y), less_equal(xm, ym))) + self.assertTrue (eq(numpy.greater_equal(x,y), greater_equal(xm, ym))) + self.assertTrue (eq(numpy.conjugate(x), conjugate(xm))) + self.assertTrue (eq(numpy.concatenate((x,y)), concatenate((xm,ym)))) + self.assertTrue (eq(numpy.concatenate((x,y)), concatenate((x,y)))) + self.assertTrue (eq(numpy.concatenate((x,y)), concatenate((xm,y)))) + self.assertTrue (eq(numpy.concatenate((x,y,x)), concatenate((x,ym,x)))) def test_xtestCount (self): "Test count" ott = array([0.,1.,2.,3.], mask=[1,0,0,0]) - self.failUnless( isinstance(count(ott), types.IntType)) + self.assertTrue( isinstance(count(ott), types.IntType)) self.assertEqual(3, count(ott)) self.assertEqual(1, count(1)) - self.failUnless (eq(0, array(1,mask=[1]))) + self.assertTrue (eq(0, array(1,mask=[1]))) ott=ott.reshape((2,2)) assert isinstance(count(ott,0),numpy.ndarray) assert isinstance(count(ott), types.IntType) - self.failUnless (eq(3, count(ott))) + self.assertTrue (eq(3, count(ott))) assert getmask(count(ott,0)) is nomask - self.failUnless (eq([1,2],count(ott,0))) + self.assertTrue (eq([1,2],count(ott,0))) def test_testMinMax (self): "Test minimum and maximum." @@ -171,31 +171,31 @@ xmr = ravel(xm) #true because of careful selection of data - self.failUnless(eq(max(xr), maximum(xmr))) + self.assertTrue(eq(max(xr), maximum(xmr))) #true because of careful selection of data - self.failUnless(eq(min(xr), minimum(xmr))) + self.assertTrue(eq(min(xr), minimum(xmr))) def test_testAddSumProd (self): "Test add, sum, product." (x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d - self.failUnless (eq(numpy.add.reduce(x), add.reduce(x))) - self.failUnless (eq(numpy.add.accumulate(x), add.accumulate(x))) - self.failUnless (eq(4, sum(array(4),axis=0))) - self.failUnless (eq(4, sum(array(4), axis=0))) - self.failUnless (eq(numpy.sum(x,axis=0), sum(x,axis=0))) - self.failUnless (eq(numpy.sum(filled(xm,0),axis=0), sum(xm,axis=0))) - self.failUnless (eq(numpy.sum(x,0), sum(x,0))) - self.failUnless (eq(numpy.product(x,axis=0), product(x,axis=0))) - self.failUnless (eq(numpy.product(x,0), product(x,0))) - self.failUnless (eq(numpy.product(filled(xm,1),axis=0), + self.assertTrue (eq(numpy.add.reduce(x), add.reduce(x))) + self.assertTrue (eq(numpy.add.accumulate(x), add.accumulate(x))) + self.assertTrue (eq(4, sum(array(4),axis=0))) + self.assertTrue (eq(4, sum(array(4), axis=0))) + self.assertTrue (eq(numpy.sum(x,axis=0), sum(x,axis=0))) + self.assertTrue (eq(numpy.sum(filled(xm,0),axis=0), sum(xm,axis=0))) + self.assertTrue (eq(numpy.sum(x,0), sum(x,0))) + self.assertTrue (eq(numpy.product(x,axis=0), product(x,axis=0))) + self.assertTrue (eq(numpy.product(x,0), product(x,0))) + self.assertTrue (eq(numpy.product(filled(xm,1),axis=0), product(xm,axis=0))) if len(s) > 1: - self.failUnless (eq(numpy.concatenate((x,y),1), + self.assertTrue (eq(numpy.concatenate((x,y),1), concatenate((xm,ym),1))) - self.failUnless (eq(numpy.add.reduce(x,1), add.reduce(x,1))) - self.failUnless (eq(numpy.sum(x,1), sum(x,1))) - self.failUnless (eq(numpy.product(x,1), product(x,1))) + self.assertTrue (eq(numpy.add.reduce(x,1), add.reduce(x,1))) + self.assertTrue (eq(numpy.sum(x,1), sum(x,1))) + self.assertTrue (eq(numpy.product(x,1), product(x,1))) def test_testCI(self): @@ -252,39 +252,39 @@ n = [0,0,1,0,0] m = make_mask(n) m2 = make_mask(m) - self.failUnless(m is m2) + self.assertTrue(m is m2) m3 = make_mask(m, copy=1) - self.failUnless(m is not m3) + self.assertTrue(m is not m3) x1 = numpy.arange(5) y1 = array(x1, mask=m) - self.failUnless( y1._data is not x1) - self.failUnless( allequal(x1,y1._data)) - self.failUnless( y1.mask is m) + self.assertTrue( y1._data is not x1) + self.assertTrue( allequal(x1,y1._data)) + self.assertTrue( y1.mask is m) y1a = array(y1, copy=0) - self.failUnless( y1a.mask is y1.mask) + self.assertTrue( y1a.mask is y1.mask) y2 = array(x1, mask=m, copy=0) - self.failUnless( y2.mask is m) - self.failUnless( y2[2] is masked) + self.assertTrue( y2.mask is m) + self.assertTrue( y2[2] is masked) y2[2]=9 - self.failUnless( y2[2] is not masked) - self.failUnless( y2.mask is not m) - self.failUnless( allequal(y2.mask, 0)) + self.assertTrue( y2[2] is not masked) + self.assertTrue( y2.mask is not m) + self.assertTrue( allequal(y2.mask, 0)) y3 = array(x1*1.0, mask=m) - self.failUnless(filled(y3).dtype is (x1*1.0).dtype) + self.assertTrue(filled(y3).dtype is (x1*1.0).dtype) x4 = arange(4) x4[2] = masked y4 = resize(x4, (8,)) - self.failUnless( eq(concatenate([x4,x4]), y4)) - self.failUnless( eq(getmask(y4),[0,0,1,0,0,0,1,0])) + self.assertTrue( eq(concatenate([x4,x4]), y4)) + self.assertTrue( eq(getmask(y4),[0,0,1,0,0,0,1,0])) y5 = repeat(x4, (2,2,2,2), axis=0) - self.failUnless( eq(y5, [0,0,1,1,2,2,3,3])) + self.assertTrue( eq(y5, [0,0,1,1,2,2,3,3])) y6 = repeat(x4, 2, axis=0) - self.failUnless( eq(y5, y6)) + self.assertTrue( eq(y5, y6)) def test_testPut(self): "Test of put" @@ -292,19 +292,19 @@ n = [0,0,0,1,1] m = make_mask(n) x = array(d, mask = m) - self.failUnless( x[3] is masked) - self.failUnless( x[4] is masked) + self.assertTrue( x[3] is masked) + self.assertTrue( x[4] is masked) x[[1,4]] = [10,40] - self.failUnless( x.mask is not m) - self.failUnless( x[3] is masked) - self.failUnless( x[4] is not masked) - self.failUnless( eq(x, [0,10,2,-1,40])) + self.assertTrue( x.mask is not m) + self.assertTrue( x[3] is masked) + self.assertTrue( x[4] is not masked) + self.assertTrue( eq(x, [0,10,2,-1,40])) x = array(d, mask = m) x.put([0,1,2],[-1,100,200]) - self.failUnless( eq(x, [-1,100,200,0,0])) - self.failUnless( x[3] is masked) - self.failUnless( x[4] is masked) + self.assertTrue( eq(x, [-1,100,200,0,0])) + self.assertTrue( x[3] is masked) + self.assertTrue( x[4] is masked) def test_testMaPut(self): (x, y, a10, m1, m2, xm, ym, z, zm, xf, s) = self.d @@ -505,67 +505,67 @@ "Test of masked element" xx=arange(6) xx[1] = masked - self.failUnless(str(masked) == '--') - self.failUnless(xx[1] is masked) - self.failUnlessEqual(filled(xx[1], 0), 0) + self.assertTrue(str(masked) == '--') + self.assertTrue(xx[1] is masked) + self.assertEqual(filled(xx[1], 0), 0) # don't know why these should raise an exception... - #self.failUnlessRaises(Exception, lambda x,y: x+y, masked, masked) - #self.failUnlessRaises(Exception, lambda x,y: x+y, masked, 2) - #self.failUnlessRaises(Exception, lambda x,y: x+y, masked, xx) - #self.failUnlessRaises(Exception, lambda x,y: x+y, xx, masked) + #self.assertRaises(Exception, lambda x,y: x+y, masked, masked) + #self.assertRaises(Exception, lambda x,y: x+y, masked, 2) + #self.assertRaises(Exception, lambda x,y: x+y, masked, xx) + #self.assertRaises(Exception, lambda x,y: x+y, xx, masked) def test_testAverage1(self): "Test of average." ott = array([0.,1.,2.,3.], mask=[1,0,0,0]) - self.failUnless(eq(2.0, average(ott,axis=0))) - self.failUnless(eq(2.0, average(ott, weights=[1., 1., 2., 1.]))) + self.assertTrue(eq(2.0, average(ott,axis=0))) + self.assertTrue(eq(2.0, average(ott, weights=[1., 1., 2., 1.]))) result, wts = average(ott, weights=[1.,1.,2.,1.], returned=1) - self.failUnless(eq(2.0, result)) - self.failUnless(wts == 4.0) + self.assertTrue(eq(2.0, result)) + self.assertTrue(wts == 4.0) ott[:] = masked - self.failUnless(average(ott,axis=0) is masked) + self.assertTrue(average(ott,axis=0) is masked) ott = array([0.,1.,2.,3.], mask=[1,0,0,0]) ott=ott.reshape(2,2) ott[:,1] = masked - self.failUnless(eq(average(ott,axis=0), [2.0, 0.0])) - self.failUnless(average(ott,axis=1)[0] is masked) - self.failUnless(eq([2.,0.], average(ott, axis=0))) + self.assertTrue(eq(average(ott,axis=0), [2.0, 0.0])) + self.assertTrue(average(ott,axis=1)[0] is masked) + self.assertTrue(eq([2.,0.], average(ott, axis=0))) result, wts = average(ott, axis=0, returned=1) - self.failUnless(eq(wts, [1., 0.])) + self.assertTrue(eq(wts, [1., 0.])) def test_testAverage2(self): "More tests of average." w1 = [0,1,1,1,1,0] w2 = [[0,1,1,1,1,0],[1,0,0,0,0,1]] x=arange(6) - self.failUnless(allclose(average(x, axis=0), 2.5)) - self.failUnless(allclose(average(x, axis=0, weights=w1), 2.5)) + self.assertTrue(allclose(average(x, axis=0), 2.5)) + self.assertTrue(allclose(average(x, axis=0, weights=w1), 2.5)) y=array([arange(6), 2.0*arange(6)]) - self.failUnless(allclose(average(y, None), + self.assertTrue(allclose(average(y, None), numpy.add.reduce(numpy.arange(6))*3./12.)) - self.failUnless(allclose(average(y, axis=0), numpy.arange(6) * 3./2.)) - self.failUnless(allclose(average(y, axis=1), + self.assertTrue(allclose(average(y, axis=0), numpy.arange(6) * 3./2.)) + self.assertTrue(allclose(average(y, axis=1), [average(x,axis=0), average(x,axis=0) * 2.0])) - self.failUnless(allclose(average(y, None, weights=w2), 20./6.)) - self.failUnless(allclose(average(y, axis=0, weights=w2), + self.assertTrue(allclose(average(y, None, weights=w2), 20./6.)) + self.assertTrue(allclose(average(y, axis=0, weights=w2), [0.,1.,2.,3.,4.,10.])) - self.failUnless(allclose(average(y, axis=1), + self.assertTrue(allclose(average(y, axis=1), [average(x,axis=0), average(x,axis=0) * 2.0])) m1 = zeros(6) m2 = [0,0,1,1,0,0] m3 = [[0,0,1,1,0,0],[0,1,1,1,1,0]] m4 = ones(6) m5 = [0, 1, 1, 1, 1, 1] - self.failUnless(allclose(average(masked_array(x, m1),axis=0), 2.5)) - self.failUnless(allclose(average(masked_array(x, m2),axis=0), 2.5)) - self.failUnless(average(masked_array(x, m4),axis=0) is masked) + self.assertTrue(allclose(average(masked_array(x, m1),axis=0), 2.5)) + self.assertTrue(allclose(average(masked_array(x, m2),axis=0), 2.5)) + self.assertTrue(average(masked_array(x, m4),axis=0) is masked) self.assertEqual(average(masked_array(x, m5),axis=0), 0.0) self.assertEqual(count(average(masked_array(x, m4),axis=0)), 0) z = masked_array(y, m3) - self.failUnless(allclose(average(z, None), 20./6.)) - self.failUnless(allclose(average(z, axis=0), [0.,1.,99.,99.,4.0, 7.5])) - self.failUnless(allclose(average(z, axis=1), [2.5, 5.0])) - self.failUnless(allclose( average(z,axis=0, weights=w2), + self.assertTrue(allclose(average(z, None), 20./6.)) + self.assertTrue(allclose(average(z, axis=0), [0.,1.,99.,99.,4.0, 7.5])) + self.assertTrue(allclose(average(z, axis=1), [2.5, 5.0])) + self.assertTrue(allclose( average(z,axis=0, weights=w2), [0.,1., 99., 99., 4.0, 10.0])) a = arange(6) @@ -578,72 +578,72 @@ r2, w2 = average(ones((2,2,3)), returned=1) self.assertEqual(shape(w2) , shape(r2)) r2, w2 = average(ones((2,2,3)), weights=ones((2,2,3)), returned=1) - self.failUnless(shape(w2) == shape(r2)) + self.assertTrue(shape(w2) == shape(r2)) a2d = array([[1,2],[0,4]], float) a2dm = masked_array(a2d, [[0,0],[1,0]]) a2da = average(a2d, axis=0) - self.failUnless(eq (a2da, [0.5, 3.0])) + self.assertTrue(eq (a2da, [0.5, 3.0])) a2dma = average(a2dm, axis=0) - self.failUnless(eq( a2dma, [1.0, 3.0])) + self.assertTrue(eq( a2dma, [1.0, 3.0])) a2dma = average(a2dm, axis=None) - self.failUnless(eq(a2dma, 7./3.)) + self.assertTrue(eq(a2dma, 7./3.)) a2dma = average(a2dm, axis=1) - self.failUnless(eq(a2dma, [1.5, 4.0])) + self.assertTrue(eq(a2dma, [1.5, 4.0])) def test_testToPython(self): self.assertEqual(1, int(array(1))) self.assertEqual(1.0, float(array(1))) self.assertEqual(1, int(array([[[1]]]))) self.assertEqual(1.0, float(array([[1]]))) - self.failUnlessRaises(TypeError, float, array([1,1])) - self.failUnlessRaises(ValueError, bool, array([0,1])) - self.failUnlessRaises(ValueError, bool, array([0,0],mask=[0,1])) + self.assertRaises(TypeError, float, array([1,1])) + self.assertRaises(ValueError, bool, array([0,1])) + self.assertRaises(ValueError, bool, array([0,0],mask=[0,1])) def test_testScalarArithmetic(self): xm = array(0, mask=1) - self.failUnless((1/array(0)).mask) - self.failUnless((1 + xm).mask) - self.failUnless((-xm).mask) - self.failUnless((-xm).mask) - self.failUnless(maximum(xm, xm).mask) - self.failUnless(minimum(xm, xm).mask) - self.failUnless(xm.filled().dtype is xm._data.dtype) + self.assertTrue((1/array(0)).mask) + self.assertTrue((1 + xm).mask) + self.assertTrue((-xm).mask) + self.assertTrue((-xm).mask) + self.assertTrue(maximum(xm, xm).mask) + self.assertTrue(minimum(xm, xm).mask) + self.assertTrue(xm.filled().dtype is xm._data.dtype) x = array(0, mask=0) - self.failUnless(x.filled() == x._data) - self.failUnlessEqual(str(xm), str(masked_print_option)) + self.assertTrue(x.filled() == x._data) + self.assertEqual(str(xm), str(masked_print_option)) def test_testArrayMethods(self): a = array([1,3,2]) b = array([1,3,2], mask=[1,0,1]) - self.failUnless(eq(a.any(), a._data.any())) - self.failUnless(eq(a.all(), a._data.all())) - self.failUnless(eq(a.argmax(), a._data.argmax())) - self.failUnless(eq(a.argmin(), a._data.argmin())) - self.failUnless(eq(a.choose(0,1,2,3,4), a._data.choose(0,1,2,3,4))) - self.failUnless(eq(a.compress([1,0,1]), a._data.compress([1,0,1]))) - self.failUnless(eq(a.conj(), a._data.conj())) - self.failUnless(eq(a.conjugate(), a._data.conjugate())) + self.assertTrue(eq(a.any(), a._data.any())) + self.assertTrue(eq(a.all(), a._data.all())) + self.assertTrue(eq(a.argmax(), a._data.argmax())) + self.assertTrue(eq(a.argmin(), a._data.argmin())) + self.assertTrue(eq(a.choose(0,1,2,3,4), a._data.choose(0,1,2,3,4))) + self.assertTrue(eq(a.compress([1,0,1]), a._data.compress([1,0,1]))) + self.assertTrue(eq(a.conj(), a._data.conj())) + self.assertTrue(eq(a.conjugate(), a._data.conjugate())) m = array([[1,2],[3,4]]) - self.failUnless(eq(m.diagonal(), m._data.diagonal())) - self.failUnless(eq(a.sum(), a._data.sum())) - self.failUnless(eq(a.take([1,2]), a._data.take([1,2]))) - self.failUnless(eq(m.transpose(), m._data.transpose())) + self.assertTrue(eq(m.diagonal(), m._data.diagonal())) + self.assertTrue(eq(a.sum(), a._data.sum())) + self.assertTrue(eq(a.take([1,2]), a._data.take([1,2]))) + self.assertTrue(eq(m.transpose(), m._data.transpose())) def test_testArrayAttributes(self): a = array([1,3,2]) b = array([1,3,2], mask=[1,0,1]) - self.failUnlessEqual(a.ndim, 1) + self.assertEqual(a.ndim, 1) def test_testAPI(self): - self.failIf([m for m in dir(numpy.ndarray) + self.assertFalse([m for m in dir(numpy.ndarray) if m not in dir(MaskedArray) and not m.startswith('_')]) def test_testSingleElementSubscript(self): a = array([1,3,2]) b = array([1,3,2], mask=[1,0,1]) - self.failUnlessEqual(a[0].shape, ()) - self.failUnlessEqual(b[0].shape, ()) - self.failUnlessEqual(b[1].shape, ()) + self.assertEqual(a[0].shape, ()) + self.assertEqual(b[0].shape, ()) + self.assertEqual(b[1].shape, ()) class TestUfuncs(TestCase): def setUp(self): @@ -689,30 +689,30 @@ ur = uf(*args) mr = mf(*args) numpy.seterr(**olderr) - self.failUnless(eq(ur.filled(0), mr.filled(0), f)) - self.failUnless(eqmask(ur.mask, mr.mask)) + self.assertTrue(eq(ur.filled(0), mr.filled(0), f)) + self.assertTrue(eqmask(ur.mask, mr.mask)) def test_reduce(self): a = self.d[0] - self.failIf(alltrue(a,axis=0)) - self.failUnless(sometrue(a,axis=0)) - self.failUnlessEqual(sum(a[:3],axis=0), 0) - self.failUnlessEqual(product(a,axis=0), 0) + self.assertFalse(alltrue(a,axis=0)) + self.assertTrue(sometrue(a,axis=0)) + self.assertEqual(sum(a[:3],axis=0), 0) + self.assertEqual(product(a,axis=0), 0) def test_minmax(self): a = arange(1,13).reshape(3,4) amask = masked_where(a < 5,a) - self.failUnlessEqual(amask.max(), a.max()) - self.failUnlessEqual(amask.min(), 5) - self.failUnless((amask.max(0) == a.max(0)).all()) - self.failUnless((amask.min(0) == [5,6,7,8]).all()) - self.failUnless(amask.max(1)[0].mask) - self.failUnless(amask.min(1)[0].mask) + self.assertEqual(amask.max(), a.max()) + self.assertEqual(amask.min(), 5) + self.assertTrue((amask.max(0) == a.max(0)).all()) + self.assertTrue((amask.min(0) == [5,6,7,8]).all()) + self.assertTrue(amask.max(1)[0].mask) + self.assertTrue(amask.min(1)[0].mask) def test_nonzero(self): for t in "?bhilqpBHILQPfdgFDGO": x = array([1,0,2,0], mask=[0,0,1,1]) - self.failUnless(eq(nonzero(x), [0])) + self.assertTrue(eq(nonzero(x), [0])) class TestArrayMethods(TestCase): @@ -753,15 +753,15 @@ (x,X,XX,m,mx,mX,mXX,) = self.d mXdiag = mX.diagonal() self.assertEqual(mX.trace(), mX.diagonal().compressed().sum()) - self.failUnless(eq(mX.trace(), + self.assertTrue(eq(mX.trace(), X.trace() - sum(mXdiag.mask*X.diagonal(),axis=0))) def test_clip(self): (x,X,XX,m,mx,mX,mXX,) = self.d clipped = mx.clip(2,8) - self.failUnless(eq(clipped.mask,mx.mask)) - self.failUnless(eq(clipped._data,x.clip(2,8))) - self.failUnless(eq(clipped._data,mx._data.clip(2,8))) + self.assertTrue(eq(clipped.mask,mx.mask)) + self.assertTrue(eq(clipped._data,x.clip(2,8))) + self.assertTrue(eq(clipped._data,mx._data.clip(2,8))) def test_ptp(self): (x,X,XX,m,mx,mX,mXX,) = self.d @@ -773,13 +773,13 @@ cols[k] = mX[:,k].compressed().ptp() for k in range(n): rows[k] = mX[k].compressed().ptp() - self.failUnless(eq(mX.ptp(0),cols)) - self.failUnless(eq(mX.ptp(1),rows)) + self.assertTrue(eq(mX.ptp(0),cols)) + self.assertTrue(eq(mX.ptp(1),rows)) def test_swapaxes(self): (x,X,XX,m,mx,mX,mXX,) = self.d mXswapped = mX.swapaxes(0,1) - self.failUnless(eq(mXswapped[-1],mX[:,-1])) + self.assertTrue(eq(mXswapped[-1],mX[:,-1])) mXXswapped = mXX.swapaxes(0,2) self.assertEqual(mXXswapped.shape,(2,2,3,3)) @@ -787,28 +787,28 @@ def test_cumprod(self): (x,X,XX,m,mx,mX,mXX,) = self.d mXcp = mX.cumprod(0) - self.failUnless(eq(mXcp._data,mX.filled(1).cumprod(0))) + self.assertTrue(eq(mXcp._data,mX.filled(1).cumprod(0))) mXcp = mX.cumprod(1) - self.failUnless(eq(mXcp._data,mX.filled(1).cumprod(1))) + self.assertTrue(eq(mXcp._data,mX.filled(1).cumprod(1))) def test_cumsum(self): (x,X,XX,m,mx,mX,mXX,) = self.d mXcp = mX.cumsum(0) - self.failUnless(eq(mXcp._data,mX.filled(0).cumsum(0))) + self.assertTrue(eq(mXcp._data,mX.filled(0).cumsum(0))) mXcp = mX.cumsum(1) - self.failUnless(eq(mXcp._data,mX.filled(0).cumsum(1))) + self.assertTrue(eq(mXcp._data,mX.filled(0).cumsum(1))) def test_varstd(self): (x,X,XX,m,mx,mX,mXX,) = self.d - self.failUnless(eq(mX.var(axis=None),mX.compressed().var())) - self.failUnless(eq(mX.std(axis=None),mX.compressed().std())) - self.failUnless(eq(mXX.var(axis=3).shape,XX.var(axis=3).shape)) - self.failUnless(eq(mX.var().shape,X.var().shape)) + self.assertTrue(eq(mX.var(axis=None),mX.compressed().var())) + self.assertTrue(eq(mX.std(axis=None),mX.compressed().std())) + self.assertTrue(eq(mXX.var(axis=3).shape,XX.var(axis=3).shape)) + self.assertTrue(eq(mX.var().shape,X.var().shape)) (mXvar0,mXvar1) = (mX.var(axis=0), mX.var(axis=1)) for k in range(6): - self.failUnless(eq(mXvar1[k],mX[k].compressed().var())) - self.failUnless(eq(mXvar0[k],mX[:,k].compressed().var())) - self.failUnless(eq(numpy.sqrt(mXvar0[k]), + self.assertTrue(eq(mXvar1[k],mX[k].compressed().var())) + self.assertTrue(eq(mXvar0[k],mX[:,k].compressed().var())) + self.assertTrue(eq(numpy.sqrt(mXvar0[k]), mX[:,k].compressed().std())) Modified: trunk/numpy/ma/tests/test_subclassing.py =================================================================== --- trunk/numpy/ma/tests/test_subclassing.py 2010-02-20 18:22:04 UTC (rev 8194) +++ trunk/numpy/ma/tests/test_subclassing.py 2010-02-20 22:31:25 UTC (rev 8195) @@ -81,40 +81,40 @@ m = [0,0,1,0,0] xsub = SubArray(x) xmsub = masked_array(xsub, mask=m) - self.failUnless(isinstance(xmsub, MaskedArray)) + self.assertTrue(isinstance(xmsub, MaskedArray)) assert_equal(xmsub._data, xsub) - self.failUnless(isinstance(xmsub._data, SubArray)) + self.assertTrue(isinstance(xmsub._data, SubArray)) def test_maskedarray_subclassing(self): "Tests subclassing MaskedArray" (x, mx) = self.data - self.failUnless(isinstance(mx._data, np.matrix)) + self.assertTrue(isinstance(mx._data, np.matrix)) def test_masked_unary_operations(self): "Tests masked_unary_operation" (x, mx) = self.data - self.failUnless(isinstance(log(mx), mmatrix)) + self.assertTrue(isinstance(log(mx), mmatrix)) assert_equal(log(x), np.log(x)) def test_masked_binary_operations(self): "Tests masked_binary_operation" (x, mx) = self.data # Result should be a mmatrix - self.failUnless(isinstance(add(mx,mx), mmatrix)) - self.failUnless(isinstance(add(mx,x), mmatrix)) + self.assertTrue(isinstance(add(mx,mx), mmatrix)) + self.assertTrue(isinstance(add(mx,x), mmatrix)) # Result should work assert_equal(add(mx,x), mx+x) - self.failUnless(isinstance(add(mx,mx)._data, np.matrix)) - self.failUnless(isinstance(add.outer(mx,mx), mmatrix)) - self.failUnless(isinstance(hypot(mx,mx), mmatrix)) - self.failUnless(isinstance(hypot(mx,x), mmatrix)) + self.assertTrue(isinstance(add(mx,mx)._data, np.matrix)) + self.assertTrue(isinstance(add.outer(mx,mx), mmatrix)) + self.assertTrue(isinstance(hypot(mx,mx), mmatrix)) + self.assertTrue(isinstance(hypot(mx,x), mmatrix)) def test_masked_binary_operations(self): "Tests domained_masked_binary_operation" (x, mx) = self.data xmx = masked_array(mx.data.__array__(), mask=mx.mask) - self.failUnless(isinstance(divide(mx,mx), mmatrix)) - self.failUnless(isinstance(divide(mx,x), mmatrix)) + self.assertTrue(isinstance(divide(mx,mx), mmatrix)) + self.assertTrue(isinstance(divide(mx,x), mmatrix)) assert_equal(divide(mx, mx), divide(xmx, xmx)) def test_attributepropagation(self): @@ -123,16 +123,16 @@ ym = msubarray(x) # z = (my+1) - self.failUnless(isinstance(z,MaskedArray)) - self.failUnless(not isinstance(z, MSubArray)) - self.failUnless(isinstance(z._data, SubArray)) + self.assertTrue(isinstance(z,MaskedArray)) + self.assertTrue(not isinstance(z, MSubArray)) + self.assertTrue(isinstance(z._data, SubArray)) assert_equal(z._data.info, {}) # z = (ym+1) - self.failUnless(isinstance(z, MaskedArray)) - self.failUnless(isinstance(z, MSubArray)) - self.failUnless(isinstance(z._data, SubArray)) - self.failUnless(z._data.info['added'] > 0) + self.assertTrue(isinstance(z, MaskedArray)) + self.assertTrue(isinstance(z, MSubArray)) + self.assertTrue(isinstance(z._data, SubArray)) + self.assertTrue(z._data.info['added'] > 0) # ym._set_mask([1,0,0,0,1]) assert_equal(ym._mask, [1,0,0,0,1]) @@ -141,7 +141,7 @@ # xsub = subarray(x, info={'name':'x'}) mxsub = masked_array(xsub) - self.failUnless(hasattr(mxsub, 'info')) + self.assertTrue(hasattr(mxsub, 'info')) assert_equal(mxsub.info, xsub.info) def test_subclasspreservation(self): @@ -152,22 +152,22 @@ xsub = MSubArray(x, mask=m, info={'xsub':xinfo}) # mxsub = masked_array(xsub, subok=False) - self.failUnless(not isinstance(mxsub, MSubArray)) - self.failUnless(isinstance(mxsub, MaskedArray)) + self.assertTrue(not isinstance(mxsub, MSubArray)) + self.assertTrue(isinstance(mxsub, MaskedArray)) assert_equal(mxsub._mask, m) # mxsub = asarray(xsub) - self.failUnless(not isinstance(mxsub, MSubArray)) - self.failUnless(isinstance(mxsub, MaskedArray)) + self.assertTrue(not isinstance(mxsub, MSubArray)) + self.assertTrue(isinstance(mxsub, MaskedArray)) assert_equal(mxsub._mask, m) # mxsub = masked_array(xsub, subok=True) - self.failUnless(isinstance(mxsub, MSubArray)) + self.assertTrue(isinstance(mxsub, MSubArray)) assert_equal(mxsub.info, xsub.info) assert_equal(mxsub._mask, xsub._mask) # mxsub = asanyarray(xsub) - self.failUnless(isinstance(mxsub, MSubArray)) + self.assertTrue(isinstance(mxsub, MSubArray)) assert_equal(mxsub.info, xsub.info) assert_equal(mxsub._mask, m) Modified: trunk/numpy/matrixlib/tests/test_regression.py =================================================================== --- trunk/numpy/matrixlib/tests/test_regression.py 2010-02-20 18:22:04 UTC (rev 8194) +++ trunk/numpy/matrixlib/tests/test_regression.py 2010-02-20 22:31:25 UTC (rev 8195) @@ -23,7 +23,7 @@ def mul() : np.mat(np.eye(2))*np.ones(2) - self.failUnlessRaises(ValueError,mul) + self.assertRaises(ValueError,mul) def test_matrix_std_argmax(self,level=rlevel): """Ticket #83""" Modified: trunk/numpy/testing/tests/test_utils.py =================================================================== --- trunk/numpy/testing/tests/test_utils.py 2010-02-20 18:22:04 UTC (rev 8194) +++ trunk/numpy/testing/tests/test_utils.py 2010-02-20 22:31:25 UTC (rev 8195) @@ -174,7 +174,7 @@ self._assert_func(x, y, decimal=3) self._assert_func(x, y, decimal=4) - self.failUnlessRaises(AssertionError, + self.assertRaises(AssertionError, lambda: self._assert_func(x, y, decimal=5)) def test_nan(self): @@ -182,11 +182,11 @@ aone = np.array([1]) ainf = np.array([np.inf]) self._assert_func(anan, anan) - self.failUnlessRaises(AssertionError, + self.assertRaises(AssertionError, lambda : self._assert_func(anan, aone)) - self.failUnlessRaises(AssertionError, + self.assertRaises(AssertionError, lambda : self._assert_func(anan, ainf)) - self.failUnlessRaises(AssertionError, + self.assertRaises(AssertionError, lambda : self._assert_func(ainf, anan)) class TestAlmostEqual(_GenericTest, unittest.TestCase): @@ -195,11 +195,11 @@ def test_nan_item(self): self._assert_func(np.nan, np.nan) - self.failUnlessRaises(AssertionError, + self.assertRaises(AssertionError, lambda : self._assert_func(np.nan, 1)) - self.failUnlessRaises(AssertionError, + self.assertRaises(AssertionError, lambda : self._assert_func(np.nan, np.inf)) - self.failUnlessRaises(AssertionError, + self.assertRaises(AssertionError, lambda : self._assert_func(np.inf, np.nan)) def test_inf_item(self): @@ -235,7 +235,7 @@ self._assert_func(x, y, significant=5) self._assert_func(x, y, significant=6) - self.failUnlessRaises(AssertionError, + self.assertRaises(AssertionError, lambda: self._assert_func(x, y, significant=7)) def test_simple_items(self): @@ -245,7 +245,7 @@ self._assert_func(x, y, significant=4) self._assert_func(x, y, significant=5) self._assert_func(x, y, significant=6) - self.failUnlessRaises(AssertionError, + self.assertRaises(AssertionError, lambda: self._assert_func(x, y, significant=7)) def test_nan_array(self): @@ -253,11 +253,11 @@ aone = np.array(1) ainf = np.array(np.inf) self._assert_func(anan, anan) - self.failUnlessRaises(AssertionError, + self.assertRaises(AssertionError, lambda : self._assert_func(anan, aone)) - self.failUnlessRaises(AssertionError, + self.assertRaises(AssertionError, lambda : self._assert_func(anan, ainf)) - self.failUnlessRaises(AssertionError, + self.assertRaises(AssertionError, lambda : self._assert_func(ainf, anan)) def test_nan_items(self): @@ -265,11 +265,11 @@ aone = np.array(1) ainf = np.array(np.inf) self._assert_func(anan, anan) - self.failUnlessRaises(AssertionError, + self.assertRaises(AssertionError, lambda : self._assert_func(anan, aone)) - self.failUnlessRaises(AssertionError, + self.assertRaises(AssertionError, lambda : self._assert_func(anan, ainf)) - self.failUnlessRaises(AssertionError, + self.assertRaises(AssertionError, lambda : self._assert_func(ainf, anan)) class TestRaises(unittest.TestCase): @@ -349,7 +349,7 @@ def failure(): return assert_array_almost_equal_nulp(x, y, nulp=1000) - self.failUnlessRaises(AssertionError, failure) + self.assertRaises(AssertionError, failure) def test_big_float32(self): x = (1e10 * np.random.randn(10)).astype(np.float32) @@ -361,14 +361,14 @@ y = x + 1 def failure(): assert_array_almost_equal_nulp(x, y, nulp=1000) - self.failUnlessRaises(AssertionError, failure) + self.assertRaises(AssertionError, failure) def test_complex(self): x = np.random.randn(10) + 1j * np.random.randn(10) y = x + 1 def failure(): assert_array_almost_equal_nulp(x, y, nulp=1000) - self.failUnlessRaises(AssertionError, failure) + self.assertRaises(AssertionError, failure) def test_complex2(self): x = np.random.randn(10) @@ -414,19 +414,19 @@ tiny = np.array([np.finfo(dt).tiny]) zero = np.array([np.PZERO]).astype(dt) nzero = np.array([np.NZERO]).astype(dt) - self.failUnlessRaises(AssertionError, + self.assertRaises(AssertionError, lambda: assert_array_max_ulp(nan, inf, maxulp=maxulp)) - self.failUnlessRaises(AssertionError, + self.assertRaises(AssertionError, lambda: assert_array_max_ulp(nan, big, maxulp=maxulp)) - self.failUnlessRaises(AssertionError, + self.assertRaises(AssertionError, lambda: assert_array_max_ulp(nan, tiny, maxulp=maxulp)) - self.failUnlessRaises(AssertionError, + self.assertRaises(AssertionError, lambda: assert_array_max_ulp(nan, zero, maxulp=maxulp)) - self.failUnlessRaises(AssertionError, + self.assertRaises(AssertionError, lambda: assert_array_max_ulp(nan, nzero, maxulp=maxulp)) if __name__ == '__main__': From numpy-svn at scipy.org Sat Feb 20 20:55:28 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 19:55:28 -0600 (CST) Subject: [Numpy-svn] r8196 - in trunk/numpy: core/tests distutils/tests fft/tests lib/tests Message-ID: <20100221015528.19FE8C7C059@scipy.org> Author: charris Date: 2010-02-20 19:55:27 -0600 (Sat, 20 Feb 2010) New Revision: 8196 Modified: trunk/numpy/core/tests/test_datetime.py trunk/numpy/core/tests/test_defchararray.py trunk/numpy/core/tests/test_dtype.py trunk/numpy/core/tests/test_multiarray.py trunk/numpy/core/tests/test_numeric.py trunk/numpy/core/tests/test_numerictypes.py trunk/numpy/core/tests/test_records.py trunk/numpy/core/tests/test_regression.py trunk/numpy/core/tests/test_umath.py trunk/numpy/distutils/tests/test_npy_pkg_config.py trunk/numpy/fft/tests/test_fftpack.py trunk/numpy/lib/tests/test_function_base.py Log: DEP: Fix more files for unittest deprecated functions. It isn't clear why these tests didn't issue deprecation warnings. Are they being run? Modified: trunk/numpy/core/tests/test_datetime.py =================================================================== --- trunk/numpy/core/tests/test_datetime.py 2010-02-20 22:31:25 UTC (rev 8195) +++ trunk/numpy/core/tests/test_datetime.py 2010-02-21 01:55:27 UTC (rev 8196) @@ -52,8 +52,8 @@ def test_divisor_conversion_fs(self): assert np.dtype('M8[fs/100]') == np.dtype('M8[10as]') - self.failUnlessRaises(ValueError, lambda : np.dtype('M8[3fs/10000]')) + self.assertRaises(ValueError, lambda : np.dtype('M8[3fs/10000]')) def test_divisor_conversion_as(self): - self.failUnlessRaises(ValueError, lambda : np.dtype('M8[as/10]')) + self.assertRaises(ValueError, lambda : np.dtype('M8[as/10]')) Modified: trunk/numpy/core/tests/test_defchararray.py =================================================================== --- trunk/numpy/core/tests/test_defchararray.py 2010-02-20 22:31:25 UTC (rev 8195) +++ trunk/numpy/core/tests/test_defchararray.py 2010-02-21 01:55:27 UTC (rev 8196) @@ -21,7 +21,7 @@ def test_from_object_array_unicode(self): A = np.array([['abc', u'Sigma \u03a3'], ['long ', '0123456789']], dtype='O') - self.failUnlessRaises(ValueError, np.char.array, (A,)) + self.assertRaises(ValueError, np.char.array, (A,)) B = np.char.array(A, **kw_unicode_true) assert_equal(B.dtype.itemsize, 10 * np.array('a', 'U').dtype.itemsize) assert_array_equal(B, [['abc', u'Sigma \u03a3'], @@ -58,7 +58,7 @@ assert_equal(B.shape, A.shape) def fail(): B = np.char.array(A, **kw_unicode_false) - self.failUnlessRaises(UnicodeEncodeError, fail) + self.assertRaises(UnicodeEncodeError, fail) def test_unicode_upconvert(self): A = np.char.array(['abc']) @@ -82,37 +82,37 @@ def test_non_existent_method(self): def fail(): _vec_string('a', np.string_, 'bogus') - self.failUnlessRaises(AttributeError, fail) + self.assertRaises(AttributeError, fail) def test_non_string_array(self): def fail(): _vec_string(1, np.string_, 'strip') - self.failUnlessRaises(TypeError, fail) + self.assertRaises(TypeError, fail) def test_invalid_args_tuple(self): def fail(): _vec_string(['a'], np.string_, 'strip', 1) - self.failUnlessRaises(TypeError, fail) + self.assertRaises(TypeError, fail) def test_invalid_type_descr(self): def fail(): _vec_string(['a'], 'BOGUS', 'strip') - self.failUnlessRaises(TypeError, fail) + self.assertRaises(TypeError, fail) def test_invalid_function_args(self): def fail(): _vec_string(['a'], np.string_, 'strip', (1,)) - self.failUnlessRaises(TypeError, fail) + self.assertRaises(TypeError, fail) def test_invalid_result_type(self): def fail(): _vec_string(['a'], np.integer, 'strip') - self.failUnlessRaises(TypeError, fail) + self.assertRaises(TypeError, fail) def test_broadcast_error(self): def fail(): _vec_string([['abc', 'def']], np.integer, 'find', (['a', 'd', 'j'],)) - self.failUnlessRaises(ValueError, fail) + self.assertRaises(ValueError, fail) class TestWhitespace(TestCase): @@ -210,7 +210,7 @@ assert_array_equal(self.A.endswith('3', 0, 3), [[0, 0], [1, 0], [1, 0]]) def fail(): self.A.endswith('3', 'fdjk') - self.failUnlessRaises(TypeError, fail) + self.assertRaises(TypeError, fail) def test_find(self): assert issubclass(self.A.find('a').dtype.type, np.integer) @@ -222,7 +222,7 @@ def test_index(self): def fail(): self.A.index('a') - self.failUnlessRaises(ValueError, fail) + self.assertRaises(ValueError, fail) assert np.char.index('abcba', 'b') == 1 assert issubclass(np.char.index('abcba', 'b').dtype.type, np.integer) @@ -264,7 +264,7 @@ def test_rindex(self): def fail(): self.A.rindex('a') - self.failUnlessRaises(ValueError, fail) + self.assertRaises(ValueError, fail) assert np.char.rindex('abcba', 'b') == 3 assert issubclass(np.char.rindex('abcba', 'b').dtype.type, np.integer) @@ -274,7 +274,7 @@ assert_array_equal(self.A.startswith('1', 0, 3), [[0, 0], [1, 0], [1, 0]]) def fail(): self.A.startswith('3', 'fdjk') - self.failUnlessRaises(TypeError, fail) + self.assertRaises(TypeError, fail) class TestMethods(TestCase): @@ -538,7 +538,7 @@ def test_isnumeric(self): def fail(): self.A.isnumeric() - self.failUnlessRaises(TypeError, fail) + self.assertRaises(TypeError, fail) assert issubclass(self.B.isnumeric().dtype.type, np.bool_) assert_array_equal(self.B.isnumeric(), [ [False, False], [True, False], [False, False]]) @@ -546,7 +546,7 @@ def test_isdecimal(self): def fail(): self.A.isdecimal() - self.failUnlessRaises(TypeError, fail) + self.assertRaises(TypeError, fail) assert issubclass(self.B.isdecimal().dtype.type, np.bool_) assert_array_equal(self.B.isdecimal(), [ [False, False], [True, False], [False, False]]) Modified: trunk/numpy/core/tests/test_dtype.py =================================================================== --- trunk/numpy/core/tests/test_dtype.py 2010-02-20 22:31:25 UTC (rev 8195) +++ trunk/numpy/core/tests/test_dtype.py 2010-02-21 01:55:27 UTC (rev 8196) @@ -14,14 +14,14 @@ """Test whether equivalent record dtypes hash the same.""" a = np.dtype([('yo', np.int)]) b = np.dtype([('yo', np.int)]) - self.failUnless(hash(a) == hash(b), + self.assertTrue(hash(a) == hash(b), "two equivalent types do not hash to the same value !") def test_different_names(self): # In theory, they may hash the same (collision) ? a = np.dtype([('yo', np.int)]) b = np.dtype([('ye', np.int)]) - self.failUnless(hash(a) != hash(b), + self.assertTrue(hash(a) != hash(b), "%s and %s hash the same !" % (a, b)) def test_different_titles(self): @@ -30,38 +30,38 @@ 'titles': ['Red pixel', 'Blue pixel']}) b = np.dtype({'names': ['r','b'], 'formats': ['u1', 'u1'], 'titles': ['RRed pixel', 'Blue pixel']}) - self.failUnless(hash(a) != hash(b), + self.assertTrue(hash(a) != hash(b), "%s and %s hash the same !" % (a, b)) class TestSubarray(TestCase): def test_single_subarray(self): a = np.dtype((np.int, (2))) b = np.dtype((np.int, (2,))) - self.failUnless(hash(a) == hash(b), + self.assertTrue(hash(a) == hash(b), "two equivalent types do not hash to the same value !") def test_equivalent_record(self): """Test whether equivalent subarray dtypes hash the same.""" a = np.dtype((np.int, (2, 3))) b = np.dtype((np.int, (2, 3))) - self.failUnless(hash(a) == hash(b), + self.assertTrue(hash(a) == hash(b), "two equivalent types do not hash to the same value !") def test_nonequivalent_record(self): """Test whether different subarray dtypes hash differently.""" a = np.dtype((np.int, (2, 3))) b = np.dtype((np.int, (3, 2))) - self.failUnless(hash(a) != hash(b), + self.assertTrue(hash(a) != hash(b), "%s and %s hash the same !" % (a, b)) a = np.dtype((np.int, (2, 3))) b = np.dtype((np.int, (2, 2))) - self.failUnless(hash(a) != hash(b), + self.assertTrue(hash(a) != hash(b), "%s and %s hash the same !" % (a, b)) a = np.dtype((np.int, (1, 2, 3))) b = np.dtype((np.int, (1, 2))) - self.failUnless(hash(a) != hash(b), + self.assertTrue(hash(a) != hash(b), "%s and %s hash the same !" % (a, b)) class TestMonsterType(TestCase): @@ -73,13 +73,13 @@ ('yi', np.dtype((np.int, (3, 2))))]) b = np.dtype([('yo', np.int), ('ye', simple1), ('yi', np.dtype((np.int, (3, 2))))]) - self.failUnless(hash(a) == hash(b)) + self.assertTrue(hash(a) == hash(b)) c = np.dtype([('yo', np.int), ('ye', simple1), ('yi', np.dtype((a, (3, 2))))]) d = np.dtype([('yo', np.int), ('ye', simple1), ('yi', np.dtype((a, (3, 2))))]) - self.failUnless(hash(c) == hash(d)) + self.assertTrue(hash(c) == hash(d)) class TestMetadata(TestCase): def test_no_metadata(self): Modified: trunk/numpy/core/tests/test_multiarray.py =================================================================== --- trunk/numpy/core/tests/test_multiarray.py 2010-02-20 22:31:25 UTC (rev 8195) +++ trunk/numpy/core/tests/test_multiarray.py 2010-02-21 01:55:27 UTC (rev 8196) @@ -66,7 +66,7 @@ assert_equal(self.three.dtype, dtype(float_)) assert_equal(self.one.dtype.char, 'l') assert_equal(self.three.dtype.char, 'd') - self.failUnless(self.three.dtype.str[0] in '<>') + self.assertTrue(self.three.dtype.str[0] in '<>') assert_equal(self.one.dtype.str[1], 'i') assert_equal(self.three.dtype.str[1], 'f') @@ -77,11 +77,11 @@ offset=offset*x.itemsize, strides=strides*x.itemsize) assert_equal(make_array(4, 4, -1), array([4, 3, 2, 1])) - self.failUnlessRaises(ValueError, make_array, 4, 4, -2) - self.failUnlessRaises(ValueError, make_array, 4, 2, -1) - self.failUnlessRaises(ValueError, make_array, 8, 3, 1) - #self.failUnlessRaises(ValueError, make_array, 8, 3, 0) - #self.failUnlessRaises(ValueError, lambda: ndarray([1], strides=4)) + self.assertRaises(ValueError, make_array, 4, 4, -2) + self.assertRaises(ValueError, make_array, 4, 2, -1) + self.assertRaises(ValueError, make_array, 8, 3, 1) + #self.assertRaises(ValueError, make_array, 8, 3, 0) + #self.assertRaises(ValueError, lambda: ndarray([1], strides=4)) def test_set_stridesattr(self): @@ -95,10 +95,10 @@ return r assert_equal(make_array(4, 4, -1), array([4, 3, 2, 1])) assert_equal(make_array(7,3,1), array([3, 4, 5, 6, 7, 8, 9])) - self.failUnlessRaises(ValueError, make_array, 4, 4, -2) - self.failUnlessRaises(ValueError, make_array, 4, 2, -1) - self.failUnlessRaises(RuntimeError, make_array, 8, 3, 1) - #self.failUnlessRaises(ValueError, make_array, 8, 3, 0) + self.assertRaises(ValueError, make_array, 4, 4, -2) + self.assertRaises(ValueError, make_array, 4, 2, -1) + self.assertRaises(RuntimeError, make_array, 8, 3, 1) + #self.assertRaises(ValueError, make_array, 8, 3, 0) def test_fill(self): for t in "?bhilqpBHILQPfdgFDGO": @@ -126,75 +126,75 @@ def test_ellipsis_subscript(self): a,b = self.d - self.failUnlessEqual(a[...], 0) - self.failUnlessEqual(b[...], 'x') - self.failUnless(a[...] is a) - self.failUnless(b[...] is b) + self.assertEqual(a[...], 0) + self.assertEqual(b[...], 'x') + self.assertTrue(a[...] is a) + self.assertTrue(b[...] is b) def test_empty_subscript(self): a,b = self.d - self.failUnlessEqual(a[()], 0) - self.failUnlessEqual(b[()], 'x') - self.failUnless(type(a[()]) is a.dtype.type) - self.failUnless(type(b[()]) is str) + self.assertEqual(a[()], 0) + self.assertEqual(b[()], 'x') + self.assertTrue(type(a[()]) is a.dtype.type) + self.assertTrue(type(b[()]) is str) def test_invalid_subscript(self): a,b = self.d - self.failUnlessRaises(IndexError, lambda x: x[0], a) - self.failUnlessRaises(IndexError, lambda x: x[0], b) - self.failUnlessRaises(IndexError, lambda x: x[array([], int)], a) - self.failUnlessRaises(IndexError, lambda x: x[array([], int)], b) + self.assertRaises(IndexError, lambda x: x[0], a) + self.assertRaises(IndexError, lambda x: x[0], b) + self.assertRaises(IndexError, lambda x: x[array([], int)], a) + self.assertRaises(IndexError, lambda x: x[array([], int)], b) def test_ellipsis_subscript_assignment(self): a,b = self.d a[...] = 42 - self.failUnlessEqual(a, 42) + self.assertEqual(a, 42) b[...] = '' - self.failUnlessEqual(b.item(), '') + self.assertEqual(b.item(), '') def test_empty_subscript_assignment(self): a,b = self.d a[()] = 42 - self.failUnlessEqual(a, 42) + self.assertEqual(a, 42) b[()] = '' - self.failUnlessEqual(b.item(), '') + self.assertEqual(b.item(), '') def test_invalid_subscript_assignment(self): a,b = self.d def assign(x, i, v): x[i] = v - self.failUnlessRaises(IndexError, assign, a, 0, 42) - self.failUnlessRaises(IndexError, assign, b, 0, '') - self.failUnlessRaises(ValueError, assign, a, (), '') + self.assertRaises(IndexError, assign, a, 0, 42) + self.assertRaises(IndexError, assign, b, 0, '') + self.assertRaises(ValueError, assign, a, (), '') def test_newaxis(self): a,b = self.d - self.failUnlessEqual(a[newaxis].shape, (1,)) - self.failUnlessEqual(a[..., newaxis].shape, (1,)) - self.failUnlessEqual(a[newaxis, ...].shape, (1,)) - self.failUnlessEqual(a[..., newaxis].shape, (1,)) - self.failUnlessEqual(a[newaxis, ..., newaxis].shape, (1,1)) - self.failUnlessEqual(a[..., newaxis, newaxis].shape, (1,1)) - self.failUnlessEqual(a[newaxis, newaxis, ...].shape, (1,1)) - self.failUnlessEqual(a[(newaxis,)*10].shape, (1,)*10) + self.assertEqual(a[newaxis].shape, (1,)) + self.assertEqual(a[..., newaxis].shape, (1,)) + self.assertEqual(a[newaxis, ...].shape, (1,)) + self.assertEqual(a[..., newaxis].shape, (1,)) + self.assertEqual(a[newaxis, ..., newaxis].shape, (1,1)) + self.assertEqual(a[..., newaxis, newaxis].shape, (1,1)) + self.assertEqual(a[newaxis, newaxis, ...].shape, (1,1)) + self.assertEqual(a[(newaxis,)*10].shape, (1,)*10) def test_invalid_newaxis(self): a,b = self.d def subscript(x, i): x[i] - self.failUnlessRaises(IndexError, subscript, a, (newaxis, 0)) - self.failUnlessRaises(IndexError, subscript, a, (newaxis,)*50) + self.assertRaises(IndexError, subscript, a, (newaxis, 0)) + self.assertRaises(IndexError, subscript, a, (newaxis,)*50) def test_constructor(self): x = ndarray(()) x[()] = 5 - self.failUnlessEqual(x[()], 5) + self.assertEqual(x[()], 5) y = ndarray((),buffer=x) y[()] = 6 - self.failUnlessEqual(x[()], 6) + self.assertEqual(x[()], 6) def test_output(self): x = array(2) - self.failUnlessRaises(ValueError, add, x, [1], x) + self.assertRaises(ValueError, add, x, [1], x) class TestScalarIndexing(TestCase): @@ -203,41 +203,41 @@ def test_ellipsis_subscript(self): a = self.d - self.failUnlessEqual(a[...], 0) - self.failUnlessEqual(a[...].shape,()) + self.assertEqual(a[...], 0) + self.assertEqual(a[...].shape,()) def test_empty_subscript(self): a = self.d - self.failUnlessEqual(a[()], 0) - self.failUnlessEqual(a[()].shape,()) + self.assertEqual(a[()], 0) + self.assertEqual(a[()].shape,()) def test_invalid_subscript(self): a = self.d - self.failUnlessRaises(IndexError, lambda x: x[0], a) - self.failUnlessRaises(IndexError, lambda x: x[array([], int)], a) + self.assertRaises(IndexError, lambda x: x[0], a) + self.assertRaises(IndexError, lambda x: x[array([], int)], a) def test_invalid_subscript_assignment(self): a = self.d def assign(x, i, v): x[i] = v - self.failUnlessRaises(TypeError, assign, a, 0, 42) + self.assertRaises(TypeError, assign, a, 0, 42) def test_newaxis(self): a = self.d - self.failUnlessEqual(a[newaxis].shape, (1,)) - self.failUnlessEqual(a[..., newaxis].shape, (1,)) - self.failUnlessEqual(a[newaxis, ...].shape, (1,)) - self.failUnlessEqual(a[..., newaxis].shape, (1,)) - self.failUnlessEqual(a[newaxis, ..., newaxis].shape, (1,1)) - self.failUnlessEqual(a[..., newaxis, newaxis].shape, (1,1)) - self.failUnlessEqual(a[newaxis, newaxis, ...].shape, (1,1)) - self.failUnlessEqual(a[(newaxis,)*10].shape, (1,)*10) + self.assertEqual(a[newaxis].shape, (1,)) + self.assertEqual(a[..., newaxis].shape, (1,)) + self.assertEqual(a[newaxis, ...].shape, (1,)) + self.assertEqual(a[..., newaxis].shape, (1,)) + self.assertEqual(a[newaxis, ..., newaxis].shape, (1,1)) + self.assertEqual(a[..., newaxis, newaxis].shape, (1,1)) + self.assertEqual(a[newaxis, newaxis, ...].shape, (1,1)) + self.assertEqual(a[(newaxis,)*10].shape, (1,)*10) def test_invalid_newaxis(self): a = self.d def subscript(x, i): x[i] - self.failUnlessRaises(IndexError, subscript, a, (newaxis, 0)) - self.failUnlessRaises(IndexError, subscript, a, (newaxis,)*50) + self.assertRaises(IndexError, subscript, a, (newaxis, 0)) + self.assertRaises(IndexError, subscript, a, (newaxis,)*50) class TestCreation(TestCase): @@ -245,7 +245,7 @@ class x(object): def __array__(self, dtype=None): pass - self.failUnlessRaises(ValueError, array, x()) + self.assertRaises(ValueError, array, x()) def test_from_string(self) : types = np.typecodes['AllInteger'] + np.typecodes['Float'] @@ -260,12 +260,12 @@ def test_test_interning(self): a0 = bool_(0) b0 = bool_(False) - self.failUnless(a0 is b0) + self.assertTrue(a0 is b0) a1 = bool_(1) b1 = bool_(True) - self.failUnless(a1 is b1) - self.failUnless(array([True])[0] is a1) - self.failUnless(array(True)[()] is a1) + self.assertTrue(a1 is b1) + self.assertTrue(array([True])[0] is a1) + self.assertTrue(array(True)[()] is a1) class TestMethods(TestCase): @@ -278,9 +278,9 @@ def test_transpose(self): a = array([[1,2],[3,4]]) assert_equal(a.transpose(), [[1,3],[2,4]]) - self.failUnlessRaises(ValueError, lambda: a.transpose(0)) - self.failUnlessRaises(ValueError, lambda: a.transpose(0,0)) - self.failUnlessRaises(ValueError, lambda: a.transpose(0,1,2)) + self.assertRaises(ValueError, lambda: a.transpose(0)) + self.assertRaises(ValueError, lambda: a.transpose(0,0)) + self.assertRaises(ValueError, lambda: a.transpose(0,1,2)) def test_sort(self): # test ordering for floats and complex containing nans. It is only @@ -545,10 +545,10 @@ class TestSubscripting(TestCase): def test_test_zero_rank(self): x = array([1,2,3]) - self.failUnless(isinstance(x[0], np.int_)) + self.assertTrue(isinstance(x[0], np.int_)) if sys.version_info[0] < 3: - self.failUnless(isinstance(x[0], int)) - self.failUnless(type(x[0, ...]) is ndarray) + self.assertTrue(isinstance(x[0], int)) + self.assertTrue(type(x[0, ...]) is ndarray) class TestPickling(TestCase): @@ -774,7 +774,7 @@ yield self.tst_basic,x.copy().astype(T),T,mask,val def test_mask_size(self): - self.failUnlessRaises(ValueError, np.putmask, + self.assertRaises(ValueError, np.putmask, np.array([1,2,3]), [True], 5) def tst_byteorder(self,dtype): @@ -820,8 +820,8 @@ def test_raise(self): x = np.random.random(24)*100 x.shape = 2,3,4 - self.failUnlessRaises(IndexError, x.take, [0,1,2], axis=0) - self.failUnlessRaises(IndexError, x.take, [-3], axis=0) + self.assertRaises(IndexError, x.take, [0,1,2], axis=0) + self.assertRaises(IndexError, x.take, [-3], axis=0) assert_array_equal(x.take([-1], axis=0)[0], x[1]) def test_clip(self): @@ -1048,7 +1048,7 @@ def test_check_reference(self): x = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) y = x - self.failUnlessRaises(ValueError,x.resize,(5,1)) + self.assertRaises(ValueError,x.resize,(5,1)) class TestRecord(TestCase): @@ -1258,7 +1258,7 @@ r = np.array([[2, 1, 1, 2, 3], [1, 1, 2, 3, 4], [1, 2, 3, 4, 5], [2, 3, 4, 5, 5], [3, 4, 5, 5, 4]], dtype=dt) l = test_neighborhood_iterator(x, [-2, 2], x[1], NEIGH_MODE['mirror']) - self.failUnless([i.dtype == dt for i in l]) + self.assertTrue([i.dtype == dt for i in l]) assert_array_equal(l, r) def test_mirror(self): Modified: trunk/numpy/core/tests/test_numeric.py =================================================================== --- trunk/numpy/core/tests/test_numeric.py 2010-02-20 22:31:25 UTC (rev 8195) +++ trunk/numpy/core/tests/test_numeric.py 2010-02-21 01:55:27 UTC (rev 8196) @@ -192,46 +192,46 @@ f = False_ t = True_ s = "xyz" - self.failUnless((t and s) is s) - self.failUnless((f and s) is f) + self.assertTrue((t and s) is s) + self.assertTrue((f and s) is f) def test_bitwise_or(self): f = False_ t = True_ - self.failUnless((t | t) is t) - self.failUnless((f | t) is t) - self.failUnless((t | f) is t) - self.failUnless((f | f) is f) + self.assertTrue((t | t) is t) + self.assertTrue((f | t) is t) + self.assertTrue((t | f) is t) + self.assertTrue((f | f) is f) def test_bitwise_and(self): f = False_ t = True_ - self.failUnless((t & t) is t) - self.failUnless((f & t) is f) - self.failUnless((t & f) is f) - self.failUnless((f & f) is f) + self.assertTrue((t & t) is t) + self.assertTrue((f & t) is f) + self.assertTrue((t & f) is f) + self.assertTrue((f & f) is f) def test_bitwise_xor(self): f = False_ t = True_ - self.failUnless((t ^ t) is f) - self.failUnless((f ^ t) is t) - self.failUnless((t ^ f) is t) - self.failUnless((f ^ f) is f) + self.assertTrue((t ^ t) is f) + self.assertTrue((f ^ t) is t) + self.assertTrue((t ^ f) is t) + self.assertTrue((f ^ f) is f) class TestSeterr(TestCase): def test_set(self): err = seterr() old = seterr(divide='warn') - self.failUnless(err == old) + self.assertTrue(err == old) new = seterr() - self.failUnless(new['divide'] == 'warn') + self.assertTrue(new['divide'] == 'warn') seterr(over='raise') - self.failUnless(geterr()['over'] == 'raise') - self.failUnless(new['divide'] == 'warn') + self.assertTrue(geterr()['over'] == 'raise') + self.assertTrue(new['divide'] == 'warn') seterr(**old) - self.failUnless(geterr() == old) + self.assertTrue(geterr() == old) def test_divide_err(self): seterr(divide='raise') @@ -254,16 +254,16 @@ ai32 = fromiter(self.makegen(), int32) ai64 = fromiter(self.makegen(), int64) af = fromiter(self.makegen(), float) - self.failUnless(ai32.dtype == dtype(int32)) - self.failUnless(ai64.dtype == dtype(int64)) - self.failUnless(af.dtype == dtype(float)) + self.assertTrue(ai32.dtype == dtype(int32)) + self.assertTrue(ai64.dtype == dtype(int64)) + self.assertTrue(af.dtype == dtype(float)) def test_lengths(self): expected = array(list(self.makegen())) a = fromiter(self.makegen(), int) a20 = fromiter(self.makegen(), int, 20) - self.failUnless(len(a) == len(expected)) - self.failUnless(len(a20) == 20) + self.assertTrue(len(a) == len(expected)) + self.assertTrue(len(a20) == 20) try: fromiter(self.makegen(), int, len(expected) + 10) except ValueError: @@ -275,8 +275,8 @@ expected = array(list(self.makegen())) a = fromiter(self.makegen(), int) a20 = fromiter(self.makegen(), int, 20) - self.failUnless(alltrue(a == expected,axis=0)) - self.failUnless(alltrue(a20 == expected[:20],axis=0)) + self.assertTrue(alltrue(a == expected,axis=0)) + self.assertTrue(alltrue(a20 == expected[:20],axis=0)) class TestIndex(TestCase): Modified: trunk/numpy/core/tests/test_numerictypes.py =================================================================== --- trunk/numpy/core/tests/test_numerictypes.py 2010-02-20 22:31:25 UTC (rev 8195) +++ trunk/numpy/core/tests/test_numerictypes.py 2010-02-21 01:55:27 UTC (rev 8196) @@ -360,7 +360,7 @@ def _bad_call(self): return self.ary['f0','f1'] def test_no_tuple(self): - self.failUnlessRaises(ValueError, self._bad_call) + self.assertRaises(ValueError, self._bad_call) def test_return(self): res = self.ary[['f0','f2']].tolist() assert(res == [(1,3), (5,7)]) Modified: trunk/numpy/core/tests/test_records.py =================================================================== --- trunk/numpy/core/tests/test_records.py 2010-02-20 22:31:25 UTC (rev 8195) +++ trunk/numpy/core/tests/test_records.py 2010-02-21 01:55:27 UTC (rev 8196) @@ -129,7 +129,7 @@ a = self.data def assign_invalid_column(x): x[0].col5 = 1 - self.failUnlessRaises(AttributeError, assign_invalid_column, a) + self.assertRaises(AttributeError, assign_invalid_column, a) def test_find_duplicate(): Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2010-02-20 22:31:25 UTC (rev 8195) +++ trunk/numpy/core/tests/test_regression.py 2010-02-21 01:55:27 UTC (rev 8196) @@ -84,7 +84,7 @@ b = a[:,:2,] def rs(): b.shape = (10,) - self.failUnlessRaises(AttributeError,rs) + self.assertRaises(AttributeError,rs) def test_bool(self,level=rlevel): """Ticket #60""" @@ -133,15 +133,15 @@ def test_mem_dtype_align(self,level=rlevel): """Ticket #93""" - self.failUnlessRaises(TypeError,np.dtype, + self.assertRaises(TypeError,np.dtype, {'names':['a'],'formats':['foo']},align=1) def test_intp(self,level=rlevel): """Ticket #99""" i_width = np.int_(0).nbytes*2 - 1 np.intp('0x' + 'f'*i_width,16) - self.failUnlessRaises(OverflowError,np.intp,'0x' + 'f'*(i_width+1),16) - self.failUnlessRaises(ValueError,np.intp,'0x1',32) + self.assertRaises(OverflowError,np.intp,'0x' + 'f'*(i_width+1),16) + self.assertRaises(ValueError,np.intp,'0x1',32) assert_equal(255,np.intp('0xFF',16)) assert_equal(1024,np.intp(1024)) @@ -196,7 +196,7 @@ """Ticket #128""" x = np.arange(9).reshape((3,3)) y = np.array([0,0,0]) - self.failUnlessRaises(ValueError,np.hstack,(x,y)) + self.assertRaises(ValueError,np.hstack,(x,y)) def test_squeeze_type(self,level=rlevel): """Ticket #133""" @@ -246,8 +246,8 @@ x = np.empty((3,1)) def bfa(): x[:] = np.arange(3) def bfb(): x[:] = np.arange(3,dtype=float) - self.failUnlessRaises(ValueError, bfa) - self.failUnlessRaises(ValueError, bfb) + self.assertRaises(ValueError, bfa) + self.assertRaises(ValueError, bfb) def test_unpickle_dtype_with_object(self,level=rlevel): """Implemented in r2840""" @@ -263,7 +263,7 @@ """Ticket #196""" dt = np.dtype([('x',int),('y',np.object_)]) # Wrong way - self.failUnlessRaises(ValueError, np.array, [1,'object'], dt) + self.assertRaises(ValueError, np.array, [1,'object'], dt) # Correct way np.array([(1,'object')],dt) @@ -279,7 +279,7 @@ """Ticket #205""" tmp = np.array([]) def index_tmp(): tmp[np.array(10)] - self.failUnlessRaises(IndexError, index_tmp) + self.assertRaises(IndexError, index_tmp) def test_chararray_rstrip(self,level=rlevel): """Ticket #222""" @@ -442,7 +442,7 @@ def test_string_array_size(self, level=rlevel): """Ticket #342""" - self.failUnlessRaises(ValueError, + self.assertRaises(ValueError, np.array,[['X'],['X','X','X']],'|S1') def test_dtype_repr(self, level=rlevel): @@ -513,8 +513,8 @@ def test_convolve_empty(self, level=rlevel): """Convolve should raise an error for empty input array.""" - self.failUnlessRaises(ValueError,np.convolve,[],[1]) - self.failUnlessRaises(ValueError,np.convolve,[1],[]) + self.assertRaises(ValueError,np.convolve,[],[1]) + self.assertRaises(ValueError,np.convolve,[1],[]) def test_multidim_byteswap(self, level=rlevel): """Ticket #449""" @@ -592,7 +592,7 @@ def test_mem_on_invalid_dtype(self): "Ticket #583" - self.failUnlessRaises(ValueError, np.fromiter, [['12',''],['13','']], str) + self.assertRaises(ValueError, np.fromiter, [['12',''],['13','']], str) def test_dot_negative_stride(self, level=rlevel): """Ticket #588""" @@ -607,7 +607,7 @@ x = np.ones([484,286]) y = np.zeros([484,286]) x |= y - self.failUnlessRaises(TypeError,rs) + self.assertRaises(TypeError,rs) def test_unicode_scalar(self, level=rlevel): """Ticket #600""" @@ -629,7 +629,7 @@ s = np.ones(10,dtype=float) x = np.array((15,),dtype=float) def ia(x,s): x[(s>0)]=1.0 - self.failUnlessRaises(ValueError,ia,x,s) + self.assertRaises(ValueError,ia,x,s) def test_mem_scalar_indexing(self, level=rlevel): """Ticket #603""" @@ -820,7 +820,7 @@ def test_mem_fromiter_invalid_dtype_string(self, level=rlevel): x = [1,2,3] - self.failUnlessRaises(ValueError, + self.assertRaises(ValueError, np.fromiter, [xi for xi in x], dtype='S') def test_reduce_big_object_array(self, level=rlevel): @@ -1033,7 +1033,7 @@ def test_for_zero_length_in_choose(self, level=rlevel): "Ticket #882" a = np.array(1) - self.failUnlessRaises(ValueError, lambda x: x.choose([]), a) + self.assertRaises(ValueError, lambda x: x.choose([]), a) def test_array_ndmin_overflow(self): "Ticket #947." @@ -1095,7 +1095,7 @@ good = 'Maximum allowed size exceeded' try: a = np.arange(sz) - self.failUnless(np.size == sz) + self.assertTrue(np.size == sz) except ValueError, e: if not str(e) == good: self.fail("Got msg '%s', expected '%s'" % (e, good)) @@ -1161,7 +1161,7 @@ a = np.array([[u'abc', u'\u03a3'], [u'asdf', u'erw']], dtype='U') def fail(): b = np.array(a, 'S4') - self.failUnlessRaises(UnicodeEncodeError, fail) + self.assertRaises(UnicodeEncodeError, fail) def test_mixed_string_unicode_array_creation(self): a = np.array(['1234', u'123']) @@ -1239,7 +1239,7 @@ """Ticket #1254""" def func(): x = np.dtype([(('a', 'a'), 'i'), ('b', 'i')]) - self.failUnlessRaises(ValueError, func) + self.assertRaises(ValueError, func) def test_signed_integer_division_overflow(self): """Ticket #1317.""" Modified: trunk/numpy/core/tests/test_umath.py =================================================================== --- trunk/numpy/core/tests/test_umath.py 2010-02-20 22:31:25 UTC (rev 8195) +++ trunk/numpy/core/tests/test_umath.py 2010-02-21 01:55:27 UTC (rev 8196) @@ -420,11 +420,11 @@ x = ncu.minimum(a, a) assert_equal(x.arr, np.zeros(1)) func, args, i = x.context - self.failUnless(func is ncu.minimum) - self.failUnlessEqual(len(args), 2) + self.assertTrue(func is ncu.minimum) + self.assertEqual(len(args), 2) assert_equal(args[0], a) assert_equal(args[1], a) - self.failUnlessEqual(i, 0) + self.assertEqual(i, 0) def test_wrap_with_iterable(self): # test fix for bug #1026: @@ -436,7 +436,7 @@ return arr.view(type(self)) a = with_wrap() x = ncu.multiply(a, (1, 2, 3)) - self.failUnless(isinstance(x, with_wrap)) + self.assertTrue(isinstance(x, with_wrap)) assert_array_equal(x, np.array((1, 2, 3))) def test_priority_with_scalar(self): @@ -447,7 +447,7 @@ return np.asarray(1.0, 'float64').view(cls).copy() a = A() x = np.float64(1)*a - self.failUnless(isinstance(x, A)) + self.assertTrue(isinstance(x, A)) assert_array_equal(x, np.array(1)) def test_old_wrap(self): @@ -480,25 +480,25 @@ b = B() c = C() f = ncu.minimum - self.failUnless(type(f(x,x)) is np.ndarray) - self.failUnless(type(f(x,a)) is A) - self.failUnless(type(f(x,b)) is B) - self.failUnless(type(f(x,c)) is C) - self.failUnless(type(f(a,x)) is A) - self.failUnless(type(f(b,x)) is B) - self.failUnless(type(f(c,x)) is C) + self.assertTrue(type(f(x,x)) is np.ndarray) + self.assertTrue(type(f(x,a)) is A) + self.assertTrue(type(f(x,b)) is B) + self.assertTrue(type(f(x,c)) is C) + self.assertTrue(type(f(a,x)) is A) + self.assertTrue(type(f(b,x)) is B) + self.assertTrue(type(f(c,x)) is C) - self.failUnless(type(f(a,a)) is A) - self.failUnless(type(f(a,b)) is B) - self.failUnless(type(f(b,a)) is B) - self.failUnless(type(f(b,b)) is B) - self.failUnless(type(f(b,c)) is C) - self.failUnless(type(f(c,b)) is C) - self.failUnless(type(f(c,c)) is C) + self.assertTrue(type(f(a,a)) is A) + self.assertTrue(type(f(a,b)) is B) + self.assertTrue(type(f(b,a)) is B) + self.assertTrue(type(f(b,b)) is B) + self.assertTrue(type(f(b,c)) is C) + self.assertTrue(type(f(c,b)) is C) + self.assertTrue(type(f(c,c)) is C) - self.failUnless(type(ncu.exp(a) is A)) - self.failUnless(type(ncu.exp(b) is B)) - self.failUnless(type(ncu.exp(c) is C)) + self.assertTrue(type(ncu.exp(a) is A)) + self.assertTrue(type(ncu.exp(b) is B)) + self.assertTrue(type(ncu.exp(c) is C)) def test_failing_wrap(self): class A(object): @@ -507,7 +507,7 @@ def __array_wrap__(self, arr, context): raise RuntimeError a = A() - self.failUnlessRaises(RuntimeError, ncu.maximum, a, a) + self.assertRaises(RuntimeError, ncu.maximum, a, a) def test_default_prepare(self): class with_wrap(object): @@ -539,7 +539,7 @@ def __array_prepare__(self, arr, context=None): raise RuntimeError a = A() - self.failUnlessRaises(RuntimeError, ncu.maximum, a, a) + self.assertRaises(RuntimeError, ncu.maximum, a, a) def test_array_with_context(self): class A(object): @@ -557,10 +557,10 @@ return np.zeros(1) a = A() ncu.maximum(np.zeros(1), a) - self.failUnless(a.func is ncu.maximum) + self.assertTrue(a.func is ncu.maximum) assert_equal(a.args[0], 0) - self.failUnless(a.args[1] is a) - self.failUnless(a.i == 1) + self.assertTrue(a.args[1] is a) + self.assertTrue(a.i == 1) assert_equal(ncu.maximum(a, B()), 0) assert_equal(ncu.maximum(a, C()), 0) @@ -771,8 +771,8 @@ add = ncu.add assert_equal(add.__name__, 'add') assert add.__doc__.startswith('add(x1, x2[, out])\n\n') - self.failUnless(add.ntypes >= 18) # don't fail if types added - self.failUnless('ii->i' in add.types) + self.assertTrue(add.ntypes >= 18) # don't fail if types added + self.assertTrue('ii->i' in add.types) assert_equal(add.nin, 2) assert_equal(add.nout, 1) assert_equal(add.identity, 0) Modified: trunk/numpy/distutils/tests/test_npy_pkg_config.py =================================================================== --- trunk/numpy/distutils/tests/test_npy_pkg_config.py 2010-02-20 22:31:25 UTC (rev 8195) +++ trunk/numpy/distutils/tests/test_npy_pkg_config.py 2010-02-21 01:55:27 UTC (rev 8196) @@ -46,10 +46,10 @@ os.close(fd) out = read_config(pkg) - self.failUnless(out.cflags() == simple_d['cflags']) - self.failUnless(out.libs() == simple_d['libflags']) - self.failUnless(out.name == simple_d['name']) - self.failUnless(out.version == simple_d['version']) + self.assertTrue(out.cflags() == simple_d['cflags']) + self.assertTrue(out.libs() == simple_d['libflags']) + self.assertTrue(out.name == simple_d['name']) + self.assertTrue(out.version == simple_d['version']) finally: os.remove(filename) @@ -63,34 +63,34 @@ os.close(fd) out = read_config(pkg) - self.failUnless(out.cflags() == simple_variable_d['cflags']) - self.failUnless(out.libs() == simple_variable_d['libflags']) - self.failUnless(out.name == simple_variable_d['name']) - self.failUnless(out.version == simple_variable_d['version']) + self.assertTrue(out.cflags() == simple_variable_d['cflags']) + self.assertTrue(out.libs() == simple_variable_d['libflags']) + self.assertTrue(out.name == simple_variable_d['name']) + self.assertTrue(out.version == simple_variable_d['version']) out.vars['prefix'] = '/Users/david' - self.failUnless(out.cflags() == '-I/Users/david/include') + self.assertTrue(out.cflags() == '-I/Users/david/include') finally: os.remove(filename) class TestParseFlags(TestCase): def test_simple_cflags(self): d = parse_flags("-I/usr/include") - self.failUnless(d['include_dirs'] == ['/usr/include']) + self.assertTrue(d['include_dirs'] == ['/usr/include']) d = parse_flags("-I/usr/include -DFOO") - self.failUnless(d['include_dirs'] == ['/usr/include']) - self.failUnless(d['macros'] == ['FOO']) + self.assertTrue(d['include_dirs'] == ['/usr/include']) + self.assertTrue(d['macros'] == ['FOO']) d = parse_flags("-I /usr/include -DFOO") - self.failUnless(d['include_dirs'] == ['/usr/include']) - self.failUnless(d['macros'] == ['FOO']) + self.assertTrue(d['include_dirs'] == ['/usr/include']) + self.assertTrue(d['macros'] == ['FOO']) def test_simple_lflags(self): d = parse_flags("-L/usr/lib -lfoo -L/usr/lib -lbar") - self.failUnless(d['library_dirs'] == ['/usr/lib', '/usr/lib']) - self.failUnless(d['libraries'] == ['foo', 'bar']) + self.assertTrue(d['library_dirs'] == ['/usr/lib', '/usr/lib']) + self.assertTrue(d['libraries'] == ['foo', 'bar']) d = parse_flags("-L /usr/lib -lfoo -L/usr/lib -lbar") - self.failUnless(d['library_dirs'] == ['/usr/lib', '/usr/lib']) - self.failUnless(d['libraries'] == ['foo', 'bar']) + self.assertTrue(d['library_dirs'] == ['/usr/lib', '/usr/lib']) + self.assertTrue(d['libraries'] == ['foo', 'bar']) Modified: trunk/numpy/fft/tests/test_fftpack.py =================================================================== --- trunk/numpy/fft/tests/test_fftpack.py 2010-02-20 22:31:25 UTC (rev 8195) +++ trunk/numpy/fft/tests/test_fftpack.py 2010-02-21 01:55:27 UTC (rev 8196) @@ -9,7 +9,7 @@ class TestFFTShift(TestCase): def test_fft_n(self): - self.failUnlessRaises(ValueError,np.fft.fft,[1,2,3],0) + self.assertRaises(ValueError,np.fft.fft,[1,2,3],0) class TestFFT1D(TestCase): Modified: trunk/numpy/lib/tests/test_function_base.py =================================================================== --- trunk/numpy/lib/tests/test_function_base.py 2010-02-20 22:31:25 UTC (rev 8195) +++ trunk/numpy/lib/tests/test_function_base.py 2010-02-21 01:55:27 UTC (rev 8196) @@ -198,9 +198,9 @@ a = array(ba,ctype) a2 = array(ba2,ctype) if ctype in ['1', 'b']: - self.failUnlessRaises(ArithmeticError, prod, a) - self.failUnlessRaises(ArithmeticError, prod, a2, 1) - self.failUnlessRaises(ArithmeticError, prod, a) + self.assertRaises(ArithmeticError, prod, a) + self.assertRaises(ArithmeticError, prod, a2, 1) + self.assertRaises(ArithmeticError, prod, a) else: assert_equal(prod(a,axis=0),26400) assert_array_equal(prod(a2,axis=0), @@ -216,9 +216,9 @@ a = array(ba,ctype) a2 = array(ba2,ctype) if ctype in ['1', 'b']: - self.failUnlessRaises(ArithmeticError, cumprod, a) - self.failUnlessRaises(ArithmeticError, cumprod, a2, 1) - self.failUnlessRaises(ArithmeticError, cumprod, a) + self.assertRaises(ArithmeticError, cumprod, a) + self.assertRaises(ArithmeticError, cumprod, a2, 1) + self.assertRaises(ArithmeticError, cumprod, a) else: assert_array_equal(cumprod(a,axis=-1), array([1, 2, 20, 220, From numpy-svn at scipy.org Sat Feb 20 21:45:30 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 20:45:30 -0600 (CST) Subject: [Numpy-svn] r8197 - trunk/numpy/core/src/multiarray Message-ID: <20100221024530.9F17FC7C059@scipy.org> Author: ptvirtan Date: 2010-02-20 20:45:30 -0600 (Sat, 20 Feb 2010) New Revision: 8197 Modified: trunk/numpy/core/src/multiarray/scalartypes.c.src Log: 3K: ENH: ensure integer scalar types are hashable -- we don't automatically inherit the hash implementation from Python ints on 3K Modified: trunk/numpy/core/src/multiarray/scalartypes.c.src =================================================================== --- trunk/numpy/core/src/multiarray/scalartypes.c.src 2010-02-21 01:55:27 UTC (rev 8196) +++ trunk/numpy/core/src/multiarray/scalartypes.c.src 2010-02-21 02:45:30 UTC (rev 8197) @@ -2438,7 +2438,7 @@ } /**end repeat**/ -#if SIZEOF_INT != SIZEOF_LONG +#if (SIZEOF_INT != SIZEOF_LONG) || defined(NPY_PY3K) static long int_arrtype_hash(PyObject *obj) { @@ -2480,14 +2480,12 @@ } return y; } -#endif -/**end repeat**/ +#else -#if SIZEOF_LONG==SIZEOF_LONGLONG static long -ulonglong_arrtype_hash(PyObject *obj) + at char@longlong_arrtype_hash(PyObject *obj) { - long x = (long)(((PyULongLongScalarObject *)obj)->obval); + long x = (long)(((Py at Char@LongLongScalarObject *)obj)->obval); if (x == -1) { x = -2; } @@ -2495,6 +2493,7 @@ } #endif +/**end repeat**/ /**begin repeat @@ -3286,13 +3285,18 @@ Py at NAME@ArrType_Type.tp_hash = @name at _arrtype_hash; /**end repeat**/ -#if SIZEOF_INT != SIZEOF_LONG +#if (SIZEOF_INT != SIZEOF_LONG) || defined(NPY_PY3K) /* We won't be inheriting from Python Int type. */ PyIntArrType_Type.tp_hash = int_arrtype_hash; #endif -#if SIZEOF_LONG != SIZEOF_LONGLONG +#if defined(NPY_PY3K) /* We won't be inheriting from Python Int type. */ + PyLongArrType_Type.tp_hash = int_arrtype_hash; +#endif + +#if (SIZEOF_LONG != SIZEOF_LONGLONG) || defined(NPY_PY3K) + /* We won't be inheriting from Python Int type. */ PyLongLongArrType_Type.tp_hash = longlong_arrtype_hash; #endif From numpy-svn at scipy.org Sat Feb 20 21:45:49 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 20:45:49 -0600 (CST) Subject: [Numpy-svn] r8198 - trunk/numpy/lib Message-ID: <20100221024549.0E366C7C059@scipy.org> Author: ptvirtan Date: 2010-02-20 20:45:48 -0600 (Sat, 20 Feb 2010) New Revision: 8198 Modified: trunk/numpy/lib/index_tricks.py Log: 3K: BUG: fix unravel_index integer division Modified: trunk/numpy/lib/index_tricks.py =================================================================== --- trunk/numpy/lib/index_tricks.py 2010-02-21 02:45:30 UTC (rev 8197) +++ trunk/numpy/lib/index_tricks.py 2010-02-21 02:45:48 UTC (rev 8198) @@ -78,7 +78,7 @@ # [dcb,dc,d,1] dim_prod = _nx.cumprod([1] + list(dims)[:0:-1])[::-1] # Indices become [x/dcb % a, x/dc % b, x/d % c, x/1 % d] - return tuple(x/dim_prod % dims) + return tuple(x//dim_prod % dims) def ix_(*args): """ From numpy-svn at scipy.org Sat Feb 20 21:46:08 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 20:46:08 -0600 (CST) Subject: [Numpy-svn] r8199 - trunk/numpy/core Message-ID: <20100221024608.C59B2C7C059@scipy.org> Author: ptvirtan Date: 2010-02-20 20:46:08 -0600 (Sat, 20 Feb 2010) New Revision: 8199 Modified: trunk/numpy/core/numerictypes.py Log: 3K: core/numerictypes: fix handling of Python types, and recognize bytes as a Python type Modified: trunk/numpy/core/numerictypes.py =================================================================== --- trunk/numpy/core/numerictypes.py 2010-02-21 02:45:48 UTC (rev 8198) +++ trunk/numpy/core/numerictypes.py 2010-02-21 02:46:08 UTC (rev 8199) @@ -99,10 +99,10 @@ # we don't export these for import *, but we do want them accessible # as numerictypes.bool, etc. from __builtin__ import bool, int, long, float, complex, object, unicode, str +from numpy.compat import bytes if sys.version_info[0] >= 3: # Py3K - from builtins import bytes class long(int): # Placeholder class -- this will not escape outside numerictypes.py pass @@ -542,16 +542,24 @@ float: 'float_', complex: 'complex_', bool: 'bool_', - str: 'string_', + bytes: 'bytes_', unicode: 'unicode_', buffer_type: 'void', } -def _python_type(t): - """returns the type corresponding to a certain Python type""" - if not isinstance(t, _types.TypeType): - t = type(t) - return allTypes[_python_types.get(t, 'object_')] +if sys.version_info[0] >= 3: + def _python_type(t): + """returns the type corresponding to a certain Python type""" + if not isinstance(t, type): + t = type(t) + return allTypes[_python_types.get(t, 'object_')] +else: + def _python_type(t): + """returns the type corresponding to a certain Python type""" + if not isinstance(t, _types.TypeType): + t = type(t) + return allTypes[_python_types.get(t, 'object_')] + def issctype(rep): """ Determines whether the given object represents a scalar data-type. From numpy-svn at scipy.org Sat Feb 20 21:46:31 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 20:46:31 -0600 (CST) Subject: [Numpy-svn] r8200 - trunk/numpy/random/mtrand Message-ID: <20100221024631.321EEC7C059@scipy.org> Author: ptvirtan Date: 2010-02-20 20:46:29 -0600 (Sat, 20 Feb 2010) New Revision: 8200 Modified: trunk/numpy/random/mtrand/mtrand.c Log: 3K: ENH: regenerate mtrand.c with a newer Cython, for better Python 3 compatibility Modified: trunk/numpy/random/mtrand/mtrand.c =================================================================== --- trunk/numpy/random/mtrand/mtrand.c 2010-02-21 02:46:08 UTC (rev 8199) +++ trunk/numpy/random/mtrand/mtrand.c 2010-02-21 02:46:29 UTC (rev 8200) @@ -1,4 +1,4 @@ -/* Generated by Cython 0.11.3 on Mon Nov 23 22:36:25 2009 */ +/* Generated by Cython 0.12.1 on Sat Feb 20 22:47:50 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -6,6 +6,7 @@ #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #else + #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif @@ -15,7 +16,9 @@ #if PY_VERSION_HEX < 0x02040000 #define METH_COEXIST 0 #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) + #define PyDict_Contains(d,o) PySequence_Contains(d,o) #endif + #if PY_VERSION_HEX < 0x02050000 typedef int Py_ssize_t; #define PY_SSIZE_T_MAX INT_MAX @@ -25,7 +28,9 @@ #define PyInt_AsSsize_t(o) PyInt_AsLong(o) #define PyNumber_Index(o) PyNumber_Int(o) #define PyIndex_Check(o) PyNumber_Check(o) + #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) #endif + #if PY_VERSION_HEX < 0x02060000 #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) @@ -35,17 +40,17 @@ #define PyType_Modified(t) typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; } Py_buffer; #define PyBUF_SIMPLE 0 @@ -59,22 +64,32 @@ #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) #endif + #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #endif + #if PY_MAJOR_VERSION >= 3 #define Py_TPFLAGS_CHECKTYPES 0 #define Py_TPFLAGS_HAVE_INDEX 0 #endif + #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif + #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type - #define PyString_Type PyBytes_Type - #define PyString_CheckExact PyBytes_CheckExact + #define PyString_Type PyUnicode_Type + #define PyString_CheckExact PyUnicode_CheckExact +#else + #define PyBytes_Type PyString_Type + #define PyBytes_CheckExact PyString_CheckExact +#endif + +#if PY_MAJOR_VERSION >= 3 #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) @@ -89,13 +104,17 @@ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define PyBytes_Type PyString_Type + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) + #endif + #if PY_MAJOR_VERSION >= 3 #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func) #endif + #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall @@ -109,6 +128,7 @@ #else #define _USE_MATH_DEFINES #endif + #if PY_VERSION_HEX < 0x02050000 #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) @@ -118,6 +138,7 @@ #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) #endif + #if PY_VERSION_HEX < 0x02050000 #define __Pyx_NAMESTR(n) ((char *)(n)) #define __Pyx_DOCSTR(n) ((char *)(n)) @@ -139,24 +160,20 @@ #include "randomkit.h" #include "distributions.h" #include "initarray.h" -#define __PYX_USE_C99_COMPLEX defined(_Complex_I) - -#ifdef __GNUC__ -#define INLINE __inline__ -#elif _WIN32 -#define INLINE __inline -#else -#define INLINE +#ifndef CYTHON_INLINE + #if defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #else + #define CYTHON_INLINE + #endif #endif -typedef struct {PyObject **p; char *s; long n; char is_unicode; char intern; char is_identifier;} __Pyx_StringTabEntry; /*proto*/ +typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ - -static int __pyx_skip_dispatch = 0; - - /* Type Conversion Predeclarations */ #if PY_MAJOR_VERSION < 3 @@ -173,8 +190,8 @@ #define __Pyx_PyBytes_AsUString(s) ((unsigned char*) __Pyx_PyBytes_AsString(s)) #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) -static INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); #if !defined(T_PYSSIZET) #if PY_VERSION_HEX < 0x02050000 @@ -238,9 +255,9 @@ #endif #endif -static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) @@ -270,35 +287,84 @@ static const char **__pyx_f; -#ifdef CYTHON_REFNANNY -typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*NewContext)(const char*, int, const char*); - void (*FinishContext)(void**); -} __Pyx_RefnannyAPIStruct; -static __Pyx_RefnannyAPIStruct *__Pyx_Refnanny = NULL; -#define __Pyx_ImportRefcountAPI(name) (__Pyx_RefnannyAPIStruct *) PyCObject_Import((char *)name, (char *)"RefnannyAPI") -#define __Pyx_INCREF(r) __Pyx_Refnanny->INCREF(__pyx_refchk, (PyObject *)(r), __LINE__) -#define __Pyx_DECREF(r) __Pyx_Refnanny->DECREF(__pyx_refchk, (PyObject *)(r), __LINE__) -#define __Pyx_GOTREF(r) __Pyx_Refnanny->GOTREF(__pyx_refchk, (PyObject *)(r), __LINE__) -#define __Pyx_GIVEREF(r) __Pyx_Refnanny->GIVEREF(__pyx_refchk, (PyObject *)(r), __LINE__) -#define __Pyx_XDECREF(r) if((r) == NULL) ; else __Pyx_DECREF(r) -#define __Pyx_SetupRefcountContext(name) void* __pyx_refchk = __Pyx_Refnanny->NewContext((name), __LINE__, __FILE__) -#define __Pyx_FinishRefcountContext() __Pyx_Refnanny->FinishContext(&__pyx_refchk) +/* Type declarations */ + +typedef double (*__pyx_t_6mtrand_rk_cont0)(rk_state *); + +typedef double (*__pyx_t_6mtrand_rk_cont1)(rk_state *, double); + +typedef double (*__pyx_t_6mtrand_rk_cont2)(rk_state *, double, double); + +typedef double (*__pyx_t_6mtrand_rk_cont3)(rk_state *, double, double, double); + +typedef long (*__pyx_t_6mtrand_rk_disc0)(rk_state *); + +typedef long (*__pyx_t_6mtrand_rk_discnp)(rk_state *, long, double); + +typedef long (*__pyx_t_6mtrand_rk_discdd)(rk_state *, double, double); + +typedef long (*__pyx_t_6mtrand_rk_discnmN)(rk_state *, long, long, long); + +typedef long (*__pyx_t_6mtrand_rk_discd)(rk_state *, double); + +/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":522 + * return sum + * + * cdef class RandomState: # <<<<<<<<<<<<<< + * """ + * RandomState(seed=None) + */ + +struct __pyx_obj_6mtrand_RandomState { + PyObject_HEAD + rk_state *internal_state; +}; + +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif + +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, int); + void (*DECREF)(void*, PyObject*, int); + void (*GOTREF)(void*, PyObject*, int); + void (*GIVEREF)(void*, PyObject*, int); + void* (*SetupContext)(const char*, int, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule((char *)modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); + end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; + } + #define __Pyx_RefNannySetupContext(name) void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) + #define __Pyx_RefNannyFinishContext() __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) + #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0) #else -#define __Pyx_INCREF(r) Py_INCREF(r) -#define __Pyx_DECREF(r) Py_DECREF(r) -#define __Pyx_GOTREF(r) -#define __Pyx_GIVEREF(r) -#define __Pyx_XDECREF(r) Py_XDECREF(r) -#define __Pyx_SetupRefcountContext(name) -#define __Pyx_FinishRefcountContext() + #define __Pyx_RefNannySetupContext(name) + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) #endif /* CYTHON_REFNANNY */ -#define __Pyx_XGIVEREF(r) if((r) == NULL) ; else __Pyx_GIVEREF(r) -#define __Pyx_XGOTREF(r) if((r) == NULL) ; else __Pyx_GOTREF(r) +#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0) +#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0) static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name); /*proto*/ @@ -309,7 +375,7 @@ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ -static INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); @@ -322,7 +388,7 @@ __Pyx_GetItemInt_List_Fast(o, i, size <= sizeof(long)) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int fits_long) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int fits_long) { if (likely(o != Py_None)) { if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); @@ -342,7 +408,7 @@ __Pyx_GetItemInt_Tuple_Fast(o, i, size <= sizeof(long)) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int fits_long) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int fits_long) { if (likely(o != Py_None)) { if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); @@ -363,7 +429,7 @@ __Pyx_GetItemInt_Fast(o, i, size <= sizeof(long)) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int fits_long) { +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int fits_long) { PyObject *r; if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) { r = PyList_GET_ITEM(o, i); @@ -382,18 +448,41 @@ return r; } +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void); + +static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/ +static int __Pyx_EndUnpack(PyObject *); /*proto*/ + static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ -static INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, +static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/ -static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ +static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) { + if (likely(PyList_CheckExact(L))) { + if (PyList_Append(L, x) < 0) return NULL; + Py_INCREF(Py_None); + return Py_None; /* this is just to have an accurate signature */ + } + else { + PyObject *r, *m; + m = __Pyx_GetAttrString(L, "append"); + if (!m) return NULL; + r = PyObject_CallFunctionObjArgs(m, x, NULL); + Py_DECREF(m); + return r; + } +} + #define __Pyx_SetItemInt(o, i, v, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \ __Pyx_SetItemInt_Fast(o, i, v, size <= sizeof(long)) : \ __Pyx_SetItemInt_Generic(o, to_py_func(i), v)) -static INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { +static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { int r; if (!j) return -1; r = PyObject_SetItem(o, j, v); @@ -401,7 +490,7 @@ return r; } -static INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int fits_long) { +static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int fits_long) { if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) { Py_INCREF(v); Py_DECREF(PyList_GET_ITEM(o, i)); @@ -416,111 +505,55 @@ } } -static INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); -static INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); +static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); -static INLINE void __Pyx_RaiseTooManyValuesError(void); +static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); -static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/ -static int __Pyx_EndUnpack(PyObject *); /*proto*/ +static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *); -static INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) { - if (likely(PyList_CheckExact(L))) { - if (PyList_Append(L, x) < 0) return NULL; - Py_INCREF(Py_None); - return Py_None; /* this is just to have an accurate signature */ - } - else { - PyObject *r, *m; - m = __Pyx_GetAttrString(L, "append"); - if (!m) return NULL; - r = PyObject_CallFunctionObjArgs(m, x, NULL); - Py_DECREF(m); - return r; - } -} +static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *); -static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); +static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *); -static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); +static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); -static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); +static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); -static INLINE char __Pyx_PyInt_AsChar(PyObject *); +static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); -static INLINE short __Pyx_PyInt_AsShort(PyObject *); +static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); -static INLINE int __Pyx_PyInt_AsInt(PyObject *); +static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); -static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); +static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *); -static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); +static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); -static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); +static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); -static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); +static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); -static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size, int strict); /*proto*/ -static INLINE long __Pyx_PyInt_AsLong(PyObject *); - -static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); - -static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); - -static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); - -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size); /*proto*/ - static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ static void __Pyx_AddTraceback(const char *funcname); /*proto*/ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ - -/* Type declarations */ - -typedef double (*__pyx_t_6mtrand_rk_cont0)(rk_state *); - -typedef double (*__pyx_t_6mtrand_rk_cont1)(rk_state *, double); - -typedef double (*__pyx_t_6mtrand_rk_cont2)(rk_state *, double, double); - -typedef double (*__pyx_t_6mtrand_rk_cont3)(rk_state *, double, double, double); - -typedef long (*__pyx_t_6mtrand_rk_disc0)(rk_state *); - -typedef long (*__pyx_t_6mtrand_rk_discnp)(rk_state *, long, double); - -typedef long (*__pyx_t_6mtrand_rk_discdd)(rk_state *, double, double); - -typedef long (*__pyx_t_6mtrand_rk_discnmN)(rk_state *, long, long, long); - -typedef long (*__pyx_t_6mtrand_rk_discd)(rk_state *, double); - -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":522 - * return sum - * - * cdef class RandomState: # <<<<<<<<<<<<<< - * """ - * RandomState(seed=None) - */ - -struct __pyx_obj_6mtrand_RandomState { - PyObject_HEAD - rk_state *internal_state; -}; /* Module declarations from numpy */ /* Module declarations from mtrand */ @@ -530,22 +563,6 @@ static PyTypeObject *__pyx_ptype_6mtrand_flatiter = 0; static PyTypeObject *__pyx_ptype_6mtrand_broadcast = 0; static PyTypeObject *__pyx_ptype_6mtrand_RandomState = 0; -static PyObject *__pyx_k_3 = 0; -static PyObject *__pyx_k_4 = 0; -static PyObject *__pyx_k_5 = 0; -static PyObject *__pyx_k_6 = 0; -static PyObject *__pyx_k_7 = 0; -static PyObject *__pyx_k_8 = 0; -static PyObject *__pyx_k_9 = 0; -static PyObject *__pyx_k_10 = 0; -static PyObject *__pyx_k_11 = 0; -static PyObject *__pyx_k_12 = 0; -static PyObject *__pyx_k_13 = 0; -static PyObject *__pyx_k_14 = 0; -static PyObject *__pyx_k_15 = 0; -static PyObject *__pyx_k_16 = 0; -static PyObject *__pyx_k_17 = 0; -static PyObject *__pyx_k_18 = 0; static PyObject *__pyx_f_6mtrand_cont0_array(rk_state *, __pyx_t_6mtrand_rk_cont0, PyObject *); /*proto*/ static PyObject *__pyx_f_6mtrand_cont1_array_sc(rk_state *, __pyx_t_6mtrand_rk_cont1, PyObject *, double); /*proto*/ static PyObject *__pyx_f_6mtrand_cont1_array(rk_state *, __pyx_t_6mtrand_rk_cont1, PyObject *, PyArrayObject *); /*proto*/ @@ -567,461 +584,441 @@ int __pyx_module_is_main_mtrand = 0; /* Implementation of mtrand */ -static PyObject *__pyx_int_624; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_TypeError; +static char __pyx_k_1[] = "size is not compatible with inputs"; +static char __pyx_k_2[] = "algorithm must be 'MT19937'"; +static char __pyx_k_3[] = "state must be 624 longs"; +static char __pyx_k_4[] = "low >= high"; +static char __pyx_k_9[] = "scale <= 0"; +static char __pyx_k_10[] = "a <= 0"; +static char __pyx_k_11[] = "b <= 0"; +static char __pyx_k_13[] = "shape <= 0"; +static char __pyx_k_15[] = "dfnum <= 0"; +static char __pyx_k_16[] = "dfden <= 0"; +static char __pyx_k_17[] = "dfnum <= 1"; +static char __pyx_k_18[] = "nonc < 0"; +static char __pyx_k_19[] = "df <= 0"; +static char __pyx_k_20[] = "nonc <= 0"; +static char __pyx_k_21[] = "df <= 1"; +static char __pyx_k_22[] = "kappa < 0"; +static char __pyx_k_31[] = "sigma <= 0"; +static char __pyx_k_32[] = "sigma <= 0.0"; +static char __pyx_k_34[] = "scale <= 0.0"; +static char __pyx_k_35[] = "mean <= 0"; +static char __pyx_k_36[] = "mean <= 0.0"; +static char __pyx_k_37[] = "left > mode"; +static char __pyx_k_38[] = "mode > right"; +static char __pyx_k_39[] = "left == right"; +static char __pyx_k_40[] = "n <= 0"; +static char __pyx_k_41[] = "p < 0"; +static char __pyx_k_42[] = "p > 1"; +static char __pyx_k_44[] = "lam < 0"; +static char __pyx_k_45[] = "a <= 1.0"; +static char __pyx_k_46[] = "p < 0.0"; +static char __pyx_k_47[] = "p > 1.0"; +static char __pyx_k_48[] = "ngood < 1"; +static char __pyx_k_49[] = "nbad < 1"; +static char __pyx_k_50[] = "nsample < 1"; +static char __pyx_k_51[] = "ngood + nbad < nsample"; +static char __pyx_k_52[] = "p <= 0.0"; +static char __pyx_k_53[] = "p >= 1.0"; +static char __pyx_k_54[] = "mean must be 1 dimensional"; +static char __pyx_k_55[] = "cov must be 2 dimensional and square"; +static char __pyx_k_56[] = "mean and cov must have same length"; +static char __pyx_k_57[] = "numpy.dual"; +static char __pyx_k_58[] = "sum(pvals[:-1]) > 1.0"; +static char __pyx_k_59[] = "standard_exponential"; +static char __pyx_k_60[] = "noncentral_chisquare"; +static char __pyx_k_61[] = "RandomState.seed (line 567)"; +static char __pyx_k_62[] = "RandomState.get_state (line 600)"; +static char __pyx_k_63[] = "RandomState.set_state (line 637)"; +static char __pyx_k_64[] = "RandomState.random_sample (line 718)"; +static char __pyx_k_65[] = "RandomState.tomaxint (line 761)"; +static char __pyx_k_66[] = "RandomState.randint (line 789)"; +static char __pyx_k_67[] = "RandomState.bytes (line 866)"; +static char __pyx_k_68[] = "RandomState.uniform (line 893)"; +static char __pyx_k_69[] = "RandomState.rand (line 981)"; +static char __pyx_k_70[] = "RandomState.randn (line 1024)"; +static char __pyx_k_71[] = "RandomState.random_integers (line 1080)"; +static char __pyx_k_72[] = "RandomState.standard_normal (line 1158)"; +static char __pyx_k_73[] = "RandomState.normal (line 1190)"; +static char __pyx_k_74[] = "RandomState.beta (line 1290)"; +static char __pyx_k_75[] = "RandomState.exponential (line 1349)"; +static char __pyx_k_76[] = "RandomState.standard_exponential (line 1403)"; +static char __pyx_k_77[] = "RandomState.standard_gamma (line 1431)"; +static char __pyx_k_78[] = "RandomState.gamma (line 1513)"; +static char __pyx_k_79[] = "RandomState.f (line 1604)"; +static char __pyx_k_80[] = "RandomState.noncentral_f (line 1707)"; +static char __pyx_k_81[] = "RandomState.chisquare (line 1802)"; +static char __pyx_k_82[] = "RandomState.noncentral_chisquare (line 1882)"; +static char __pyx_k_83[] = "RandomState.standard_cauchy (line 1974)"; +static char __pyx_k_84[] = "RandomState.standard_t (line 2035)"; +static char __pyx_k_85[] = "RandomState.vonmises (line 2136)"; +static char __pyx_k_86[] = "RandomState.pareto (line 2231)"; +static char __pyx_k_87[] = "RandomState.weibull (line 2320)"; +static char __pyx_k_88[] = "RandomState.power (line 2420)"; +static char __pyx_k_89[] = "RandomState.laplace (line 2529)"; +static char __pyx_k_90[] = "RandomState.gumbel (line 2619)"; +static char __pyx_k_91[] = "RandomState.logistic (line 2743)"; +static char __pyx_k_92[] = "RandomState.lognormal (line 2831)"; +static char __pyx_k_93[] = "RandomState.rayleigh (line 2962)"; +static char __pyx_k_94[] = "RandomState.wald (line 3034)"; +static char __pyx_k_95[] = "RandomState.triangular (line 3120)"; +static char __pyx_k_96[] = "RandomState.binomial (line 3208)"; +static char __pyx_k_97[] = "RandomState.negative_binomial (line 3316)"; +static char __pyx_k_98[] = "RandomState.poisson (line 3411)"; +static char __pyx_k_99[] = "RandomState.zipf (line 3474)"; +static char __pyx_k__a[] = "a"; +static char __pyx_k__b[] = "b"; +static char __pyx_k__f[] = "f"; +static char __pyx_k__n[] = "n"; +static char __pyx_k__p[] = "p"; +static char __pyx_k_100[] = "RandomState.geometric (line 3566)"; +static char __pyx_k_101[] = "RandomState.hypergeometric (line 3632)"; +static char __pyx_k_102[] = "RandomState.logseries (line 3751)"; +static char __pyx_k_103[] = "RandomState.multivariate_normal (line 3846)"; +static char __pyx_k_104[] = "RandomState.multinomial (line 3979)"; +static char __pyx_k_105[] = "RandomState.dirichlet (line 4072)"; +static char __pyx_k_106[] = "RandomState.shuffle (line 4166)"; +static char __pyx_k_107[] = "RandomState.permutation (line 4202)"; +static char __pyx_k__df[] = "df"; +static char __pyx_k__mu[] = "mu"; +static char __pyx_k__nd[] = "nd"; +static char __pyx_k__np[] = "np"; +static char __pyx_k__add[] = "add"; +static char __pyx_k__any[] = "any"; +static char __pyx_k__cov[] = "cov"; +static char __pyx_k__dot[] = "dot"; +static char __pyx_k__key[] = "key"; +static char __pyx_k__lam[] = "lam"; +static char __pyx_k__loc[] = "loc"; +static char __pyx_k__low[] = "low"; +static char __pyx_k__pos[] = "pos"; +static char __pyx_k__svd[] = "svd"; +static char __pyx_k__beta[] = "beta"; +static char __pyx_k__copy[] = "copy"; +static char __pyx_k__data[] = "data"; +static char __pyx_k__high[] = "high"; +static char __pyx_k__left[] = "left"; +static char __pyx_k__less[] = "less"; +static char __pyx_k__mean[] = "mean"; +static char __pyx_k__mode[] = "mode"; +static char __pyx_k__nbad[] = "nbad"; +static char __pyx_k__nonc[] = "nonc"; +static char __pyx_k__rand[] = "rand"; +static char __pyx_k__seed[] = "seed"; +static char __pyx_k__size[] = "size"; +static char __pyx_k__sqrt[] = "sqrt"; +static char __pyx_k__uint[] = "uint"; +static char __pyx_k__wald[] = "wald"; +static char __pyx_k__zipf[] = "zipf"; +static char __pyx_k___rand[] = "_rand"; +static char __pyx_k__alpha[] = "alpha"; +static char __pyx_k__array[] = "array"; +static char __pyx_k__bytes[] = "bytes"; +static char __pyx_k__dfden[] = "dfden"; +static char __pyx_k__dfnum[] = "dfnum"; +static char __pyx_k__empty[] = "empty"; +static char __pyx_k__equal[] = "equal"; +static char __pyx_k__gamma[] = "gamma"; +static char __pyx_k__gauss[] = "gauss"; +static char __pyx_k__kappa[] = "kappa"; +static char __pyx_k__ngood[] = "ngood"; +static char __pyx_k__numpy[] = "numpy"; +static char __pyx_k__power[] = "power"; +static char __pyx_k__pvals[] = "pvals"; +static char __pyx_k__randn[] = "randn"; +static char __pyx_k__right[] = "right"; +static char __pyx_k__scale[] = "scale"; +static char __pyx_k__shape[] = "shape"; +static char __pyx_k__sigma[] = "sigma"; +static char __pyx_k__zeros[] = "zeros"; +static char __pyx_k__arange[] = "arange"; +static char __pyx_k__gumbel[] = "gumbel"; +static char __pyx_k__normal[] = "normal"; +static char __pyx_k__pareto[] = "pareto"; +static char __pyx_k__random[] = "random"; +static char __pyx_k__reduce[] = "reduce"; +static char __pyx_k__uint32[] = "uint32"; +static char __pyx_k__MT19937[] = "MT19937"; +static char __pyx_k__asarray[] = "asarray"; +static char __pyx_k__dataptr[] = "dataptr"; +static char __pyx_k__float64[] = "float64"; +static char __pyx_k__greater[] = "greater"; +static char __pyx_k__integer[] = "integer"; +static char __pyx_k__laplace[] = "laplace"; +static char __pyx_k__nsample[] = "nsample"; +static char __pyx_k__poisson[] = "poisson"; +static char __pyx_k__randint[] = "randint"; +static char __pyx_k__shuffle[] = "shuffle"; +static char __pyx_k__uniform[] = "uniform"; +static char __pyx_k__weibull[] = "weibull"; +static char __pyx_k____main__[] = "__main__"; +static char __pyx_k____test__[] = "__test__"; +static char __pyx_k__binomial[] = "binomial"; +static char __pyx_k__logistic[] = "logistic"; +static char __pyx_k__multiply[] = "multiply"; +static char __pyx_k__rayleigh[] = "rayleigh"; +static char __pyx_k__subtract[] = "subtract"; +static char __pyx_k__tomaxint[] = "tomaxint"; +static char __pyx_k__vonmises[] = "vonmises"; +static char __pyx_k__TypeError[] = "TypeError"; +static char __pyx_k__chisquare[] = "chisquare"; +static char __pyx_k__dirichlet[] = "dirichlet"; +static char __pyx_k__geometric[] = "geometric"; +static char __pyx_k__get_state[] = "get_state"; +static char __pyx_k__has_gauss[] = "has_gauss"; +static char __pyx_k__lognormal[] = "lognormal"; +static char __pyx_k__logseries[] = "logseries"; +static char __pyx_k__set_state[] = "set_state"; +static char __pyx_k__ValueError[] = "ValueError"; +static char __pyx_k__dimensions[] = "dimensions"; +static char __pyx_k__less_equal[] = "less_equal"; +static char __pyx_k__standard_t[] = "standard_t"; +static char __pyx_k__triangular[] = "triangular"; +static char __pyx_k__RandomState[] = "RandomState"; +static char __pyx_k__exponential[] = "exponential"; +static char __pyx_k__multinomial[] = "multinomial"; +static char __pyx_k__permutation[] = "permutation"; +static char __pyx_k__noncentral_f[] = "noncentral_f"; +static char __pyx_k__greater_equal[] = "greater_equal"; +static char __pyx_k__random_sample[] = "random_sample"; +static char __pyx_k__hypergeometric[] = "hypergeometric"; +static char __pyx_k__internal_state[] = "internal_state"; +static char __pyx_k__standard_gamma[] = "standard_gamma"; +static char __pyx_k__random_integers[] = "random_integers"; +static char __pyx_k__standard_cauchy[] = "standard_cauchy"; +static char __pyx_k__standard_normal[] = "standard_normal"; +static char __pyx_k__negative_binomial[] = "negative_binomial"; +static char __pyx_k____RandomState_ctor[] = "__RandomState_ctor"; +static char __pyx_k__multivariate_normal[] = "multivariate_normal"; +static PyObject *__pyx_kp_s_1; +static PyObject *__pyx_kp_s_10; +static PyObject *__pyx_kp_u_100; +static PyObject *__pyx_kp_u_101; +static PyObject *__pyx_kp_u_102; +static PyObject *__pyx_kp_u_103; +static PyObject *__pyx_kp_u_104; +static PyObject *__pyx_kp_u_105; +static PyObject *__pyx_kp_u_106; +static PyObject *__pyx_kp_u_107; +static PyObject *__pyx_kp_s_11; +static PyObject *__pyx_kp_s_13; +static PyObject *__pyx_kp_s_15; +static PyObject *__pyx_kp_s_16; +static PyObject *__pyx_kp_s_17; +static PyObject *__pyx_kp_s_18; +static PyObject *__pyx_kp_s_19; +static PyObject *__pyx_kp_s_2; +static PyObject *__pyx_kp_s_20; +static PyObject *__pyx_kp_s_21; +static PyObject *__pyx_kp_s_22; +static PyObject *__pyx_kp_s_3; +static PyObject *__pyx_kp_s_31; +static PyObject *__pyx_kp_s_32; +static PyObject *__pyx_kp_s_34; +static PyObject *__pyx_kp_s_35; +static PyObject *__pyx_kp_s_36; +static PyObject *__pyx_kp_s_37; +static PyObject *__pyx_kp_s_38; +static PyObject *__pyx_kp_s_39; +static PyObject *__pyx_kp_s_4; +static PyObject *__pyx_kp_s_40; +static PyObject *__pyx_kp_s_41; +static PyObject *__pyx_kp_s_42; +static PyObject *__pyx_kp_s_44; +static PyObject *__pyx_kp_s_45; +static PyObject *__pyx_kp_s_46; +static PyObject *__pyx_kp_s_47; +static PyObject *__pyx_kp_s_48; +static PyObject *__pyx_kp_s_49; +static PyObject *__pyx_kp_s_50; +static PyObject *__pyx_kp_s_51; +static PyObject *__pyx_kp_s_52; +static PyObject *__pyx_kp_s_53; +static PyObject *__pyx_kp_s_54; +static PyObject *__pyx_kp_s_55; +static PyObject *__pyx_kp_s_56; +static PyObject *__pyx_n_s_57; +static PyObject *__pyx_kp_s_58; +static PyObject *__pyx_n_s_59; +static PyObject *__pyx_n_s_60; +static PyObject *__pyx_kp_u_61; +static PyObject *__pyx_kp_u_62; +static PyObject *__pyx_kp_u_63; +static PyObject *__pyx_kp_u_64; +static PyObject *__pyx_kp_u_65; +static PyObject *__pyx_kp_u_66; +static PyObject *__pyx_kp_u_67; +static PyObject *__pyx_kp_u_68; +static PyObject *__pyx_kp_u_69; +static PyObject *__pyx_kp_u_70; +static PyObject *__pyx_kp_u_71; +static PyObject *__pyx_kp_u_72; +static PyObject *__pyx_kp_u_73; +static PyObject *__pyx_kp_u_74; +static PyObject *__pyx_kp_u_75; +static PyObject *__pyx_kp_u_76; +static PyObject *__pyx_kp_u_77; +static PyObject *__pyx_kp_u_78; +static PyObject *__pyx_kp_u_79; +static PyObject *__pyx_kp_u_80; +static PyObject *__pyx_kp_u_81; +static PyObject *__pyx_kp_u_82; +static PyObject *__pyx_kp_u_83; +static PyObject *__pyx_kp_u_84; +static PyObject *__pyx_kp_u_85; +static PyObject *__pyx_kp_u_86; +static PyObject *__pyx_kp_u_87; +static PyObject *__pyx_kp_u_88; +static PyObject *__pyx_kp_u_89; +static PyObject *__pyx_kp_s_9; +static PyObject *__pyx_kp_u_90; +static PyObject *__pyx_kp_u_91; +static PyObject *__pyx_kp_u_92; +static PyObject *__pyx_kp_u_93; +static PyObject *__pyx_kp_u_94; +static PyObject *__pyx_kp_u_95; +static PyObject *__pyx_kp_u_96; +static PyObject *__pyx_kp_u_97; +static PyObject *__pyx_kp_u_98; +static PyObject *__pyx_kp_u_99; +static PyObject *__pyx_n_s__MT19937; +static PyObject *__pyx_n_s__RandomState; +static PyObject *__pyx_n_s__TypeError; +static PyObject *__pyx_n_s__ValueError; +static PyObject *__pyx_n_s____RandomState_ctor; +static PyObject *__pyx_n_s____main__; +static PyObject *__pyx_n_s____test__; +static PyObject *__pyx_n_s___rand; +static PyObject *__pyx_n_s__a; +static PyObject *__pyx_n_s__add; +static PyObject *__pyx_n_s__alpha; +static PyObject *__pyx_n_s__any; +static PyObject *__pyx_n_s__arange; +static PyObject *__pyx_n_s__array; +static PyObject *__pyx_n_s__asarray; +static PyObject *__pyx_n_s__b; +static PyObject *__pyx_n_s__beta; +static PyObject *__pyx_n_s__binomial; +static PyObject *__pyx_n_s__bytes; +static PyObject *__pyx_n_s__chisquare; +static PyObject *__pyx_n_s__copy; +static PyObject *__pyx_n_s__cov; +static PyObject *__pyx_n_s__data; +static PyObject *__pyx_n_s__dataptr; +static PyObject *__pyx_n_s__df; +static PyObject *__pyx_n_s__dfden; +static PyObject *__pyx_n_s__dfnum; +static PyObject *__pyx_n_s__dimensions; +static PyObject *__pyx_n_s__dirichlet; +static PyObject *__pyx_n_s__dot; +static PyObject *__pyx_n_s__empty; +static PyObject *__pyx_n_s__equal; +static PyObject *__pyx_n_s__exponential; +static PyObject *__pyx_n_s__f; +static PyObject *__pyx_n_s__float64; +static PyObject *__pyx_n_s__gamma; +static PyObject *__pyx_n_s__gauss; +static PyObject *__pyx_n_s__geometric; +static PyObject *__pyx_n_s__get_state; +static PyObject *__pyx_n_s__greater; +static PyObject *__pyx_n_s__greater_equal; +static PyObject *__pyx_n_s__gumbel; +static PyObject *__pyx_n_s__has_gauss; +static PyObject *__pyx_n_s__high; +static PyObject *__pyx_n_s__hypergeometric; +static PyObject *__pyx_n_s__integer; +static PyObject *__pyx_n_s__internal_state; +static PyObject *__pyx_n_s__kappa; +static PyObject *__pyx_n_s__key; +static PyObject *__pyx_n_s__lam; +static PyObject *__pyx_n_s__laplace; +static PyObject *__pyx_n_s__left; +static PyObject *__pyx_n_s__less; +static PyObject *__pyx_n_s__less_equal; +static PyObject *__pyx_n_s__loc; +static PyObject *__pyx_n_s__logistic; +static PyObject *__pyx_n_s__lognormal; +static PyObject *__pyx_n_s__logseries; +static PyObject *__pyx_n_s__low; +static PyObject *__pyx_n_s__mean; +static PyObject *__pyx_n_s__mode; +static PyObject *__pyx_n_s__mu; +static PyObject *__pyx_n_s__multinomial; +static PyObject *__pyx_n_s__multiply; +static PyObject *__pyx_n_s__multivariate_normal; +static PyObject *__pyx_n_s__n; +static PyObject *__pyx_n_s__nbad; +static PyObject *__pyx_n_s__nd; +static PyObject *__pyx_n_s__negative_binomial; +static PyObject *__pyx_n_s__ngood; +static PyObject *__pyx_n_s__nonc; +static PyObject *__pyx_n_s__noncentral_f; +static PyObject *__pyx_n_s__normal; +static PyObject *__pyx_n_s__np; +static PyObject *__pyx_n_s__nsample; +static PyObject *__pyx_n_s__numpy; +static PyObject *__pyx_n_s__p; +static PyObject *__pyx_n_s__pareto; +static PyObject *__pyx_n_s__permutation; +static PyObject *__pyx_n_s__poisson; +static PyObject *__pyx_n_s__pos; +static PyObject *__pyx_n_s__power; +static PyObject *__pyx_n_s__pvals; +static PyObject *__pyx_n_s__rand; +static PyObject *__pyx_n_s__randint; +static PyObject *__pyx_n_s__randn; +static PyObject *__pyx_n_s__random; +static PyObject *__pyx_n_s__random_integers; +static PyObject *__pyx_n_s__random_sample; +static PyObject *__pyx_n_s__rayleigh; +static PyObject *__pyx_n_s__reduce; +static PyObject *__pyx_n_s__right; +static PyObject *__pyx_n_s__scale; +static PyObject *__pyx_n_s__seed; +static PyObject *__pyx_n_s__set_state; +static PyObject *__pyx_n_s__shape; +static PyObject *__pyx_n_s__shuffle; +static PyObject *__pyx_n_s__sigma; +static PyObject *__pyx_n_s__size; +static PyObject *__pyx_n_s__sqrt; +static PyObject *__pyx_n_s__standard_cauchy; +static PyObject *__pyx_n_s__standard_gamma; +static PyObject *__pyx_n_s__standard_normal; +static PyObject *__pyx_n_s__standard_t; +static PyObject *__pyx_n_s__subtract; +static PyObject *__pyx_n_s__svd; +static PyObject *__pyx_n_s__tomaxint; +static PyObject *__pyx_n_s__triangular; +static PyObject *__pyx_n_s__uint; +static PyObject *__pyx_n_s__uint32; +static PyObject *__pyx_n_s__uniform; +static PyObject *__pyx_n_s__vonmises; +static PyObject *__pyx_n_s__wald; +static PyObject *__pyx_n_s__weibull; +static PyObject *__pyx_n_s__zeros; +static PyObject *__pyx_n_s__zipf; static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; -static char __pyx_k___main__[] = "__main__"; -static PyObject *__pyx_kp___main__; -static char __pyx_k___init__[] = "__init__"; -static PyObject *__pyx_kp___init__; -static char __pyx_k___dealloc__[] = "__dealloc__"; -static PyObject *__pyx_kp___dealloc__; -static char __pyx_k_seed[] = "seed"; -static PyObject *__pyx_kp_seed; -static char __pyx_k_get_state[] = "get_state"; -static PyObject *__pyx_kp_get_state; -static char __pyx_k_set_state[] = "set_state"; -static PyObject *__pyx_kp_set_state; -static char __pyx_k___getstate__[] = "__getstate__"; -static PyObject *__pyx_kp___getstate__; -static char __pyx_k___setstate__[] = "__setstate__"; -static PyObject *__pyx_kp___setstate__; -static char __pyx_k___reduce__[] = "__reduce__"; -static PyObject *__pyx_kp___reduce__; -static char __pyx_k_random_sample[] = "random_sample"; -static PyObject *__pyx_kp_random_sample; -static char __pyx_k_tomaxint[] = "tomaxint"; -static PyObject *__pyx_kp_tomaxint; -static char __pyx_k_randint[] = "randint"; -static PyObject *__pyx_kp_randint; -static char __pyx_k_bytes[] = "bytes"; -static PyObject *__pyx_kp_bytes; -static char __pyx_k_uniform[] = "uniform"; -static PyObject *__pyx_kp_uniform; -static char __pyx_k_rand[] = "rand"; -static PyObject *__pyx_kp_rand; -static char __pyx_k_randn[] = "randn"; -static PyObject *__pyx_kp_randn; -static char __pyx_k_random_integers[] = "random_integers"; -static PyObject *__pyx_kp_random_integers; -static char __pyx_k_standard_normal[] = "standard_normal"; -static PyObject *__pyx_kp_standard_normal; -static char __pyx_k_normal[] = "normal"; -static PyObject *__pyx_kp_normal; -static char __pyx_k_beta[] = "beta"; -static PyObject *__pyx_kp_beta; -static char __pyx_k_exponential[] = "exponential"; -static PyObject *__pyx_kp_exponential; -static char __pyx_k_1[] = "standard_exponential"; -static PyObject *__pyx_kp_1; -static char __pyx_k_standard_gamma[] = "standard_gamma"; -static PyObject *__pyx_kp_standard_gamma; -static char __pyx_k_gamma[] = "gamma"; -static PyObject *__pyx_kp_gamma; -static char __pyx_k_f[] = "f"; -static PyObject *__pyx_kp_f; -static char __pyx_k_noncentral_f[] = "noncentral_f"; -static PyObject *__pyx_kp_noncentral_f; -static char __pyx_k_chisquare[] = "chisquare"; -static PyObject *__pyx_kp_chisquare; -static char __pyx_k_2[] = "noncentral_chisquare"; -static PyObject *__pyx_kp_2; -static char __pyx_k_standard_cauchy[] = "standard_cauchy"; -static PyObject *__pyx_kp_standard_cauchy; -static char __pyx_k_standard_t[] = "standard_t"; -static PyObject *__pyx_kp_standard_t; -static char __pyx_k_vonmises[] = "vonmises"; -static PyObject *__pyx_kp_vonmises; -static char __pyx_k_pareto[] = "pareto"; -static PyObject *__pyx_kp_pareto; -static char __pyx_k_weibull[] = "weibull"; -static PyObject *__pyx_kp_weibull; -static char __pyx_k_power[] = "power"; -static PyObject *__pyx_kp_power; -static char __pyx_k_laplace[] = "laplace"; -static PyObject *__pyx_kp_laplace; -static char __pyx_k_gumbel[] = "gumbel"; -static PyObject *__pyx_kp_gumbel; -static char __pyx_k_logistic[] = "logistic"; -static PyObject *__pyx_kp_logistic; -static char __pyx_k_lognormal[] = "lognormal"; -static PyObject *__pyx_kp_lognormal; -static char __pyx_k_rayleigh[] = "rayleigh"; -static PyObject *__pyx_kp_rayleigh; -static char __pyx_k_wald[] = "wald"; -static PyObject *__pyx_kp_wald; -static char __pyx_k_triangular[] = "triangular"; -static PyObject *__pyx_kp_triangular; -static char __pyx_k_binomial[] = "binomial"; -static PyObject *__pyx_kp_binomial; -static char __pyx_k_negative_binomial[] = "negative_binomial"; -static PyObject *__pyx_kp_negative_binomial; -static char __pyx_k_poisson[] = "poisson"; -static PyObject *__pyx_kp_poisson; -static char __pyx_k_zipf[] = "zipf"; -static PyObject *__pyx_kp_zipf; -static char __pyx_k_geometric[] = "geometric"; -static PyObject *__pyx_kp_geometric; -static char __pyx_k_hypergeometric[] = "hypergeometric"; -static PyObject *__pyx_kp_hypergeometric; -static char __pyx_k_logseries[] = "logseries"; -static PyObject *__pyx_kp_logseries; -static char __pyx_k_multivariate_normal[] = "multivariate_normal"; -static PyObject *__pyx_kp_multivariate_normal; -static char __pyx_k_multinomial[] = "multinomial"; -static PyObject *__pyx_kp_multinomial; -static char __pyx_k_dirichlet[] = "dirichlet"; -static PyObject *__pyx_kp_dirichlet; -static char __pyx_k_shuffle[] = "shuffle"; -static PyObject *__pyx_kp_shuffle; -static char __pyx_k_permutation[] = "permutation"; -static PyObject *__pyx_kp_permutation; -static char __pyx_k_state[] = "state"; -static PyObject *__pyx_kp_state; -static char __pyx_k_size[] = "size"; -static PyObject *__pyx_kp_size; -static char __pyx_k_low[] = "low"; -static PyObject *__pyx_kp_low; -static char __pyx_k_high[] = "high"; -static PyObject *__pyx_kp_high; -static char __pyx_k_length[] = "length"; -static PyObject *__pyx_kp_length; -static char __pyx_k_loc[] = "loc"; -static PyObject *__pyx_kp_loc; -static char __pyx_k_scale[] = "scale"; -static PyObject *__pyx_kp_scale; -static char __pyx_k_a[] = "a"; -static PyObject *__pyx_kp_a; -static char __pyx_k_b[] = "b"; -static PyObject *__pyx_kp_b; -static char __pyx_k_shape[] = "shape"; -static PyObject *__pyx_kp_shape; -static char __pyx_k_dfnum[] = "dfnum"; -static PyObject *__pyx_kp_dfnum; -static char __pyx_k_dfden[] = "dfden"; -static PyObject *__pyx_kp_dfden; -static char __pyx_k_nonc[] = "nonc"; -static PyObject *__pyx_kp_nonc; -static char __pyx_k_df[] = "df"; -static PyObject *__pyx_kp_df; -static char __pyx_k_mu[] = "mu"; -static PyObject *__pyx_kp_mu; -static char __pyx_k_kappa[] = "kappa"; -static PyObject *__pyx_kp_kappa; -static char __pyx_k_mean[] = "mean"; -static PyObject *__pyx_kp_mean; -static char __pyx_k_sigma[] = "sigma"; -static PyObject *__pyx_kp_sigma; -static char __pyx_k_left[] = "left"; -static PyObject *__pyx_kp_left; -static char __pyx_k_mode[] = "mode"; -static PyObject *__pyx_kp_mode; -static char __pyx_k_right[] = "right"; -static PyObject *__pyx_kp_right; -static char __pyx_k_n[] = "n"; -static PyObject *__pyx_kp_n; -static char __pyx_k_p[] = "p"; -static PyObject *__pyx_kp_p; -static char __pyx_k_lam[] = "lam"; -static PyObject *__pyx_kp_lam; -static char __pyx_k_ngood[] = "ngood"; -static PyObject *__pyx_kp_ngood; -static char __pyx_k_nbad[] = "nbad"; -static PyObject *__pyx_kp_nbad; -static char __pyx_k_nsample[] = "nsample"; -static PyObject *__pyx_kp_nsample; -static char __pyx_k_cov[] = "cov"; -static PyObject *__pyx_kp_cov; -static char __pyx_k_pvals[] = "pvals"; -static PyObject *__pyx_kp_pvals; -static char __pyx_k_alpha[] = "alpha"; -static PyObject *__pyx_kp_alpha; -static char __pyx_k_x[] = "x"; -static PyObject *__pyx_kp_x; -static char __pyx_k_numpy[] = "numpy"; -static PyObject *__pyx_kp_numpy; -static char __pyx_k_np[] = "np"; -static PyObject *__pyx_kp_np; -static char __pyx_k__rand[] = "_rand"; -static PyObject *__pyx_kp__rand; -static char __pyx_k_empty[] = "empty"; -static PyObject *__pyx_kp_empty; -static char __pyx_k_19[] = "float64"; -static PyObject *__pyx_kp_19; -static char __pyx_k_ValueError[] = "ValueError"; -static PyObject *__pyx_kp_ValueError; -static char __pyx_k_integer[] = "integer"; -static PyObject *__pyx_kp_integer; -static char __pyx_k_uint[] = "uint"; -static PyObject *__pyx_kp_uint; -static char __pyx_k_asarray[] = "asarray"; -static PyObject *__pyx_kp_asarray; -static char __pyx_k_27[] = "uint32"; -static PyObject *__pyx_kp_27; -static char __pyx_k_28[] = "MT19937"; -static PyObject *__pyx_kp_28; -static char __pyx_k_29[] = "MT19937"; -static PyObject *__pyx_kp_29; -static char __pyx_k_TypeError[] = "TypeError"; -static PyObject *__pyx_kp_TypeError; -static char __pyx_k_random[] = "random"; -static PyObject *__pyx_kp_random; -static char __pyx_k___RandomState_ctor[] = "__RandomState_ctor"; -static PyObject *__pyx_kp___RandomState_ctor; -static char __pyx_k_subtract[] = "subtract"; -static PyObject *__pyx_kp_subtract; -static char __pyx_k_any[] = "any"; -static PyObject *__pyx_kp_any; -static char __pyx_k_less_equal[] = "less_equal"; -static PyObject *__pyx_kp_less_equal; -static char __pyx_k_less[] = "less"; -static PyObject *__pyx_kp_less; -static char __pyx_k_greater[] = "greater"; -static PyObject *__pyx_kp_greater; -static char __pyx_k_equal[] = "equal"; -static PyObject *__pyx_kp_equal; -static char __pyx_k_add[] = "add"; -static PyObject *__pyx_kp_add; -static char __pyx_k_greater_equal[] = "greater_equal"; -static PyObject *__pyx_kp_greater_equal; -static char __pyx_k_array[] = "array"; -static PyObject *__pyx_kp_array; -static char __pyx_k_append[] = "append"; -static PyObject *__pyx_kp_append; -static char __pyx_k_multiply[] = "multiply"; -static PyObject *__pyx_kp_multiply; -static char __pyx_k_reduce[] = "reduce"; -static PyObject *__pyx_kp_reduce; -static char __pyx_k_128[] = "numpy.dual"; -static PyObject *__pyx_kp_128; -static char __pyx_k_svd[] = "svd"; -static PyObject *__pyx_kp_svd; -static char __pyx_k_dot[] = "dot"; -static PyObject *__pyx_kp_dot; -static char __pyx_k_sqrt[] = "sqrt"; -static PyObject *__pyx_kp_sqrt; -static char __pyx_k_zeros[] = "zeros"; -static PyObject *__pyx_kp_zeros; -static char __pyx_k_130[] = "copy"; -static PyObject *__pyx_kp_130; -static char __pyx_k_copy[] = "copy"; -static PyObject *__pyx_kp_copy; -static char __pyx_k_arange[] = "arange"; -static PyObject *__pyx_kp_arange; -static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_builtin_TypeError; -static PyObject *__pyx_kp_20; -static char __pyx_k_20[] = "size is not compatible with inputs"; -static PyObject *__pyx_kp_21; -static char __pyx_k_21[] = "size is not compatible with inputs"; -static PyObject *__pyx_kp_22; -static char __pyx_k_22[] = "size is not compatible with inputs"; -static PyObject *__pyx_kp_23; -static char __pyx_k_23[] = "size is not compatible with inputs"; -static PyObject *__pyx_kp_24; -static char __pyx_k_24[] = "size is not compatible with inputs"; -static PyObject *__pyx_kp_25; -static char __pyx_k_25[] = "size is not compatible with inputs"; -static PyObject *__pyx_kp_26; -static char __pyx_k_26[] = "size is not compatible with inputs"; -static PyObject *__pyx_kp_30; -static PyObject *__pyx_kp_31; -static char __pyx_k_30[] = "algorithm must be 'MT19937'"; -static char __pyx_k_31[] = "state must be 624 longs"; -static PyObject *__pyx_kp_32; -static char __pyx_k_32[] = "low >= high"; -static PyObject *__pyx_kp_33; -static PyObject *__pyx_kp_34; -static char __pyx_k_33[] = "scale <= 0"; -static char __pyx_k_34[] = "scale <= 0"; -static PyObject *__pyx_kp_35; -static PyObject *__pyx_kp_36; -static PyObject *__pyx_kp_37; -static PyObject *__pyx_kp_38; -static char __pyx_k_35[] = "a <= 0"; -static char __pyx_k_36[] = "b <= 0"; -static char __pyx_k_37[] = "a <= 0"; -static char __pyx_k_38[] = "b <= 0"; -static PyObject *__pyx_kp_39; -static PyObject *__pyx_kp_40; -static char __pyx_k_39[] = "scale <= 0"; -static char __pyx_k_40[] = "scale <= 0"; -static PyObject *__pyx_kp_41; -static PyObject *__pyx_kp_42; -static char __pyx_k_41[] = "shape <= 0"; -static char __pyx_k_42[] = "shape <= 0"; -static PyObject *__pyx_kp_43; -static PyObject *__pyx_kp_44; -static PyObject *__pyx_kp_45; -static PyObject *__pyx_kp_46; -static char __pyx_k_43[] = "shape <= 0"; -static char __pyx_k_44[] = "scale <= 0"; -static char __pyx_k_45[] = "shape <= 0"; -static char __pyx_k_46[] = "scale <= 0"; -static PyObject *__pyx_kp_47; -static PyObject *__pyx_kp_48; -static PyObject *__pyx_kp_49; -static PyObject *__pyx_kp_50; -static char __pyx_k_47[] = "shape <= 0"; -static char __pyx_k_48[] = "scale <= 0"; -static char __pyx_k_49[] = "dfnum <= 0"; -static char __pyx_k_50[] = "dfden <= 0"; -static PyObject *__pyx_kp_51; -static PyObject *__pyx_kp_52; -static PyObject *__pyx_kp_53; -static PyObject *__pyx_kp_54; -static PyObject *__pyx_kp_55; -static PyObject *__pyx_kp_56; -static char __pyx_k_51[] = "dfnum <= 1"; -static char __pyx_k_52[] = "dfden <= 0"; -static char __pyx_k_53[] = "nonc < 0"; -static char __pyx_k_54[] = "dfnum <= 1"; -static char __pyx_k_55[] = "dfden <= 0"; -static char __pyx_k_56[] = "nonc < 0"; -static PyObject *__pyx_kp_57; -static PyObject *__pyx_kp_58; -static char __pyx_k_57[] = "df <= 0"; -static char __pyx_k_58[] = "df <= 0"; -static PyObject *__pyx_kp_59; -static PyObject *__pyx_kp_60; -static PyObject *__pyx_kp_61; -static PyObject *__pyx_kp_62; -static char __pyx_k_59[] = "df <= 0"; -static char __pyx_k_60[] = "nonc <= 0"; -static char __pyx_k_61[] = "df <= 1"; -static char __pyx_k_62[] = "nonc < 0"; -static PyObject *__pyx_kp_63; -static PyObject *__pyx_kp_64; -static char __pyx_k_63[] = "df <= 0"; -static char __pyx_k_64[] = "df <= 0"; -static PyObject *__pyx_kp_65; -static PyObject *__pyx_kp_66; -static char __pyx_k_65[] = "kappa < 0"; -static char __pyx_k_66[] = "kappa < 0"; -static PyObject *__pyx_kp_67; -static PyObject *__pyx_kp_68; -static char __pyx_k_67[] = "a <= 0"; -static char __pyx_k_68[] = "a <= 0"; -static PyObject *__pyx_kp_69; -static PyObject *__pyx_kp_70; -static char __pyx_k_69[] = "a <= 0"; -static char __pyx_k_70[] = "a <= 0"; -static PyObject *__pyx_kp_71; -static PyObject *__pyx_kp_72; -static char __pyx_k_71[] = "a <= 0"; -static char __pyx_k_72[] = "a <= 0"; -static PyObject *__pyx_kp_73; -static PyObject *__pyx_kp_74; -static char __pyx_k_73[] = "scale <= 0"; -static char __pyx_k_74[] = "scale <= 0"; -static PyObject *__pyx_kp_75; -static PyObject *__pyx_kp_76; -static char __pyx_k_75[] = "scale <= 0"; -static char __pyx_k_76[] = "scale <= 0"; -static PyObject *__pyx_kp_77; -static PyObject *__pyx_kp_78; -static char __pyx_k_77[] = "scale <= 0"; -static char __pyx_k_78[] = "scale <= 0"; -static PyObject *__pyx_kp_79; -static PyObject *__pyx_kp_80; -static char __pyx_k_79[] = "sigma <= 0"; -static char __pyx_k_80[] = "sigma <= 0.0"; -static PyObject *__pyx_kp_81; -static PyObject *__pyx_kp_82; -static char __pyx_k_81[] = "scale <= 0"; -static char __pyx_k_82[] = "scale <= 0.0"; -static PyObject *__pyx_kp_83; -static PyObject *__pyx_kp_84; -static PyObject *__pyx_kp_85; -static PyObject *__pyx_kp_86; -static char __pyx_k_83[] = "mean <= 0"; -static char __pyx_k_84[] = "scale <= 0"; -static char __pyx_k_85[] = "mean <= 0.0"; -static char __pyx_k_86[] = "scale <= 0.0"; -static PyObject *__pyx_kp_87; -static PyObject *__pyx_kp_88; -static PyObject *__pyx_kp_89; -static PyObject *__pyx_kp_90; -static PyObject *__pyx_kp_91; -static PyObject *__pyx_kp_92; -static char __pyx_k_87[] = "left > mode"; -static char __pyx_k_88[] = "mode > right"; -static char __pyx_k_89[] = "left == right"; -static char __pyx_k_90[] = "left > mode"; -static char __pyx_k_91[] = "mode > right"; -static char __pyx_k_92[] = "left == right"; -static PyObject *__pyx_kp_93; -static PyObject *__pyx_kp_94; -static PyObject *__pyx_kp_95; -static PyObject *__pyx_kp_96; -static PyObject *__pyx_kp_97; -static PyObject *__pyx_kp_98; -static char __pyx_k_93[] = "n <= 0"; -static char __pyx_k_94[] = "p < 0"; -static char __pyx_k_95[] = "p > 1"; -static char __pyx_k_96[] = "n <= 0"; -static char __pyx_k_97[] = "p < 0"; -static char __pyx_k_98[] = "p > 1"; -static PyObject *__pyx_kp_99; -static PyObject *__pyx_kp_100; -static PyObject *__pyx_kp_101; -static PyObject *__pyx_kp_102; -static PyObject *__pyx_kp_103; -static PyObject *__pyx_kp_104; -static char __pyx_k_99[] = "n <= 0"; -static char __pyx_k_100[] = "p < 0"; -static char __pyx_k_101[] = "p > 1"; -static char __pyx_k_102[] = "n <= 0"; -static char __pyx_k_103[] = "p < 0"; -static char __pyx_k_104[] = "p > 1"; -static PyObject *__pyx_kp_105; -static PyObject *__pyx_kp_106; -static char __pyx_k_105[] = "lam < 0"; -static char __pyx_k_106[] = "lam < 0"; -static PyObject *__pyx_kp_107; -static PyObject *__pyx_kp_108; -static char __pyx_k_107[] = "a <= 1.0"; -static char __pyx_k_108[] = "a <= 1.0"; -static PyObject *__pyx_kp_109; -static PyObject *__pyx_kp_110; -static PyObject *__pyx_kp_111; -static PyObject *__pyx_kp_112; -static char __pyx_k_109[] = "p < 0.0"; -static char __pyx_k_110[] = "p > 1.0"; -static char __pyx_k_111[] = "p < 0.0"; -static char __pyx_k_112[] = "p > 1.0"; -static PyObject *__pyx_kp_113; -static PyObject *__pyx_kp_114; -static PyObject *__pyx_kp_115; -static PyObject *__pyx_kp_116; -static PyObject *__pyx_kp_117; -static PyObject *__pyx_kp_118; -static PyObject *__pyx_kp_119; -static PyObject *__pyx_kp_120; -static char __pyx_k_113[] = "ngood < 1"; -static char __pyx_k_114[] = "nbad < 1"; -static char __pyx_k_115[] = "nsample < 1"; -static char __pyx_k_116[] = "ngood + nbad < nsample"; -static char __pyx_k_117[] = "ngood < 1"; -static char __pyx_k_118[] = "nbad < 1"; -static char __pyx_k_119[] = "nsample < 1"; -static char __pyx_k_120[] = "ngood + nbad < nsample"; -static PyObject *__pyx_kp_121; -static PyObject *__pyx_kp_122; -static PyObject *__pyx_kp_123; -static PyObject *__pyx_kp_124; -static char __pyx_k_121[] = "p <= 0.0"; -static char __pyx_k_122[] = "p >= 1.0"; -static char __pyx_k_123[] = "p <= 0.0"; -static char __pyx_k_124[] = "p >= 1.0"; -static PyObject *__pyx_kp_125; -static PyObject *__pyx_kp_126; -static PyObject *__pyx_kp_127; -static char __pyx_k_125[] = "mean must be 1 dimensional"; -static char __pyx_k_126[] = "cov must be 2 dimensional and square"; -static char __pyx_k_127[] = "mean and cov must have same length"; -static PyObject *__pyx_kp_129; -static char __pyx_k_129[] = "sum(pvals[:-1]) > 1.0"; +static PyObject *__pyx_int_624; +static PyObject *__pyx_k_5; +static PyObject *__pyx_k_6; +static PyObject *__pyx_k_7; +static PyObject *__pyx_k_8; +static PyObject *__pyx_k_12; +static PyObject *__pyx_k_14; +static PyObject *__pyx_k_23; +static PyObject *__pyx_k_24; +static PyObject *__pyx_k_25; +static PyObject *__pyx_k_26; +static PyObject *__pyx_k_27; +static PyObject *__pyx_k_28; +static PyObject *__pyx_k_29; +static PyObject *__pyx_k_30; +static PyObject *__pyx_k_33; +static PyObject *__pyx_k_43; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":128 * import numpy as np @@ -1037,13 +1034,13 @@ long __pyx_v_length; long __pyx_v_i; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; long __pyx_t_5; - __Pyx_SetupRefcountContext("cont0_array"); + __Pyx_RefNannySetupContext("cont0_array"); + __Pyx_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":134 @@ -1080,32 +1077,32 @@ * length = PyArray_SIZE(array) * array_data = array.data */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_19); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4))); __Pyx_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + arrayObject = ((PyArrayObject *)__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":138 * else: @@ -1162,7 +1159,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -1170,8 +1166,9 @@ __pyx_r = 0; __pyx_L0:; __Pyx_DECREF((PyObject *)arrayObject); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -1189,13 +1186,13 @@ long __pyx_v_length; long __pyx_v_i; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; long __pyx_t_5; - __Pyx_SetupRefcountContext("cont1_array_sc"); + __Pyx_RefNannySetupContext("cont1_array_sc"); + __Pyx_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":151 @@ -1232,32 +1229,32 @@ * length = PyArray_SIZE(array) * array_data = array.data */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_19); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4))); __Pyx_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + arrayObject = ((PyArrayObject *)__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":155 * else: @@ -1314,7 +1311,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -1322,8 +1318,9 @@ __pyx_r = 0; __pyx_L0:; __Pyx_DECREF((PyObject *)arrayObject); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -1344,13 +1341,14 @@ PyArrayIterObject *__pyx_v_itera; PyArrayMultiIterObject *__pyx_v_multi; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; npy_intp __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - __Pyx_SetupRefcountContext("cont1_array"); + __Pyx_RefNannySetupContext("cont1_array"); + __Pyx_INCREF(__pyx_v_size); + __Pyx_INCREF((PyObject *)__pyx_v_oa); arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_itera = ((PyArrayIterObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); __Pyx_INCREF(Py_None); @@ -1450,32 +1448,32 @@ * array_data = array.data * multi = PyArray_MultiIterNew(2, array, */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_19); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4))); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_5))); __Pyx_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + arrayObject = ((PyArrayObject *)__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":180 * else: @@ -1493,12 +1491,12 @@ * if (multi.size != PyArray_SIZE(array)): * raise ValueError("size is not compatible with inputs") */ - __pyx_t_4 = PyArray_MultiIterNew(2, ((void *)arrayObject), ((void *)__pyx_v_oa)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_t_4))); + __pyx_t_5 = PyArray_MultiIterNew(2, ((void *)arrayObject), ((void *)__pyx_v_oa)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_t_5))); __Pyx_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":183 * multi = PyArray_MultiIterNew(2, array, @@ -1517,16 +1515,16 @@ * for i from 0 <= i < multi.size: * oa_data = PyArray_MultiIter_DATA(multi, 1) */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_20); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_20); - __Pyx_GIVEREF(__pyx_kp_20); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_1)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_1)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } @@ -1587,7 +1585,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); @@ -1597,8 +1594,10 @@ __Pyx_DECREF((PyObject *)arrayObject); __Pyx_DECREF((PyObject *)__pyx_v_itera); __Pyx_DECREF((PyObject *)__pyx_v_multi); + __Pyx_DECREF(__pyx_v_size); + __Pyx_DECREF((PyObject *)__pyx_v_oa); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -1616,13 +1615,13 @@ long __pyx_v_length; long __pyx_v_i; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; long __pyx_t_5; - __Pyx_SetupRefcountContext("cont2_array_sc"); + __Pyx_RefNannySetupContext("cont2_array_sc"); + __Pyx_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":198 @@ -1659,32 +1658,32 @@ * length = PyArray_SIZE(array) * array_data = array.data */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_19); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4))); __Pyx_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + arrayObject = ((PyArrayObject *)__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":202 * else: @@ -1741,7 +1740,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -1749,8 +1747,9 @@ __pyx_r = 0; __pyx_L0:; __Pyx_DECREF((PyObject *)arrayObject); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -1770,13 +1769,15 @@ npy_intp __pyx_v_i; PyArrayMultiIterObject *__pyx_v_multi; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; npy_intp __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - __Pyx_SetupRefcountContext("cont2_array"); + __Pyx_RefNannySetupContext("cont2_array"); + __Pyx_INCREF(__pyx_v_size); + __Pyx_INCREF((PyObject *)__pyx_v_oa); + __Pyx_INCREF((PyObject *)__pyx_v_ob); arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); __Pyx_INCREF(Py_None); @@ -1884,32 +1885,32 @@ * array_data = array.data * multi = PyArray_MultiIterNew(3, array, oa, ob) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_19); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4))); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_5))); __Pyx_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + arrayObject = ((PyArrayObject *)__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":230 * else: @@ -1927,12 +1928,12 @@ * if (multi.size != PyArray_SIZE(array)): * raise ValueError("size is not compatible with inputs") */ - __pyx_t_4 = PyArray_MultiIterNew(3, ((void *)arrayObject), ((void *)__pyx_v_oa), ((void *)__pyx_v_ob)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_t_4))); + __pyx_t_5 = PyArray_MultiIterNew(3, ((void *)arrayObject), ((void *)__pyx_v_oa), ((void *)__pyx_v_ob)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_t_5))); __Pyx_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":232 * array_data = array.data @@ -1951,16 +1952,16 @@ * for i from 0 <= i < multi.size: * oa_data = PyArray_MultiIter_DATA(multi, 1) */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_21); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_21); - __Pyx_GIVEREF(__pyx_kp_21); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_1)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_1)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } @@ -2039,7 +2040,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); @@ -2048,8 +2048,11 @@ __pyx_L0:; __Pyx_DECREF((PyObject *)arrayObject); __Pyx_DECREF((PyObject *)__pyx_v_multi); + __Pyx_DECREF(__pyx_v_size); + __Pyx_DECREF((PyObject *)__pyx_v_oa); + __Pyx_DECREF((PyObject *)__pyx_v_ob); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -2067,13 +2070,13 @@ long __pyx_v_length; long __pyx_v_i; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; long __pyx_t_5; - __Pyx_SetupRefcountContext("cont3_array_sc"); + __Pyx_RefNannySetupContext("cont3_array_sc"); + __Pyx_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":250 @@ -2110,32 +2113,32 @@ * length = PyArray_SIZE(array) * array_data = array.data */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_19); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4))); __Pyx_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + arrayObject = ((PyArrayObject *)__pyx_t_4); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":254 * else: @@ -2192,7 +2195,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -2200,8 +2202,9 @@ __pyx_r = 0; __pyx_L0:; __Pyx_DECREF((PyObject *)arrayObject); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -2222,13 +2225,16 @@ npy_intp __pyx_v_i; PyArrayMultiIterObject *__pyx_v_multi; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; npy_intp __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - __Pyx_SetupRefcountContext("cont3_array"); + __Pyx_RefNannySetupContext("cont3_array"); + __Pyx_INCREF(__pyx_v_size); + __Pyx_INCREF((PyObject *)__pyx_v_oa); + __Pyx_INCREF((PyObject *)__pyx_v_ob); + __Pyx_INCREF((PyObject *)__pyx_v_oc); arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); __Pyx_INCREF(Py_None); @@ -2345,32 +2351,32 @@ * array_data = array.data * multi = PyArray_MultiIterNew(4, array, oa, */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_19); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4))); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_5))); __Pyx_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + arrayObject = ((PyArrayObject *)__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":284 * else: @@ -2388,12 +2394,12 @@ * if (multi.size != PyArray_SIZE(array)): * raise ValueError("size is not compatible with inputs") */ - __pyx_t_4 = PyArray_MultiIterNew(4, ((void *)arrayObject), ((void *)__pyx_v_oa), ((void *)__pyx_v_ob), ((void *)__pyx_v_oc)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_t_4))); + __pyx_t_5 = PyArray_MultiIterNew(4, ((void *)arrayObject), ((void *)__pyx_v_oa), ((void *)__pyx_v_ob), ((void *)__pyx_v_oc)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_t_5))); __Pyx_DECREF(((PyObject *)__pyx_v_multi)); - __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_5); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":287 * multi = PyArray_MultiIterNew(4, array, oa, @@ -2412,16 +2418,16 @@ * for i from 0 <= i < multi.size: * oa_data = PyArray_MultiIter_DATA(multi, 1) */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_22); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_22); - __Pyx_GIVEREF(__pyx_kp_22); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_1)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_1)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } @@ -2500,7 +2506,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); @@ -2509,8 +2514,12 @@ __pyx_L0:; __Pyx_DECREF((PyObject *)arrayObject); __Pyx_DECREF((PyObject *)__pyx_v_multi); + __Pyx_DECREF(__pyx_v_size); + __Pyx_DECREF((PyObject *)__pyx_v_oa); + __Pyx_DECREF((PyObject *)__pyx_v_ob); + __Pyx_DECREF((PyObject *)__pyx_v_oc); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -2528,13 +2537,13 @@ long __pyx_v_length; long __pyx_v_i; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; long __pyx_t_5; - __Pyx_SetupRefcountContext("disc0_array"); + __Pyx_RefNannySetupContext("disc0_array"); + __Pyx_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":303 @@ -2571,23 +2580,23 @@ * length = PyArray_SIZE(array) * array_data = array.data */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); __Pyx_INCREF(((PyObject *)((PyObject*)&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)((PyObject*)&PyInt_Type))); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)&PyInt_Type))); __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type))); - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4))); __Pyx_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_t_4); @@ -2648,7 +2657,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -2656,8 +2664,9 @@ __pyx_r = 0; __pyx_L0:; __Pyx_DECREF((PyObject *)arrayObject); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -2675,13 +2684,13 @@ long __pyx_v_length; long __pyx_v_i; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; long __pyx_t_5; - __Pyx_SetupRefcountContext("discnp_array_sc"); + __Pyx_RefNannySetupContext("discnp_array_sc"); + __Pyx_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":319 @@ -2718,23 +2727,23 @@ * length = PyArray_SIZE(array) * array_data = array.data */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); __Pyx_INCREF(((PyObject *)((PyObject*)&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)((PyObject*)&PyInt_Type))); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)&PyInt_Type))); __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type))); - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4))); __Pyx_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_t_4); @@ -2795,7 +2804,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -2803,8 +2811,9 @@ __pyx_r = 0; __pyx_L0:; __Pyx_DECREF((PyObject *)arrayObject); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -2824,13 +2833,15 @@ long *__pyx_v_on_data; PyArrayMultiIterObject *__pyx_v_multi; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; npy_intp __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - __Pyx_SetupRefcountContext("discnp_array"); + __Pyx_RefNannySetupContext("discnp_array"); + __Pyx_INCREF(__pyx_v_size); + __Pyx_INCREF((PyObject *)__pyx_v_on); + __Pyx_INCREF((PyObject *)__pyx_v_op); arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); __Pyx_INCREF(Py_None); @@ -2938,23 +2949,23 @@ * array_data = array.data * multi = PyArray_MultiIterNew(3, array, on, op) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); __Pyx_INCREF(((PyObject *)((PyObject*)&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)((PyObject*)&PyInt_Type))); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)&PyInt_Type))); __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type))); - __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_5))); __Pyx_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_t_5); @@ -3001,15 +3012,15 @@ * on_data = PyArray_MultiIter_DATA(multi, 1) */ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_kp_23); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_23); - __Pyx_GIVEREF(__pyx_kp_23); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_1)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_1)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } @@ -3088,7 +3099,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); @@ -3097,8 +3107,11 @@ __pyx_L0:; __Pyx_DECREF((PyObject *)arrayObject); __Pyx_DECREF((PyObject *)__pyx_v_multi); + __Pyx_DECREF(__pyx_v_size); + __Pyx_DECREF((PyObject *)__pyx_v_on); + __Pyx_DECREF((PyObject *)__pyx_v_op); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -3116,13 +3129,13 @@ long __pyx_v_length; long __pyx_v_i; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; long __pyx_t_5; - __Pyx_SetupRefcountContext("discdd_array_sc"); + __Pyx_RefNannySetupContext("discdd_array_sc"); + __Pyx_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":368 @@ -3159,23 +3172,23 @@ * length = PyArray_SIZE(array) * array_data = array.data */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); __Pyx_INCREF(((PyObject *)((PyObject*)&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)((PyObject*)&PyInt_Type))); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)&PyInt_Type))); __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type))); - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4))); __Pyx_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_t_4); @@ -3236,7 +3249,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -3244,8 +3256,9 @@ __pyx_r = 0; __pyx_L0:; __Pyx_DECREF((PyObject *)arrayObject); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -3265,13 +3278,15 @@ double *__pyx_v_on_data; PyArrayMultiIterObject *__pyx_v_multi; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; npy_intp __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - __Pyx_SetupRefcountContext("discdd_array"); + __Pyx_RefNannySetupContext("discdd_array"); + __Pyx_INCREF(__pyx_v_size); + __Pyx_INCREF((PyObject *)__pyx_v_on); + __Pyx_INCREF((PyObject *)__pyx_v_op); arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); __Pyx_INCREF(Py_None); @@ -3379,23 +3394,23 @@ * array_data = array.data * multi = PyArray_MultiIterNew(3, array, on, op) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); __Pyx_INCREF(((PyObject *)((PyObject*)&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)((PyObject*)&PyInt_Type))); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)&PyInt_Type))); __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type))); - __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_5))); __Pyx_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_t_5); @@ -3442,15 +3457,15 @@ * on_data = PyArray_MultiIter_DATA(multi, 1) */ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_kp_24); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_24); - __Pyx_GIVEREF(__pyx_kp_24); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_1)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_1)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } @@ -3529,7 +3544,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); @@ -3538,8 +3552,11 @@ __pyx_L0:; __Pyx_DECREF((PyObject *)arrayObject); __Pyx_DECREF((PyObject *)__pyx_v_multi); + __Pyx_DECREF(__pyx_v_size); + __Pyx_DECREF((PyObject *)__pyx_v_on); + __Pyx_DECREF((PyObject *)__pyx_v_op); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -3557,13 +3574,13 @@ long __pyx_v_length; long __pyx_v_i; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; long __pyx_t_5; - __Pyx_SetupRefcountContext("discnmN_array_sc"); + __Pyx_RefNannySetupContext("discnmN_array_sc"); + __Pyx_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":418 @@ -3600,23 +3617,23 @@ * length = PyArray_SIZE(array) * array_data = array.data */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); __Pyx_INCREF(((PyObject *)((PyObject*)&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)((PyObject*)&PyInt_Type))); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)&PyInt_Type))); __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type))); - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4))); __Pyx_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_t_4); @@ -3677,7 +3694,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -3685,8 +3701,9 @@ __pyx_r = 0; __pyx_L0:; __Pyx_DECREF((PyObject *)arrayObject); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -3707,13 +3724,16 @@ npy_intp __pyx_v_i; PyArrayMultiIterObject *__pyx_v_multi; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; npy_intp __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - __Pyx_SetupRefcountContext("discnmN_array"); + __Pyx_RefNannySetupContext("discnmN_array"); + __Pyx_INCREF(__pyx_v_size); + __Pyx_INCREF((PyObject *)__pyx_v_on); + __Pyx_INCREF((PyObject *)__pyx_v_om); + __Pyx_INCREF((PyObject *)__pyx_v_oN); arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); __Pyx_INCREF(Py_None); @@ -3830,23 +3850,23 @@ * array_data = array.data * multi = PyArray_MultiIterNew(4, array, on, om, */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); __Pyx_INCREF(((PyObject *)((PyObject*)&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)((PyObject*)&PyInt_Type))); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)&PyInt_Type))); __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type))); - __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_5))); __Pyx_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_t_5); @@ -3893,15 +3913,15 @@ * on_data = PyArray_MultiIter_DATA(multi, 1) */ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_kp_25); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_25); - __Pyx_GIVEREF(__pyx_kp_25); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_1)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_1)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } @@ -3980,7 +4000,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); @@ -3989,8 +4008,12 @@ __pyx_L0:; __Pyx_DECREF((PyObject *)arrayObject); __Pyx_DECREF((PyObject *)__pyx_v_multi); + __Pyx_DECREF(__pyx_v_size); + __Pyx_DECREF((PyObject *)__pyx_v_on); + __Pyx_DECREF((PyObject *)__pyx_v_om); + __Pyx_DECREF((PyObject *)__pyx_v_oN); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -4008,13 +4031,13 @@ long __pyx_v_length; long __pyx_v_i; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; long __pyx_t_5; - __Pyx_SetupRefcountContext("discd_array_sc"); + __Pyx_RefNannySetupContext("discd_array_sc"); + __Pyx_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":471 @@ -4051,23 +4074,23 @@ * length = PyArray_SIZE(array) * array_data = array.data */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); __Pyx_INCREF(((PyObject *)((PyObject*)&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)((PyObject*)&PyInt_Type))); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)&PyInt_Type))); __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type))); - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_4))); __Pyx_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_t_4); @@ -4128,7 +4151,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -4136,8 +4158,9 @@ __pyx_r = 0; __pyx_L0:; __Pyx_DECREF((PyObject *)arrayObject); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -4158,13 +4181,14 @@ PyArrayMultiIterObject *__pyx_v_multi; PyArrayIterObject *__pyx_v_itera; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; npy_intp __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - __Pyx_SetupRefcountContext("discd_array"); + __Pyx_RefNannySetupContext("discd_array"); + __Pyx_INCREF(__pyx_v_size); + __Pyx_INCREF((PyObject *)__pyx_v_oa); arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_itera = ((PyArrayIterObject *)Py_None); __Pyx_INCREF(Py_None); @@ -4264,23 +4288,23 @@ * array_data = array.data * multi = PyArray_MultiIterNew(2, array, oa) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); __Pyx_INCREF(((PyObject *)((PyObject*)&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)((PyObject*)&PyInt_Type))); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)&PyInt_Type))); __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type))); - __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_5))); __Pyx_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_t_5); @@ -4327,15 +4351,15 @@ * oa_data = PyArray_MultiIter_DATA(multi, 1) */ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_kp_26); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_26); - __Pyx_GIVEREF(__pyx_kp_26); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_1)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_1)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } @@ -4396,7 +4420,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); @@ -4406,8 +4429,10 @@ __Pyx_DECREF((PyObject *)arrayObject); __Pyx_DECREF((PyObject *)__pyx_v_multi); __Pyx_DECREF((PyObject *)__pyx_v_itera); + __Pyx_DECREF(__pyx_v_size); + __Pyx_DECREF((PyObject *)__pyx_v_oa); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -4427,7 +4452,7 @@ long __pyx_v_i; double __pyx_r; long __pyx_t_1; - __Pyx_SetupRefcountContext("kahan_sum"); + __Pyx_RefNannySetupContext("kahan_sum"); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":513 * cdef double c, y, t, sum @@ -4506,7 +4531,7 @@ __pyx_r = 0; __pyx_L0:; - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -4525,12 +4550,12 @@ PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_seed,0}; - __Pyx_SetupRefcountContext("__init__"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__seed,0}; + __Pyx_RefNannySetupContext("__init__"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[1] = {0}; - values[0] = Py_None; + values[0] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; @@ -4539,7 +4564,7 @@ switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_seed); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__seed); if (unlikely(value)) { values[0] = value; kw_args--; } } } @@ -4548,7 +4573,7 @@ } __pyx_v_seed = values[0]; } else { - __pyx_v_seed = Py_None; + __pyx_v_seed = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: __pyx_v_seed = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; @@ -4579,17 +4604,17 @@ * * def __dealloc__(self): */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_seed); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__seed); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_seed); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_seed); __Pyx_GIVEREF(__pyx_v_seed); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = 0; @@ -4601,7 +4626,7 @@ __Pyx_AddTraceback("mtrand.RandomState.__init__"); __pyx_r = -1; __pyx_L0:; - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -4616,7 +4641,8 @@ static void __pyx_pf_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pf_6mtrand_11RandomState___dealloc__(PyObject *__pyx_v_self) { int __pyx_t_1; - __Pyx_SetupRefcountContext("__dealloc__"); + __Pyx_RefNannySetupContext("__dealloc__"); + __Pyx_INCREF((PyObject *)__pyx_v_self); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":563 * @@ -4649,7 +4675,8 @@ } __pyx_L5:; - __Pyx_FinishRefcountContext(); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_RefNannyFinishContext(); } /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":567 @@ -4668,17 +4695,16 @@ PyArrayObject *arrayObject_obj; PyObject *__pyx_v_iseed; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; + unsigned long __pyx_t_2; PyObject *__pyx_t_3 = NULL; - unsigned long __pyx_t_4; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_seed,0}; - __Pyx_SetupRefcountContext("seed"); + PyObject *__pyx_t_4 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__seed,0}; + __Pyx_RefNannySetupContext("seed"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[1] = {0}; - values[0] = Py_None; + values[0] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; @@ -4687,7 +4713,7 @@ switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_seed); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__seed); if (unlikely(value)) { values[0] = value; kw_args--; } } } @@ -4696,7 +4722,7 @@ } __pyx_v_seed = values[0]; } else { - __pyx_v_seed = Py_None; + __pyx_v_seed = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: __pyx_v_seed = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; @@ -4710,6 +4736,8 @@ __Pyx_AddTraceback("mtrand.RandomState.seed"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_seed); arrayObject_obj = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_iseed = Py_None; __Pyx_INCREF(Py_None); @@ -4741,16 +4769,7 @@ * rk_seed(seed, self.internal_state) * elif isinstance(seed, np.integer): */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_seed); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_seed); - __Pyx_GIVEREF(__pyx_v_seed); - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyType_Type)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_1 = (__pyx_t_3 == ((PyObject *)((PyObject*)&PyInt_Type))); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_seed)) == ((PyObject *)((PyObject*)&PyInt_Type))); if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":591 @@ -4760,8 +4779,8 @@ * elif isinstance(seed, np.integer): * iseed = int(seed) */ - __pyx_t_4 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_seed); if (unlikely((__pyx_t_4 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - rk_seed(__pyx_t_4, ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); + __pyx_t_2 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_seed); if (unlikely((__pyx_t_2 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + rk_seed(__pyx_t_2, ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); goto __pyx_L6; } @@ -4772,13 +4791,13 @@ * iseed = int(seed) * rk_seed(iseed, self.internal_state) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_integer); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_1 = PyObject_IsInstance(__pyx_v_seed, __pyx_t_3); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__integer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = PyObject_IsInstance(__pyx_v_seed, __pyx_t_4); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":593 @@ -4788,17 +4807,17 @@ * rk_seed(iseed, self.internal_state) * else: */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_seed); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_seed); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_seed); __Pyx_GIVEREF(__pyx_v_seed); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_iseed); - __pyx_v_iseed = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_iseed = __pyx_t_3; + __pyx_t_3 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":594 * elif isinstance(seed, np.integer): @@ -4807,8 +4826,8 @@ * else: * obj = PyArray_ContiguousFromObject(seed, NPY_LONG, 1, 1) */ - __pyx_t_4 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_iseed); if (unlikely((__pyx_t_4 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - rk_seed(__pyx_t_4, ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); + __pyx_t_2 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_iseed); if (unlikely((__pyx_t_2 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + rk_seed(__pyx_t_2, ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); goto __pyx_L6; } /*else*/ { @@ -4820,12 +4839,12 @@ * init_by_array(self.internal_state, (obj.data), * obj.dimensions[0]) */ - __pyx_t_2 = PyArray_ContiguousFromObject(__pyx_v_seed, NPY_LONG, 1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_2))); + __pyx_t_3 = PyArray_ContiguousFromObject(__pyx_v_seed, NPY_LONG, 1, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); __Pyx_DECREF(((PyObject *)arrayObject_obj)); - arrayObject_obj = ((PyArrayObject *)__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + arrayObject_obj = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":598 * obj = PyArray_ContiguousFromObject(seed, NPY_LONG, 1, 1) @@ -4841,16 +4860,17 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("mtrand.RandomState.seed"); __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF((PyObject *)arrayObject_obj); __Pyx_DECREF(__pyx_v_iseed); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_seed); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -4867,12 +4887,11 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self, PyObject *unused) { PyArrayObject *arrayObject_state; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - __Pyx_SetupRefcountContext("get_state"); + __Pyx_RefNannySetupContext("get_state"); arrayObject_state = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":631 @@ -4882,32 +4901,32 @@ * memcpy((state.data), (self.internal_state.key), 624*sizeof(long)) * state = np.asarray(state, np.uint32) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_uint); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__uint); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_624); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_624); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_624); __Pyx_GIVEREF(__pyx_int_624); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_2))); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); __Pyx_DECREF(((PyObject *)arrayObject_state)); - arrayObject_state = ((PyArrayObject *)__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + arrayObject_state = ((PyArrayObject *)__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":632 * cdef ndarray state "arrayObject_state" @@ -4925,32 +4944,32 @@ * return ('MT19937', state, self.internal_state.pos, * self.internal_state.has_gauss, self.internal_state.gauss) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_asarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__asarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__uint32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_27); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_INCREF(((PyObject *)arrayObject_state)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)arrayObject_state)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)arrayObject_state)); __Pyx_GIVEREF(((PyObject *)arrayObject_state)); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_2))); + __Pyx_DECREF(((PyObject *)arrayObject_state)); + arrayObject_state = ((PyArrayObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); - __Pyx_DECREF(((PyObject *)arrayObject_state)); - arrayObject_state = ((PyArrayObject *)__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":634 * memcpy((state.data), (self.internal_state.key), 624*sizeof(long)) @@ -4960,8 +4979,8 @@ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":635 * state = np.asarray(state, np.uint32) @@ -4970,35 +4989,34 @@ * * def set_state(self, state): */ - __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->has_gauss); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->has_gauss); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->gauss); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyFloat_FromDouble(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->gauss); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_28); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_28); - __Pyx_GIVEREF(__pyx_kp_28); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_n_s__MT19937)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_n_s__MT19937)); + __Pyx_GIVEREF(((PyObject *)__pyx_n_s__MT19937)); __Pyx_INCREF(((PyObject *)arrayObject_state)); PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)arrayObject_state)); __Pyx_GIVEREF(((PyObject *)arrayObject_state)); - PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_1 = 0; - __pyx_t_2 = 0; - __pyx_r = ((PyObject *)__pyx_t_4); + __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); @@ -5008,7 +5026,7 @@ __pyx_L0:; __Pyx_DECREF((PyObject *)arrayObject_state); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -5030,20 +5048,17 @@ PyObject *__pyx_v_has_gauss; PyObject *__pyx_v_cached_gaussian; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - int __pyx_5; PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; + Py_ssize_t __pyx_t_7; double __pyx_t_8; - __Pyx_SetupRefcountContext("set_state"); + __Pyx_RefNannySetupContext("set_state"); + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_state); arrayObject_obj = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_algorithm_name = Py_None; __Pyx_INCREF(Py_None); __pyx_v_key = Py_None; __Pyx_INCREF(Py_None); @@ -5057,11 +5072,11 @@ * if algorithm_name != 'MT19937': * raise ValueError("algorithm must be 'MT19937'") */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_state, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_v_algorithm_name); - __pyx_v_algorithm_name = __pyx_1; - __pyx_1 = 0; + __pyx_v_algorithm_name = __pyx_t_1; + __pyx_t_1 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":687 * cdef int pos @@ -5070,7 +5085,7 @@ * raise ValueError("algorithm must be 'MT19937'") * key, pos = state[1:3] */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_algorithm_name, __pyx_kp_29, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_algorithm_name, ((PyObject *)__pyx_n_s__MT19937), Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -5084,13 +5099,13 @@ * if len(state) == 3: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_kp_30); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_30); - __Pyx_GIVEREF(__pyx_kp_30); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_2)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_2)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -5105,35 +5120,35 @@ * if len(state) == 3: * has_gauss = 0 */ - __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, 3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - if (PyTuple_CheckExact(__pyx_1) && likely(PyTuple_GET_SIZE(__pyx_1) == 2)) { - PyObject* tuple = __pyx_1; - __pyx_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_3); - __pyx_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_4); - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_4); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_t_3 = PySequence_GetSlice(__pyx_v_state, 1, 3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) { + PyObject* tuple = __pyx_t_3; + __pyx_t_1 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_1); + __pyx_t_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_key); - __pyx_v_key = __pyx_3; - __pyx_3 = 0; - __pyx_v_pos = __pyx_t_4; + __pyx_v_key = __pyx_t_1; + __pyx_t_1 = 0; + __pyx_v_pos = __pyx_t_5; } else { - __pyx_2 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_3 = __Pyx_UnpackItem(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_UnpackItem(__pyx_2, 1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_4); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_6, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_6, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_EndUnpack(__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_v_key); - __pyx_v_key = __pyx_3; - __pyx_3 = 0; - __pyx_v_pos = __pyx_t_4; + __pyx_v_key = __pyx_t_1; + __pyx_t_1 = 0; + __pyx_v_pos = __pyx_t_5; } /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":690 @@ -5143,8 +5158,8 @@ * has_gauss = 0 * cached_gaussian = 0.0 */ - __pyx_t_5 = PyObject_Length(__pyx_v_state); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = (__pyx_t_5 == 3); + __pyx_t_7 = PyObject_Length(__pyx_v_state); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_7 == 3); if (__pyx_t_2) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":691 @@ -5181,35 +5196,35 @@ * try: * obj = PyArray_ContiguousFromObject(key, NPY_ULONG, 1, 1) */ - __pyx_4 = PySequence_GetSlice(__pyx_v_state, 3, 5); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - if (PyTuple_CheckExact(__pyx_4) && likely(PyTuple_GET_SIZE(__pyx_4) == 2)) { - PyObject* tuple = __pyx_4; - __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2); - __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3); - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_t_3 = PySequence_GetSlice(__pyx_v_state, 3, 5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) { + PyObject* tuple = __pyx_t_3; + __pyx_t_4 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_4); + __pyx_t_1 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_has_gauss); - __pyx_v_has_gauss = __pyx_2; - __pyx_2 = 0; + __pyx_v_has_gauss = __pyx_t_4; + __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_cached_gaussian); - __pyx_v_cached_gaussian = __pyx_3; - __pyx_3 = 0; + __pyx_v_cached_gaussian = __pyx_t_1; + __pyx_t_1 = 0; } else { - __pyx_1 = PyObject_GetIter(__pyx_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __Pyx_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_6, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_6, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_EndUnpack(__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_v_has_gauss); - __pyx_v_has_gauss = __pyx_2; - __pyx_2 = 0; + __pyx_v_has_gauss = __pyx_t_4; + __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_cached_gaussian); - __pyx_v_cached_gaussian = __pyx_3; - __pyx_3 = 0; + __pyx_v_cached_gaussian = __pyx_t_1; + __pyx_t_1 = 0; } } __pyx_L6:; @@ -5248,10 +5263,8 @@ __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; goto __pyx_L14_try_end; __pyx_L7_error:; - __Pyx_XDECREF(__pyx_4); __pyx_4 = 0; - __Pyx_XDECREF(__pyx_1); __pyx_1 = 0; - __Pyx_XDECREF(__pyx_2); __pyx_2 = 0; - __Pyx_XDECREF(__pyx_3); __pyx_3 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -5262,13 +5275,13 @@ * # compatibility -- could be an older pickle * obj = PyArray_ContiguousFromObject(key, NPY_LONG, 1, 1) */ - __pyx_5 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); - if (__pyx_5) { - __Pyx_AddTraceback("mtrand.set_state"); - if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __pyx_t_5 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); + if (__pyx_t_5) { + __Pyx_AddTraceback("mtrand.RandomState.set_state"); + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_t_6); + __Pyx_GOTREF(__pyx_t_4); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":699 * except TypeError: @@ -5277,21 +5290,22 @@ * if obj.dimensions[0] != 624: * raise ValueError("state must be 624 longs") */ - __pyx_t_7 = PyArray_ContiguousFromObject(__pyx_v_key, NPY_LONG, 1, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_7))); + __pyx_t_6 = PyArray_ContiguousFromObject(__pyx_v_key, NPY_LONG, 1, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_6))); __Pyx_DECREF(((PyObject *)arrayObject_obj)); - arrayObject_obj = ((PyArrayObject *)__pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + arrayObject_obj = ((PyArrayObject *)__pyx_t_6); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L8_exception_handled; } __pyx_L9_except_error:; - __Pyx_XDECREF(__pyx_save_exc_type); - __Pyx_XDECREF(__pyx_save_exc_value); - __Pyx_XDECREF(__pyx_save_exc_tb); + __Pyx_XGIVEREF(__pyx_save_exc_type); + __Pyx_XGIVEREF(__pyx_save_exc_value); + __Pyx_XGIVEREF(__pyx_save_exc_tb); + __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); goto __pyx_L1_error; __pyx_L8_exception_handled:; __Pyx_XGIVEREF(__pyx_save_exc_type); @@ -5318,14 +5332,14 @@ * memcpy((self.internal_state.key), (obj.data), 624*sizeof(long)) * self.internal_state.pos = pos */ - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - __Pyx_INCREF(__pyx_kp_31); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_31); - __Pyx_GIVEREF(__pyx_kp_31); - __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_3)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_3)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3)); + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -5358,8 +5372,8 @@ * self.internal_state.gauss = cached_gaussian * */ - __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_has_gauss); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->has_gauss = __pyx_t_4; + __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_has_gauss); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->has_gauss = __pyx_t_5; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":705 * self.internal_state.pos = pos @@ -5368,20 +5382,16 @@ * * # Pickling support: */ - __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_cached_gaussian); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_cached_gaussian); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->gauss = __pyx_t_8; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_2); - __Pyx_XDECREF(__pyx_3); - __Pyx_XDECREF(__pyx_4); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("mtrand.RandomState.set_state"); __pyx_r = NULL; __pyx_L0:; @@ -5390,8 +5400,10 @@ __Pyx_DECREF(__pyx_v_key); __Pyx_DECREF(__pyx_v_has_gauss); __Pyx_DECREF(__pyx_v_cached_gaussian); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_state); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -5408,7 +5420,7 @@ PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - __Pyx_SetupRefcountContext("__getstate__"); + __Pyx_RefNannySetupContext("__getstate__"); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":709 * # Pickling support: @@ -5418,7 +5430,7 @@ * def __setstate__(self, state): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_get_state); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_state); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); @@ -5436,7 +5448,7 @@ __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -5454,7 +5466,7 @@ PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - __Pyx_SetupRefcountContext("__setstate__"); + __Pyx_RefNannySetupContext("__setstate__"); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":712 * @@ -5463,17 +5475,17 @@ * * def __reduce__(self): */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_set_state); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__set_state); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -5486,7 +5498,7 @@ __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -5501,11 +5513,10 @@ static PyObject *__pyx_pf_6mtrand_11RandomState___reduce__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ static PyObject *__pyx_pf_6mtrand_11RandomState___reduce__(PyObject *__pyx_v_self, PyObject *unused) { PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - __Pyx_SetupRefcountContext("__reduce__"); + __Pyx_RefNannySetupContext("__reduce__"); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":715 * @@ -5515,38 +5526,37 @@ * # Basic distributions: */ __Pyx_XDECREF(__pyx_r); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_random); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_kp___RandomState_ctor); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__random); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_get_state); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____RandomState_ctor); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_state); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_empty_tuple)); - PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_empty_tuple)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_empty_tuple)); __Pyx_GIVEREF(((PyObject *)__pyx_empty_tuple)); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_r = ((PyObject *)__pyx_t_1); - __pyx_t_1 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); @@ -5554,7 +5564,7 @@ __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -5572,12 +5582,12 @@ PyObject *__pyx_v_size = 0; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("random_sample"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("random_sample"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[1] = {0}; - values[0] = Py_None; + values[0] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; @@ -5586,7 +5596,7 @@ switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[0] = value; kw_args--; } } } @@ -5595,7 +5605,7 @@ } __pyx_v_size = values[0]; } else { - __pyx_v_size = Py_None; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; @@ -5632,7 +5642,7 @@ __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -5650,12 +5660,12 @@ PyObject *__pyx_v_size = 0; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("tomaxint"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("tomaxint"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[1] = {0}; - values[0] = Py_None; + values[0] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; @@ -5664,7 +5674,7 @@ switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[0] = value; kw_args--; } } } @@ -5673,7 +5683,7 @@ } __pyx_v_size = values[0]; } else { - __pyx_v_size = Py_None; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; @@ -5710,7 +5720,7 @@ __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -5736,19 +5746,18 @@ long __pyx_v_length; long __pyx_v_i; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; long __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_low,&__pyx_kp_high,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("randint"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__low,&__pyx_n_s__high,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("randint"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[3] = {0,0,0}; - values[1] = Py_None; - values[2] = Py_None; + values[1] = ((PyObject *)Py_None); + values[2] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); @@ -5758,17 +5767,17 @@ } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_low); + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__low); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_high); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__high); if (unlikely(value)) { values[1] = value; kw_args--; } } case 2: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[2] = value; kw_args--; } } } @@ -5779,8 +5788,8 @@ __pyx_v_high = values[1]; __pyx_v_size = values[2]; } else { - __pyx_v_high = Py_None; - __pyx_v_size = Py_None; + __pyx_v_high = ((PyObject *)Py_None); + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); case 2: __pyx_v_high = PyTuple_GET_ITEM(__pyx_args, 1); @@ -5796,6 +5805,10 @@ __Pyx_AddTraceback("mtrand.RandomState.randint"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_low); + __Pyx_INCREF(__pyx_v_high); + __Pyx_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":845 @@ -5879,13 +5892,13 @@ * if size is None: */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_kp_32); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_32); - __Pyx_GIVEREF(__pyx_kp_32); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_4)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_4)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4)); + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_4, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -5927,23 +5940,23 @@ * length = PyArray_SIZE(array) * array_data = array.data */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); __Pyx_INCREF(((PyObject *)((PyObject*)&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)((PyObject*)&PyInt_Type))); + PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)((PyObject*)&PyInt_Type))); __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type))); - __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_5))); __Pyx_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_t_5); @@ -6004,7 +6017,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); @@ -6012,8 +6024,12 @@ __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF((PyObject *)arrayObject); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_low); + __Pyx_DECREF(__pyx_v_high); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -6033,7 +6049,7 @@ PyObject *__pyx_v_bytestring; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; - __Pyx_SetupRefcountContext("bytes"); + __Pyx_RefNannySetupContext("bytes"); assert(__pyx_arg_length); { __pyx_v_length = __Pyx_PyInt_AsUnsignedInt(__pyx_arg_length); if (unlikely((__pyx_v_length == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } @@ -6087,7 +6103,7 @@ __pyx_L0:; __Pyx_DECREF(__pyx_v_bytestring); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -6112,19 +6128,18 @@ double __pyx_v_fhigh; PyObject *__pyx_v_temp; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_low,&__pyx_kp_high,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("uniform"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__low,&__pyx_n_s__high,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("uniform"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[3] = {0,0,0}; - values[0] = __pyx_k_3; - values[1] = __pyx_k_4; - values[2] = Py_None; + values[0] = __pyx_k_5; + values[1] = __pyx_k_6; + values[2] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); @@ -6135,17 +6150,17 @@ switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_low); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__low); if (unlikely(value)) { values[0] = value; kw_args--; } } case 1: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_high); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__high); if (unlikely(value)) { values[1] = value; kw_args--; } } case 2: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[2] = value; kw_args--; } } } @@ -6156,9 +6171,9 @@ __pyx_v_high = values[1]; __pyx_v_size = values[2]; } else { - __pyx_v_low = __pyx_k_3; - __pyx_v_high = __pyx_k_4; - __pyx_v_size = Py_None; + __pyx_v_low = __pyx_k_5; + __pyx_v_high = __pyx_k_6; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); case 2: __pyx_v_high = PyTuple_GET_ITEM(__pyx_args, 1); @@ -6174,6 +6189,10 @@ __Pyx_AddTraceback("mtrand.RandomState.uniform"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_low); + __Pyx_INCREF(__pyx_v_high); + __Pyx_INCREF(__pyx_v_size); __pyx_v_olow = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_ohigh = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_odiff = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); @@ -6268,23 +6287,23 @@ * Py_INCREF(temp) # needed to get around Pyrex's automatic reference-counting * # rules because EnsureArray steals a reference */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_subtract); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__subtract); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_ohigh)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_ohigh)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_ohigh)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ohigh)); __Pyx_INCREF(((PyObject *)__pyx_v_olow)); - PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_olow)); + PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_olow)); __Pyx_GIVEREF(((PyObject *)__pyx_v_olow)); - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_temp); __pyx_v_temp = __pyx_t_4; __pyx_t_4 = 0; @@ -6329,7 +6348,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -6340,8 +6358,12 @@ __Pyx_DECREF((PyObject *)__pyx_v_ohigh); __Pyx_DECREF((PyObject *)__pyx_v_odiff); __Pyx_DECREF(__pyx_v_temp); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_low); + __Pyx_DECREF(__pyx_v_high); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -6358,15 +6380,16 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_rand(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - __Pyx_SetupRefcountContext("rand"); + PyObject *__pyx_t_5 = NULL; + __Pyx_RefNannySetupContext("rand"); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "rand", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; + __Pyx_INCREF((PyObject *)__pyx_v_self); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1019 * @@ -6387,7 +6410,7 @@ * return self.random_sample(size=args) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_random_sample); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__random_sample); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); @@ -6407,17 +6430,17 @@ * def randn(self, *args): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_random_sample); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__random_sample); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_1)); - if (PyDict_SetItem(__pyx_1, __pyx_kp_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__size), __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; } __pyx_L5:; @@ -6425,15 +6448,16 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("mtrand.RandomState.rand"); __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF(__pyx_v_args); + __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -6455,10 +6479,11 @@ PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - __Pyx_SetupRefcountContext("randn"); + __Pyx_RefNannySetupContext("randn"); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "randn", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; + __Pyx_INCREF((PyObject *)__pyx_v_self); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1075 * @@ -6479,7 +6504,7 @@ * return self.standard_normal(args) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_standard_normal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__standard_normal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); @@ -6499,17 +6524,17 @@ * def random_integers(self, low, high=None, size=None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_standard_normal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__standard_normal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); - __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; @@ -6526,8 +6551,9 @@ __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF(__pyx_v_args); + __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -6550,13 +6576,13 @@ PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_low,&__pyx_kp_high,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("random_integers"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__low,&__pyx_n_s__high,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("random_integers"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[3] = {0,0,0}; - values[1] = Py_None; - values[2] = Py_None; + values[1] = ((PyObject *)Py_None); + values[2] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); @@ -6566,17 +6592,17 @@ } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_low); + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__low); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_high); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__high); if (unlikely(value)) { values[1] = value; kw_args--; } } case 2: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[2] = value; kw_args--; } } } @@ -6587,8 +6613,8 @@ __pyx_v_high = values[1]; __pyx_v_size = values[2]; } else { - __pyx_v_high = Py_None; - __pyx_v_size = Py_None; + __pyx_v_high = ((PyObject *)Py_None); + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); case 2: __pyx_v_high = PyTuple_GET_ITEM(__pyx_args, 1); @@ -6604,8 +6630,10 @@ __Pyx_AddTraceback("mtrand.RandomState.random_integers"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_v_low); __Pyx_INCREF(__pyx_v_high); + __Pyx_INCREF(__pyx_v_size); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1152 * @@ -6650,12 +6678,12 @@ * # Complicated, continuous distributions: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_randint); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__randint); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyNumber_Add(__pyx_v_high, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_low); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_low); __Pyx_GIVEREF(__pyx_v_low); @@ -6665,10 +6693,10 @@ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; @@ -6682,10 +6710,12 @@ __Pyx_AddTraceback("mtrand.RandomState.random_integers"); __pyx_r = NULL; __pyx_L0:; + __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_DECREF(__pyx_v_low); __Pyx_DECREF(__pyx_v_high); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -6703,12 +6733,12 @@ PyObject *__pyx_v_size = 0; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("standard_normal"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("standard_normal"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[1] = {0}; - values[0] = Py_None; + values[0] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; @@ -6717,7 +6747,7 @@ switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[0] = value; kw_args--; } } } @@ -6726,7 +6756,7 @@ } __pyx_v_size = values[0]; } else { - __pyx_v_size = Py_None; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; @@ -6763,7 +6793,7 @@ __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -6786,20 +6816,19 @@ double __pyx_v_floc; double __pyx_v_fscale; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_loc,&__pyx_kp_scale,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("normal"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__loc,&__pyx_n_s__scale,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("normal"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[3] = {0,0,0}; - values[0] = __pyx_k_5; - values[1] = __pyx_k_6; - values[2] = Py_None; + values[0] = __pyx_k_7; + values[1] = __pyx_k_8; + values[2] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); @@ -6810,17 +6839,17 @@ switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_loc); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__loc); if (unlikely(value)) { values[0] = value; kw_args--; } } case 1: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_scale); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__scale); if (unlikely(value)) { values[1] = value; kw_args--; } } case 2: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[2] = value; kw_args--; } } } @@ -6831,9 +6860,9 @@ __pyx_v_scale = values[1]; __pyx_v_size = values[2]; } else { - __pyx_v_loc = __pyx_k_5; - __pyx_v_scale = __pyx_k_6; - __pyx_v_size = Py_None; + __pyx_v_loc = __pyx_k_7; + __pyx_v_scale = __pyx_k_8; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); case 2: __pyx_v_scale = PyTuple_GET_ITEM(__pyx_args, 1); @@ -6849,6 +6878,10 @@ __Pyx_AddTraceback("mtrand.RandomState.normal"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_loc); + __Pyx_INCREF(__pyx_v_scale); + __Pyx_INCREF(__pyx_v_size); __pyx_v_oloc = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); @@ -6898,13 +6931,13 @@ * */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_33); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_33); - __Pyx_GIVEREF(__pyx_kp_33); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_9)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_9)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -6973,37 +7006,37 @@ * raise ValueError("scale <= 0") * return cont2_array(self.internal_state, rk_normal, size, oloc, oscale) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_oscale)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_oscale)); __Pyx_GIVEREF(((PyObject *)__pyx_v_oscale)); __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { @@ -7016,15 +7049,15 @@ * */ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_kp_34); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_34); - __Pyx_GIVEREF(__pyx_kp_34); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_9)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_9)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L8; } @@ -7038,16 +7071,15 @@ * def beta(self, a, b, size=None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_normal, __pyx_v_size, __pyx_v_oloc, __pyx_v_oscale); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_t_3 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_normal, __pyx_v_size, __pyx_v_oloc, __pyx_v_oscale); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -7057,8 +7089,12 @@ __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_oloc); __Pyx_DECREF((PyObject *)__pyx_v_oscale); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_loc); + __Pyx_DECREF(__pyx_v_scale); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -7081,18 +7117,17 @@ double __pyx_v_fa; double __pyx_v_fb; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_a,&__pyx_kp_b,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("beta"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__a,&__pyx_n_s__b,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("beta"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[3] = {0,0,0}; - values[2] = Py_None; + values[2] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); @@ -7102,18 +7137,18 @@ } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_a); + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__a); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_b); + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__b); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("beta", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[2] = value; kw_args--; } } } @@ -7124,7 +7159,7 @@ __pyx_v_b = values[1]; __pyx_v_size = values[2]; } else { - __pyx_v_size = Py_None; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); @@ -7142,6 +7177,10 @@ __Pyx_AddTraceback("mtrand.RandomState.beta"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_a); + __Pyx_INCREF(__pyx_v_b); + __Pyx_INCREF(__pyx_v_size); __pyx_v_oa = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_ob = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); @@ -7191,13 +7230,13 @@ * raise ValueError("b <= 0") */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_35); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_35); - __Pyx_GIVEREF(__pyx_kp_35); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_10)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_10)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -7223,13 +7262,13 @@ * */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_kp_36); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_36); - __Pyx_GIVEREF(__pyx_kp_36); - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_11)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_11)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -7298,37 +7337,37 @@ * raise ValueError("a <= 0") * if np.any(np.less_equal(ob, 0)): */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_oa)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_oa)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_oa)); __Pyx_GIVEREF(((PyObject *)__pyx_v_oa)); __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { @@ -7341,15 +7380,15 @@ * raise ValueError("b <= 0") */ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_kp_37); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_37); - __Pyx_GIVEREF(__pyx_kp_37); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_10)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_10)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L9; } @@ -7362,39 +7401,39 @@ * raise ValueError("b <= 0") * return cont2_array(self.internal_state, rk_beta, size, oa, ob) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_ob)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_ob)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ob)); __Pyx_INCREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1346 @@ -7404,14 +7443,14 @@ * return cont2_array(self.internal_state, rk_beta, size, oa, ob) * */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_kp_38); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_38); - __Pyx_GIVEREF(__pyx_kp_38); - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_11)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_11)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -7436,7 +7475,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -7446,8 +7484,12 @@ __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_oa); __Pyx_DECREF((PyObject *)__pyx_v_ob); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_a); + __Pyx_DECREF(__pyx_v_b); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -7467,19 +7509,18 @@ PyArrayObject *__pyx_v_oscale; double __pyx_v_fscale; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_scale,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("exponential"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__scale,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("exponential"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[2] = {0,0}; - values[0] = __pyx_k_7; - values[1] = Py_None; + values[0] = __pyx_k_12; + values[1] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); @@ -7489,12 +7530,12 @@ switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_scale); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__scale); if (unlikely(value)) { values[0] = value; kw_args--; } } case 1: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[1] = value; kw_args--; } } } @@ -7504,8 +7545,8 @@ __pyx_v_scale = values[0]; __pyx_v_size = values[1]; } else { - __pyx_v_scale = __pyx_k_7; - __pyx_v_size = Py_None; + __pyx_v_scale = __pyx_k_12; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); case 1: __pyx_v_scale = PyTuple_GET_ITEM(__pyx_args, 0); @@ -7520,6 +7561,9 @@ __Pyx_AddTraceback("mtrand.RandomState.exponential"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_scale); + __Pyx_INCREF(__pyx_v_size); __pyx_v_oscale = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1390 @@ -7559,13 +7603,13 @@ * */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_39); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_39); - __Pyx_GIVEREF(__pyx_kp_39); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_9)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_9)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -7620,41 +7664,41 @@ * raise ValueError("scale <= 0") * return cont1_array(self.internal_state, rk_exponential, size, oscale) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_oscale)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oscale)); __Pyx_GIVEREF(((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1400 @@ -7664,14 +7708,14 @@ * return cont1_array(self.internal_state, rk_exponential, size, oscale) * */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_40); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_40); - __Pyx_GIVEREF(__pyx_kp_40); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_9)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_9)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9)); + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -7696,7 +7740,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -7705,8 +7748,11 @@ __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_oscale); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_scale); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -7724,12 +7770,12 @@ PyObject *__pyx_v_size = 0; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("standard_exponential"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("standard_exponential"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[1] = {0}; - values[0] = Py_None; + values[0] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; @@ -7738,7 +7784,7 @@ switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[0] = value; kw_args--; } } } @@ -7747,7 +7793,7 @@ } __pyx_v_size = values[0]; } else { - __pyx_v_size = Py_None; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; @@ -7784,7 +7830,7 @@ __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -7804,18 +7850,17 @@ PyArrayObject *__pyx_v_oshape; double __pyx_v_fshape; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_shape,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("standard_gamma"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__shape,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("standard_gamma"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[2] = {0,0}; - values[1] = Py_None; + values[1] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); @@ -7824,12 +7869,12 @@ } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_shape); + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__shape); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[1] = value; kw_args--; } } } @@ -7839,7 +7884,7 @@ __pyx_v_shape = values[0]; __pyx_v_size = values[1]; } else { - __pyx_v_size = Py_None; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); case 1: __pyx_v_shape = PyTuple_GET_ITEM(__pyx_args, 0); @@ -7854,6 +7899,9 @@ __Pyx_AddTraceback("mtrand.RandomState.standard_gamma"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_shape); + __Pyx_INCREF(__pyx_v_size); __pyx_v_oshape = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1501 @@ -7893,13 +7941,13 @@ * */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_41); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_41); - __Pyx_GIVEREF(__pyx_kp_41); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_13)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_13)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_13)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -7954,41 +8002,41 @@ * raise ValueError("shape <= 0") * return cont1_array(self.internal_state, rk_standard_gamma, size, oshape) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_oshape)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oshape)); __Pyx_GIVEREF(((PyObject *)__pyx_v_oshape)); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1510 @@ -7998,14 +8046,14 @@ * return cont1_array(self.internal_state, rk_standard_gamma, size, oshape) * */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_42); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_42); - __Pyx_GIVEREF(__pyx_kp_42); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_13)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_13)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_13)); + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -8030,7 +8078,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -8039,8 +8086,11 @@ __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_oshape); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_shape); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -8063,19 +8113,18 @@ double __pyx_v_fshape; double __pyx_v_fscale; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_shape,&__pyx_kp_scale,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("gamma"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__shape,&__pyx_n_s__scale,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("gamma"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[3] = {0,0,0}; - values[1] = __pyx_k_8; - values[2] = Py_None; + values[1] = __pyx_k_14; + values[2] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); @@ -8085,17 +8134,17 @@ } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_shape); + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__shape); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_scale); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__scale); if (unlikely(value)) { values[1] = value; kw_args--; } } case 2: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[2] = value; kw_args--; } } } @@ -8106,8 +8155,8 @@ __pyx_v_scale = values[1]; __pyx_v_size = values[2]; } else { - __pyx_v_scale = __pyx_k_8; - __pyx_v_size = Py_None; + __pyx_v_scale = __pyx_k_14; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); case 2: __pyx_v_scale = PyTuple_GET_ITEM(__pyx_args, 1); @@ -8123,6 +8172,10 @@ __Pyx_AddTraceback("mtrand.RandomState.gamma"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_shape); + __Pyx_INCREF(__pyx_v_scale); + __Pyx_INCREF(__pyx_v_size); __pyx_v_oshape = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); @@ -8172,13 +8225,13 @@ * raise ValueError("scale <= 0") */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_43); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_43); - __Pyx_GIVEREF(__pyx_kp_43); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_13)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_13)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_13)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -8204,13 +8257,13 @@ * */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_kp_44); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_44); - __Pyx_GIVEREF(__pyx_kp_44); - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_9)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_9)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -8279,41 +8332,41 @@ * raise ValueError("shape <= 0") * if np.any(np.less_equal(oscale, 0.0)): */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_oshape)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oshape)); __Pyx_GIVEREF(((PyObject *)__pyx_v_oshape)); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1599 @@ -8323,14 +8376,14 @@ * if np.any(np.less_equal(oscale, 0.0)): * raise ValueError("scale <= 0") */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_45); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_45); - __Pyx_GIVEREF(__pyx_kp_45); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_13)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_13)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_13)); + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -8345,41 +8398,41 @@ * raise ValueError("scale <= 0") * return cont2_array(self.internal_state, rk_gamma, size, oshape, oscale) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_INCREF(((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_oscale)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_oscale)); __Pyx_GIVEREF(((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1601 @@ -8389,16 +8442,16 @@ * return cont2_array(self.internal_state, rk_gamma, size, oshape, oscale) * */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_46); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_46); - __Pyx_GIVEREF(__pyx_kp_46); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_9)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_9)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9)); + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L10; } @@ -8412,16 +8465,15 @@ * def f(self, dfnum, dfden, size=None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_gamma, __pyx_v_size, __pyx_v_oshape, __pyx_v_oscale); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_gamma, __pyx_v_size, __pyx_v_oshape, __pyx_v_oscale); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -8431,8 +8483,12 @@ __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_oshape); __Pyx_DECREF((PyObject *)__pyx_v_oscale); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_shape); + __Pyx_DECREF(__pyx_v_scale); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -8455,18 +8511,17 @@ double __pyx_v_fdfnum; double __pyx_v_fdfden; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_dfnum,&__pyx_kp_dfden,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("f"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__dfnum,&__pyx_n_s__dfden,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("f"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[3] = {0,0,0}; - values[2] = Py_None; + values[2] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); @@ -8476,18 +8531,18 @@ } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_dfnum); + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dfnum); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_dfden); + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dfden); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("f", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[2] = value; kw_args--; } } } @@ -8498,7 +8553,7 @@ __pyx_v_dfden = values[1]; __pyx_v_size = values[2]; } else { - __pyx_v_size = Py_None; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); @@ -8516,6 +8571,10 @@ __Pyx_AddTraceback("mtrand.RandomState.f"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_dfnum); + __Pyx_INCREF(__pyx_v_dfden); + __Pyx_INCREF(__pyx_v_size); __pyx_v_odfnum = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_odfden = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); @@ -8565,13 +8624,13 @@ * raise ValueError("scale <= 0") */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_47); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_47); - __Pyx_GIVEREF(__pyx_kp_47); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_13)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_13)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_13)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -8597,13 +8656,13 @@ * */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_kp_48); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_48); - __Pyx_GIVEREF(__pyx_kp_48); - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_9)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_9)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -8672,41 +8731,41 @@ * raise ValueError("dfnum <= 0") * if np.any(np.less_equal(odfden, 0.0)): */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_odfnum)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_odfnum)); __Pyx_GIVEREF(((PyObject *)__pyx_v_odfnum)); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1702 @@ -8716,14 +8775,14 @@ * if np.any(np.less_equal(odfden, 0.0)): * raise ValueError("dfden <= 0") */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_49); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_49); - __Pyx_GIVEREF(__pyx_kp_49); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_15)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_15)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_15)); + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -8738,41 +8797,41 @@ * raise ValueError("dfden <= 0") * return cont2_array(self.internal_state, rk_f, size, odfnum, odfden) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_INCREF(((PyObject *)__pyx_v_odfden)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_odfden)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_odfden)); __Pyx_GIVEREF(((PyObject *)__pyx_v_odfden)); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1704 @@ -8782,16 +8841,16 @@ * return cont2_array(self.internal_state, rk_f, size, odfnum, odfden) * */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_50); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_50); - __Pyx_GIVEREF(__pyx_kp_50); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_16)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_16)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_16)); + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L10; } @@ -8805,16 +8864,15 @@ * def noncentral_f(self, dfnum, dfden, nonc, size=None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_f, __pyx_v_size, __pyx_v_odfnum, __pyx_v_odfden); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_f, __pyx_v_size, __pyx_v_odfnum, __pyx_v_odfden); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -8824,8 +8882,12 @@ __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_odfnum); __Pyx_DECREF((PyObject *)__pyx_v_odfden); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_dfnum); + __Pyx_DECREF(__pyx_v_dfden); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -8851,18 +8913,17 @@ double __pyx_v_fdfden; double __pyx_v_fnonc; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_dfnum,&__pyx_kp_dfden,&__pyx_kp_nonc,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("noncentral_f"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__dfnum,&__pyx_n_s__dfden,&__pyx_n_s__nonc,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("noncentral_f"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[4] = {0,0,0,0}; - values[3] = Py_None; + values[3] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); @@ -8873,24 +8934,24 @@ } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_dfnum); + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dfnum); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_dfden); + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dfden); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("noncentral_f", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_nonc); + values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nonc); if (likely(values[2])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("noncentral_f", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[3] = value; kw_args--; } } } @@ -8902,7 +8963,7 @@ __pyx_v_nonc = values[2]; __pyx_v_size = values[3]; } else { - __pyx_v_size = Py_None; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 3); @@ -8921,6 +8982,11 @@ __Pyx_AddTraceback("mtrand.RandomState.noncentral_f"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_dfnum); + __Pyx_INCREF(__pyx_v_dfden); + __Pyx_INCREF(__pyx_v_nonc); + __Pyx_INCREF(__pyx_v_size); __pyx_v_odfnum = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_odfden = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_ononc = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); @@ -8980,13 +9046,13 @@ * raise ValueError("dfden <= 0") */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_51); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_51); - __Pyx_GIVEREF(__pyx_kp_51); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_17)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_17)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_17)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -9012,13 +9078,13 @@ * raise ValueError("nonc < 0") */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_kp_52); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_52); - __Pyx_GIVEREF(__pyx_kp_52); - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_16)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_16)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_16)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -9044,13 +9110,13 @@ * fdfnum, fdfden, fnonc) */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_53); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_53); - __Pyx_GIVEREF(__pyx_kp_53); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_18)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_18)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -9141,41 +9207,41 @@ * raise ValueError("dfnum <= 1") * if np.any(np.less_equal(odfden, 0.0)): */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_odfnum)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_odfnum)); __Pyx_GIVEREF(((PyObject *)__pyx_v_odfnum)); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1794 @@ -9185,14 +9251,14 @@ * if np.any(np.less_equal(odfden, 0.0)): * raise ValueError("dfden <= 0") */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_54); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_54); - __Pyx_GIVEREF(__pyx_kp_54); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_17)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_17)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_17)); + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -9207,41 +9273,41 @@ * raise ValueError("dfden <= 0") * if np.any(np.less(ononc, 0.0)): */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_INCREF(((PyObject *)__pyx_v_odfden)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_odfden)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_odfden)); __Pyx_GIVEREF(((PyObject *)__pyx_v_odfden)); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1796 @@ -9251,16 +9317,16 @@ * if np.any(np.less(ononc, 0.0)): * raise ValueError("nonc < 0") */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_kp_55); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_55); - __Pyx_GIVEREF(__pyx_kp_55); - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_16)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_16)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_16)); + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L11; } @@ -9273,41 +9339,41 @@ * raise ValueError("nonc < 0") * return cont3_array(self.internal_state, rk_noncentral_f, size, odfnum, */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__less); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_less); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_5 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_INCREF(((PyObject *)__pyx_v_ononc)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_ononc)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_ononc)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ononc)); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1798 @@ -9317,16 +9383,16 @@ * return cont3_array(self.internal_state, rk_noncentral_f, size, odfnum, * odfden, ononc) */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_kp_56); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_56); - __Pyx_GIVEREF(__pyx_kp_56); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_18)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_18)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L12; } @@ -9348,16 +9414,15 @@ * * def chisquare(self, df, size=None): */ - __pyx_t_4 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_noncentral_f, __pyx_v_size, __pyx_v_odfnum, __pyx_v_odfden, __pyx_v_ononc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_t_2 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_noncentral_f, __pyx_v_size, __pyx_v_odfnum, __pyx_v_odfden, __pyx_v_ononc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -9368,8 +9433,13 @@ __Pyx_DECREF((PyObject *)__pyx_v_odfnum); __Pyx_DECREF((PyObject *)__pyx_v_odfden); __Pyx_DECREF((PyObject *)__pyx_v_ononc); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_dfnum); + __Pyx_DECREF(__pyx_v_dfden); + __Pyx_DECREF(__pyx_v_nonc); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -9389,18 +9459,17 @@ PyArrayObject *__pyx_v_odf; double __pyx_v_fdf; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_df,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("chisquare"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__df,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("chisquare"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[2] = {0,0}; - values[1] = Py_None; + values[1] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); @@ -9409,12 +9478,12 @@ } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_df); + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__df); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[1] = value; kw_args--; } } } @@ -9424,7 +9493,7 @@ __pyx_v_df = values[0]; __pyx_v_size = values[1]; } else { - __pyx_v_size = Py_None; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); case 1: __pyx_v_df = PyTuple_GET_ITEM(__pyx_args, 0); @@ -9439,6 +9508,9 @@ __Pyx_AddTraceback("mtrand.RandomState.chisquare"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_df); + __Pyx_INCREF(__pyx_v_size); __pyx_v_odf = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1869 @@ -9478,13 +9550,13 @@ * */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_57); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_57); - __Pyx_GIVEREF(__pyx_kp_57); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_19)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_19)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_19)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -9539,41 +9611,41 @@ * raise ValueError("df <= 0") * return cont1_array(self.internal_state, rk_chisquare, size, odf) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_odf)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_odf)); __Pyx_GIVEREF(((PyObject *)__pyx_v_odf)); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1879 @@ -9583,14 +9655,14 @@ * return cont1_array(self.internal_state, rk_chisquare, size, odf) * */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_58); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_58); - __Pyx_GIVEREF(__pyx_kp_58); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_19)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_19)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_19)); + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -9615,7 +9687,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -9624,8 +9695,11 @@ __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_odf); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_df); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -9648,18 +9722,17 @@ double __pyx_v_fdf; double __pyx_v_fnonc; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_df,&__pyx_kp_nonc,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("noncentral_chisquare"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__df,&__pyx_n_s__nonc,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("noncentral_chisquare"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[3] = {0,0,0}; - values[2] = Py_None; + values[2] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); @@ -9669,18 +9742,18 @@ } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_df); + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__df); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_nonc); + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nonc); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("noncentral_chisquare", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1882; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[2] = value; kw_args--; } } } @@ -9691,7 +9764,7 @@ __pyx_v_nonc = values[1]; __pyx_v_size = values[2]; } else { - __pyx_v_size = Py_None; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); @@ -9709,6 +9782,10 @@ __Pyx_AddTraceback("mtrand.RandomState.noncentral_chisquare"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_df); + __Pyx_INCREF(__pyx_v_nonc); + __Pyx_INCREF(__pyx_v_size); __pyx_v_odf = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_ononc = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); @@ -9758,13 +9835,13 @@ * raise ValueError("nonc <= 0") */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_59); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_59); - __Pyx_GIVEREF(__pyx_kp_59); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_19)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_19)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_19)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -9790,13 +9867,13 @@ * size, fdf, fnonc) */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_kp_60); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_60); - __Pyx_GIVEREF(__pyx_kp_60); - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_20)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_20)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_20)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -9873,41 +9950,41 @@ * raise ValueError("df <= 1") * if np.any(np.less_equal(ononc, 0.0)): */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_odf)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_odf)); __Pyx_GIVEREF(((PyObject *)__pyx_v_odf)); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1968 @@ -9917,14 +9994,14 @@ * if np.any(np.less_equal(ononc, 0.0)): * raise ValueError("nonc < 0") */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_61); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_61); - __Pyx_GIVEREF(__pyx_kp_61); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_21)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_21)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_21)); + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -9939,41 +10016,41 @@ * raise ValueError("nonc < 0") * return cont2_array(self.internal_state, rk_noncentral_chisquare, size, */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_INCREF(((PyObject *)__pyx_v_ononc)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_ononc)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_ononc)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ononc)); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1970 @@ -9983,16 +10060,16 @@ * return cont2_array(self.internal_state, rk_noncentral_chisquare, size, * odf, ononc) */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_62); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_62); - __Pyx_GIVEREF(__pyx_kp_62); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_18)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_18)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18)); + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L10; } @@ -10014,16 +10091,15 @@ * * def standard_cauchy(self, size=None): */ - __pyx_t_3 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_noncentral_chisquare, __pyx_v_size, __pyx_v_odf, __pyx_v_ononc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_noncentral_chisquare, __pyx_v_size, __pyx_v_odf, __pyx_v_ononc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -10033,8 +10109,12 @@ __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_odf); __Pyx_DECREF((PyObject *)__pyx_v_ononc); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_df); + __Pyx_DECREF(__pyx_v_nonc); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -10052,12 +10132,12 @@ PyObject *__pyx_v_size = 0; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("standard_cauchy"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("standard_cauchy"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[1] = {0}; - values[0] = Py_None; + values[0] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; @@ -10066,7 +10146,7 @@ switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[0] = value; kw_args--; } } } @@ -10075,7 +10155,7 @@ } __pyx_v_size = values[0]; } else { - __pyx_v_size = Py_None; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; @@ -10112,7 +10192,7 @@ __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -10132,18 +10212,17 @@ PyArrayObject *__pyx_v_odf; double __pyx_v_fdf; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_df,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("standard_t"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__df,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("standard_t"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[2] = {0,0}; - values[1] = Py_None; + values[1] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); @@ -10152,12 +10231,12 @@ } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_df); + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__df); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[1] = value; kw_args--; } } } @@ -10167,7 +10246,7 @@ __pyx_v_df = values[0]; __pyx_v_size = values[1]; } else { - __pyx_v_size = Py_None; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); case 1: __pyx_v_df = PyTuple_GET_ITEM(__pyx_args, 0); @@ -10182,6 +10261,9 @@ __Pyx_AddTraceback("mtrand.RandomState.standard_t"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_df); + __Pyx_INCREF(__pyx_v_size); __pyx_v_odf = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2123 @@ -10221,13 +10303,13 @@ * */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_63); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_63); - __Pyx_GIVEREF(__pyx_kp_63); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_19)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_19)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_19)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -10282,41 +10364,41 @@ * raise ValueError("df <= 0") * return cont1_array(self.internal_state, rk_standard_t, size, odf) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_odf)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_odf)); __Pyx_GIVEREF(((PyObject *)__pyx_v_odf)); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2133 @@ -10326,14 +10408,14 @@ * return cont1_array(self.internal_state, rk_standard_t, size, odf) * */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_64); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_64); - __Pyx_GIVEREF(__pyx_kp_64); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_19)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_19)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_19)); + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -10358,7 +10440,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -10367,8 +10448,11 @@ __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_odf); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_df); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -10391,18 +10475,17 @@ double __pyx_v_fmu; double __pyx_v_fkappa; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_mu,&__pyx_kp_kappa,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("vonmises"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__mu,&__pyx_n_s__kappa,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("vonmises"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[3] = {0,0,0}; - values[2] = Py_None; + values[2] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); @@ -10412,18 +10495,18 @@ } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_mu); + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mu); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_kappa); + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__kappa); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("vonmises", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[2] = value; kw_args--; } } } @@ -10434,7 +10517,7 @@ __pyx_v_kappa = values[1]; __pyx_v_size = values[2]; } else { - __pyx_v_size = Py_None; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); @@ -10452,6 +10535,10 @@ __Pyx_AddTraceback("mtrand.RandomState.vonmises"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_mu); + __Pyx_INCREF(__pyx_v_kappa); + __Pyx_INCREF(__pyx_v_size); __pyx_v_omu = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_okappa = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); @@ -10501,13 +10588,13 @@ * */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_65); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_65); - __Pyx_GIVEREF(__pyx_kp_65); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_22)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_22)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_22)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -10576,41 +10663,41 @@ * raise ValueError("kappa < 0") * return cont2_array(self.internal_state, rk_vonmises, size, omu, okappa) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__less); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_okappa)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_okappa)); __Pyx_GIVEREF(((PyObject *)__pyx_v_okappa)); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2228 @@ -10620,14 +10707,14 @@ * return cont2_array(self.internal_state, rk_vonmises, size, omu, okappa) * */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_66); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_66); - __Pyx_GIVEREF(__pyx_kp_66); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_22)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_22)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_22)); + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -10652,7 +10739,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -10662,8 +10748,12 @@ __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_omu); __Pyx_DECREF((PyObject *)__pyx_v_okappa); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_mu); + __Pyx_DECREF(__pyx_v_kappa); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -10683,18 +10773,17 @@ PyArrayObject *__pyx_v_oa; double __pyx_v_fa; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_a,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("pareto"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__a,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("pareto"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[2] = {0,0}; - values[1] = Py_None; + values[1] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); @@ -10703,12 +10792,12 @@ } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_a); + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__a); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[1] = value; kw_args--; } } } @@ -10718,7 +10807,7 @@ __pyx_v_a = values[0]; __pyx_v_size = values[1]; } else { - __pyx_v_size = Py_None; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); case 1: __pyx_v_a = PyTuple_GET_ITEM(__pyx_args, 0); @@ -10733,6 +10822,9 @@ __Pyx_AddTraceback("mtrand.RandomState.pareto"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_a); + __Pyx_INCREF(__pyx_v_size); __pyx_v_oa = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2307 @@ -10772,13 +10864,13 @@ * */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_67); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_67); - __Pyx_GIVEREF(__pyx_kp_67); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_10)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_10)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -10833,41 +10925,41 @@ * raise ValueError("a <= 0") * return cont1_array(self.internal_state, rk_pareto, size, oa) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_oa)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oa)); __Pyx_GIVEREF(((PyObject *)__pyx_v_oa)); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2317 @@ -10877,14 +10969,14 @@ * return cont1_array(self.internal_state, rk_pareto, size, oa) * */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_68); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_68); - __Pyx_GIVEREF(__pyx_kp_68); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_10)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_10)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10)); + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -10909,7 +11001,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -10918,8 +11009,11 @@ __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_oa); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_a); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -10939,18 +11033,17 @@ PyArrayObject *__pyx_v_oa; double __pyx_v_fa; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_a,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("weibull"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__a,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("weibull"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[2] = {0,0}; - values[1] = Py_None; + values[1] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); @@ -10959,12 +11052,12 @@ } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_a); + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__a); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[1] = value; kw_args--; } } } @@ -10974,7 +11067,7 @@ __pyx_v_a = values[0]; __pyx_v_size = values[1]; } else { - __pyx_v_size = Py_None; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); case 1: __pyx_v_a = PyTuple_GET_ITEM(__pyx_args, 0); @@ -10989,6 +11082,9 @@ __Pyx_AddTraceback("mtrand.RandomState.weibull"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_a); + __Pyx_INCREF(__pyx_v_size); __pyx_v_oa = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2407 @@ -11028,13 +11124,13 @@ * */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_69); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_69); - __Pyx_GIVEREF(__pyx_kp_69); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_10)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_10)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -11089,41 +11185,41 @@ * raise ValueError("a <= 0") * return cont1_array(self.internal_state, rk_weibull, size, oa) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_oa)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oa)); __Pyx_GIVEREF(((PyObject *)__pyx_v_oa)); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2417 @@ -11133,14 +11229,14 @@ * return cont1_array(self.internal_state, rk_weibull, size, oa) * */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_70); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_70); - __Pyx_GIVEREF(__pyx_kp_70); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_10)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_10)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10)); + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -11165,7 +11261,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -11174,8 +11269,11 @@ __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_oa); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_a); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -11195,18 +11293,17 @@ PyArrayObject *__pyx_v_oa; double __pyx_v_fa; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_a,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("power"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__a,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("power"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[2] = {0,0}; - values[1] = Py_None; + values[1] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); @@ -11215,12 +11312,12 @@ } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_a); + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__a); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[1] = value; kw_args--; } } } @@ -11230,7 +11327,7 @@ __pyx_v_a = values[0]; __pyx_v_size = values[1]; } else { - __pyx_v_size = Py_None; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); case 1: __pyx_v_a = PyTuple_GET_ITEM(__pyx_args, 0); @@ -11245,6 +11342,9 @@ __Pyx_AddTraceback("mtrand.RandomState.power"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_a); + __Pyx_INCREF(__pyx_v_size); __pyx_v_oa = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2516 @@ -11284,13 +11384,13 @@ * */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_71); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_71); - __Pyx_GIVEREF(__pyx_kp_71); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_10)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_10)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -11345,41 +11445,41 @@ * raise ValueError("a <= 0") * return cont1_array(self.internal_state, rk_power, size, oa) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_oa)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oa)); __Pyx_GIVEREF(((PyObject *)__pyx_v_oa)); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2526 @@ -11389,14 +11489,14 @@ * return cont1_array(self.internal_state, rk_power, size, oa) * */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_72); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_72); - __Pyx_GIVEREF(__pyx_kp_72); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_10)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_10)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10)); + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -11421,7 +11521,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -11430,8 +11529,11 @@ __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_oa); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_a); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -11454,20 +11556,19 @@ double __pyx_v_floc; double __pyx_v_fscale; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_loc,&__pyx_kp_scale,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("laplace"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__loc,&__pyx_n_s__scale,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("laplace"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[3] = {0,0,0}; - values[0] = __pyx_k_9; - values[1] = __pyx_k_10; - values[2] = Py_None; + values[0] = __pyx_k_23; + values[1] = __pyx_k_24; + values[2] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); @@ -11478,17 +11579,17 @@ switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_loc); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__loc); if (unlikely(value)) { values[0] = value; kw_args--; } } case 1: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_scale); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__scale); if (unlikely(value)) { values[1] = value; kw_args--; } } case 2: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[2] = value; kw_args--; } } } @@ -11499,9 +11600,9 @@ __pyx_v_scale = values[1]; __pyx_v_size = values[2]; } else { - __pyx_v_loc = __pyx_k_9; - __pyx_v_scale = __pyx_k_10; - __pyx_v_size = Py_None; + __pyx_v_loc = __pyx_k_23; + __pyx_v_scale = __pyx_k_24; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); case 2: __pyx_v_scale = PyTuple_GET_ITEM(__pyx_args, 1); @@ -11517,6 +11618,10 @@ __Pyx_AddTraceback("mtrand.RandomState.laplace"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_loc); + __Pyx_INCREF(__pyx_v_scale); + __Pyx_INCREF(__pyx_v_size); __pyx_v_oloc = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); @@ -11566,13 +11671,13 @@ * */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_73); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_73); - __Pyx_GIVEREF(__pyx_kp_73); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_9)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_9)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2609; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -11615,7 +11720,7 @@ */ __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_loc, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6mtrand_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2613; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_oloc)); __pyx_v_oloc = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; @@ -11629,7 +11734,7 @@ */ __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6mtrand_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_oscale)); __pyx_v_oscale = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; @@ -11641,41 +11746,41 @@ * raise ValueError("scale <= 0") * return cont2_array(self.internal_state, rk_laplace, size, oloc, oscale) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_oscale)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oscale)); __Pyx_GIVEREF(((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2616 @@ -11685,14 +11790,14 @@ * return cont2_array(self.internal_state, rk_laplace, size, oloc, oscale) * */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_74); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_74); - __Pyx_GIVEREF(__pyx_kp_74); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_9)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_9)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9)); + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -11717,7 +11822,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -11727,8 +11831,12 @@ __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_oloc); __Pyx_DECREF((PyObject *)__pyx_v_oscale); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_loc); + __Pyx_DECREF(__pyx_v_scale); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -11751,20 +11859,19 @@ double __pyx_v_floc; double __pyx_v_fscale; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_loc,&__pyx_kp_scale,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("gumbel"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__loc,&__pyx_n_s__scale,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("gumbel"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[3] = {0,0,0}; - values[0] = __pyx_k_11; - values[1] = __pyx_k_12; - values[2] = Py_None; + values[0] = __pyx_k_25; + values[1] = __pyx_k_26; + values[2] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); @@ -11775,17 +11882,17 @@ switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_loc); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__loc); if (unlikely(value)) { values[0] = value; kw_args--; } } case 1: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_scale); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__scale); if (unlikely(value)) { values[1] = value; kw_args--; } } case 2: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[2] = value; kw_args--; } } } @@ -11796,9 +11903,9 @@ __pyx_v_scale = values[1]; __pyx_v_size = values[2]; } else { - __pyx_v_loc = __pyx_k_11; - __pyx_v_scale = __pyx_k_12; - __pyx_v_size = Py_None; + __pyx_v_loc = __pyx_k_25; + __pyx_v_scale = __pyx_k_26; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); case 2: __pyx_v_scale = PyTuple_GET_ITEM(__pyx_args, 1); @@ -11814,6 +11921,10 @@ __Pyx_AddTraceback("mtrand.RandomState.gumbel"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_loc); + __Pyx_INCREF(__pyx_v_scale); + __Pyx_INCREF(__pyx_v_size); __pyx_v_oloc = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); @@ -11863,13 +11974,13 @@ * */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_75); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_75); - __Pyx_GIVEREF(__pyx_kp_75); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_9)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_9)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2733; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -11912,7 +12023,7 @@ */ __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_loc, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6mtrand_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_oloc)); __pyx_v_oloc = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; @@ -11926,7 +12037,7 @@ */ __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6mtrand_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_oscale)); __pyx_v_oscale = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; @@ -11938,41 +12049,41 @@ * raise ValueError("scale <= 0") * return cont2_array(self.internal_state, rk_gumbel, size, oloc, oscale) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_oscale)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oscale)); __Pyx_GIVEREF(((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2740 @@ -11982,14 +12093,14 @@ * return cont2_array(self.internal_state, rk_gumbel, size, oloc, oscale) * */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_76); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_76); - __Pyx_GIVEREF(__pyx_kp_76); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_9)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_9)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9)); + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -12014,7 +12125,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -12024,8 +12134,12 @@ __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_oloc); __Pyx_DECREF((PyObject *)__pyx_v_oscale); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_loc); + __Pyx_DECREF(__pyx_v_scale); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -12048,20 +12162,19 @@ double __pyx_v_floc; double __pyx_v_fscale; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_loc,&__pyx_kp_scale,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("logistic"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__loc,&__pyx_n_s__scale,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("logistic"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[3] = {0,0,0}; - values[0] = __pyx_k_13; - values[1] = __pyx_k_14; - values[2] = Py_None; + values[0] = __pyx_k_27; + values[1] = __pyx_k_28; + values[2] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); @@ -12072,17 +12185,17 @@ switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_loc); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__loc); if (unlikely(value)) { values[0] = value; kw_args--; } } case 1: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_scale); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__scale); if (unlikely(value)) { values[1] = value; kw_args--; } } case 2: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[2] = value; kw_args--; } } } @@ -12093,9 +12206,9 @@ __pyx_v_scale = values[1]; __pyx_v_size = values[2]; } else { - __pyx_v_loc = __pyx_k_13; - __pyx_v_scale = __pyx_k_14; - __pyx_v_size = Py_None; + __pyx_v_loc = __pyx_k_27; + __pyx_v_scale = __pyx_k_28; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); case 2: __pyx_v_scale = PyTuple_GET_ITEM(__pyx_args, 1); @@ -12111,6 +12224,10 @@ __Pyx_AddTraceback("mtrand.RandomState.logistic"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_loc); + __Pyx_INCREF(__pyx_v_scale); + __Pyx_INCREF(__pyx_v_size); __pyx_v_oloc = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); @@ -12160,13 +12277,13 @@ * */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_77); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_77); - __Pyx_GIVEREF(__pyx_kp_77); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_9)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_9)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -12209,7 +12326,7 @@ */ __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_loc, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6mtrand_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_oloc)); __pyx_v_oloc = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; @@ -12223,7 +12340,7 @@ */ __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6mtrand_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_oscale)); __pyx_v_oscale = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; @@ -12235,41 +12352,41 @@ * raise ValueError("scale <= 0") * return cont2_array(self.internal_state, rk_logistic, size, oloc, oscale) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_oscale)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oscale)); __Pyx_GIVEREF(((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2828 @@ -12279,14 +12396,14 @@ * return cont2_array(self.internal_state, rk_logistic, size, oloc, oscale) * */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_78); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_78); - __Pyx_GIVEREF(__pyx_kp_78); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_9)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_9)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9)); + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -12311,7 +12428,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -12321,8 +12437,12 @@ __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_oloc); __Pyx_DECREF((PyObject *)__pyx_v_oscale); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_loc); + __Pyx_DECREF(__pyx_v_scale); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -12345,20 +12465,19 @@ double __pyx_v_fmean; double __pyx_v_fsigma; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_mean,&__pyx_kp_sigma,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("lognormal"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__mean,&__pyx_n_s__sigma,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("lognormal"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[3] = {0,0,0}; - values[0] = __pyx_k_15; - values[1] = __pyx_k_16; - values[2] = Py_None; + values[0] = __pyx_k_29; + values[1] = __pyx_k_30; + values[2] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); @@ -12369,17 +12488,17 @@ switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_mean); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mean); if (unlikely(value)) { values[0] = value; kw_args--; } } case 1: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_sigma); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sigma); if (unlikely(value)) { values[1] = value; kw_args--; } } case 2: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[2] = value; kw_args--; } } } @@ -12390,9 +12509,9 @@ __pyx_v_sigma = values[1]; __pyx_v_size = values[2]; } else { - __pyx_v_mean = __pyx_k_15; - __pyx_v_sigma = __pyx_k_16; - __pyx_v_size = Py_None; + __pyx_v_mean = __pyx_k_29; + __pyx_v_sigma = __pyx_k_30; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); case 2: __pyx_v_sigma = PyTuple_GET_ITEM(__pyx_args, 1); @@ -12408,6 +12527,10 @@ __Pyx_AddTraceback("mtrand.RandomState.lognormal"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_mean); + __Pyx_INCREF(__pyx_v_sigma); + __Pyx_INCREF(__pyx_v_size); __pyx_v_omean = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_osigma = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); @@ -12457,13 +12580,13 @@ * */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_79); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_79); - __Pyx_GIVEREF(__pyx_kp_79); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_31)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_31)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_31)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -12506,7 +12629,7 @@ */ __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_mean, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6mtrand_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_omean)); __pyx_v_omean = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; @@ -12520,7 +12643,7 @@ */ __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_sigma, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6mtrand_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_osigma)); __pyx_v_osigma = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; @@ -12532,41 +12655,41 @@ * raise ValueError("sigma <= 0.0") * return cont2_array(self.internal_state, rk_lognormal, size, omean, osigma) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_osigma)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_osigma)); __Pyx_GIVEREF(((PyObject *)__pyx_v_osigma)); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2959 @@ -12576,14 +12699,14 @@ * return cont2_array(self.internal_state, rk_lognormal, size, omean, osigma) * */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_80); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_80); - __Pyx_GIVEREF(__pyx_kp_80); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_32)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_32)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_32)); + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -12608,7 +12731,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -12618,8 +12740,12 @@ __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_omean); __Pyx_DECREF((PyObject *)__pyx_v_osigma); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_mean); + __Pyx_DECREF(__pyx_v_sigma); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -12639,19 +12765,18 @@ PyArrayObject *__pyx_v_oscale; double __pyx_v_fscale; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_scale,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("rayleigh"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__scale,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("rayleigh"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[2] = {0,0}; - values[0] = __pyx_k_17; - values[1] = Py_None; + values[0] = __pyx_k_33; + values[1] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); @@ -12661,12 +12786,12 @@ switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_scale); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__scale); if (unlikely(value)) { values[0] = value; kw_args--; } } case 1: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[1] = value; kw_args--; } } } @@ -12676,8 +12801,8 @@ __pyx_v_scale = values[0]; __pyx_v_size = values[1]; } else { - __pyx_v_scale = __pyx_k_17; - __pyx_v_size = Py_None; + __pyx_v_scale = __pyx_k_33; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); case 1: __pyx_v_scale = PyTuple_GET_ITEM(__pyx_args, 0); @@ -12692,6 +12817,9 @@ __Pyx_AddTraceback("mtrand.RandomState.rayleigh"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_scale); + __Pyx_INCREF(__pyx_v_size); __pyx_v_oscale = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3020 @@ -12731,13 +12859,13 @@ * */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_81); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_81); - __Pyx_GIVEREF(__pyx_kp_81); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_9)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_9)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -12792,41 +12920,41 @@ * raise ValueError("scale <= 0.0") * return cont1_array(self.internal_state, rk_rayleigh, size, oscale) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_oscale)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oscale)); __Pyx_GIVEREF(((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3031 @@ -12836,14 +12964,14 @@ * return cont1_array(self.internal_state, rk_rayleigh, size, oscale) * */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_82); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_82); - __Pyx_GIVEREF(__pyx_kp_82); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_34)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_34)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_34)); + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3031; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -12868,7 +12996,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -12877,8 +13004,11 @@ __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_oscale); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_scale); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -12901,18 +13031,17 @@ double __pyx_v_fmean; double __pyx_v_fscale; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_mean,&__pyx_kp_scale,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("wald"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__mean,&__pyx_n_s__scale,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("wald"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[3] = {0,0,0}; - values[2] = Py_None; + values[2] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); @@ -12922,18 +13051,18 @@ } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_mean); + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mean); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_scale); + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__scale); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("wald", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3034; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[2] = value; kw_args--; } } } @@ -12944,7 +13073,7 @@ __pyx_v_scale = values[1]; __pyx_v_size = values[2]; } else { - __pyx_v_size = Py_None; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); @@ -12962,6 +13091,10 @@ __Pyx_AddTraceback("mtrand.RandomState.wald"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_mean); + __Pyx_INCREF(__pyx_v_scale); + __Pyx_INCREF(__pyx_v_size); __pyx_v_omean = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); @@ -13011,13 +13144,13 @@ * raise ValueError("scale <= 0") */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_83); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_83); - __Pyx_GIVEREF(__pyx_kp_83); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_35)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_35)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_35)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -13043,13 +13176,13 @@ * */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_kp_84); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_84); - __Pyx_GIVEREF(__pyx_kp_84); - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_9)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_9)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -13092,7 +13225,7 @@ */ __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_mean, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6mtrand_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_omean)); __pyx_v_omean = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; @@ -13106,7 +13239,7 @@ */ __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6mtrand_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6mtrand_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_oscale)); __pyx_v_oscale = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; @@ -13118,41 +13251,41 @@ * raise ValueError("mean <= 0.0") * elif np.any(np.less_equal(oscale,0.0)): */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_omean)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_omean)); __Pyx_GIVEREF(((PyObject *)__pyx_v_omean)); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3113 @@ -13162,14 +13295,14 @@ * elif np.any(np.less_equal(oscale,0.0)): * raise ValueError("scale <= 0.0") */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_85); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_85); - __Pyx_GIVEREF(__pyx_kp_85); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_36)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_36)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_36)); + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -13183,41 +13316,41 @@ * raise ValueError("scale <= 0.0") * return cont2_array(self.internal_state, rk_wald, size, omean, oscale) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_INCREF(((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_oscale)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_oscale)); __Pyx_GIVEREF(((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3115 @@ -13227,16 +13360,16 @@ * return cont2_array(self.internal_state, rk_wald, size, omean, oscale) * */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_86); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_86); - __Pyx_GIVEREF(__pyx_kp_86); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_34)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_34)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_34)); + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L9; } @@ -13250,16 +13383,15 @@ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_wald, __pyx_v_size, __pyx_v_omean, __pyx_v_oscale); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_wald, __pyx_v_size, __pyx_v_omean, __pyx_v_oscale); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -13269,8 +13401,12 @@ __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_omean); __Pyx_DECREF((PyObject *)__pyx_v_oscale); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_mean); + __Pyx_DECREF(__pyx_v_scale); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -13296,18 +13432,17 @@ double __pyx_v_fmode; double __pyx_v_fright; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_left,&__pyx_kp_mode,&__pyx_kp_right,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("triangular"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__left,&__pyx_n_s__mode,&__pyx_n_s__right,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("triangular"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[4] = {0,0,0,0}; - values[3] = Py_None; + values[3] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); @@ -13318,24 +13453,24 @@ } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_left); + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__left); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_mode); + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mode); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("triangular", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3120; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_right); + values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__right); if (likely(values[2])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("triangular", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3120; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[3] = value; kw_args--; } } } @@ -13347,7 +13482,7 @@ __pyx_v_right = values[2]; __pyx_v_size = values[3]; } else { - __pyx_v_size = Py_None; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 3); @@ -13366,6 +13501,11 @@ __Pyx_AddTraceback("mtrand.RandomState.triangular"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_left); + __Pyx_INCREF(__pyx_v_mode); + __Pyx_INCREF(__pyx_v_right); + __Pyx_INCREF(__pyx_v_size); __pyx_v_oleft = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_omode = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_oright = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); @@ -13425,13 +13565,13 @@ * raise ValueError("mode > right") */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_87); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_87); - __Pyx_GIVEREF(__pyx_kp_87); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_37)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_37)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_37)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -13457,13 +13597,13 @@ * raise ValueError("left == right") */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_kp_88); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_88); - __Pyx_GIVEREF(__pyx_kp_88); - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_38)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_38)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_38)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -13489,13 +13629,13 @@ * fmode, fright) */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_89); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_89); - __Pyx_GIVEREF(__pyx_kp_89); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_39)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_39)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_39)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -13586,37 +13726,37 @@ * raise ValueError("left > mode") * if np.any(np.greater(omode, oright)): */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_greater); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__greater); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_oleft)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_oleft)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_oleft)); __Pyx_GIVEREF(((PyObject *)__pyx_v_oleft)); __Pyx_INCREF(((PyObject *)__pyx_v_omode)); - PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_omode)); + PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_omode)); __Pyx_GIVEREF(((PyObject *)__pyx_v_omode)); - __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { @@ -13629,15 +13769,15 @@ * raise ValueError("mode > right") */ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_kp_90); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_90); - __Pyx_GIVEREF(__pyx_kp_90); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_37)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_37)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_37)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L10; } @@ -13650,39 +13790,39 @@ * raise ValueError("mode > right") * if np.any(np.equal(oleft, oright)): */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_greater); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__greater); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_omode)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_omode)); __Pyx_GIVEREF(((PyObject *)__pyx_v_omode)); __Pyx_INCREF(((PyObject *)__pyx_v_oright)); PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_oright)); __Pyx_GIVEREF(((PyObject *)__pyx_v_oright)); - __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3201 @@ -13692,14 +13832,14 @@ * if np.any(np.equal(oleft, oright)): * raise ValueError("left == right") */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_91); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_91); - __Pyx_GIVEREF(__pyx_kp_91); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_38)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_38)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_38)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -13714,39 +13854,39 @@ * raise ValueError("left == right") * return cont3_array(self.internal_state, rk_triangular, size, oleft, */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__equal); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_oleft)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_oleft)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_oleft)); __Pyx_GIVEREF(((PyObject *)__pyx_v_oleft)); __Pyx_INCREF(((PyObject *)__pyx_v_oright)); - PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_oright)); + PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_oright)); __Pyx_GIVEREF(((PyObject *)__pyx_v_oright)); - __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3203 @@ -13756,16 +13896,16 @@ * return cont3_array(self.internal_state, rk_triangular, size, oleft, * omode, oright) */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_kp_92); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_92); - __Pyx_GIVEREF(__pyx_kp_92); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_39)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_39)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_39)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L12; } @@ -13787,16 +13927,15 @@ * * # Complicated, discrete distributions: */ - __pyx_t_4 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_triangular, __pyx_v_size, __pyx_v_oleft, __pyx_v_omode, __pyx_v_oright); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_t_3 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_triangular, __pyx_v_size, __pyx_v_oleft, __pyx_v_omode, __pyx_v_oright); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -13807,8 +13946,13 @@ __Pyx_DECREF((PyObject *)__pyx_v_oleft); __Pyx_DECREF((PyObject *)__pyx_v_omode); __Pyx_DECREF((PyObject *)__pyx_v_oright); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_left); + __Pyx_DECREF(__pyx_v_mode); + __Pyx_DECREF(__pyx_v_right); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -13831,18 +13975,17 @@ long __pyx_v_ln; double __pyx_v_fp; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_n,&__pyx_kp_p,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("binomial"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__n,&__pyx_n_s__p,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("binomial"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[3] = {0,0,0}; - values[2] = Py_None; + values[2] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); @@ -13852,18 +13995,18 @@ } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_n); + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__n); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_p); + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__p); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("binomial", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3208; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[2] = value; kw_args--; } } } @@ -13874,7 +14017,7 @@ __pyx_v_p = values[1]; __pyx_v_size = values[2]; } else { - __pyx_v_size = Py_None; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); @@ -13892,6 +14035,10 @@ __Pyx_AddTraceback("mtrand.RandomState.binomial"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_n); + __Pyx_INCREF(__pyx_v_p); + __Pyx_INCREF(__pyx_v_size); __pyx_v_on = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_op = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); @@ -13941,13 +14088,13 @@ * raise ValueError("p < 0") */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_93); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_93); - __Pyx_GIVEREF(__pyx_kp_93); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_40)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_40)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_40)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3297; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -13973,13 +14120,13 @@ * raise ValueError("p > 1") */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_kp_94); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_94); - __Pyx_GIVEREF(__pyx_kp_94); - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_41)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_41)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_41)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -14004,13 +14151,13 @@ * */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_95); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_95); - __Pyx_GIVEREF(__pyx_kp_95); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_42)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_42)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_42)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -14079,37 +14226,37 @@ * raise ValueError("n <= 0") * if np.any(np.less(p, 0)): */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_n); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_n); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_n); __Pyx_GIVEREF(__pyx_v_n); __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { @@ -14122,15 +14269,15 @@ * raise ValueError("p < 0") */ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_kp_96); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_96); - __Pyx_GIVEREF(__pyx_kp_96); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_40)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_40)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_40)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L9; } @@ -14143,39 +14290,39 @@ * raise ValueError("p < 0") * if np.any(np.greater(p, 1)): */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_less); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__less); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_p); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_p); __Pyx_GIVEREF(__pyx_v_p); __Pyx_INCREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3311 @@ -14185,14 +14332,14 @@ * if np.any(np.greater(p, 1)): * raise ValueError("p > 1") */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_97); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_97); - __Pyx_GIVEREF(__pyx_kp_97); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_41)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_41)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_41)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3311; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -14207,39 +14354,39 @@ * raise ValueError("p > 1") * return discnp_array(self.internal_state, rk_binomial, size, on, op) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_greater); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__greater); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_p); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_p); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_p); __Pyx_GIVEREF(__pyx_v_p); __Pyx_INCREF(__pyx_int_1); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); - __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3313 @@ -14249,16 +14396,16 @@ * return discnp_array(self.internal_state, rk_binomial, size, on, op) * */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_kp_98); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_98); - __Pyx_GIVEREF(__pyx_kp_98); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_42)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_42)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_42)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L11; } @@ -14272,16 +14419,15 @@ * def negative_binomial(self, n, p, size=None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_binomial, __pyx_v_size, __pyx_v_on, __pyx_v_op); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_t_3 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_binomial, __pyx_v_size, __pyx_v_on, __pyx_v_op); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -14291,8 +14437,12 @@ __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_on); __Pyx_DECREF((PyObject *)__pyx_v_op); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_n); + __Pyx_DECREF(__pyx_v_p); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -14315,18 +14465,17 @@ double __pyx_v_fn; double __pyx_v_fp; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_n,&__pyx_kp_p,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("negative_binomial"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__n,&__pyx_n_s__p,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("negative_binomial"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[3] = {0,0,0}; - values[2] = Py_None; + values[2] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); @@ -14336,18 +14485,18 @@ } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_n); + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__n); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_p); + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__p); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("negative_binomial", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3316; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[2] = value; kw_args--; } } } @@ -14358,7 +14507,7 @@ __pyx_v_p = values[1]; __pyx_v_size = values[2]; } else { - __pyx_v_size = Py_None; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); @@ -14376,6 +14525,10 @@ __Pyx_AddTraceback("mtrand.RandomState.negative_binomial"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_n); + __Pyx_INCREF(__pyx_v_p); + __Pyx_INCREF(__pyx_v_size); __pyx_v_on = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_op = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); @@ -14425,13 +14578,13 @@ * raise ValueError("p < 0") */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_99); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_99); - __Pyx_GIVEREF(__pyx_kp_99); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_40)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_40)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_40)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -14457,13 +14610,13 @@ * raise ValueError("p > 1") */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_kp_100); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_100); - __Pyx_GIVEREF(__pyx_kp_100); - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_41)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_41)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_41)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -14488,13 +14641,13 @@ * size, fn, fp) */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_101); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_101); - __Pyx_GIVEREF(__pyx_kp_101); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_42)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_42)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_42)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -14571,37 +14724,37 @@ * raise ValueError("n <= 0") * if np.any(np.less(p, 0)): */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_n); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_n); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_n); __Pyx_GIVEREF(__pyx_v_n); __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { @@ -14614,15 +14767,15 @@ * raise ValueError("p < 0") */ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_kp_102); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_102); - __Pyx_GIVEREF(__pyx_kp_102); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_40)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_40)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_40)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L9; } @@ -14635,39 +14788,39 @@ * raise ValueError("p < 0") * if np.any(np.greater(p, 1)): */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_less); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__less); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_p); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_p); __Pyx_GIVEREF(__pyx_v_p); __Pyx_INCREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3405 @@ -14677,14 +14830,14 @@ * if np.any(np.greater(p, 1)): * raise ValueError("p > 1") */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_103); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_103); - __Pyx_GIVEREF(__pyx_kp_103); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_41)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_41)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_41)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -14699,39 +14852,39 @@ * raise ValueError("p > 1") * return discdd_array(self.internal_state, rk_negative_binomial, size, */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_greater); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__greater); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_p); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_p); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_p); __Pyx_GIVEREF(__pyx_v_p); __Pyx_INCREF(__pyx_int_1); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); - __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3407 @@ -14741,16 +14894,16 @@ * return discdd_array(self.internal_state, rk_negative_binomial, size, * on, op) */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_kp_104); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_104); - __Pyx_GIVEREF(__pyx_kp_104); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_42)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_42)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_42)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L11; } @@ -14772,16 +14925,15 @@ * * def poisson(self, lam=1.0, size=None): */ - __pyx_t_4 = __pyx_f_6mtrand_discdd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_negative_binomial, __pyx_v_size, __pyx_v_on, __pyx_v_op); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_t_3 = __pyx_f_6mtrand_discdd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_negative_binomial, __pyx_v_size, __pyx_v_on, __pyx_v_op); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -14791,8 +14943,12 @@ __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_on); __Pyx_DECREF((PyObject *)__pyx_v_op); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_n); + __Pyx_DECREF(__pyx_v_p); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -14812,19 +14968,18 @@ PyArrayObject *__pyx_v_olam; double __pyx_v_flam; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_lam,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("poisson"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__lam,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("poisson"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[2] = {0,0}; - values[0] = __pyx_k_18; - values[1] = Py_None; + values[0] = __pyx_k_43; + values[1] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); @@ -14834,12 +14989,12 @@ switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_lam); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lam); if (unlikely(value)) { values[0] = value; kw_args--; } } case 1: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[1] = value; kw_args--; } } } @@ -14849,8 +15004,8 @@ __pyx_v_lam = values[0]; __pyx_v_size = values[1]; } else { - __pyx_v_lam = __pyx_k_18; - __pyx_v_size = Py_None; + __pyx_v_lam = __pyx_k_43; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); case 1: __pyx_v_lam = PyTuple_GET_ITEM(__pyx_args, 0); @@ -14865,6 +15020,9 @@ __Pyx_AddTraceback("mtrand.RandomState.poisson"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_lam); + __Pyx_INCREF(__pyx_v_size); __pyx_v_olam = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3461 @@ -14907,13 +15065,13 @@ * */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_105); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_105); - __Pyx_GIVEREF(__pyx_kp_105); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_44)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_44)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_44)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -14968,37 +15126,37 @@ * raise ValueError("lam < 0") * return discd_array(self.internal_state, rk_poisson, size, olam) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__less); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_olam)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_olam)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_olam)); __Pyx_GIVEREF(((PyObject *)__pyx_v_olam)); __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_0); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { @@ -15011,15 +15169,15 @@ * */ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_kp_106); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_106); - __Pyx_GIVEREF(__pyx_kp_106); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_44)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_44)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_44)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3471; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L8; } @@ -15033,16 +15191,15 @@ * def zipf(self, a, size=None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_poisson, __pyx_v_size, __pyx_v_olam); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_t_3 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_poisson, __pyx_v_size, __pyx_v_olam); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -15051,8 +15208,11 @@ __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_olam); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_lam); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -15072,18 +15232,17 @@ PyArrayObject *__pyx_v_oa; double __pyx_v_fa; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_a,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("zipf"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__a,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("zipf"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[2] = {0,0}; - values[1] = Py_None; + values[1] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); @@ -15092,12 +15251,12 @@ } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_a); + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__a); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[1] = value; kw_args--; } } } @@ -15107,7 +15266,7 @@ __pyx_v_a = values[0]; __pyx_v_size = values[1]; } else { - __pyx_v_size = Py_None; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); case 1: __pyx_v_a = PyTuple_GET_ITEM(__pyx_args, 0); @@ -15122,6 +15281,9 @@ __Pyx_AddTraceback("mtrand.RandomState.zipf"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_a); + __Pyx_INCREF(__pyx_v_size); __pyx_v_oa = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3553 @@ -15161,13 +15323,13 @@ * */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_107); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_107); - __Pyx_GIVEREF(__pyx_kp_107); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_45)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_45)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_45)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -15222,41 +15384,41 @@ * raise ValueError("a <= 1.0") * return discd_array(self.internal_state, rk_zipf, size, oa) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_oa)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oa)); __Pyx_GIVEREF(((PyObject *)__pyx_v_oa)); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3563 @@ -15266,14 +15428,14 @@ * return discd_array(self.internal_state, rk_zipf, size, oa) * */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_108); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_108); - __Pyx_GIVEREF(__pyx_kp_108); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_45)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_45)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_45)); + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -15298,7 +15460,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -15307,8 +15468,11 @@ __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_oa); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_a); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -15328,18 +15492,17 @@ PyArrayObject *__pyx_v_op; double __pyx_v_fp; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_p,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("geometric"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__p,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("geometric"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[2] = {0,0}; - values[1] = Py_None; + values[1] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); @@ -15348,12 +15511,12 @@ } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_p); + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__p); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[1] = value; kw_args--; } } } @@ -15363,7 +15526,7 @@ __pyx_v_p = values[0]; __pyx_v_size = values[1]; } else { - __pyx_v_size = Py_None; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); case 1: __pyx_v_p = PyTuple_GET_ITEM(__pyx_args, 0); @@ -15378,6 +15541,9 @@ __Pyx_AddTraceback("mtrand.RandomState.geometric"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_p); + __Pyx_INCREF(__pyx_v_size); __pyx_v_op = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3614 @@ -15417,13 +15583,13 @@ * raise ValueError("p > 1.0") */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_109); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_109); - __Pyx_GIVEREF(__pyx_kp_109); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_46)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_46)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_46)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -15449,13 +15615,13 @@ * */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_kp_110); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_110); - __Pyx_GIVEREF(__pyx_kp_110); - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_47)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_47)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_47)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -15510,41 +15676,41 @@ * raise ValueError("p < 0.0") * if np.any(np.greater(op, 1.0)): */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_less); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__less); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_op)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_op)); __Pyx_GIVEREF(((PyObject *)__pyx_v_op)); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3627 @@ -15554,14 +15720,14 @@ * if np.any(np.greater(op, 1.0)): * raise ValueError("p > 1.0") */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_111); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_111); - __Pyx_GIVEREF(__pyx_kp_111); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_46)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_46)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_46)); + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -15576,41 +15742,41 @@ * raise ValueError("p > 1.0") * return discd_array(self.internal_state, rk_geometric, size, op) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_greater); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__greater); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_2 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_INCREF(((PyObject *)__pyx_v_op)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_op)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_op)); __Pyx_GIVEREF(((PyObject *)__pyx_v_op)); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3629 @@ -15620,16 +15786,16 @@ * return discd_array(self.internal_state, rk_geometric, size, op) * */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_112); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_112); - __Pyx_GIVEREF(__pyx_kp_112); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_47)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_47)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_47)); + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L10; } @@ -15643,16 +15809,15 @@ * def hypergeometric(self, ngood, nbad, nsample, size=None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_geometric, __pyx_v_size, __pyx_v_op); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_4 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_geometric, __pyx_v_size, __pyx_v_op); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -15661,8 +15826,11 @@ __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_op); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_p); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -15688,19 +15856,18 @@ long __pyx_v_lnbad; long __pyx_v_lnsample; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_ngood,&__pyx_kp_nbad,&__pyx_kp_nsample,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("hypergeometric"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__ngood,&__pyx_n_s__nbad,&__pyx_n_s__nsample,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("hypergeometric"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[4] = {0,0,0,0}; - values[3] = Py_None; + values[3] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); @@ -15711,24 +15878,24 @@ } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_ngood); + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ngood); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_nbad); + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nbad); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("hypergeometric", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3632; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_nsample); + values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nsample); if (likely(values[2])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("hypergeometric", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3632; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[3] = value; kw_args--; } } } @@ -15740,7 +15907,7 @@ __pyx_v_nsample = values[2]; __pyx_v_size = values[3]; } else { - __pyx_v_size = Py_None; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 3); @@ -15759,6 +15926,11 @@ __Pyx_AddTraceback("mtrand.RandomState.hypergeometric"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_ngood); + __Pyx_INCREF(__pyx_v_nbad); + __Pyx_INCREF(__pyx_v_nsample); + __Pyx_INCREF(__pyx_v_size); __pyx_v_ongood = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_onbad = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_onsample = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); @@ -15821,13 +15993,13 @@ * raise ValueError("nbad < 1") */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_113); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_113); - __Pyx_GIVEREF(__pyx_kp_113); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_48)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_48)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_48)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -15856,13 +16028,13 @@ * raise ValueError("nsample < 1") */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_kp_114); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_114); - __Pyx_GIVEREF(__pyx_kp_114); - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_49)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_49)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_49)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3726; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -15891,13 +16063,13 @@ * raise ValueError("ngood + nbad < nsample") */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_115); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_115); - __Pyx_GIVEREF(__pyx_kp_115); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_50)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_50)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_50)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -15929,13 +16101,13 @@ * lngood, lnbad, lnsample) */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_116); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_116); - __Pyx_GIVEREF(__pyx_kp_116); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_51)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_51)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_51)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3730; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -16026,37 +16198,37 @@ * raise ValueError("ngood < 1") * if np.any(np.less(onbad, 1)): */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__less); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_ongood)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_ongood)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_ongood)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ongood)); __Pyx_INCREF(__pyx_int_1); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); - __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { @@ -16069,15 +16241,15 @@ * raise ValueError("nbad < 1") */ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_kp_117); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_117); - __Pyx_GIVEREF(__pyx_kp_117); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_48)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_48)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_48)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L11; } @@ -16090,39 +16262,39 @@ * raise ValueError("nbad < 1") * if np.any(np.less(onsample, 1)): */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_less); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__less); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_onbad)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_onbad)); __Pyx_GIVEREF(((PyObject *)__pyx_v_onbad)); __Pyx_INCREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); - __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3742; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3743 @@ -16132,14 +16304,14 @@ * if np.any(np.less(onsample, 1)): * raise ValueError("nsample < 1") */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_118); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_118); - __Pyx_GIVEREF(__pyx_kp_118); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_49)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_49)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_49)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -16154,39 +16326,39 @@ * raise ValueError("nsample < 1") * if np.any(np.less(np.add(ongood, onbad),onsample)): */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_less); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__less); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_onsample)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_onsample)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_onsample)); __Pyx_GIVEREF(((PyObject *)__pyx_v_onsample)); __Pyx_INCREF(__pyx_int_1); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); - __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3745 @@ -16196,16 +16368,16 @@ * if np.any(np.less(np.add(ongood, onbad),onsample)): * raise ValueError("ngood + nbad < nsample") */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_kp_119); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_119); - __Pyx_GIVEREF(__pyx_kp_119); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_50)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_50)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_50)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L13; } @@ -16218,54 +16390,54 @@ * raise ValueError("ngood + nbad < nsample") * return discnmN_array(self.internal_state, rk_hypergeometric, size, */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__less); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_less); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__add); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_add); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_INCREF(((PyObject *)__pyx_v_ongood)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_ongood)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_ongood)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ongood)); __Pyx_INCREF(((PyObject *)__pyx_v_onbad)); - PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_onbad)); + PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_onbad)); __Pyx_GIVEREF(((PyObject *)__pyx_v_onbad)); - __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_onsample)); - PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_onsample)); + PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_onsample)); __Pyx_GIVEREF(((PyObject *)__pyx_v_onsample)); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_1) { @@ -16278,15 +16450,15 @@ * ongood, onbad, onsample) */ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - __Pyx_INCREF(__pyx_kp_120); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_120); - __Pyx_GIVEREF(__pyx_kp_120); - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_51)); + PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_51)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_51)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L14; } @@ -16308,16 +16480,15 @@ * * def logseries(self, p, size=None): */ - __pyx_t_2 = __pyx_f_6mtrand_discnmN_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_hypergeometric, __pyx_v_size, __pyx_v_ongood, __pyx_v_onbad, __pyx_v_onsample); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_3 = __pyx_f_6mtrand_discnmN_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_hypergeometric, __pyx_v_size, __pyx_v_ongood, __pyx_v_onbad, __pyx_v_onsample); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -16329,8 +16500,13 @@ __Pyx_DECREF((PyObject *)__pyx_v_ongood); __Pyx_DECREF((PyObject *)__pyx_v_onbad); __Pyx_DECREF((PyObject *)__pyx_v_onsample); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_ngood); + __Pyx_DECREF(__pyx_v_nbad); + __Pyx_DECREF(__pyx_v_nsample); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -16350,18 +16526,17 @@ PyArrayObject *__pyx_v_op; double __pyx_v_fp; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_p,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("logseries"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__p,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("logseries"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[2] = {0,0}; - values[1] = Py_None; + values[1] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); @@ -16370,12 +16545,12 @@ } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_p); + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__p); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[1] = value; kw_args--; } } } @@ -16385,7 +16560,7 @@ __pyx_v_p = values[0]; __pyx_v_size = values[1]; } else { - __pyx_v_size = Py_None; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); case 1: __pyx_v_p = PyTuple_GET_ITEM(__pyx_args, 0); @@ -16400,6 +16575,9 @@ __Pyx_AddTraceback("mtrand.RandomState.logseries"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_p); + __Pyx_INCREF(__pyx_v_size); __pyx_v_op = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3828 @@ -16439,13 +16617,13 @@ * raise ValueError("p >= 1.0") */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_121); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_121); - __Pyx_GIVEREF(__pyx_kp_121); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_52)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_52)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_52)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -16471,13 +16649,13 @@ * */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_kp_122); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_122); - __Pyx_GIVEREF(__pyx_kp_122); - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_53)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_53)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_53)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -16532,41 +16710,41 @@ * raise ValueError("p <= 0.0") * if np.any(np.greater_equal(op, 1.0)): */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_less_equal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_op)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_op)); __Pyx_GIVEREF(((PyObject *)__pyx_v_op)); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3840 @@ -16576,14 +16754,14 @@ * if np.any(np.greater_equal(op, 1.0)): * raise ValueError("p >= 1.0") */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_kp_123); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_123); - __Pyx_GIVEREF(__pyx_kp_123); - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_52)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_52)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_52)); + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -16598,41 +16776,41 @@ * raise ValueError("p >= 1.0") * return discd_array(self.internal_state, rk_logseries, size, op) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_greater_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__greater_equal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_2 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_INCREF(((PyObject *)__pyx_v_op)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_op)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_op)); __Pyx_GIVEREF(((PyObject *)__pyx_v_op)); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3842 @@ -16642,16 +16820,16 @@ * return discd_array(self.internal_state, rk_logseries, size, op) * */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_124); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_124); - __Pyx_GIVEREF(__pyx_kp_124); - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_53)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_53)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_53)); + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L10; } @@ -16665,16 +16843,15 @@ * # Multivariate distributions: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_logseries, __pyx_v_size, __pyx_v_op); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_4 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, rk_logseries, __pyx_v_size, __pyx_v_op); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3843; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); @@ -16683,8 +16860,11 @@ __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_op); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_p); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -16710,10 +16890,6 @@ PyObject *__pyx_v_s; PyObject *__pyx_v_v; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; @@ -16722,12 +16898,13 @@ int __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_mean,&__pyx_kp_cov,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("multivariate_normal"); + PyObject *__pyx_t_9 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__mean,&__pyx_n_s__cov,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("multivariate_normal"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[3] = {0,0,0}; - values[2] = Py_None; + values[2] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); @@ -16737,18 +16914,18 @@ } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_mean); + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mean); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_cov); + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cov); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("multivariate_normal", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3846; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[2] = value; kw_args--; } } } @@ -16759,7 +16936,7 @@ __pyx_v_cov = values[1]; __pyx_v_size = values[2]; } else { - __pyx_v_size = Py_None; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); @@ -16777,8 +16954,10 @@ __Pyx_AddTraceback("mtrand.RandomState.multivariate_normal"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_v_mean); __Pyx_INCREF(__pyx_v_cov); + __Pyx_INCREF(__pyx_v_size); __pyx_v_shape = Py_None; __Pyx_INCREF(Py_None); __pyx_v_final_shape = Py_None; __Pyx_INCREF(Py_None); __pyx_v_x = Py_None; __Pyx_INCREF(Py_None); @@ -16794,20 +16973,20 @@ * cov = np.array(cov) * if size is None: */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_mean); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_mean); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_mean); __Pyx_GIVEREF(__pyx_v_mean); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3939; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_v_mean); __pyx_v_mean = __pyx_t_3; __pyx_t_3 = 0; @@ -16819,23 +16998,23 @@ * if size is None: * shape = [] */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_cov); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cov); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_cov); __Pyx_GIVEREF(__pyx_v_cov); - __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_v_cov); - __pyx_v_cov = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_cov = __pyx_t_2; + __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3941 * mean = np.array(mean) @@ -16854,11 +17033,11 @@ * else: * shape = size */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_DECREF(__pyx_v_shape); - __pyx_v_shape = ((PyObject *)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_v_shape = ((PyObject *)__pyx_t_2); + __pyx_t_2 = 0; goto __pyx_L6; } /*else*/ { @@ -16883,10 +17062,10 @@ * raise ValueError("mean must be 1 dimensional") * if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]): */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_mean, __pyx_kp_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_5 != 1); if (__pyx_t_4) { @@ -16897,16 +17076,16 @@ * if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]): * raise ValueError("cov must be 2 dimensional and square") */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_kp_125); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_125); - __Pyx_GIVEREF(__pyx_kp_125); - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_54)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_54)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_54)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } @@ -16919,28 +17098,28 @@ * raise ValueError("cov must be 2 dimensional and square") * if mean.shape[0] != cov.shape[0]: */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_kp_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = (__pyx_t_5 != 2); if (!__pyx_t_4) { - __pyx_t_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_kp_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_1 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_kp_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_2 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_1, __pyx_2, Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = __pyx_t_6; } else { __pyx_t_7 = __pyx_t_4; @@ -16954,14 +17133,14 @@ * if mean.shape[0] != cov.shape[0]: * raise ValueError("mean and cov must have same length") */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_126); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_126); - __Pyx_GIVEREF(__pyx_kp_126); - __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_55)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_55)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_55)); + __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -16976,20 +17155,20 @@ * raise ValueError("mean and cov must have same length") * # Compute shape of output */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_mean, __pyx_kp_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_1 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_kp_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_s__shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_2 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_1, __pyx_2, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_7) { @@ -17002,13 +17181,13 @@ * if isinstance(shape, int): */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_kp_127); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_127); - __Pyx_GIVEREF(__pyx_kp_127); - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_56)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_56)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_56)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -17052,19 +17231,19 @@ * final_shape.append(mean.shape[0]) * # Create a matrix of independent standard normally distributed random */ - __pyx_1 = PySequence_GetSlice(__pyx_v_shape, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_1 = 0; - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)&PyList_Type)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PySequence_GetSlice(__pyx_v_shape, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyList_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_final_shape); - __pyx_v_final_shape = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_final_shape = __pyx_t_2; + __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3955 * shape = [shape] @@ -17073,15 +17252,15 @@ * # Create a matrix of independent standard normally distributed random * # numbers. The matrix has rows with the same length as mean and as */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_mean, __pyx_kp_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_2 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_final_shape, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_final_shape, __pyx_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3959 * # numbers. The matrix has rows with the same length as mean and as @@ -17090,34 +17269,34 @@ * x.shape = (np.multiply.reduce(final_shape[0:len(final_shape)-1]), * mean.shape[0]) */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_standard_normal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__standard_normal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_multiply); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_kp_reduce); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__multiply); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__reduce); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_final_shape); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_final_shape); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_final_shape); __Pyx_GIVEREF(__pyx_v_final_shape); - __pyx_t_8 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_x); __pyx_v_x = __pyx_t_8; __pyx_t_8 = 0; @@ -17129,26 +17308,26 @@ * mean.shape[0]) * # Transform matrix of standard normals into matrix where each row */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_8 = PyObject_GetAttr(__pyx_2, __pyx_kp_multiply); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_t_8, __pyx_kp_reduce); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__multiply); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__reduce); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = PyObject_Length(__pyx_v_final_shape); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_GetSlice(__pyx_v_final_shape, 0, (__pyx_t_5 - 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_8, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_5 = PyObject_Length(__pyx_v_final_shape); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_1 = PySequence_GetSlice(__pyx_v_final_shape, 0, (__pyx_t_5 - 1)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_8)); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_1); - __Pyx_GIVEREF(__pyx_1); - __pyx_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3961 * x = self.standard_normal(np.multiply.reduce(final_shape)) @@ -17157,19 +17336,19 @@ * # Transform matrix of standard normals into matrix where each row * # contains multivariate normals with the desired covariance. */ - __pyx_t_8 = PyObject_GetAttr(__pyx_v_mean, __pyx_kp_shape); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_2 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_8)); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_2); - __Pyx_GIVEREF(__pyx_2); - __pyx_t_1 = 0; - __pyx_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_3 = 0; + __pyx_t_8 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3960 * # many rows are necessary to form a matrix of shape final_shape. @@ -17178,8 +17357,8 @@ * mean.shape[0]) * # Transform matrix of standard normals into matrix where each row */ - if (PyObject_SetAttr(__pyx_v_x, __pyx_kp_shape, ((PyObject *)__pyx_t_8)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; + if (PyObject_SetAttr(__pyx_v_x, __pyx_n_s__shape, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3969 * # decomposition of cov is such an A. @@ -17188,20 +17367,21 @@ * # XXX: we really should be doing this by Cholesky decomposition * (u,s,v) = svd(cov) */ - __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_8)); - __Pyx_INCREF(__pyx_kp_svd); - PyList_SET_ITEM(__pyx_t_8, 0, __pyx_kp_svd); - __Pyx_GIVEREF(__pyx_kp_svd); - __pyx_1 = __Pyx_Import(__pyx_kp_128, ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_svd); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_INCREF(((PyObject *)__pyx_n_s__svd)); + PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__svd)); + __Pyx_GIVEREF(((PyObject *)__pyx_n_s__svd)); + __pyx_t_8 = __Pyx_Import(((PyObject *)__pyx_n_s_57), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__svd); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF(__pyx_v_svd); - __pyx_v_svd = __pyx_2; - __pyx_2 = 0; - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_v_svd = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3971 * from numpy.dual import svd @@ -17211,49 +17391,49 @@ * # The rows of x now have the correct covariance but mean 0. Add */ __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_8)); + __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_cov); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_cov); __Pyx_GIVEREF(__pyx_v_cov); - __pyx_t_1 = PyObject_Call(__pyx_v_svd, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 3)) { - PyObject* tuple = __pyx_t_1; - __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2); - __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3); - __pyx_4 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyObject_Call(__pyx_v_svd, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 3)) { + PyObject* tuple = __pyx_t_2; + __pyx_t_8 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_8); + __pyx_t_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_3); + __pyx_t_1 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_v_u); - __pyx_v_u = __pyx_2; - __pyx_2 = 0; + __pyx_v_u = __pyx_t_8; + __pyx_t_8 = 0; __Pyx_DECREF(__pyx_v_s); - __pyx_v_s = __pyx_3; - __pyx_3 = 0; + __pyx_v_s = __pyx_t_3; + __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_v); - __pyx_v_v = __pyx_4; - __pyx_4 = 0; + __pyx_v_v = __pyx_t_1; + __pyx_t_1 = 0; } else { - __pyx_1 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_4 = __Pyx_UnpackItem(__pyx_1, 2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_4); - if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = __Pyx_UnpackItem(__pyx_t_9, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_9, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_9, 2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_EndUnpack(__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_v_u); - __pyx_v_u = __pyx_2; - __pyx_2 = 0; + __pyx_v_u = __pyx_t_8; + __pyx_t_8 = 0; __Pyx_DECREF(__pyx_v_s); - __pyx_v_s = __pyx_3; - __pyx_3 = 0; + __pyx_v_s = __pyx_t_3; + __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_v); - __pyx_v_v = __pyx_4; - __pyx_4 = 0; + __pyx_v_v = __pyx_t_1; + __pyx_t_1 = 0; } /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3972 @@ -17263,40 +17443,40 @@ * # The rows of x now have the correct covariance but mean 0. Add * # mean to each row. Then each row will have mean mean. */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_dot); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__dot); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_8 = PyObject_GetAttr(__pyx_2, __pyx_kp_sqrt); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__sqrt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_s); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_s); __Pyx_GIVEREF(__pyx_v_s); - __pyx_t_3 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Multiply(__pyx_v_x, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Multiply(__pyx_v_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_v); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_v); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_v); __Pyx_GIVEREF(__pyx_v_v); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_v_x); __pyx_v_x = __pyx_t_2; __pyx_t_2 = 0; @@ -17308,26 +17488,26 @@ * x.shape = tuple(final_shape) * return x */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __pyx_t_2 = PyObject_GetAttr(__pyx_3, __pyx_kp_add); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_8 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__add); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_mean); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_mean); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_mean); __Pyx_GIVEREF(__pyx_v_mean); __Pyx_INCREF(__pyx_v_x); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_x); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_x); __Pyx_GIVEREF(__pyx_v_x); __Pyx_INCREF(__pyx_v_x); - PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_x); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_x); __Pyx_GIVEREF(__pyx_v_x); - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_8, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3975; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3976 @@ -17338,15 +17518,15 @@ * */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_final_shape); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_final_shape); __Pyx_GIVEREF(__pyx_v_final_shape); - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyTuple_Type)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - if (PyObject_SetAttr(__pyx_v_x, __pyx_kp_shape, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyTuple_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyObject_SetAttr(__pyx_v_x, __pyx_n_s__shape, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3977 * np.add(mean,x,x) @@ -17363,14 +17543,11 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_2); - __Pyx_XDECREF(__pyx_3); - __Pyx_XDECREF(__pyx_4); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("mtrand.RandomState.multivariate_normal"); __pyx_r = NULL; __pyx_L0:; @@ -17381,10 +17558,12 @@ __Pyx_DECREF(__pyx_v_u); __Pyx_DECREF(__pyx_v_s); __Pyx_DECREF(__pyx_v_v); + __Pyx_DECREF((PyObject *)__pyx_v_self); __Pyx_DECREF(__pyx_v_mean); __Pyx_DECREF(__pyx_v_cov); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -17414,19 +17593,19 @@ PyObject *__pyx_v_shape; PyObject *__pyx_v_multin; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; long __pyx_t_6; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_n,&__pyx_kp_pvals,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("multinomial"); + double __pyx_t_7; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__n,&__pyx_n_s__pvals,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("multinomial"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[3] = {0,0,0}; - values[2] = Py_None; + values[2] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); @@ -17436,18 +17615,18 @@ } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_n); + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__n); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_pvals); + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pvals); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("multinomial", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3979; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[2] = value; kw_args--; } } } @@ -17458,7 +17637,7 @@ __pyx_v_pvals = values[1]; __pyx_v_size = values[2]; } else { - __pyx_v_size = Py_None; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 2); @@ -17476,6 +17655,9 @@ __Pyx_AddTraceback("mtrand.RandomState.multinomial"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_pvals); + __Pyx_INCREF(__pyx_v_size); arrayObject_parr = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); arrayObject_mnarr = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_shape = Py_None; __Pyx_INCREF(Py_None); @@ -17532,13 +17714,13 @@ * if size is None: */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_kp_129); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_129); - __Pyx_GIVEREF(__pyx_kp_129); - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_58)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_58)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_58)); + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_4, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4043; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -17566,12 +17748,12 @@ __pyx_t_4 = PyInt_FromLong(__pyx_v_d); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4046; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_shape); - __pyx_v_shape = ((PyObject *)__pyx_t_2); + __pyx_v_shape = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L7; } @@ -17583,16 +17765,7 @@ * shape = (size, d) * else: */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size); - __Pyx_GIVEREF(__pyx_v_size); - __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)&PyType_Type)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_3 = (__pyx_t_4 == ((PyObject *)((PyObject*)&PyInt_Type))); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_size)) == ((PyObject *)((PyObject*)&PyInt_Type))); if (__pyx_t_3) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4048 @@ -17602,19 +17775,19 @@ * else: * shape = size + (d,) */ - __pyx_t_4 = PyInt_FromLong(__pyx_v_d); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_v_d); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4048; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_v_shape); + __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_v_shape); - __pyx_v_shape = ((PyObject *)__pyx_t_2); - __pyx_t_2 = 0; goto __pyx_L7; } /*else*/ { @@ -17626,19 +17799,19 @@ * * multin = np.zeros(shape, int) */ - __pyx_t_2 = PyInt_FromLong(__pyx_v_d); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_v_d); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_v_size, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_v_size, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_v_shape); - __pyx_v_shape = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_shape = __pyx_t_4; + __pyx_t_4 = 0; } __pyx_L7:; @@ -17649,23 +17822,23 @@ * mnarr = multin * mnix = mnarr.data */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); __Pyx_INCREF(((PyObject *)((PyObject*)&PyInt_Type))); PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)((PyObject*)&PyInt_Type))); __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type))); - __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_multin); __pyx_v_multin = __pyx_t_5; __pyx_t_5 = 0; @@ -17745,7 +17918,12 @@ * dn = dn - mnix[i+j] * if dn <= 0: */ - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]) = rk_binomial(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, __pyx_v_dn, ((__pyx_v_pix[__pyx_v_j]) / __pyx_v_Sum)); + __pyx_t_7 = (__pyx_v_pix[__pyx_v_j]); + if (unlikely(__pyx_v_Sum == 0)) { + PyErr_Format(PyExc_ZeroDivisionError, "float division"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } + (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]) = rk_binomial(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, __pyx_v_dn, (__pyx_t_7 / __pyx_v_Sum)); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4061 * for j from 0 <= j < d-1: @@ -17836,7 +18014,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); @@ -17847,8 +18024,11 @@ __Pyx_DECREF((PyObject *)arrayObject_mnarr); __Pyx_DECREF(__pyx_v_shape); __Pyx_DECREF(__pyx_v_multin); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_pvals); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -17878,19 +18058,18 @@ PyObject *__pyx_v_shape; PyObject *__pyx_v_diric; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; long __pyx_t_6; - static PyObject **__pyx_pyargnames[] = {&__pyx_kp_alpha,&__pyx_kp_size,0}; - __Pyx_SetupRefcountContext("dirichlet"); + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__alpha,&__pyx_n_s__size,0}; + __Pyx_RefNannySetupContext("dirichlet"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[2] = {0,0}; - values[1] = Py_None; + values[1] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); @@ -17899,12 +18078,12 @@ } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_alpha); + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alpha); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 1) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_size); + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size); if (unlikely(value)) { values[1] = value; kw_args--; } } } @@ -17914,7 +18093,7 @@ __pyx_v_alpha = values[0]; __pyx_v_size = values[1]; } else { - __pyx_v_size = Py_None; + __pyx_v_size = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: __pyx_v_size = PyTuple_GET_ITEM(__pyx_args, 1); case 1: __pyx_v_alpha = PyTuple_GET_ITEM(__pyx_args, 0); @@ -17929,6 +18108,9 @@ __Pyx_AddTraceback("mtrand.RandomState.dirichlet"); return NULL; __pyx_L4_argument_unpacking_done:; + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_alpha); + __Pyx_INCREF(__pyx_v_size); __pyx_v_alpha_arr = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_val_arr = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_shape = Py_None; __Pyx_INCREF(Py_None); @@ -17987,12 +18169,12 @@ __pyx_t_2 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_v_shape); - __pyx_v_shape = ((PyObject *)__pyx_t_4); + __pyx_v_shape = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L6; } @@ -18004,16 +18186,7 @@ * shape = (size, k) * else: */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_size); - __Pyx_GIVEREF(__pyx_v_size); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyType_Type)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_3 = (__pyx_t_2 == ((PyObject *)((PyObject*)&PyInt_Type))); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_size)) == ((PyObject *)((PyObject*)&PyInt_Type))); if (__pyx_t_3) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4143 @@ -18023,19 +18196,19 @@ * else: * shape = size + (k,) */ - __pyx_t_2 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_size); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size); __Pyx_GIVEREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_v_shape); + __pyx_v_shape = __pyx_t_2; __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_v_shape); - __pyx_v_shape = ((PyObject *)__pyx_t_4); - __pyx_t_4 = 0; goto __pyx_L6; } /*else*/ { @@ -18047,19 +18220,19 @@ * * diric = np.zeros(shape, np.float64) */ - __pyx_t_4 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_v_size, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_v_size, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_shape); - __pyx_v_shape = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_v_shape = __pyx_t_2; + __pyx_t_2 = 0; } __pyx_L6:; @@ -18070,31 +18243,31 @@ * val_arr = diric * val_data= val_arr.data */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_19); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_shape); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape); __Pyx_GIVEREF(__pyx_v_shape); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_v_diric); - __pyx_v_diric = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_diric = __pyx_t_5; + __pyx_t_5 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4148 * @@ -18190,6 +18363,10 @@ * for j from 0 <= j < k: * val_data[i+j] = val_data[i+j] * invacc */ + if (unlikely(__pyx_v_acc == 0)) { + PyErr_Format(PyExc_ZeroDivisionError, "float division"); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + } __pyx_v_invacc = (1 / __pyx_v_acc); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4159 @@ -18237,7 +18414,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); @@ -18248,8 +18424,11 @@ __Pyx_DECREF((PyObject *)__pyx_v_val_arr); __Pyx_DECREF(__pyx_v_shape); __Pyx_DECREF(__pyx_v_diric); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_alpha); + __Pyx_DECREF(__pyx_v_size); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -18268,16 +18447,15 @@ long __pyx_v_j; int __pyx_v_copy; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; int __pyx_t_6; - __Pyx_SetupRefcountContext("shuffle"); + __Pyx_RefNannySetupContext("shuffle"); + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_x); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4176 * cdef int copy @@ -18311,10 +18489,10 @@ * except: * j = 0 */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_x, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4178; __pyx_clineno = __LINE__; goto __pyx_L5_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_Length(__pyx_1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4178; __pyx_clineno = __LINE__; goto __pyx_L5_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_x, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4178; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4178; __pyx_clineno = __LINE__; goto __pyx_L5_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_j = __pyx_t_1; } __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; @@ -18322,7 +18500,7 @@ __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; goto __pyx_L12_try_end; __pyx_L5_error:; - __Pyx_XDECREF(__pyx_1); __pyx_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4179 * try: @@ -18332,7 +18510,7 @@ * */ /*except:*/ { - __Pyx_AddTraceback("mtrand.shuffle"); + __Pyx_AddTraceback("mtrand.RandomState.shuffle"); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4179; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_3); @@ -18352,9 +18530,10 @@ goto __pyx_L6_exception_handled; } __pyx_L7_except_error:; - __Pyx_XDECREF(__pyx_save_exc_type); - __Pyx_XDECREF(__pyx_save_exc_value); - __Pyx_XDECREF(__pyx_save_exc_tb); + __Pyx_XGIVEREF(__pyx_save_exc_type); + __Pyx_XGIVEREF(__pyx_save_exc_value); + __Pyx_XGIVEREF(__pyx_save_exc_tb); + __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); goto __pyx_L1_error; __pyx_L6_exception_handled:; __Pyx_XGIVEREF(__pyx_save_exc_type); @@ -18401,14 +18580,14 @@ * i = i - 1 * else: */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_j, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_2 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_i, __pyx_1, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_2, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_j, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_i, __pyx_t_4, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_t_3, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4187 * j = rk_interval(i, self.internal_state) @@ -18430,10 +18609,10 @@ * if copy: * while(i > 0): */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_x, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_5 = PyObject_HasAttr(__pyx_1, __pyx_kp_130); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_x, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyObject_HasAttr(__pyx_t_3, ((PyObject *)__pyx_n_s__copy)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_copy = __pyx_t_5; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4191 @@ -18473,26 +18652,26 @@ * i = i - 1 * else: */ - __pyx_2 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_j, sizeof(long), PyInt_FromLong); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_t_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_copy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_j, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__copy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_1 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_copy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_i, __pyx_t_3, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_t_2, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_t_4, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4195 * j = rk_interval(i, self.internal_state) @@ -18534,20 +18713,20 @@ * i = i - 1 * */ - __pyx_2 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_j, sizeof(long), PyInt_FromLong); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_1 = PySequence_GetSlice(__pyx_2, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_2); - __pyx_3 = PySequence_GetSlice(__pyx_2, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_3); - __Pyx_DECREF(__pyx_2); __pyx_2 = 0; - if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_i, __pyx_1, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_3, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_j, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PySequence_GetSlice(__pyx_t_4, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PySequence_GetSlice(__pyx_t_4, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_i, __pyx_t_3, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_t_2, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4200 * j = rk_interval(i, self.internal_state) @@ -18566,17 +18745,16 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); - __Pyx_XDECREF(__pyx_2); - __Pyx_XDECREF(__pyx_3); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("mtrand.RandomState.shuffle"); __pyx_r = NULL; __pyx_L0:; + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_x); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -18593,12 +18771,13 @@ static PyObject *__pyx_pf_6mtrand_11RandomState_permutation(PyObject *__pyx_v_self, PyObject *__pyx_v_x) { PyObject *__pyx_v_arr; PyObject *__pyx_r = NULL; - PyObject *__pyx_1 = 0; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; - __Pyx_SetupRefcountContext("permutation"); + __Pyx_RefNannySetupContext("permutation"); + __Pyx_INCREF((PyObject *)__pyx_v_self); + __Pyx_INCREF(__pyx_v_x); __pyx_v_arr = Py_None; __Pyx_INCREF(Py_None); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4229 @@ -18608,21 +18787,21 @@ * arr = np.arange(x) * else: */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_integer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__integer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)((PyObject*)&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)&PyInt_Type))); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)&PyInt_Type))); __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_3 = PyObject_IsInstance(__pyx_v_x, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_3 = PyObject_IsInstance(__pyx_v_x, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4230 @@ -18632,20 +18811,20 @@ * else: * arr = np.array(x) */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_arange); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__arange); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_x); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_x); __Pyx_GIVEREF(__pyx_v_x); - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_arr); __pyx_v_arr = __pyx_t_4; __pyx_t_4 = 0; @@ -18660,20 +18839,20 @@ * self.shuffle(arr) * return arr */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_np); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_x); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_x); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_x); __Pyx_GIVEREF(__pyx_v_x); - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_arr); __pyx_v_arr = __pyx_t_2; __pyx_t_2 = 0; @@ -18687,18 +18866,18 @@ * return arr * */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_shuffle); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__shuffle); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_arr); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_arr); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_arr); __Pyx_GIVEREF(__pyx_v_arr); - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4234 * arr = np.array(x) @@ -18715,7 +18894,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); @@ -18723,8 +18901,10 @@ __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF(__pyx_v_arr); + __Pyx_DECREF((PyObject *)__pyx_v_self); + __Pyx_DECREF(__pyx_v_x); __Pyx_XGIVEREF(__pyx_r); - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -18945,6 +19125,10 @@ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ + 0, /*tp_del*/ + #if PY_VERSION_HEX >= 0x02060000 + 0, /*tp_version_tag*/ + #endif }; static struct PyMethodDef __pyx_methods[] = { @@ -18968,246 +19152,228 @@ #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp___main__, __pyx_k___main__, sizeof(__pyx_k___main__), 1, 1, 1}, - {&__pyx_kp___init__, __pyx_k___init__, sizeof(__pyx_k___init__), 1, 1, 1}, - {&__pyx_kp___dealloc__, __pyx_k___dealloc__, sizeof(__pyx_k___dealloc__), 1, 1, 1}, - {&__pyx_kp_seed, __pyx_k_seed, sizeof(__pyx_k_seed), 1, 1, 1}, - {&__pyx_kp_get_state, __pyx_k_get_state, sizeof(__pyx_k_get_state), 1, 1, 1}, - {&__pyx_kp_set_state, __pyx_k_set_state, sizeof(__pyx_k_set_state), 1, 1, 1}, - {&__pyx_kp___getstate__, __pyx_k___getstate__, sizeof(__pyx_k___getstate__), 1, 1, 1}, - {&__pyx_kp___setstate__, __pyx_k___setstate__, sizeof(__pyx_k___setstate__), 1, 1, 1}, - {&__pyx_kp___reduce__, __pyx_k___reduce__, sizeof(__pyx_k___reduce__), 1, 1, 1}, - {&__pyx_kp_random_sample, __pyx_k_random_sample, sizeof(__pyx_k_random_sample), 1, 1, 1}, - {&__pyx_kp_tomaxint, __pyx_k_tomaxint, sizeof(__pyx_k_tomaxint), 1, 1, 1}, - {&__pyx_kp_randint, __pyx_k_randint, sizeof(__pyx_k_randint), 1, 1, 1}, - {&__pyx_kp_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 1, 1, 1}, - {&__pyx_kp_uniform, __pyx_k_uniform, sizeof(__pyx_k_uniform), 1, 1, 1}, - {&__pyx_kp_rand, __pyx_k_rand, sizeof(__pyx_k_rand), 1, 1, 1}, - {&__pyx_kp_randn, __pyx_k_randn, sizeof(__pyx_k_randn), 1, 1, 1}, - {&__pyx_kp_random_integers, __pyx_k_random_integers, sizeof(__pyx_k_random_integers), 1, 1, 1}, - {&__pyx_kp_standard_normal, __pyx_k_standard_normal, sizeof(__pyx_k_standard_normal), 1, 1, 1}, - {&__pyx_kp_normal, __pyx_k_normal, sizeof(__pyx_k_normal), 1, 1, 1}, - {&__pyx_kp_beta, __pyx_k_beta, sizeof(__pyx_k_beta), 1, 1, 1}, - {&__pyx_kp_exponential, __pyx_k_exponential, sizeof(__pyx_k_exponential), 1, 1, 1}, - {&__pyx_kp_1, __pyx_k_1, sizeof(__pyx_k_1), 1, 1, 1}, - {&__pyx_kp_standard_gamma, __pyx_k_standard_gamma, sizeof(__pyx_k_standard_gamma), 1, 1, 1}, - {&__pyx_kp_gamma, __pyx_k_gamma, sizeof(__pyx_k_gamma), 1, 1, 1}, - {&__pyx_kp_f, __pyx_k_f, sizeof(__pyx_k_f), 1, 1, 1}, - {&__pyx_kp_noncentral_f, __pyx_k_noncentral_f, sizeof(__pyx_k_noncentral_f), 1, 1, 1}, - {&__pyx_kp_chisquare, __pyx_k_chisquare, sizeof(__pyx_k_chisquare), 1, 1, 1}, - {&__pyx_kp_2, __pyx_k_2, sizeof(__pyx_k_2), 1, 1, 1}, - {&__pyx_kp_standard_cauchy, __pyx_k_standard_cauchy, sizeof(__pyx_k_standard_cauchy), 1, 1, 1}, - {&__pyx_kp_standard_t, __pyx_k_standard_t, sizeof(__pyx_k_standard_t), 1, 1, 1}, - {&__pyx_kp_vonmises, __pyx_k_vonmises, sizeof(__pyx_k_vonmises), 1, 1, 1}, - {&__pyx_kp_pareto, __pyx_k_pareto, sizeof(__pyx_k_pareto), 1, 1, 1}, - {&__pyx_kp_weibull, __pyx_k_weibull, sizeof(__pyx_k_weibull), 1, 1, 1}, - {&__pyx_kp_power, __pyx_k_power, sizeof(__pyx_k_power), 1, 1, 1}, - {&__pyx_kp_laplace, __pyx_k_laplace, sizeof(__pyx_k_laplace), 1, 1, 1}, - {&__pyx_kp_gumbel, __pyx_k_gumbel, sizeof(__pyx_k_gumbel), 1, 1, 1}, - {&__pyx_kp_logistic, __pyx_k_logistic, sizeof(__pyx_k_logistic), 1, 1, 1}, - {&__pyx_kp_lognormal, __pyx_k_lognormal, sizeof(__pyx_k_lognormal), 1, 1, 1}, - {&__pyx_kp_rayleigh, __pyx_k_rayleigh, sizeof(__pyx_k_rayleigh), 1, 1, 1}, - {&__pyx_kp_wald, __pyx_k_wald, sizeof(__pyx_k_wald), 1, 1, 1}, - {&__pyx_kp_triangular, __pyx_k_triangular, sizeof(__pyx_k_triangular), 1, 1, 1}, - {&__pyx_kp_binomial, __pyx_k_binomial, sizeof(__pyx_k_binomial), 1, 1, 1}, - {&__pyx_kp_negative_binomial, __pyx_k_negative_binomial, sizeof(__pyx_k_negative_binomial), 1, 1, 1}, - {&__pyx_kp_poisson, __pyx_k_poisson, sizeof(__pyx_k_poisson), 1, 1, 1}, - {&__pyx_kp_zipf, __pyx_k_zipf, sizeof(__pyx_k_zipf), 1, 1, 1}, - {&__pyx_kp_geometric, __pyx_k_geometric, sizeof(__pyx_k_geometric), 1, 1, 1}, - {&__pyx_kp_hypergeometric, __pyx_k_hypergeometric, sizeof(__pyx_k_hypergeometric), 1, 1, 1}, - {&__pyx_kp_logseries, __pyx_k_logseries, sizeof(__pyx_k_logseries), 1, 1, 1}, - {&__pyx_kp_multivariate_normal, __pyx_k_multivariate_normal, sizeof(__pyx_k_multivariate_normal), 1, 1, 1}, - {&__pyx_kp_multinomial, __pyx_k_multinomial, sizeof(__pyx_k_multinomial), 1, 1, 1}, - {&__pyx_kp_dirichlet, __pyx_k_dirichlet, sizeof(__pyx_k_dirichlet), 1, 1, 1}, - {&__pyx_kp_shuffle, __pyx_k_shuffle, sizeof(__pyx_k_shuffle), 1, 1, 1}, - {&__pyx_kp_permutation, __pyx_k_permutation, sizeof(__pyx_k_permutation), 1, 1, 1}, - {&__pyx_kp_state, __pyx_k_state, sizeof(__pyx_k_state), 1, 1, 1}, - {&__pyx_kp_size, __pyx_k_size, sizeof(__pyx_k_size), 1, 1, 1}, - {&__pyx_kp_low, __pyx_k_low, sizeof(__pyx_k_low), 1, 1, 1}, - {&__pyx_kp_high, __pyx_k_high, sizeof(__pyx_k_high), 1, 1, 1}, - {&__pyx_kp_length, __pyx_k_length, sizeof(__pyx_k_length), 1, 1, 1}, - {&__pyx_kp_loc, __pyx_k_loc, sizeof(__pyx_k_loc), 1, 1, 1}, - {&__pyx_kp_scale, __pyx_k_scale, sizeof(__pyx_k_scale), 1, 1, 1}, - {&__pyx_kp_a, __pyx_k_a, sizeof(__pyx_k_a), 1, 1, 1}, - {&__pyx_kp_b, __pyx_k_b, sizeof(__pyx_k_b), 1, 1, 1}, - {&__pyx_kp_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 1, 1, 1}, - {&__pyx_kp_dfnum, __pyx_k_dfnum, sizeof(__pyx_k_dfnum), 1, 1, 1}, - {&__pyx_kp_dfden, __pyx_k_dfden, sizeof(__pyx_k_dfden), 1, 1, 1}, - {&__pyx_kp_nonc, __pyx_k_nonc, sizeof(__pyx_k_nonc), 1, 1, 1}, - {&__pyx_kp_df, __pyx_k_df, sizeof(__pyx_k_df), 1, 1, 1}, - {&__pyx_kp_mu, __pyx_k_mu, sizeof(__pyx_k_mu), 1, 1, 1}, - {&__pyx_kp_kappa, __pyx_k_kappa, sizeof(__pyx_k_kappa), 1, 1, 1}, - {&__pyx_kp_mean, __pyx_k_mean, sizeof(__pyx_k_mean), 1, 1, 1}, - {&__pyx_kp_sigma, __pyx_k_sigma, sizeof(__pyx_k_sigma), 1, 1, 1}, - {&__pyx_kp_left, __pyx_k_left, sizeof(__pyx_k_left), 1, 1, 1}, - {&__pyx_kp_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 1, 1, 1}, - {&__pyx_kp_right, __pyx_k_right, sizeof(__pyx_k_right), 1, 1, 1}, - {&__pyx_kp_n, __pyx_k_n, sizeof(__pyx_k_n), 1, 1, 1}, - {&__pyx_kp_p, __pyx_k_p, sizeof(__pyx_k_p), 1, 1, 1}, - {&__pyx_kp_lam, __pyx_k_lam, sizeof(__pyx_k_lam), 1, 1, 1}, - {&__pyx_kp_ngood, __pyx_k_ngood, sizeof(__pyx_k_ngood), 1, 1, 1}, - {&__pyx_kp_nbad, __pyx_k_nbad, sizeof(__pyx_k_nbad), 1, 1, 1}, - {&__pyx_kp_nsample, __pyx_k_nsample, sizeof(__pyx_k_nsample), 1, 1, 1}, - {&__pyx_kp_cov, __pyx_k_cov, sizeof(__pyx_k_cov), 1, 1, 1}, - {&__pyx_kp_pvals, __pyx_k_pvals, sizeof(__pyx_k_pvals), 1, 1, 1}, - {&__pyx_kp_alpha, __pyx_k_alpha, sizeof(__pyx_k_alpha), 1, 1, 1}, - {&__pyx_kp_x, __pyx_k_x, sizeof(__pyx_k_x), 1, 1, 1}, - {&__pyx_kp_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 1, 1, 1}, - {&__pyx_kp_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 1, 1}, - {&__pyx_kp__rand, __pyx_k__rand, sizeof(__pyx_k__rand), 1, 1, 1}, - {&__pyx_kp_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 1, 1, 1}, - {&__pyx_kp_19, __pyx_k_19, sizeof(__pyx_k_19), 1, 1, 1}, - {&__pyx_kp_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 1, 1, 1}, - {&__pyx_kp_integer, __pyx_k_integer, sizeof(__pyx_k_integer), 1, 1, 1}, - {&__pyx_kp_uint, __pyx_k_uint, sizeof(__pyx_k_uint), 1, 1, 1}, - {&__pyx_kp_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 1, 1, 1}, - {&__pyx_kp_27, __pyx_k_27, sizeof(__pyx_k_27), 1, 1, 1}, - {&__pyx_kp_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 1, 0}, - {&__pyx_kp_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 1, 0}, - {&__pyx_kp_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 1, 1, 1}, - {&__pyx_kp_random, __pyx_k_random, sizeof(__pyx_k_random), 1, 1, 1}, - {&__pyx_kp___RandomState_ctor, __pyx_k___RandomState_ctor, sizeof(__pyx_k___RandomState_ctor), 1, 1, 1}, - {&__pyx_kp_subtract, __pyx_k_subtract, sizeof(__pyx_k_subtract), 1, 1, 1}, - {&__pyx_kp_any, __pyx_k_any, sizeof(__pyx_k_any), 1, 1, 1}, - {&__pyx_kp_less_equal, __pyx_k_less_equal, sizeof(__pyx_k_less_equal), 1, 1, 1}, - {&__pyx_kp_less, __pyx_k_less, sizeof(__pyx_k_less), 1, 1, 1}, - {&__pyx_kp_greater, __pyx_k_greater, sizeof(__pyx_k_greater), 1, 1, 1}, - {&__pyx_kp_equal, __pyx_k_equal, sizeof(__pyx_k_equal), 1, 1, 1}, - {&__pyx_kp_add, __pyx_k_add, sizeof(__pyx_k_add), 1, 1, 1}, - {&__pyx_kp_greater_equal, __pyx_k_greater_equal, sizeof(__pyx_k_greater_equal), 1, 1, 1}, - {&__pyx_kp_array, __pyx_k_array, sizeof(__pyx_k_array), 1, 1, 1}, - {&__pyx_kp_append, __pyx_k_append, sizeof(__pyx_k_append), 1, 1, 1}, - {&__pyx_kp_multiply, __pyx_k_multiply, sizeof(__pyx_k_multiply), 1, 1, 1}, - {&__pyx_kp_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 1, 1, 1}, - {&__pyx_kp_128, __pyx_k_128, sizeof(__pyx_k_128), 1, 1, 1}, - {&__pyx_kp_svd, __pyx_k_svd, sizeof(__pyx_k_svd), 1, 1, 1}, - {&__pyx_kp_dot, __pyx_k_dot, sizeof(__pyx_k_dot), 1, 1, 1}, - {&__pyx_kp_sqrt, __pyx_k_sqrt, sizeof(__pyx_k_sqrt), 1, 1, 1}, - {&__pyx_kp_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 1, 1, 1}, - {&__pyx_kp_130, __pyx_k_130, sizeof(__pyx_k_130), 0, 1, 0}, - {&__pyx_kp_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 1, 1, 1}, - {&__pyx_kp_arange, __pyx_k_arange, sizeof(__pyx_k_arange), 1, 1, 1}, - {&__pyx_kp_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 0}, - {&__pyx_kp_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 0}, - {&__pyx_kp_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 0}, - {&__pyx_kp_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 0}, - {&__pyx_kp_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 0}, - {&__pyx_kp_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 0}, - {&__pyx_kp_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 0, 0}, - {&__pyx_kp_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 0}, - {&__pyx_kp_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 0, 0}, - {&__pyx_kp_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 0, 0}, - {&__pyx_kp_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 0}, - {&__pyx_kp_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 0, 0}, - {&__pyx_kp_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 0, 0}, - {&__pyx_kp_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 0, 0}, - {&__pyx_kp_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 0, 0}, - {&__pyx_kp_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 0, 0}, - {&__pyx_kp_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 0}, - {&__pyx_kp_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 0, 0}, - {&__pyx_kp_41, __pyx_k_41, sizeof(__pyx_k_41), 0, 0, 0}, - {&__pyx_kp_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 0, 0}, - {&__pyx_kp_43, __pyx_k_43, sizeof(__pyx_k_43), 0, 0, 0}, - {&__pyx_kp_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 0, 0}, - {&__pyx_kp_45, __pyx_k_45, sizeof(__pyx_k_45), 0, 0, 0}, - {&__pyx_kp_46, __pyx_k_46, sizeof(__pyx_k_46), 0, 0, 0}, - {&__pyx_kp_47, __pyx_k_47, sizeof(__pyx_k_47), 0, 0, 0}, - {&__pyx_kp_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 0, 0}, - {&__pyx_kp_49, __pyx_k_49, sizeof(__pyx_k_49), 0, 0, 0}, - {&__pyx_kp_50, __pyx_k_50, sizeof(__pyx_k_50), 0, 0, 0}, - {&__pyx_kp_51, __pyx_k_51, sizeof(__pyx_k_51), 0, 0, 0}, - {&__pyx_kp_52, __pyx_k_52, sizeof(__pyx_k_52), 0, 0, 0}, - {&__pyx_kp_53, __pyx_k_53, sizeof(__pyx_k_53), 0, 0, 0}, - {&__pyx_kp_54, __pyx_k_54, sizeof(__pyx_k_54), 0, 0, 0}, - {&__pyx_kp_55, __pyx_k_55, sizeof(__pyx_k_55), 0, 0, 0}, - {&__pyx_kp_56, __pyx_k_56, sizeof(__pyx_k_56), 0, 0, 0}, - {&__pyx_kp_57, __pyx_k_57, sizeof(__pyx_k_57), 0, 0, 0}, - {&__pyx_kp_58, __pyx_k_58, sizeof(__pyx_k_58), 0, 0, 0}, - {&__pyx_kp_59, __pyx_k_59, sizeof(__pyx_k_59), 0, 0, 0}, - {&__pyx_kp_60, __pyx_k_60, sizeof(__pyx_k_60), 0, 0, 0}, - {&__pyx_kp_61, __pyx_k_61, sizeof(__pyx_k_61), 0, 0, 0}, - {&__pyx_kp_62, __pyx_k_62, sizeof(__pyx_k_62), 0, 0, 0}, - {&__pyx_kp_63, __pyx_k_63, sizeof(__pyx_k_63), 0, 0, 0}, - {&__pyx_kp_64, __pyx_k_64, sizeof(__pyx_k_64), 0, 0, 0}, - {&__pyx_kp_65, __pyx_k_65, sizeof(__pyx_k_65), 0, 0, 0}, - {&__pyx_kp_66, __pyx_k_66, sizeof(__pyx_k_66), 0, 0, 0}, - {&__pyx_kp_67, __pyx_k_67, sizeof(__pyx_k_67), 0, 0, 0}, - {&__pyx_kp_68, __pyx_k_68, sizeof(__pyx_k_68), 0, 0, 0}, - {&__pyx_kp_69, __pyx_k_69, sizeof(__pyx_k_69), 0, 0, 0}, - {&__pyx_kp_70, __pyx_k_70, sizeof(__pyx_k_70), 0, 0, 0}, - {&__pyx_kp_71, __pyx_k_71, sizeof(__pyx_k_71), 0, 0, 0}, - {&__pyx_kp_72, __pyx_k_72, sizeof(__pyx_k_72), 0, 0, 0}, - {&__pyx_kp_73, __pyx_k_73, sizeof(__pyx_k_73), 0, 0, 0}, - {&__pyx_kp_74, __pyx_k_74, sizeof(__pyx_k_74), 0, 0, 0}, - {&__pyx_kp_75, __pyx_k_75, sizeof(__pyx_k_75), 0, 0, 0}, - {&__pyx_kp_76, __pyx_k_76, sizeof(__pyx_k_76), 0, 0, 0}, - {&__pyx_kp_77, __pyx_k_77, sizeof(__pyx_k_77), 0, 0, 0}, - {&__pyx_kp_78, __pyx_k_78, sizeof(__pyx_k_78), 0, 0, 0}, - {&__pyx_kp_79, __pyx_k_79, sizeof(__pyx_k_79), 0, 0, 0}, - {&__pyx_kp_80, __pyx_k_80, sizeof(__pyx_k_80), 0, 0, 0}, - {&__pyx_kp_81, __pyx_k_81, sizeof(__pyx_k_81), 0, 0, 0}, - {&__pyx_kp_82, __pyx_k_82, sizeof(__pyx_k_82), 0, 0, 0}, - {&__pyx_kp_83, __pyx_k_83, sizeof(__pyx_k_83), 0, 0, 0}, - {&__pyx_kp_84, __pyx_k_84, sizeof(__pyx_k_84), 0, 0, 0}, - {&__pyx_kp_85, __pyx_k_85, sizeof(__pyx_k_85), 0, 0, 0}, - {&__pyx_kp_86, __pyx_k_86, sizeof(__pyx_k_86), 0, 0, 0}, - {&__pyx_kp_87, __pyx_k_87, sizeof(__pyx_k_87), 0, 0, 0}, - {&__pyx_kp_88, __pyx_k_88, sizeof(__pyx_k_88), 0, 0, 0}, - {&__pyx_kp_89, __pyx_k_89, sizeof(__pyx_k_89), 0, 0, 0}, - {&__pyx_kp_90, __pyx_k_90, sizeof(__pyx_k_90), 0, 0, 0}, - {&__pyx_kp_91, __pyx_k_91, sizeof(__pyx_k_91), 0, 0, 0}, - {&__pyx_kp_92, __pyx_k_92, sizeof(__pyx_k_92), 0, 0, 0}, - {&__pyx_kp_93, __pyx_k_93, sizeof(__pyx_k_93), 0, 0, 0}, - {&__pyx_kp_94, __pyx_k_94, sizeof(__pyx_k_94), 0, 0, 0}, - {&__pyx_kp_95, __pyx_k_95, sizeof(__pyx_k_95), 0, 0, 0}, - {&__pyx_kp_96, __pyx_k_96, sizeof(__pyx_k_96), 0, 0, 0}, - {&__pyx_kp_97, __pyx_k_97, sizeof(__pyx_k_97), 0, 0, 0}, - {&__pyx_kp_98, __pyx_k_98, sizeof(__pyx_k_98), 0, 0, 0}, - {&__pyx_kp_99, __pyx_k_99, sizeof(__pyx_k_99), 0, 0, 0}, - {&__pyx_kp_100, __pyx_k_100, sizeof(__pyx_k_100), 0, 0, 0}, - {&__pyx_kp_101, __pyx_k_101, sizeof(__pyx_k_101), 0, 0, 0}, - {&__pyx_kp_102, __pyx_k_102, sizeof(__pyx_k_102), 0, 0, 0}, - {&__pyx_kp_103, __pyx_k_103, sizeof(__pyx_k_103), 0, 0, 0}, - {&__pyx_kp_104, __pyx_k_104, sizeof(__pyx_k_104), 0, 0, 0}, - {&__pyx_kp_105, __pyx_k_105, sizeof(__pyx_k_105), 0, 0, 0}, - {&__pyx_kp_106, __pyx_k_106, sizeof(__pyx_k_106), 0, 0, 0}, - {&__pyx_kp_107, __pyx_k_107, sizeof(__pyx_k_107), 0, 0, 0}, - {&__pyx_kp_108, __pyx_k_108, sizeof(__pyx_k_108), 0, 0, 0}, - {&__pyx_kp_109, __pyx_k_109, sizeof(__pyx_k_109), 0, 0, 0}, - {&__pyx_kp_110, __pyx_k_110, sizeof(__pyx_k_110), 0, 0, 0}, - {&__pyx_kp_111, __pyx_k_111, sizeof(__pyx_k_111), 0, 0, 0}, - {&__pyx_kp_112, __pyx_k_112, sizeof(__pyx_k_112), 0, 0, 0}, - {&__pyx_kp_113, __pyx_k_113, sizeof(__pyx_k_113), 0, 0, 0}, - {&__pyx_kp_114, __pyx_k_114, sizeof(__pyx_k_114), 0, 0, 0}, - {&__pyx_kp_115, __pyx_k_115, sizeof(__pyx_k_115), 0, 0, 0}, - {&__pyx_kp_116, __pyx_k_116, sizeof(__pyx_k_116), 0, 0, 0}, - {&__pyx_kp_117, __pyx_k_117, sizeof(__pyx_k_117), 0, 0, 0}, - {&__pyx_kp_118, __pyx_k_118, sizeof(__pyx_k_118), 0, 0, 0}, - {&__pyx_kp_119, __pyx_k_119, sizeof(__pyx_k_119), 0, 0, 0}, - {&__pyx_kp_120, __pyx_k_120, sizeof(__pyx_k_120), 0, 0, 0}, - {&__pyx_kp_121, __pyx_k_121, sizeof(__pyx_k_121), 0, 0, 0}, - {&__pyx_kp_122, __pyx_k_122, sizeof(__pyx_k_122), 0, 0, 0}, - {&__pyx_kp_123, __pyx_k_123, sizeof(__pyx_k_123), 0, 0, 0}, - {&__pyx_kp_124, __pyx_k_124, sizeof(__pyx_k_124), 0, 0, 0}, - {&__pyx_kp_125, __pyx_k_125, sizeof(__pyx_k_125), 0, 0, 0}, - {&__pyx_kp_126, __pyx_k_126, sizeof(__pyx_k_126), 0, 0, 0}, - {&__pyx_kp_127, __pyx_k_127, sizeof(__pyx_k_127), 0, 0, 0}, - {&__pyx_kp_129, __pyx_k_129, sizeof(__pyx_k_129), 0, 0, 0}, - {0, 0, 0, 0, 0, 0} + {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0}, + {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0}, + {&__pyx_kp_u_100, __pyx_k_100, sizeof(__pyx_k_100), 0, 1, 0, 0}, + {&__pyx_kp_u_101, __pyx_k_101, sizeof(__pyx_k_101), 0, 1, 0, 0}, + {&__pyx_kp_u_102, __pyx_k_102, sizeof(__pyx_k_102), 0, 1, 0, 0}, + {&__pyx_kp_u_103, __pyx_k_103, sizeof(__pyx_k_103), 0, 1, 0, 0}, + {&__pyx_kp_u_104, __pyx_k_104, sizeof(__pyx_k_104), 0, 1, 0, 0}, + {&__pyx_kp_u_105, __pyx_k_105, sizeof(__pyx_k_105), 0, 1, 0, 0}, + {&__pyx_kp_u_106, __pyx_k_106, sizeof(__pyx_k_106), 0, 1, 0, 0}, + {&__pyx_kp_u_107, __pyx_k_107, sizeof(__pyx_k_107), 0, 1, 0, 0}, + {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0}, + {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0}, + {&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0}, + {&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0}, + {&__pyx_kp_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 0}, + {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0}, + {&__pyx_kp_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 0}, + {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, + {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0}, + {&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0}, + {&__pyx_kp_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 0}, + {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, + {&__pyx_kp_s_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 0, 1, 0}, + {&__pyx_kp_s_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 0, 1, 0}, + {&__pyx_kp_s_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 0, 1, 0}, + {&__pyx_kp_s_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 0, 1, 0}, + {&__pyx_kp_s_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 0, 1, 0}, + {&__pyx_kp_s_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 0, 1, 0}, + {&__pyx_kp_s_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 0, 1, 0}, + {&__pyx_kp_s_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 1, 0}, + {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0}, + {&__pyx_kp_s_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 0, 1, 0}, + {&__pyx_kp_s_41, __pyx_k_41, sizeof(__pyx_k_41), 0, 0, 1, 0}, + {&__pyx_kp_s_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 0, 1, 0}, + {&__pyx_kp_s_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 0, 1, 0}, + {&__pyx_kp_s_45, __pyx_k_45, sizeof(__pyx_k_45), 0, 0, 1, 0}, + {&__pyx_kp_s_46, __pyx_k_46, sizeof(__pyx_k_46), 0, 0, 1, 0}, + {&__pyx_kp_s_47, __pyx_k_47, sizeof(__pyx_k_47), 0, 0, 1, 0}, + {&__pyx_kp_s_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 0, 1, 0}, + {&__pyx_kp_s_49, __pyx_k_49, sizeof(__pyx_k_49), 0, 0, 1, 0}, + {&__pyx_kp_s_50, __pyx_k_50, sizeof(__pyx_k_50), 0, 0, 1, 0}, + {&__pyx_kp_s_51, __pyx_k_51, sizeof(__pyx_k_51), 0, 0, 1, 0}, + {&__pyx_kp_s_52, __pyx_k_52, sizeof(__pyx_k_52), 0, 0, 1, 0}, + {&__pyx_kp_s_53, __pyx_k_53, sizeof(__pyx_k_53), 0, 0, 1, 0}, + {&__pyx_kp_s_54, __pyx_k_54, sizeof(__pyx_k_54), 0, 0, 1, 0}, + {&__pyx_kp_s_55, __pyx_k_55, sizeof(__pyx_k_55), 0, 0, 1, 0}, + {&__pyx_kp_s_56, __pyx_k_56, sizeof(__pyx_k_56), 0, 0, 1, 0}, + {&__pyx_n_s_57, __pyx_k_57, sizeof(__pyx_k_57), 0, 0, 1, 1}, + {&__pyx_kp_s_58, __pyx_k_58, sizeof(__pyx_k_58), 0, 0, 1, 0}, + {&__pyx_n_s_59, __pyx_k_59, sizeof(__pyx_k_59), 0, 0, 1, 1}, + {&__pyx_n_s_60, __pyx_k_60, sizeof(__pyx_k_60), 0, 0, 1, 1}, + {&__pyx_kp_u_61, __pyx_k_61, sizeof(__pyx_k_61), 0, 1, 0, 0}, + {&__pyx_kp_u_62, __pyx_k_62, sizeof(__pyx_k_62), 0, 1, 0, 0}, + {&__pyx_kp_u_63, __pyx_k_63, sizeof(__pyx_k_63), 0, 1, 0, 0}, + {&__pyx_kp_u_64, __pyx_k_64, sizeof(__pyx_k_64), 0, 1, 0, 0}, + {&__pyx_kp_u_65, __pyx_k_65, sizeof(__pyx_k_65), 0, 1, 0, 0}, + {&__pyx_kp_u_66, __pyx_k_66, sizeof(__pyx_k_66), 0, 1, 0, 0}, + {&__pyx_kp_u_67, __pyx_k_67, sizeof(__pyx_k_67), 0, 1, 0, 0}, + {&__pyx_kp_u_68, __pyx_k_68, sizeof(__pyx_k_68), 0, 1, 0, 0}, + {&__pyx_kp_u_69, __pyx_k_69, sizeof(__pyx_k_69), 0, 1, 0, 0}, + {&__pyx_kp_u_70, __pyx_k_70, sizeof(__pyx_k_70), 0, 1, 0, 0}, + {&__pyx_kp_u_71, __pyx_k_71, sizeof(__pyx_k_71), 0, 1, 0, 0}, + {&__pyx_kp_u_72, __pyx_k_72, sizeof(__pyx_k_72), 0, 1, 0, 0}, + {&__pyx_kp_u_73, __pyx_k_73, sizeof(__pyx_k_73), 0, 1, 0, 0}, + {&__pyx_kp_u_74, __pyx_k_74, sizeof(__pyx_k_74), 0, 1, 0, 0}, + {&__pyx_kp_u_75, __pyx_k_75, sizeof(__pyx_k_75), 0, 1, 0, 0}, + {&__pyx_kp_u_76, __pyx_k_76, sizeof(__pyx_k_76), 0, 1, 0, 0}, + {&__pyx_kp_u_77, __pyx_k_77, sizeof(__pyx_k_77), 0, 1, 0, 0}, + {&__pyx_kp_u_78, __pyx_k_78, sizeof(__pyx_k_78), 0, 1, 0, 0}, + {&__pyx_kp_u_79, __pyx_k_79, sizeof(__pyx_k_79), 0, 1, 0, 0}, + {&__pyx_kp_u_80, __pyx_k_80, sizeof(__pyx_k_80), 0, 1, 0, 0}, + {&__pyx_kp_u_81, __pyx_k_81, sizeof(__pyx_k_81), 0, 1, 0, 0}, + {&__pyx_kp_u_82, __pyx_k_82, sizeof(__pyx_k_82), 0, 1, 0, 0}, + {&__pyx_kp_u_83, __pyx_k_83, sizeof(__pyx_k_83), 0, 1, 0, 0}, + {&__pyx_kp_u_84, __pyx_k_84, sizeof(__pyx_k_84), 0, 1, 0, 0}, + {&__pyx_kp_u_85, __pyx_k_85, sizeof(__pyx_k_85), 0, 1, 0, 0}, + {&__pyx_kp_u_86, __pyx_k_86, sizeof(__pyx_k_86), 0, 1, 0, 0}, + {&__pyx_kp_u_87, __pyx_k_87, sizeof(__pyx_k_87), 0, 1, 0, 0}, + {&__pyx_kp_u_88, __pyx_k_88, sizeof(__pyx_k_88), 0, 1, 0, 0}, + {&__pyx_kp_u_89, __pyx_k_89, sizeof(__pyx_k_89), 0, 1, 0, 0}, + {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0}, + {&__pyx_kp_u_90, __pyx_k_90, sizeof(__pyx_k_90), 0, 1, 0, 0}, + {&__pyx_kp_u_91, __pyx_k_91, sizeof(__pyx_k_91), 0, 1, 0, 0}, + {&__pyx_kp_u_92, __pyx_k_92, sizeof(__pyx_k_92), 0, 1, 0, 0}, + {&__pyx_kp_u_93, __pyx_k_93, sizeof(__pyx_k_93), 0, 1, 0, 0}, + {&__pyx_kp_u_94, __pyx_k_94, sizeof(__pyx_k_94), 0, 1, 0, 0}, + {&__pyx_kp_u_95, __pyx_k_95, sizeof(__pyx_k_95), 0, 1, 0, 0}, + {&__pyx_kp_u_96, __pyx_k_96, sizeof(__pyx_k_96), 0, 1, 0, 0}, + {&__pyx_kp_u_97, __pyx_k_97, sizeof(__pyx_k_97), 0, 1, 0, 0}, + {&__pyx_kp_u_98, __pyx_k_98, sizeof(__pyx_k_98), 0, 1, 0, 0}, + {&__pyx_kp_u_99, __pyx_k_99, sizeof(__pyx_k_99), 0, 1, 0, 0}, + {&__pyx_n_s__MT19937, __pyx_k__MT19937, sizeof(__pyx_k__MT19937), 0, 0, 1, 1}, + {&__pyx_n_s__RandomState, __pyx_k__RandomState, sizeof(__pyx_k__RandomState), 0, 0, 1, 1}, + {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1}, + {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1}, + {&__pyx_n_s____RandomState_ctor, __pyx_k____RandomState_ctor, sizeof(__pyx_k____RandomState_ctor), 0, 0, 1, 1}, + {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1}, + {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1}, + {&__pyx_n_s___rand, __pyx_k___rand, sizeof(__pyx_k___rand), 0, 0, 1, 1}, + {&__pyx_n_s__a, __pyx_k__a, sizeof(__pyx_k__a), 0, 0, 1, 1}, + {&__pyx_n_s__add, __pyx_k__add, sizeof(__pyx_k__add), 0, 0, 1, 1}, + {&__pyx_n_s__alpha, __pyx_k__alpha, sizeof(__pyx_k__alpha), 0, 0, 1, 1}, + {&__pyx_n_s__any, __pyx_k__any, sizeof(__pyx_k__any), 0, 0, 1, 1}, + {&__pyx_n_s__arange, __pyx_k__arange, sizeof(__pyx_k__arange), 0, 0, 1, 1}, + {&__pyx_n_s__array, __pyx_k__array, sizeof(__pyx_k__array), 0, 0, 1, 1}, + {&__pyx_n_s__asarray, __pyx_k__asarray, sizeof(__pyx_k__asarray), 0, 0, 1, 1}, + {&__pyx_n_s__b, __pyx_k__b, sizeof(__pyx_k__b), 0, 0, 1, 1}, + {&__pyx_n_s__beta, __pyx_k__beta, sizeof(__pyx_k__beta), 0, 0, 1, 1}, + {&__pyx_n_s__binomial, __pyx_k__binomial, sizeof(__pyx_k__binomial), 0, 0, 1, 1}, + {&__pyx_n_s__bytes, __pyx_k__bytes, sizeof(__pyx_k__bytes), 0, 0, 1, 1}, + {&__pyx_n_s__chisquare, __pyx_k__chisquare, sizeof(__pyx_k__chisquare), 0, 0, 1, 1}, + {&__pyx_n_s__copy, __pyx_k__copy, sizeof(__pyx_k__copy), 0, 0, 1, 1}, + {&__pyx_n_s__cov, __pyx_k__cov, sizeof(__pyx_k__cov), 0, 0, 1, 1}, + {&__pyx_n_s__data, __pyx_k__data, sizeof(__pyx_k__data), 0, 0, 1, 1}, + {&__pyx_n_s__dataptr, __pyx_k__dataptr, sizeof(__pyx_k__dataptr), 0, 0, 1, 1}, + {&__pyx_n_s__df, __pyx_k__df, sizeof(__pyx_k__df), 0, 0, 1, 1}, + {&__pyx_n_s__dfden, __pyx_k__dfden, sizeof(__pyx_k__dfden), 0, 0, 1, 1}, + {&__pyx_n_s__dfnum, __pyx_k__dfnum, sizeof(__pyx_k__dfnum), 0, 0, 1, 1}, + {&__pyx_n_s__dimensions, __pyx_k__dimensions, sizeof(__pyx_k__dimensions), 0, 0, 1, 1}, + {&__pyx_n_s__dirichlet, __pyx_k__dirichlet, sizeof(__pyx_k__dirichlet), 0, 0, 1, 1}, + {&__pyx_n_s__dot, __pyx_k__dot, sizeof(__pyx_k__dot), 0, 0, 1, 1}, + {&__pyx_n_s__empty, __pyx_k__empty, sizeof(__pyx_k__empty), 0, 0, 1, 1}, + {&__pyx_n_s__equal, __pyx_k__equal, sizeof(__pyx_k__equal), 0, 0, 1, 1}, + {&__pyx_n_s__exponential, __pyx_k__exponential, sizeof(__pyx_k__exponential), 0, 0, 1, 1}, + {&__pyx_n_s__f, __pyx_k__f, sizeof(__pyx_k__f), 0, 0, 1, 1}, + {&__pyx_n_s__float64, __pyx_k__float64, sizeof(__pyx_k__float64), 0, 0, 1, 1}, + {&__pyx_n_s__gamma, __pyx_k__gamma, sizeof(__pyx_k__gamma), 0, 0, 1, 1}, + {&__pyx_n_s__gauss, __pyx_k__gauss, sizeof(__pyx_k__gauss), 0, 0, 1, 1}, + {&__pyx_n_s__geometric, __pyx_k__geometric, sizeof(__pyx_k__geometric), 0, 0, 1, 1}, + {&__pyx_n_s__get_state, __pyx_k__get_state, sizeof(__pyx_k__get_state), 0, 0, 1, 1}, + {&__pyx_n_s__greater, __pyx_k__greater, sizeof(__pyx_k__greater), 0, 0, 1, 1}, + {&__pyx_n_s__greater_equal, __pyx_k__greater_equal, sizeof(__pyx_k__greater_equal), 0, 0, 1, 1}, + {&__pyx_n_s__gumbel, __pyx_k__gumbel, sizeof(__pyx_k__gumbel), 0, 0, 1, 1}, + {&__pyx_n_s__has_gauss, __pyx_k__has_gauss, sizeof(__pyx_k__has_gauss), 0, 0, 1, 1}, + {&__pyx_n_s__high, __pyx_k__high, sizeof(__pyx_k__high), 0, 0, 1, 1}, + {&__pyx_n_s__hypergeometric, __pyx_k__hypergeometric, sizeof(__pyx_k__hypergeometric), 0, 0, 1, 1}, + {&__pyx_n_s__integer, __pyx_k__integer, sizeof(__pyx_k__integer), 0, 0, 1, 1}, + {&__pyx_n_s__internal_state, __pyx_k__internal_state, sizeof(__pyx_k__internal_state), 0, 0, 1, 1}, + {&__pyx_n_s__kappa, __pyx_k__kappa, sizeof(__pyx_k__kappa), 0, 0, 1, 1}, + {&__pyx_n_s__key, __pyx_k__key, sizeof(__pyx_k__key), 0, 0, 1, 1}, + {&__pyx_n_s__lam, __pyx_k__lam, sizeof(__pyx_k__lam), 0, 0, 1, 1}, + {&__pyx_n_s__laplace, __pyx_k__laplace, sizeof(__pyx_k__laplace), 0, 0, 1, 1}, + {&__pyx_n_s__left, __pyx_k__left, sizeof(__pyx_k__left), 0, 0, 1, 1}, + {&__pyx_n_s__less, __pyx_k__less, sizeof(__pyx_k__less), 0, 0, 1, 1}, + {&__pyx_n_s__less_equal, __pyx_k__less_equal, sizeof(__pyx_k__less_equal), 0, 0, 1, 1}, + {&__pyx_n_s__loc, __pyx_k__loc, sizeof(__pyx_k__loc), 0, 0, 1, 1}, + {&__pyx_n_s__logistic, __pyx_k__logistic, sizeof(__pyx_k__logistic), 0, 0, 1, 1}, + {&__pyx_n_s__lognormal, __pyx_k__lognormal, sizeof(__pyx_k__lognormal), 0, 0, 1, 1}, + {&__pyx_n_s__logseries, __pyx_k__logseries, sizeof(__pyx_k__logseries), 0, 0, 1, 1}, + {&__pyx_n_s__low, __pyx_k__low, sizeof(__pyx_k__low), 0, 0, 1, 1}, + {&__pyx_n_s__mean, __pyx_k__mean, sizeof(__pyx_k__mean), 0, 0, 1, 1}, + {&__pyx_n_s__mode, __pyx_k__mode, sizeof(__pyx_k__mode), 0, 0, 1, 1}, + {&__pyx_n_s__mu, __pyx_k__mu, sizeof(__pyx_k__mu), 0, 0, 1, 1}, + {&__pyx_n_s__multinomial, __pyx_k__multinomial, sizeof(__pyx_k__multinomial), 0, 0, 1, 1}, + {&__pyx_n_s__multiply, __pyx_k__multiply, sizeof(__pyx_k__multiply), 0, 0, 1, 1}, + {&__pyx_n_s__multivariate_normal, __pyx_k__multivariate_normal, sizeof(__pyx_k__multivariate_normal), 0, 0, 1, 1}, + {&__pyx_n_s__n, __pyx_k__n, sizeof(__pyx_k__n), 0, 0, 1, 1}, + {&__pyx_n_s__nbad, __pyx_k__nbad, sizeof(__pyx_k__nbad), 0, 0, 1, 1}, + {&__pyx_n_s__nd, __pyx_k__nd, sizeof(__pyx_k__nd), 0, 0, 1, 1}, + {&__pyx_n_s__negative_binomial, __pyx_k__negative_binomial, sizeof(__pyx_k__negative_binomial), 0, 0, 1, 1}, + {&__pyx_n_s__ngood, __pyx_k__ngood, sizeof(__pyx_k__ngood), 0, 0, 1, 1}, + {&__pyx_n_s__nonc, __pyx_k__nonc, sizeof(__pyx_k__nonc), 0, 0, 1, 1}, + {&__pyx_n_s__noncentral_f, __pyx_k__noncentral_f, sizeof(__pyx_k__noncentral_f), 0, 0, 1, 1}, + {&__pyx_n_s__normal, __pyx_k__normal, sizeof(__pyx_k__normal), 0, 0, 1, 1}, + {&__pyx_n_s__np, __pyx_k__np, sizeof(__pyx_k__np), 0, 0, 1, 1}, + {&__pyx_n_s__nsample, __pyx_k__nsample, sizeof(__pyx_k__nsample), 0, 0, 1, 1}, + {&__pyx_n_s__numpy, __pyx_k__numpy, sizeof(__pyx_k__numpy), 0, 0, 1, 1}, + {&__pyx_n_s__p, __pyx_k__p, sizeof(__pyx_k__p), 0, 0, 1, 1}, + {&__pyx_n_s__pareto, __pyx_k__pareto, sizeof(__pyx_k__pareto), 0, 0, 1, 1}, + {&__pyx_n_s__permutation, __pyx_k__permutation, sizeof(__pyx_k__permutation), 0, 0, 1, 1}, + {&__pyx_n_s__poisson, __pyx_k__poisson, sizeof(__pyx_k__poisson), 0, 0, 1, 1}, + {&__pyx_n_s__pos, __pyx_k__pos, sizeof(__pyx_k__pos), 0, 0, 1, 1}, + {&__pyx_n_s__power, __pyx_k__power, sizeof(__pyx_k__power), 0, 0, 1, 1}, + {&__pyx_n_s__pvals, __pyx_k__pvals, sizeof(__pyx_k__pvals), 0, 0, 1, 1}, + {&__pyx_n_s__rand, __pyx_k__rand, sizeof(__pyx_k__rand), 0, 0, 1, 1}, + {&__pyx_n_s__randint, __pyx_k__randint, sizeof(__pyx_k__randint), 0, 0, 1, 1}, + {&__pyx_n_s__randn, __pyx_k__randn, sizeof(__pyx_k__randn), 0, 0, 1, 1}, + {&__pyx_n_s__random, __pyx_k__random, sizeof(__pyx_k__random), 0, 0, 1, 1}, + {&__pyx_n_s__random_integers, __pyx_k__random_integers, sizeof(__pyx_k__random_integers), 0, 0, 1, 1}, + {&__pyx_n_s__random_sample, __pyx_k__random_sample, sizeof(__pyx_k__random_sample), 0, 0, 1, 1}, + {&__pyx_n_s__rayleigh, __pyx_k__rayleigh, sizeof(__pyx_k__rayleigh), 0, 0, 1, 1}, + {&__pyx_n_s__reduce, __pyx_k__reduce, sizeof(__pyx_k__reduce), 0, 0, 1, 1}, + {&__pyx_n_s__right, __pyx_k__right, sizeof(__pyx_k__right), 0, 0, 1, 1}, + {&__pyx_n_s__scale, __pyx_k__scale, sizeof(__pyx_k__scale), 0, 0, 1, 1}, + {&__pyx_n_s__seed, __pyx_k__seed, sizeof(__pyx_k__seed), 0, 0, 1, 1}, + {&__pyx_n_s__set_state, __pyx_k__set_state, sizeof(__pyx_k__set_state), 0, 0, 1, 1}, + {&__pyx_n_s__shape, __pyx_k__shape, sizeof(__pyx_k__shape), 0, 0, 1, 1}, + {&__pyx_n_s__shuffle, __pyx_k__shuffle, sizeof(__pyx_k__shuffle), 0, 0, 1, 1}, + {&__pyx_n_s__sigma, __pyx_k__sigma, sizeof(__pyx_k__sigma), 0, 0, 1, 1}, + {&__pyx_n_s__size, __pyx_k__size, sizeof(__pyx_k__size), 0, 0, 1, 1}, + {&__pyx_n_s__sqrt, __pyx_k__sqrt, sizeof(__pyx_k__sqrt), 0, 0, 1, 1}, + {&__pyx_n_s__standard_cauchy, __pyx_k__standard_cauchy, sizeof(__pyx_k__standard_cauchy), 0, 0, 1, 1}, + {&__pyx_n_s__standard_gamma, __pyx_k__standard_gamma, sizeof(__pyx_k__standard_gamma), 0, 0, 1, 1}, + {&__pyx_n_s__standard_normal, __pyx_k__standard_normal, sizeof(__pyx_k__standard_normal), 0, 0, 1, 1}, + {&__pyx_n_s__standard_t, __pyx_k__standard_t, sizeof(__pyx_k__standard_t), 0, 0, 1, 1}, + {&__pyx_n_s__subtract, __pyx_k__subtract, sizeof(__pyx_k__subtract), 0, 0, 1, 1}, + {&__pyx_n_s__svd, __pyx_k__svd, sizeof(__pyx_k__svd), 0, 0, 1, 1}, + {&__pyx_n_s__tomaxint, __pyx_k__tomaxint, sizeof(__pyx_k__tomaxint), 0, 0, 1, 1}, + {&__pyx_n_s__triangular, __pyx_k__triangular, sizeof(__pyx_k__triangular), 0, 0, 1, 1}, + {&__pyx_n_s__uint, __pyx_k__uint, sizeof(__pyx_k__uint), 0, 0, 1, 1}, + {&__pyx_n_s__uint32, __pyx_k__uint32, sizeof(__pyx_k__uint32), 0, 0, 1, 1}, + {&__pyx_n_s__uniform, __pyx_k__uniform, sizeof(__pyx_k__uniform), 0, 0, 1, 1}, + {&__pyx_n_s__vonmises, __pyx_k__vonmises, sizeof(__pyx_k__vonmises), 0, 0, 1, 1}, + {&__pyx_n_s__wald, __pyx_k__wald, sizeof(__pyx_k__wald), 0, 0, 1, 1}, + {&__pyx_n_s__weibull, __pyx_k__weibull, sizeof(__pyx_k__weibull), 0, 0, 1, 1}, + {&__pyx_n_s__zeros, __pyx_k__zeros, sizeof(__pyx_k__zeros), 0, 0, 1, 1}, + {&__pyx_n_s__zipf, __pyx_k__zipf, sizeof(__pyx_k__zipf), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_kp_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_kp_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitGlobals(void) { - __pyx_int_624 = PyInt_FromLong(624); if (unlikely(!__pyx_int_624)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + __pyx_int_624 = PyInt_FromLong(624); if (unlikely(!__pyx_int_624)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; return 0; __pyx_L1_error:; return -1; @@ -19221,20 +19387,21 @@ PyMODINIT_FUNC PyInit_mtrand(void) #endif { - PyObject *__pyx_1 = 0; PyObject *__pyx_t_1 = NULL; - __pyx_init_filenames(); - #ifdef CYTHON_REFNANNY - void* __pyx_refchk = NULL; - __Pyx_Refnanny = __Pyx_ImportRefcountAPI("refnanny"); - if (!__Pyx_Refnanny) { + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + #if CYTHON_REFNANNY + void* __pyx_refnanny = NULL; + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); + if (!__Pyx_RefNanny) { PyErr_Clear(); - __Pyx_Refnanny = __Pyx_ImportRefcountAPI("Cython.Runtime.refnanny"); - if (!__Pyx_Refnanny) - Py_FatalError("failed to import refnanny module"); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); } - __pyx_refchk = __Pyx_Refnanny->NewContext("PyMODINIT_FUNC PyInit_mtrand(void)", __LINE__, __FILE__); + __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_mtrand(void)", __LINE__, __FILE__); #endif + __pyx_init_filenames(); __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION < 3 __pyx_empty_bytes = PyString_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -19261,21 +19428,20 @@ __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + /*--- Initialize various global constants etc. ---*/ + if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_module_is_main_mtrand) { - if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_kp___main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; } - /*--- Initialize various global constants etc. ---*/ - if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Builtin init code ---*/ if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_skip_dispatch = 0; /*--- Global init code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ - __pyx_ptype_6mtrand_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr)); if (unlikely(!__pyx_ptype_6mtrand_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6mtrand_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject)); if (unlikely(!__pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6mtrand_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject)); if (unlikely(!__pyx_ptype_6mtrand_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6mtrand_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject)); if (unlikely(!__pyx_ptype_6mtrand_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6mtrand_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_6mtrand_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6mtrand_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6mtrand_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_6mtrand_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6mtrand_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_6mtrand_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyType_Ready(&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_SetAttrString(__pyx_m, "RandomState", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState; @@ -19299,10 +19465,10 @@ * * cdef object cont0_array(rk_state *state, rk_cont0 func, object size): */ - __pyx_1 = __Pyx_Import(__pyx_kp_numpy, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - if (PyObject_SetAttr(__pyx_m, __pyx_kp_np, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":893 * return bytestring @@ -19313,14 +19479,14 @@ */ __pyx_t_1 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_k_3 = __pyx_t_1; + __pyx_k_5 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GIVEREF(__pyx_k_3); __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_k_4 = __pyx_t_1; + __pyx_k_6 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GIVEREF(__pyx_k_4); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1190 * return cont0_array(self.internal_state, rk_gauss, size) @@ -19331,14 +19497,14 @@ */ __pyx_t_1 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_k_5 = __pyx_t_1; + __pyx_k_7 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GIVEREF(__pyx_k_5); __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_k_6 = __pyx_t_1; + __pyx_k_8 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GIVEREF(__pyx_k_6); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1349 * return cont2_array(self.internal_state, rk_beta, size, oa, ob) @@ -19349,9 +19515,9 @@ */ __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_k_7 = __pyx_t_1; + __pyx_k_12 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GIVEREF(__pyx_k_7); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1513 * return cont1_array(self.internal_state, rk_standard_gamma, size, oshape) @@ -19362,9 +19528,9 @@ */ __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_k_8 = __pyx_t_1; + __pyx_k_14 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GIVEREF(__pyx_k_8); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2529 * return cont1_array(self.internal_state, rk_power, size, oa) @@ -19375,14 +19541,14 @@ */ __pyx_t_1 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_k_9 = __pyx_t_1; + __pyx_k_23 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GIVEREF(__pyx_k_9); __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_k_10 = __pyx_t_1; + __pyx_k_24 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GIVEREF(__pyx_k_10); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2619 * return cont2_array(self.internal_state, rk_laplace, size, oloc, oscale) @@ -19393,14 +19559,14 @@ */ __pyx_t_1 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_k_11 = __pyx_t_1; + __pyx_k_25 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GIVEREF(__pyx_k_11); __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_k_12 = __pyx_t_1; + __pyx_k_26 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GIVEREF(__pyx_k_12); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2743 * return cont2_array(self.internal_state, rk_gumbel, size, oloc, oscale) @@ -19411,14 +19577,14 @@ */ __pyx_t_1 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_k_13 = __pyx_t_1; + __pyx_k_27 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GIVEREF(__pyx_k_13); __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_k_14 = __pyx_t_1; + __pyx_k_28 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GIVEREF(__pyx_k_14); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2831 * return cont2_array(self.internal_state, rk_logistic, size, oloc, oscale) @@ -19429,14 +19595,14 @@ */ __pyx_t_1 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_k_15 = __pyx_t_1; + __pyx_k_29 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GIVEREF(__pyx_k_15); __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_k_16 = __pyx_t_1; + __pyx_k_30 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GIVEREF(__pyx_k_16); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2962 * return cont2_array(self.internal_state, rk_lognormal, size, omean, osigma) @@ -19447,9 +19613,9 @@ */ __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_k_17 = __pyx_t_1; + __pyx_k_33 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GIVEREF(__pyx_k_17); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3411 * on, op) @@ -19460,9 +19626,9 @@ */ __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_k_18 = __pyx_t_1; + __pyx_k_43 = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GIVEREF(__pyx_k_18); /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4236 * return arr @@ -19473,7 +19639,7 @@ */ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6mtrand_RandomState)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_kp__rand, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_s___rand, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4237 @@ -19483,13 +19649,13 @@ * get_state = _rand.get_state * set_state = _rand.set_state */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_seed); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_seed, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__seed); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__seed, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4238 * _rand = RandomState() @@ -19498,12 +19664,12 @@ * set_state = _rand.set_state * random_sample = _rand.random_sample */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_get_state); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__get_state); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_get_state, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__get_state, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4239 @@ -19513,13 +19679,13 @@ * random_sample = _rand.random_sample * randint = _rand.randint */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_set_state); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_set_state, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__set_state); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__set_state, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4240 * get_state = _rand.get_state @@ -19528,12 +19694,12 @@ * randint = _rand.randint * bytes = _rand.bytes */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_random_sample); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__random_sample); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_random_sample, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__random_sample, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4241 @@ -19543,13 +19709,13 @@ * bytes = _rand.bytes * uniform = _rand.uniform */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_randint); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_randint, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__randint); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__randint, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4242 * random_sample = _rand.random_sample @@ -19558,12 +19724,12 @@ * uniform = _rand.uniform * rand = _rand.rand */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_bytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__bytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_bytes, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__bytes, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4243 @@ -19573,13 +19739,13 @@ * rand = _rand.rand * randn = _rand.randn */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_uniform); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_uniform, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__uniform); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__uniform, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4244 * bytes = _rand.bytes @@ -19588,12 +19754,12 @@ * randn = _rand.randn * random_integers = _rand.random_integers */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_rand, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__rand, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4245 @@ -19603,13 +19769,13 @@ * random_integers = _rand.random_integers * standard_normal = _rand.standard_normal */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_randn); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_randn, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__randn); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__randn, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4246 * rand = _rand.rand @@ -19618,12 +19784,12 @@ * standard_normal = _rand.standard_normal * normal = _rand.normal */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_random_integers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__random_integers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_random_integers, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__random_integers, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4247 @@ -19633,13 +19799,13 @@ * normal = _rand.normal * beta = _rand.beta */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_standard_normal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_standard_normal, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__standard_normal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__standard_normal, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4248 * random_integers = _rand.random_integers @@ -19648,12 +19814,12 @@ * beta = _rand.beta * exponential = _rand.exponential */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_normal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__normal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_normal, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__normal, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4249 @@ -19663,13 +19829,13 @@ * exponential = _rand.exponential * standard_exponential = _rand.standard_exponential */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_beta); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_beta, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__beta); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__beta, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4250 * normal = _rand.normal @@ -19678,12 +19844,12 @@ * standard_exponential = _rand.standard_exponential * standard_gamma = _rand.standard_gamma */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_exponential); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__exponential); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_exponential, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__exponential, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4251 @@ -19693,13 +19859,13 @@ * standard_gamma = _rand.standard_gamma * gamma = _rand.gamma */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_1, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s_59); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_59, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4252 * exponential = _rand.exponential @@ -19708,12 +19874,12 @@ * gamma = _rand.gamma * f = _rand.f */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_standard_gamma); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__standard_gamma); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_standard_gamma, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__standard_gamma, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4253 @@ -19723,13 +19889,13 @@ * f = _rand.f * noncentral_f = _rand.noncentral_f */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_gamma); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_gamma, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__gamma); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__gamma, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4254 * standard_gamma = _rand.standard_gamma @@ -19738,12 +19904,12 @@ * noncentral_f = _rand.noncentral_f * chisquare = _rand.chisquare */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_f, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__f, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4255 @@ -19753,13 +19919,13 @@ * chisquare = _rand.chisquare * noncentral_chisquare = _rand.noncentral_chisquare */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_noncentral_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_noncentral_f, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__noncentral_f); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__noncentral_f, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4256 * f = _rand.f @@ -19768,12 +19934,12 @@ * noncentral_chisquare = _rand.noncentral_chisquare * standard_cauchy = _rand.standard_cauchy */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_chisquare); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__chisquare); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_chisquare, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__chisquare, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4257 @@ -19783,13 +19949,13 @@ * standard_cauchy = _rand.standard_cauchy * standard_t = _rand.standard_t */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s_60); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_60, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4258 * chisquare = _rand.chisquare @@ -19798,12 +19964,12 @@ * standard_t = _rand.standard_t * vonmises = _rand.vonmises */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_standard_cauchy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__standard_cauchy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_standard_cauchy, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__standard_cauchy, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4259 @@ -19813,13 +19979,13 @@ * vonmises = _rand.vonmises * pareto = _rand.pareto */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_standard_t); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_standard_t, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__standard_t); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__standard_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4260 * standard_cauchy = _rand.standard_cauchy @@ -19828,12 +19994,12 @@ * pareto = _rand.pareto * weibull = _rand.weibull */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_vonmises); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__vonmises); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_vonmises, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__vonmises, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4261 @@ -19843,13 +20009,13 @@ * weibull = _rand.weibull * power = _rand.power */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_pareto); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_pareto, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__pareto); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__pareto, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4262 * vonmises = _rand.vonmises @@ -19858,12 +20024,12 @@ * power = _rand.power * laplace = _rand.laplace */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_weibull); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__weibull); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_weibull, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__weibull, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4263 @@ -19873,13 +20039,13 @@ * laplace = _rand.laplace * gumbel = _rand.gumbel */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_power); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_power, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__power); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__power, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4264 * weibull = _rand.weibull @@ -19888,12 +20054,12 @@ * gumbel = _rand.gumbel * logistic = _rand.logistic */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_laplace); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__laplace); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_laplace, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__laplace, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4265 @@ -19903,13 +20069,13 @@ * logistic = _rand.logistic * lognormal = _rand.lognormal */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_gumbel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_gumbel, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__gumbel); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__gumbel, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4266 * laplace = _rand.laplace @@ -19918,12 +20084,12 @@ * lognormal = _rand.lognormal * rayleigh = _rand.rayleigh */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_logistic); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__logistic); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_logistic, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__logistic, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4267 @@ -19933,13 +20099,13 @@ * rayleigh = _rand.rayleigh * wald = _rand.wald */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_lognormal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_lognormal, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__lognormal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__lognormal, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4268 * logistic = _rand.logistic @@ -19948,12 +20114,12 @@ * wald = _rand.wald * triangular = _rand.triangular */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_rayleigh); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__rayleigh); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_rayleigh, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__rayleigh, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4269 @@ -19963,13 +20129,13 @@ * triangular = _rand.triangular * */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_wald); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_wald, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__wald); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__wald, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4270 * rayleigh = _rand.rayleigh @@ -19978,12 +20144,12 @@ * * binomial = _rand.binomial */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_triangular); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__triangular); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_triangular, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__triangular, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4272 @@ -19993,13 +20159,13 @@ * negative_binomial = _rand.negative_binomial * poisson = _rand.poisson */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_binomial); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_binomial, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__binomial); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__binomial, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4273 * @@ -20008,12 +20174,12 @@ * poisson = _rand.poisson * zipf = _rand.zipf */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_negative_binomial); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__negative_binomial); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_negative_binomial, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__negative_binomial, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4274 @@ -20023,13 +20189,13 @@ * zipf = _rand.zipf * geometric = _rand.geometric */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_poisson); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_poisson, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__poisson); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__poisson, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4275 * negative_binomial = _rand.negative_binomial @@ -20038,12 +20204,12 @@ * geometric = _rand.geometric * hypergeometric = _rand.hypergeometric */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_zipf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__zipf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_zipf, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__zipf, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4276 @@ -20053,13 +20219,13 @@ * hypergeometric = _rand.hypergeometric * logseries = _rand.logseries */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_geometric); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_geometric, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__geometric); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__geometric, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4277 * zipf = _rand.zipf @@ -20068,12 +20234,12 @@ * logseries = _rand.logseries * */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_hypergeometric); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__hypergeometric); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_hypergeometric, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__hypergeometric, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4278 @@ -20083,13 +20249,13 @@ * * multivariate_normal = _rand.multivariate_normal */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_logseries); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_logseries, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__logseries); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__logseries, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4280 * logseries = _rand.logseries @@ -20098,12 +20264,12 @@ * multinomial = _rand.multinomial * dirichlet = _rand.dirichlet */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_multivariate_normal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__multivariate_normal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_multivariate_normal, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__multivariate_normal, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4281 @@ -20113,13 +20279,13 @@ * dirichlet = _rand.dirichlet * */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_multinomial); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_multinomial, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__multinomial); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__multinomial, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4282 * multivariate_normal = _rand.multivariate_normal @@ -20128,12 +20294,12 @@ * * shuffle = _rand.shuffle */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_dirichlet); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__dirichlet); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_dirichlet, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__dirichlet, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4284 @@ -20142,30 +20308,511 @@ * shuffle = _rand.shuffle # <<<<<<<<<<<<<< * permutation = _rand.permutation */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_shuffle); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_shuffle, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__shuffle); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__shuffle, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4285 * * shuffle = _rand.shuffle * permutation = _rand.permutation # <<<<<<<<<<<<<< */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__rand); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_1); - __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_permutation); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___rand); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__permutation); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_kp_permutation, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s__permutation, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1 + * # mtrand.pyx -- A Pyrex wrapper of Jean-Sebastien Roy's RandomKit # <<<<<<<<<<<<<< + * # + * # Copyright 2005 Robert Kern (robert.kern at gmail.com) + */ + __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__seed); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_61), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__get_state); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_62), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__set_state); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_63), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__random_sample); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_64), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__tomaxint); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_65), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__randint); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_66), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__bytes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_67), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__uniform); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_68), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__rand); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_69), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__randn); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_70), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__random_integers); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_71), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__standard_normal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_72), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__normal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_73), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__beta); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_74), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__exponential); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_75), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s_59); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_76), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__standard_gamma); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_77), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__gamma); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_78), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__f); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_79), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__noncentral_f); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_80), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__chisquare); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_81), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s_60); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_82), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__standard_cauchy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_83), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__standard_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_84), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__vonmises); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_85), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__pareto); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_86), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__weibull); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_87), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__power); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_88), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__laplace); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_89), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__gumbel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_90), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__logistic); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_91), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__lognormal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_92), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__rayleigh); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_93), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__wald); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_94), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__triangular); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_95), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__binomial); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_96), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__negative_binomial); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_97), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__poisson); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_98), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__zipf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_99), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__geometric); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_100), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__hypergeometric); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_101), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__logseries); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_102), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__multivariate_normal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_103), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__multinomial); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_104), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__dirichlet); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_105), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__shuffle); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_106), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__RandomState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__permutation); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_107), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_1); __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { __Pyx_AddTraceback("init mtrand"); Py_DECREF(__pyx_m); __pyx_m = 0; @@ -20173,7 +20820,7 @@ PyErr_SetString(PyExc_ImportError, "init mtrand"); } __pyx_L0:; - __Pyx_FinishRefcountContext(); + __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else @@ -20315,42 +20962,90 @@ } +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + #if PY_VERSION_HEX < 0x02050000 + "need more than %d value%s to unpack", (int)index, + #else + "need more than %zd value%s to unpack", index, + #endif + (index == 1) ? "" : "s"); +} + +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void) { + PyErr_SetString(PyExc_ValueError, "too many values to unpack"); +} + +static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) { + PyObject *item; + if (!(item = PyIter_Next(iter))) { + if (!PyErr_Occurred()) { + __Pyx_RaiseNeedMoreValuesError(index); + } + } + return item; +} + +static int __Pyx_EndUnpack(PyObject *iter) { + PyObject *item; + if ((item = PyIter_Next(iter))) { + Py_DECREF(item); + __Pyx_RaiseTooManyValuesError(); + return -1; + } + else if (!PyErr_Occurred()) + return 0; + else + return -1; +} + static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *local_type, *local_value, *local_tb; PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; - PyErr_NormalizeException(type, value, tb); - if (PyErr_Occurred()) + PyErr_NormalizeException(&local_type, &local_value, &local_tb); + if (unlikely(tstate->curexc_type)) goto bad; - Py_INCREF(*type); - Py_INCREF(*value); - Py_INCREF(*tb); + #if PY_MAJOR_VERSION >= 3 + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + #endif + *type = local_type; + *value = local_value; + *tb = local_tb; + Py_INCREF(local_type); + Py_INCREF(local_value); + Py_INCREF(local_tb); tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; - tstate->exc_type = *type; - tstate->exc_value = *value; - tstate->exc_traceback = *tb; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; /* Make sure tstate is in a consistent state when we XDECREF - these objects (XDECREF may run arbitrary code). */ + these objects (XDECREF may run arbitrary code). */ Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); return 0; bad: - Py_XDECREF(*type); - Py_XDECREF(*value); - Py_XDECREF(*tb); + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); return -1; } -static INLINE int __Pyx_CheckKeywordStrings( +static CYTHON_INLINE int __Pyx_CheckKeywordStrings( PyObject *kwdict, const char* function_name, int kw_allowed) @@ -20384,20 +21079,20 @@ return 0; } -static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - if (!type) { +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { PyErr_Format(PyExc_SystemError, "Missing type object"); return 0; } - if (obj == Py_None || PyObject_TypeCheck(obj, type)) + if (likely(PyObject_TypeCheck(obj, type))) return 1; - PyErr_Format(PyExc_TypeError, "Cannot convert %s to %s", - Py_TYPE(obj)->tp_name, type->tp_name); + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); return 0; } -static INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { PyThreadState *tstate = PyThreadState_GET(); *type = tstate->exc_type; *value = tstate->exc_value; @@ -20462,6 +21157,34 @@ return result; } +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} + +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} + + +#if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { Py_XINCREF(type); Py_XINCREF(value); @@ -20517,6 +21240,7 @@ } #endif } + __Pyx_ErrRestore(type, value, tb); return; raise_error: @@ -20526,94 +21250,59 @@ return; } -static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); +#else /* Python 3+ */ -#if PY_MAJOR_VERSION >= 3 - /* Note: this is a temporary work-around to prevent crashes in Python 3.0 */ - if ((tstate->exc_type != NULL) & (tstate->exc_type != Py_None)) { - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - PyErr_NormalizeException(&type, &value, &tb); - PyErr_NormalizeException(&tmp_type, &tmp_value, &tmp_tb); - tstate->exc_type = 0; - tstate->exc_value = 0; - tstate->exc_traceback = 0; - PyException_SetContext(value, tmp_value); - Py_DECREF(tmp_type); - Py_XDECREF(tmp_tb); +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; } -#endif + if (value == Py_None) + value = 0; - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (!PyExceptionClass_Check(type)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } -static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; + PyErr_SetObject(type, value); - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -} - - -static INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { - PyErr_Format(PyExc_ValueError, - #if PY_VERSION_HEX < 0x02050000 - "need more than %d value%s to unpack", (int)index, - #else - "need more than %zd value%s to unpack", index, - #endif - (index == 1) ? "" : "s"); -} - -static INLINE void __Pyx_RaiseTooManyValuesError(void) { - PyErr_SetString(PyExc_ValueError, "too many values to unpack"); -} - -static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) { - PyObject *item; - if (!(item = PyIter_Next(iter))) { - if (!PyErr_Occurred()) { - __Pyx_RaiseNeedMoreValuesError(index); + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); } } - return item; -} -static int __Pyx_EndUnpack(PyObject *iter) { - PyObject *item; - if ((item = PyIter_Next(iter))) { - Py_DECREF(item); - __Pyx_RaiseTooManyValuesError(); - return -1; - } - else if (!PyErr_Occurred()) - return 0; - else - return -1; +bad: + return; } +#endif -static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { +static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { + const unsigned char neg_one = (unsigned char)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; if (sizeof(unsigned char) < sizeof(long)) { long val = __Pyx_PyInt_AsLong(x); if (unlikely(val != (long)(unsigned char)val)) { if (!unlikely(val == -1 && PyErr_Occurred())) { PyErr_SetString(PyExc_OverflowError, - (((unsigned char)-1) > ((unsigned char)0) && unlikely(val < 0)) ? + (is_unsigned && unlikely(val < 0)) ? "can't convert negative value to unsigned char" : "value too large to convert to unsigned char"); } @@ -20624,13 +21313,15 @@ return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); } -static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { +static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { + const unsigned short neg_one = (unsigned short)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; if (sizeof(unsigned short) < sizeof(long)) { long val = __Pyx_PyInt_AsLong(x); if (unlikely(val != (long)(unsigned short)val)) { if (!unlikely(val == -1 && PyErr_Occurred())) { PyErr_SetString(PyExc_OverflowError, - (((unsigned short)-1) > ((unsigned short)0) && unlikely(val < 0)) ? + (is_unsigned && unlikely(val < 0)) ? "can't convert negative value to unsigned short" : "value too large to convert to unsigned short"); } @@ -20641,13 +21332,15 @@ return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); } -static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { +static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { + const unsigned int neg_one = (unsigned int)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; if (sizeof(unsigned int) < sizeof(long)) { long val = __Pyx_PyInt_AsLong(x); if (unlikely(val != (long)(unsigned int)val)) { if (!unlikely(val == -1 && PyErr_Occurred())) { PyErr_SetString(PyExc_OverflowError, - (((unsigned int)-1) > ((unsigned int)0) && unlikely(val < 0)) ? + (is_unsigned && unlikely(val < 0)) ? "can't convert negative value to unsigned int" : "value too large to convert to unsigned int"); } @@ -20658,13 +21351,15 @@ return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); } -static INLINE char __Pyx_PyInt_AsChar(PyObject* x) { +static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) { + const char neg_one = (char)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; if (sizeof(char) < sizeof(long)) { long val = __Pyx_PyInt_AsLong(x); if (unlikely(val != (long)(char)val)) { if (!unlikely(val == -1 && PyErr_Occurred())) { PyErr_SetString(PyExc_OverflowError, - (((char)-1) > ((char)0) && unlikely(val < 0)) ? + (is_unsigned && unlikely(val < 0)) ? "can't convert negative value to char" : "value too large to convert to char"); } @@ -20675,13 +21370,15 @@ return (char)__Pyx_PyInt_AsLong(x); } -static INLINE short __Pyx_PyInt_AsShort(PyObject* x) { +static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) { + const short neg_one = (short)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; if (sizeof(short) < sizeof(long)) { long val = __Pyx_PyInt_AsLong(x); if (unlikely(val != (long)(short)val)) { if (!unlikely(val == -1 && PyErr_Occurred())) { PyErr_SetString(PyExc_OverflowError, - (((short)-1) > ((short)0) && unlikely(val < 0)) ? + (is_unsigned && unlikely(val < 0)) ? "can't convert negative value to short" : "value too large to convert to short"); } @@ -20692,13 +21389,15 @@ return (short)__Pyx_PyInt_AsLong(x); } -static INLINE int __Pyx_PyInt_AsInt(PyObject* x) { +static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) { + const int neg_one = (int)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; if (sizeof(int) < sizeof(long)) { long val = __Pyx_PyInt_AsLong(x); if (unlikely(val != (long)(int)val)) { if (!unlikely(val == -1 && PyErr_Occurred())) { PyErr_SetString(PyExc_OverflowError, - (((int)-1) > ((int)0) && unlikely(val < 0)) ? + (is_unsigned && unlikely(val < 0)) ? "can't convert negative value to int" : "value too large to convert to int"); } @@ -20709,13 +21408,15 @@ return (int)__Pyx_PyInt_AsLong(x); } -static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { +static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { + const signed char neg_one = (signed char)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; if (sizeof(signed char) < sizeof(long)) { long val = __Pyx_PyInt_AsLong(x); if (unlikely(val != (long)(signed char)val)) { if (!unlikely(val == -1 && PyErr_Occurred())) { PyErr_SetString(PyExc_OverflowError, - (((signed char)-1) > ((signed char)0) && unlikely(val < 0)) ? + (is_unsigned && unlikely(val < 0)) ? "can't convert negative value to signed char" : "value too large to convert to signed char"); } @@ -20726,13 +21427,15 @@ return (signed char)__Pyx_PyInt_AsSignedLong(x); } -static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { +static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { + const signed short neg_one = (signed short)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; if (sizeof(signed short) < sizeof(long)) { long val = __Pyx_PyInt_AsLong(x); if (unlikely(val != (long)(signed short)val)) { if (!unlikely(val == -1 && PyErr_Occurred())) { PyErr_SetString(PyExc_OverflowError, - (((signed short)-1) > ((signed short)0) && unlikely(val < 0)) ? + (is_unsigned && unlikely(val < 0)) ? "can't convert negative value to signed short" : "value too large to convert to signed short"); } @@ -20743,13 +21446,15 @@ return (signed short)__Pyx_PyInt_AsSignedLong(x); } -static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { +static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { + const signed int neg_one = (signed int)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; if (sizeof(signed int) < sizeof(long)) { long val = __Pyx_PyInt_AsLong(x); if (unlikely(val != (long)(signed int)val)) { if (!unlikely(val == -1 && PyErr_Occurred())) { PyErr_SetString(PyExc_OverflowError, - (((signed int)-1) > ((signed int)0) && unlikely(val < 0)) ? + (is_unsigned && unlikely(val < 0)) ? "can't convert negative value to signed int" : "value too large to convert to signed int"); } @@ -20760,11 +21465,13 @@ return (signed int)__Pyx_PyInt_AsSignedLong(x); } -static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { +static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { + const unsigned long neg_one = (unsigned long)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 if (likely(PyInt_Check(x))) { long val = PyInt_AS_LONG(x); - if (((unsigned long)-1) > ((unsigned long)0) && unlikely(val < 0)) { + if (is_unsigned && unlikely(val < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to unsigned long"); return (unsigned long)-1; @@ -20773,14 +21480,16 @@ } else #endif if (likely(PyLong_Check(x))) { - if (((unsigned long)-1) > ((unsigned long)0) && unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; + if (is_unsigned) { + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to unsigned long"); + return (unsigned long)-1; + } + return PyLong_AsUnsignedLong(x); + } else { + return PyLong_AsLong(x); } - return (((unsigned long)-1) < ((unsigned long)0)) ? - PyLong_AsLong(x) : - PyLong_AsUnsignedLong(x); } else { unsigned long val; PyObject *tmp = __Pyx_PyNumber_Int(x); @@ -20791,11 +21500,13 @@ } } -static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { +static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { + const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 if (likely(PyInt_Check(x))) { long val = PyInt_AS_LONG(x); - if (((unsigned PY_LONG_LONG)-1) > ((unsigned PY_LONG_LONG)0) && unlikely(val < 0)) { + if (is_unsigned && unlikely(val < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to unsigned PY_LONG_LONG"); return (unsigned PY_LONG_LONG)-1; @@ -20804,14 +21515,16 @@ } else #endif if (likely(PyLong_Check(x))) { - if (((unsigned PY_LONG_LONG)-1) > ((unsigned PY_LONG_LONG)0) && unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; + if (is_unsigned) { + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to unsigned PY_LONG_LONG"); + return (unsigned PY_LONG_LONG)-1; + } + return PyLong_AsUnsignedLongLong(x); + } else { + return PyLong_AsLongLong(x); } - return (((unsigned PY_LONG_LONG)-1) < ((unsigned PY_LONG_LONG)0)) ? - PyLong_AsLongLong(x) : - PyLong_AsUnsignedLongLong(x); } else { unsigned PY_LONG_LONG val; PyObject *tmp = __Pyx_PyNumber_Int(x); @@ -20822,11 +21535,13 @@ } } -static INLINE long __Pyx_PyInt_AsLong(PyObject* x) { +static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) { + const long neg_one = (long)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 if (likely(PyInt_Check(x))) { long val = PyInt_AS_LONG(x); - if (((long)-1) > ((long)0) && unlikely(val < 0)) { + if (is_unsigned && unlikely(val < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long)-1; @@ -20835,14 +21550,16 @@ } else #endif if (likely(PyLong_Check(x))) { - if (((long)-1) > ((long)0) && unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; + if (is_unsigned) { + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long)-1; + } + return PyLong_AsUnsignedLong(x); + } else { + return PyLong_AsLong(x); } - return (((long)-1) < ((long)0)) ? - PyLong_AsLong(x) : - PyLong_AsUnsignedLong(x); } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); @@ -20853,11 +21570,13 @@ } } -static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { +static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { + const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 if (likely(PyInt_Check(x))) { long val = PyInt_AS_LONG(x); - if (((PY_LONG_LONG)-1) > ((PY_LONG_LONG)0) && unlikely(val < 0)) { + if (is_unsigned && unlikely(val < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PY_LONG_LONG"); return (PY_LONG_LONG)-1; @@ -20866,14 +21585,16 @@ } else #endif if (likely(PyLong_Check(x))) { - if (((PY_LONG_LONG)-1) > ((PY_LONG_LONG)0) && unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; + if (is_unsigned) { + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to PY_LONG_LONG"); + return (PY_LONG_LONG)-1; + } + return PyLong_AsUnsignedLongLong(x); + } else { + return PyLong_AsLongLong(x); } - return (((PY_LONG_LONG)-1) < ((PY_LONG_LONG)0)) ? - PyLong_AsLongLong(x) : - PyLong_AsUnsignedLongLong(x); } else { PY_LONG_LONG val; PyObject *tmp = __Pyx_PyNumber_Int(x); @@ -20884,11 +21605,13 @@ } } -static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { +static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { + const signed long neg_one = (signed long)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 if (likely(PyInt_Check(x))) { long val = PyInt_AS_LONG(x); - if (((signed long)-1) > ((signed long)0) && unlikely(val < 0)) { + if (is_unsigned && unlikely(val < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to signed long"); return (signed long)-1; @@ -20897,14 +21620,16 @@ } else #endif if (likely(PyLong_Check(x))) { - if (((signed long)-1) > ((signed long)0) && unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; + if (is_unsigned) { + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to signed long"); + return (signed long)-1; + } + return PyLong_AsUnsignedLong(x); + } else { + return PyLong_AsLong(x); } - return (((signed long)-1) < ((signed long)0)) ? - PyLong_AsLong(x) : - PyLong_AsUnsignedLong(x); } else { signed long val; PyObject *tmp = __Pyx_PyNumber_Int(x); @@ -20915,11 +21640,13 @@ } } -static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { +static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { + const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 if (likely(PyInt_Check(x))) { long val = PyInt_AS_LONG(x); - if (((signed PY_LONG_LONG)-1) > ((signed PY_LONG_LONG)0) && unlikely(val < 0)) { + if (is_unsigned && unlikely(val < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to signed PY_LONG_LONG"); return (signed PY_LONG_LONG)-1; @@ -20928,14 +21655,16 @@ } else #endif if (likely(PyLong_Check(x))) { - if (((signed PY_LONG_LONG)-1) > ((signed PY_LONG_LONG)0) && unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; + if (is_unsigned) { + if (unlikely(Py_SIZE(x) < 0)) { + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to signed PY_LONG_LONG"); + return (signed PY_LONG_LONG)-1; + } + return PyLong_AsUnsignedLongLong(x); + } else { + return PyLong_AsLongLong(x); } - return (((signed PY_LONG_LONG)-1) < ((signed PY_LONG_LONG)0)) ? - PyLong_AsLongLong(x) : - PyLong_AsUnsignedLongLong(x); } else { signed PY_LONG_LONG val; PyObject *tmp = __Pyx_PyNumber_Int(x); @@ -20949,11 +21678,12 @@ #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, - long size) + long size, int strict) { PyObject *py_module = 0; PyObject *result = 0; PyObject *py_name = 0; + char warning[200]; py_module = __Pyx_ImportModule(module_name); if (!py_module) @@ -20978,9 +21708,15 @@ module_name, class_name); goto bad; } - if (((PyTypeObject *)result)->tp_basicsize != size) { + if (!strict && ((PyTypeObject *)result)->tp_basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), + "%s.%s size changed, may indicate binary incompatibility", + module_name, class_name); + PyErr_WarnEx(NULL, warning, 0); + } + else if (((PyTypeObject *)result)->tp_basicsize != size) { PyErr_Format(PyExc_ValueError, - "%s.%s does not appear to be the correct type object", + "%s.%s has the wrong size, try recompiling", module_name, class_name); goto bad; } @@ -21087,7 +21823,7 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 - if (t->is_unicode && (!t->is_identifier)) { + if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); @@ -21095,10 +21831,14 @@ *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else /* Python 3+ has unicode identifiers */ - if (t->is_identifier || (t->is_unicode && t->intern)) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->is_unicode) { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + if (t->is_unicode | t->is_str) { + if (t->intern) { + *t->p = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); + } else { + *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } @@ -21112,13 +21852,13 @@ /* Type Conversion Functions */ -static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { if (x == Py_True) return 1; else if ((x == Py_False) | (x == Py_None)) return 0; else return PyObject_IsTrue(x); } -static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; @@ -21164,7 +21904,7 @@ return res; } -static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject* x = PyNumber_Index(b); if (!x) return -1; @@ -21173,7 +21913,7 @@ return ival; } -static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { #if PY_VERSION_HEX < 0x02050000 if (ival <= LONG_MAX) return PyInt_FromLong((long)ival); @@ -21187,7 +21927,7 @@ #endif } -static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { +static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) { return (size_t)-1; From numpy-svn at scipy.org Sat Feb 20 21:46:46 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 20:46:46 -0600 (CST) Subject: [Numpy-svn] r8201 - trunk/numpy/matrixlib Message-ID: <20100221024646.529F0C7C059@scipy.org> Author: ptvirtan Date: 2010-02-20 20:46:46 -0600 (Sat, 20 Feb 2010) New Revision: 8201 Modified: trunk/numpy/matrixlib/defmatrix.py Log: 3K: matrixlib: adapt to changes in str.translate Modified: trunk/numpy/matrixlib/defmatrix.py =================================================================== --- trunk/numpy/matrixlib/defmatrix.py 2010-02-21 02:46:29 UTC (rev 8200) +++ trunk/numpy/matrixlib/defmatrix.py 2010-02-21 02:46:46 UTC (rev 8201) @@ -6,22 +6,34 @@ from numpy.core.numerictypes import issubdtype # make translation table -_table = [None]*256 -for k in range(256): - _table[k] = chr(k) -_table = ''.join(_table) - _numchars = '0123456789.-+jeEL' -_todelete = [] -for k in _table: - if k not in _numchars: - _todelete.append(k) -_todelete = ''.join(_todelete) -del k -def _eval(astr): - return eval(astr.translate(_table,_todelete)) +if sys.version_info[0] >= 3: + class _NumCharTable: + def __getitem__(self, i): + if chr(i) in _numchars: + return chr(i) + else: + return None + _table = _NumCharTable() + def _eval(astr): + return eval(astr.translate(_table)) +else: + _table = [None]*256 + for k in range(256): + _table[k] = chr(k) + _table = ''.join(_table) + _todelete = [] + for k in _table: + if k not in _numchars: + _todelete.append(k) + _todelete = ''.join(_todelete) + del k + + def _eval(astr): + return eval(astr.translate(_table,_todelete)) + def _convert_from_string(data): rows = data.split(';') newdata = [] From numpy-svn at scipy.org Sat Feb 20 21:47:14 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 20:47:14 -0600 (CST) Subject: [Numpy-svn] r8202 - trunk/numpy/core/tests Message-ID: <20100221024714.A855CC7C059@scipy.org> Author: ptvirtan Date: 2010-02-20 20:47:14 -0600 (Sat, 20 Feb 2010) New Revision: 8202 Modified: trunk/numpy/core/tests/test_numerictypes.py trunk/numpy/core/tests/test_records.py trunk/numpy/core/tests/test_regression.py Log: 3K: core: fix a few str vs bytes issues in tests Modified: trunk/numpy/core/tests/test_numerictypes.py =================================================================== --- trunk/numpy/core/tests/test_numerictypes.py 2010-02-21 02:46:46 UTC (rev 8201) +++ trunk/numpy/core/tests/test_numerictypes.py 2010-02-21 02:47:14 UTC (rev 8202) @@ -308,7 +308,10 @@ h = np.array(self._buffer, dtype=self._descr) self.assert_(h.dtype['Info']['value'].name == 'complex128') self.assert_(h.dtype['Info']['y2'].name == 'float64') - self.assert_(h.dtype['info']['Name'].name == 'unicode256') + if sys.version_info[0] >= 3: + self.assert_(h.dtype['info']['Name'].name == 'str256') + else: + self.assert_(h.dtype['info']['Name'].name == 'unicode256') self.assert_(h.dtype['info']['Value'].name == 'complex128') def test_nested2_descriptor(self): Modified: trunk/numpy/core/tests/test_records.py =================================================================== --- trunk/numpy/core/tests/test_records.py 2010-02-21 02:46:46 UTC (rev 8201) +++ trunk/numpy/core/tests/test_records.py 2010-02-21 02:47:14 UTC (rev 8202) @@ -11,17 +11,17 @@ def test_method_array(self): r = np.rec.array(asbytes('abcdefg') * 100, formats='i2,a3,i4', shape=3, byteorder='big') - assert_equal(r[1].item(), (25444, 'efg', 1633837924)) + assert_equal(r[1].item(), (25444, asbytes('efg'), 1633837924)) def test_method_array2(self): r = np.rec.array([(1, 11, 'a'), (2, 22, 'b'), (3, 33, 'c'), (4, 44, 'd'), (5, 55, 'ex'), (6, 66, 'f'), (7, 77, 'g')], formats='u1,f4,a1') - assert_equal(r[1].item(), (2, 22.0, 'b')) + assert_equal(r[1].item(), (2, 22.0, asbytes('b'))) def test_recarray_slices(self): r = np.rec.array([(1, 11, 'a'), (2, 22, 'b'), (3, 33, 'c'), (4, 44, 'd'), (5, 55, 'ex'), (6, 66, 'f'), (7, 77, 'g')], formats='u1,f4,a1') - assert_equal(r[1::2][1].item(), (4, 44.0, 'd')) + assert_equal(r[1::2][1].item(), (4, 44.0, asbytes('d'))) def test_recarray_fromarrays(self): x1 = np.array([1, 2, 3, 4]) Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2010-02-21 02:46:46 UTC (rev 8201) +++ trunk/numpy/core/tests/test_regression.py 2010-02-21 02:47:14 UTC (rev 8202) @@ -6,7 +6,7 @@ from os import path from numpy.testing import * from numpy.testing.utils import _assert_valid_refcount -from numpy.compat import asbytes, asunicode +from numpy.compat import asbytes, asunicode, asbytes_nested import numpy as np if sys.version_info[0] >= 3: @@ -284,9 +284,9 @@ def test_chararray_rstrip(self,level=rlevel): """Ticket #222""" x = np.chararray((1,),5) - x[0] = 'a ' + x[0] = asbytes('a ') x = x.rstrip() - assert_equal(x[0], 'a') + assert_equal(x[0], asbytes('a')) def test_object_array_shape(self,level=rlevel): """Ticket #239""" @@ -438,7 +438,7 @@ def test_numeric_carray_compare(self, level=rlevel): """Ticket #341""" - assert_equal(np.array([ 'X' ], 'c'),'X') + assert_equal(np.array(['X'], 'c'), asbytes('X')) def test_string_array_size(self, level=rlevel): """Ticket #342""" @@ -988,7 +988,7 @@ def test_char_array_creation(self, level=rlevel): a = np.array('123', dtype='c') - b = np.array(['1','2','3']) + b = np.array(asbytes_nested(['1','2','3'])) assert_equal(a,b) def test_unaligned_unicode_access(self, level=rlevel) : @@ -997,7 +997,10 @@ msg = 'unicode offset: %d chars'%i t = np.dtype([('a','S%d'%i),('b','U2')]) x = np.array([(asbytes('a'),u'b')], dtype=t) - assert_equal(str(x), "[('a', u'b')]", err_msg=msg) + if sys.version_info[0] >= 3: + assert_equal(str(x), "[(b'a', 'b')]", err_msg=msg) + else: + assert_equal(str(x), "[('a', u'b')]", err_msg=msg) def test_sign_for_complex_nan(self, level=rlevel): """Ticket 794.""" @@ -1146,13 +1149,13 @@ def test_object_array_to_fixed_string(self): """Ticket #1235.""" a = np.array(['abcdefgh', 'ijklmnop'], dtype=np.object_) - b = np.array(a, dtype=(np.string_, 8)) + b = np.array(a, dtype=(np.str_, 8)) assert_equal(a, b) - c = np.array(a, dtype=(np.string_, 5)) + c = np.array(a, dtype=(np.str_, 5)) assert_equal(c, np.array(['abcde', 'ijklm'])) - d = np.array(a, dtype=(np.string_, 12)) + d = np.array(a, dtype=(np.str_, 12)) assert_equal(a, d) - e = np.empty((2, ), dtype=(np.string_, 8)) + e = np.empty((2, ), dtype=(np.str_, 8)) e[:] = a[:] assert_equal(a, e) From numpy-svn at scipy.org Sat Feb 20 21:47:31 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 20:47:31 -0600 (CST) Subject: [Numpy-svn] r8203 - in trunk/numpy/lib: . tests Message-ID: <20100221024731.805E5C7C059@scipy.org> Author: ptvirtan Date: 2010-02-20 20:47:31 -0600 (Sat, 20 Feb 2010) New Revision: 8203 Modified: trunk/numpy/lib/polynomial.py trunk/numpy/lib/tests/test_polynomial.py Log: 3K: lib: poly1d __div__ -> __truediv__, and fix its doctests Modified: trunk/numpy/lib/polynomial.py =================================================================== --- trunk/numpy/lib/polynomial.py 2010-02-21 02:47:14 UTC (rev 8202) +++ trunk/numpy/lib/polynomial.py 2010-02-21 02:47:31 UTC (rev 8203) @@ -1147,6 +1147,8 @@ other = poly1d(other) return polydiv(self, other) + __truediv__ = __div__ + def __rdiv__(self, other): if isscalar(other): return poly1d(other/self.coeffs) Modified: trunk/numpy/lib/tests/test_polynomial.py =================================================================== --- trunk/numpy/lib/tests/test_polynomial.py 2010-02-21 02:47:14 UTC (rev 8202) +++ trunk/numpy/lib/tests/test_polynomial.py 2010-02-21 02:47:31 UTC (rev 8203) @@ -5,22 +5,22 @@ >>> p = poly1d([1.,2,3]) >>> p poly1d([ 1., 2., 3.]) ->>> print p +>>> print(p) 2 1 x + 2 x + 3 >>> q = poly1d([3.,2,1]) >>> q poly1d([ 3., 2., 1.]) ->>> print q +>>> print(q) 2 3 x + 2 x + 1 ->>> print poly1d([1.89999+2j, -3j, -5.12345678, 2+1j]) +>>> print(poly1d([1.89999+2j, -3j, -5.12345678, 2+1j])) 3 2 (1.9 + 2j) x - 3j x - 5.123 x + (2 + 1j) ->>> print poly1d([100e-90, 1.234567e-9j+3, -1234.999e8]) +>>> print(poly1d([100e-90, 1.234567e-9j+3, -1234.999e8])) 2 1e-88 x + (3 + 1.235e-09j) x - 1.235e+11 ->>> print poly1d([-3, -2, -1]) +>>> print(poly1d([-3, -2, -1])) 2 -3 x - 2 x - 1 @@ -70,11 +70,11 @@ poly1d([ 2.]) >>> q = poly1d([1.,2,3], variable='y') ->>> print q +>>> print(q) 2 1 y + 2 y + 3 >>> q = poly1d([1.,2,3], variable='lambda') ->>> print q +>>> print(q) 2 1 lambda + 2 lambda + 3 From numpy-svn at scipy.org Sat Feb 20 21:47:48 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 20:47:48 -0600 (CST) Subject: [Numpy-svn] r8204 - trunk/numpy/polynomial/tests Message-ID: <20100221024748.CC465C7C059@scipy.org> Author: ptvirtan Date: 2010-02-20 20:47:48 -0600 (Sat, 20 Feb 2010) New Revision: 8204 Modified: trunk/numpy/polynomial/tests/test_chebyshev.py trunk/numpy/polynomial/tests/test_polynomial.py trunk/numpy/polynomial/tests/test_polyutils.py Log: 3K: polynomial: make tests to import Modified: trunk/numpy/polynomial/tests/test_chebyshev.py =================================================================== --- trunk/numpy/polynomial/tests/test_chebyshev.py 2010-02-21 02:47:31 UTC (rev 8203) +++ trunk/numpy/polynomial/tests/test_chebyshev.py 2010-02-21 02:47:48 UTC (rev 8204) @@ -6,7 +6,6 @@ import numpy as np import numpy.polynomial.chebyshev as ch from numpy.testing import * -from exceptions import TypeError, ValueError def trim(x) : return ch.chebtrim(x, tol=1e-6) Modified: trunk/numpy/polynomial/tests/test_polynomial.py =================================================================== --- trunk/numpy/polynomial/tests/test_polynomial.py 2010-02-21 02:47:31 UTC (rev 8203) +++ trunk/numpy/polynomial/tests/test_polynomial.py 2010-02-21 02:47:48 UTC (rev 8204) @@ -6,7 +6,6 @@ import numpy as np import numpy.polynomial.polynomial as poly from numpy.testing import * -from exceptions import TypeError, ValueError def trim(x) : return poly.polytrim(x, tol=1e-6) Modified: trunk/numpy/polynomial/tests/test_polyutils.py =================================================================== --- trunk/numpy/polynomial/tests/test_polyutils.py 2010-02-21 02:47:31 UTC (rev 8203) +++ trunk/numpy/polynomial/tests/test_polyutils.py 2010-02-21 02:47:48 UTC (rev 8204) @@ -6,7 +6,6 @@ import numpy as np import numpy.polynomial.polyutils as pu from numpy.testing import * -from exceptions import TypeError, ValueError class TestMisc(TestCase) : From numpy-svn at scipy.org Sat Feb 20 21:48:05 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 20:48:05 -0600 (CST) Subject: [Numpy-svn] r8205 - in trunk/numpy/linalg: . tests Message-ID: <20100221024805.0C70FC7C059@scipy.org> Author: ptvirtan Date: 2010-02-20 20:48:04 -0600 (Sat, 20 Feb 2010) New Revision: 8205 Modified: trunk/numpy/linalg/linalg.py trunk/numpy/linalg/tests/test_build.py Log: 3K: linalg: fix integer division issue and tests Modified: trunk/numpy/linalg/linalg.py =================================================================== --- trunk/numpy/linalg/linalg.py 2010-02-21 02:47:48 UTC (rev 8204) +++ trunk/numpy/linalg/linalg.py 2010-02-21 02:48:04 UTC (rev 8205) @@ -1046,7 +1046,7 @@ w = wr+1j*wi v = array(vr, w.dtype) ind = flatnonzero(wi != 0.0) # indices of complex e-vals - for i in range(len(ind)/2): + for i in range(len(ind)//2): v[ind[2*i]] = vr[ind[2*i]] + 1j*vr[ind[2*i+1]] v[ind[2*i+1]] = vr[ind[2*i]] - 1j*vr[ind[2*i+1]] result_t = _complexType(result_t) Modified: trunk/numpy/linalg/tests/test_build.py =================================================================== --- trunk/numpy/linalg/tests/test_build.py 2010-02-21 02:47:48 UTC (rev 8204) +++ trunk/numpy/linalg/tests/test_build.py 2010-02-21 02:48:04 UTC (rev 8205) @@ -6,6 +6,8 @@ from numpy.linalg import lapack_lite from numpy.testing import TestCase, dec +from numpy.compat import asbytes_nested + class FindDependenciesLdd: def __init__(self): self.cmd = ['ldd'] @@ -41,7 +43,7 @@ def test_lapack(self): f = FindDependenciesLdd() deps = f.grep_dependencies(lapack_lite.__file__, - ['libg2c', 'libgfortran']) + asbytes_nested(['libg2c', 'libgfortran'])) self.failIf(len(deps) > 1, """Both g77 and gfortran runtimes linked in lapack_lite ! This is likely to cause random crashes and wrong results. See numpy INSTALL.txt for more From numpy-svn at scipy.org Sat Feb 20 21:48:19 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 20:48:19 -0600 (CST) Subject: [Numpy-svn] r8206 - trunk/numpy/lib Message-ID: <20100221024819.38983C7C059@scipy.org> Author: ptvirtan Date: 2010-02-20 20:48:19 -0600 (Sat, 20 Feb 2010) New Revision: 8206 Modified: trunk/numpy/lib/utils.py Log: 3K: lib: fix sort(key=) issue Modified: trunk/numpy/lib/utils.py =================================================================== --- trunk/numpy/lib/utils.py 2010-02-21 02:48:04 UTC (rev 8205) +++ trunk/numpy/lib/utils.py 2010-02-21 02:48:19 UTC (rev 8206) @@ -791,11 +791,9 @@ r += max(-index / 100, -100) return r - def relevance_sort(a, b): - dr = relevance(b, *cache[b]) - relevance(a, *cache[a]) - if dr != 0: return dr - else: return cmp(a, b) - found.sort(relevance_sort) + def relevance_value(a): + return relevance(a, *cache[a]) + found.sort(key=relevance_value) # Pretty-print s = "Search results for '%s'" % (' '.join(whats)) From numpy-svn at scipy.org Sat Feb 20 21:48:33 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 20:48:33 -0600 (CST) Subject: [Numpy-svn] r8207 - trunk/numpy/lib Message-ID: <20100221024833.EA8CAC7C059@scipy.org> Author: ptvirtan Date: 2010-02-20 20:48:33 -0600 (Sat, 20 Feb 2010) New Revision: 8207 Modified: trunk/numpy/lib/_iotools.py trunk/numpy/lib/io.py Log: 3K: lib: missing_values in genfromtxt is never a basestring on Py3 Modified: trunk/numpy/lib/_iotools.py =================================================================== --- trunk/numpy/lib/_iotools.py 2010-02-21 02:48:19 UTC (rev 8206) +++ trunk/numpy/lib/_iotools.py 2010-02-21 02:48:33 UTC (rev 8207) @@ -600,7 +600,7 @@ if missing_values is None: self.missing_values = set([asbytes('')]) else: - if isinstance(missing_values, basestring): + if isinstance(missing_values, bytes): missing_values = missing_values.split(asbytes(",")) self.missing_values = set(list(missing_values) + [asbytes('')]) # Modified: trunk/numpy/lib/io.py =================================================================== --- trunk/numpy/lib/io.py 2010-02-21 02:48:19 UTC (rev 8206) +++ trunk/numpy/lib/io.py 2010-02-21 02:48:33 UTC (rev 8207) @@ -1209,7 +1209,7 @@ if value not in entry: entry.append(value) # We have a string : apply it to all entries - elif isinstance(user_missing_values, basestring): + elif isinstance(user_missing_values, bytes): user_value = user_missing_values.split(asbytes(",")) for entry in missing_values: entry.extend(user_value) From numpy-svn at scipy.org Sat Feb 20 21:48:47 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 20:48:47 -0600 (CST) Subject: [Numpy-svn] r8208 - trunk/numpy/lib Message-ID: <20100221024847.DB0D2C7C059@scipy.org> Author: ptvirtan Date: 2010-02-20 20:48:47 -0600 (Sat, 20 Feb 2010) New Revision: 8208 Modified: trunk/numpy/lib/recfunctions.py Log: 3K: lib: zip is izip on Py3 Modified: trunk/numpy/lib/recfunctions.py =================================================================== --- trunk/numpy/lib/recfunctions.py 2010-02-21 02:48:33 UTC (rev 8207) +++ trunk/numpy/lib/recfunctions.py 2010-02-21 02:48:47 UTC (rev 8208) @@ -18,6 +18,10 @@ from numpy.lib._iotools import _is_string_like +import sys +if sys.version_info[0] >= 3: + iterizip = zip + _check_fill_value = np.ma.core._check_fill_value __all__ = ['append_fields', From numpy-svn at scipy.org Sat Feb 20 21:49:04 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 20:49:04 -0600 (CST) Subject: [Numpy-svn] r8209 - trunk/numpy/lib/tests Message-ID: <20100221024904.A6783C7C059@scipy.org> Author: ptvirtan Date: 2010-02-20 20:49:04 -0600 (Sat, 20 Feb 2010) New Revision: 8209 Modified: trunk/numpy/lib/tests/test_io.py trunk/numpy/lib/tests/test_twodim_base.py Log: 3K: lib: fix bytes vs str issues in tests Modified: trunk/numpy/lib/tests/test_io.py =================================================================== --- trunk/numpy/lib/tests/test_io.py 2010-02-21 02:48:47 UTC (rev 8208) +++ trunk/numpy/lib/tests/test_io.py 2010-02-21 02:49:04 UTC (rev 8209) @@ -15,7 +15,7 @@ from numpy.lib._iotools import ConverterError, ConverterLockError, \ ConversionWarning -from numpy.compat import asbytes, asbytes_nested +from numpy.compat import asbytes, asbytes_nested, bytes if sys.version_info[0] >= 3: from io import BytesIO @@ -171,8 +171,9 @@ np.savetxt(c, a, fmt=fmt) c.seek(0) assert_equal(c.readlines(), - [(fmt + ' ' + fmt + '\n') % (1, 2), - (fmt + ' ' + fmt + '\n') % (3, 4)]) + asbytes_nested( + [(fmt + ' ' + fmt + '\n') % (1, 2), + (fmt + ' ' + fmt + '\n') % (3, 4)])) a = np.array([[1, 2], [3, 4]], int) c = StringIO() @@ -186,7 +187,7 @@ np.savetxt(c, a, fmt='%d') c.seek(0) lines = c.readlines() - assert_equal(lines, ['1\n', '2\n', '3\n', '4\n']) + assert_equal(lines, asbytes_nested(['1\n', '2\n', '3\n', '4\n'])) def test_record(self): a = np.array([(1, 2), (3, 4)], dtype=[('x', 'i4'), ('y', 'i4')]) @@ -200,7 +201,7 @@ c = StringIO() np.savetxt(c, a, delimiter=asbytes(','), fmt='%d') c.seek(0) - assert_equal(c.readlines(), ['1,2\n', '3,4\n']) + assert_equal(c.readlines(), asbytes_nested(['1,2\n', '3,4\n'])) def test_format(self): a = np.array([(1, 2), (3, 4)]) @@ -667,7 +668,7 @@ def test_dtype_with_converters(self): dstr = "2009; 23; 46" test = np.ndfromtxt(StringIO(dstr,), - delimiter=";", dtype=float, converters={0:str}) + delimiter=";", dtype=float, converters={0:bytes}) control = np.array([('2009', 23., 46)], dtype=[('f0', '|S4'), ('f1', float), ('f2', float)]) assert_equal(test, control) @@ -709,7 +710,7 @@ "Test user_converters w/ explicit (standard) dtype" data = StringIO('skip,skip,2001-01-01,1.0,skip') test = np.genfromtxt(data, delimiter=",", names=None, dtype=float, - usecols=(2, 3), converters={2: str}) + usecols=(2, 3), converters={2: bytes}) control = np.array([('2001-01-01', 1.)], dtype=[('', '|S10'), ('', float)]) assert_equal(test, control) Modified: trunk/numpy/lib/tests/test_twodim_base.py =================================================================== --- trunk/numpy/lib/tests/test_twodim_base.py 2010-02-21 02:48:47 UTC (rev 8208) +++ trunk/numpy/lib/tests/test_twodim_base.py 2010-02-21 02:49:04 UTC (rev 8209) @@ -9,6 +9,7 @@ triu_indices_from, tril_indices, tril_indices_from ) import numpy as np +from numpy.compat import asbytes, asbytes_nested def get_mat(n): data = arange(n) @@ -65,7 +66,8 @@ assert_equal(eye(3, 2, -3), [[0, 0], [0, 0], [0, 0]]) def test_strings(self): - assert_equal(eye(2, 2, dtype='S3'), [['1', ''], ['', '1']]) + assert_equal(eye(2, 2, dtype='S3'), + asbytes_nested([['1', ''], ['', '1']])) def test_bool(self): assert_equal(eye(2, 2, dtype=bool), [[True, False], [False, True]]) From numpy-svn at scipy.org Sat Feb 20 21:49:22 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 20:49:22 -0600 (CST) Subject: [Numpy-svn] r8210 - trunk/numpy/core/src/multiarray Message-ID: <20100221024922.890A2C7C059@scipy.org> Author: ptvirtan Date: 2010-02-20 20:49:22 -0600 (Sat, 20 Feb 2010) New Revision: 8210 Modified: trunk/numpy/core/src/multiarray/scalartypes.c.src Log: 3K: ENH: core: follow Python in formatting negative zeros in (-0+x*j) Modified: trunk/numpy/core/src/multiarray/scalartypes.c.src =================================================================== --- trunk/numpy/core/src/multiarray/scalartypes.c.src 2010-02-21 02:49:04 UTC (rev 8209) +++ trunk/numpy/core/src/multiarray/scalartypes.c.src 2010-02-21 02:49:22 UTC (rev 8210) @@ -410,7 +410,11 @@ /* * Ideally, we should handle this nan/inf stuff in NumpyOS_ascii_format* */ +#if PY_VERSION_HEX >= 0x03000000 + if (val.real == 0.0 && npy_signbit(val.real) == 0) { +#else if (val.real == 0.0) { +#endif PyOS_snprintf(format, sizeof(format), _FMT1, prec); res = NumPyOS_ascii_format at type@(buf, buflen-1, format, val.imag, 0); if (res == NULL) { From numpy-svn at scipy.org Sat Feb 20 21:49:39 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 20:49:39 -0600 (CST) Subject: [Numpy-svn] r8211 - trunk/numpy/oldnumeric Message-ID: <20100221024939.F085AC7C059@scipy.org> Author: ptvirtan Date: 2010-02-20 20:49:39 -0600 (Sat, 20 Feb 2010) New Revision: 8211 Modified: trunk/numpy/oldnumeric/compat.py trunk/numpy/oldnumeric/misc.py Log: 3K: ENH: make oldnumeric to import -- but don't implement oldnumeric.Unpickler as it's not straightforward to do Modified: trunk/numpy/oldnumeric/compat.py =================================================================== --- trunk/numpy/oldnumeric/compat.py 2010-02-21 02:49:22 UTC (rev 8210) +++ trunk/numpy/oldnumeric/compat.py 2010-02-21 02:49:39 UTC (rev 8211) @@ -95,12 +95,20 @@ return m import pickle, copy -class Unpickler(pickle.Unpickler): - def load_array(self): - self.stack.append(_LoadArray(self)) +if sys.version_info[0] >= 3: + class Unpickler(pickle.Unpickler): + # XXX: should we implement this? It's not completely straightforward + # to do. + def __init__(self, *a, **kw): + raise NotImplementedError( + "numpy.oldnumeric.Unpickler is not supported on Python 3") +else: + class Unpickler(pickle.Unpickler): + def load_array(self): + self.stack.append(_LoadArray(self)) - dispatch = copy.copy(pickle.Unpickler.dispatch) - dispatch['A'] = load_array + dispatch = copy.copy(pickle.Unpickler.dispatch) + dispatch['A'] = load_array class Pickler(pickle.Pickler): def __init__(self, *args, **kwds): Modified: trunk/numpy/oldnumeric/misc.py =================================================================== --- trunk/numpy/oldnumeric/misc.py 2010-02-21 02:49:22 UTC (rev 8210) +++ trunk/numpy/oldnumeric/misc.py 2010-02-21 02:49:39 UTC (rev 8211) @@ -18,6 +18,13 @@ import copy import copy_reg +import sys +if sys.version_info[0] >= 3: + import copyreg + import io + StringIO = io.BytesIO + copy_reg = copyreg + from numpy import sort, clip, rank, sign, shape, putmask, allclose, size,\ choose, swapaxes, array_str, array_repr, e, pi, put, \ resize, around, concatenate, vdot, transpose, \ From numpy-svn at scipy.org Sat Feb 20 21:50:19 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 20:50:19 -0600 (CST) Subject: [Numpy-svn] r8212 - in trunk/numpy/numarray: . include include/numpy numpy Message-ID: <20100221025019.40925C7C059@scipy.org> Author: ptvirtan Date: 2010-02-20 20:50:19 -0600 (Sat, 20 Feb 2010) New Revision: 8212 Added: trunk/numpy/numarray/include/ trunk/numpy/numarray/include/numpy/ trunk/numpy/numarray/include/numpy/arraybase.h trunk/numpy/numarray/include/numpy/cfunc.h trunk/numpy/numarray/include/numpy/ieeespecial.h trunk/numpy/numarray/include/numpy/libnumarray.h trunk/numpy/numarray/include/numpy/numcomplex.h trunk/numpy/numarray/include/numpy/nummacro.h Removed: trunk/numpy/numarray/numpy/arraybase.h trunk/numpy/numarray/numpy/cfunc.h trunk/numpy/numarray/numpy/ieeespecial.h trunk/numpy/numarray/numpy/libnumarray.h trunk/numpy/numarray/numpy/numcomplex.h trunk/numpy/numarray/numpy/nummacro.h Modified: trunk/numpy/numarray/setup.py trunk/numpy/numarray/setupscons.py trunk/numpy/numarray/util.py Log: 3K: ENH: move numarray includes under numarray/include so that the 'numpy' directory does not confuse 2to3's relative import conversion Copied: trunk/numpy/numarray/include/numpy/arraybase.h (from rev 8211, trunk/numpy/numarray/numpy/arraybase.h) =================================================================== --- trunk/numpy/numarray/include/numpy/arraybase.h (rev 0) +++ trunk/numpy/numarray/include/numpy/arraybase.h 2010-02-21 02:50:19 UTC (rev 8212) @@ -0,0 +1,71 @@ +#if !defined(__arraybase_h) +#define _arraybase_h 1 + +#define SZ_BUF 79 +#define MAXDIM NPY_MAXDIMS +#define MAXARGS 18 + +typedef npy_intp maybelong; +typedef npy_bool Bool; +typedef npy_int8 Int8; +typedef npy_uint8 UInt8; +typedef npy_int16 Int16; +typedef npy_uint16 UInt16; +typedef npy_int32 Int32; +typedef npy_uint32 UInt32; +typedef npy_int64 Int64; +typedef npy_uint64 UInt64; +typedef npy_float32 Float32; +typedef npy_float64 Float64; + +typedef enum +{ + tAny=-1, + tBool=PyArray_BOOL, + tInt8=PyArray_INT8, + tUInt8=PyArray_UINT8, + tInt16=PyArray_INT16, + tUInt16=PyArray_UINT16, + tInt32=PyArray_INT32, + tUInt32=PyArray_UINT32, + tInt64=PyArray_INT64, + tUInt64=PyArray_UINT64, + tFloat32=PyArray_FLOAT32, + tFloat64=PyArray_FLOAT64, + tComplex32=PyArray_COMPLEX64, + tComplex64=PyArray_COMPLEX128, + tObject=PyArray_OBJECT, /* placeholder... does nothing */ + tMaxType=PyArray_NTYPES, + tDefault = tFloat64, +#if NPY_BITSOF_LONG == 64 + tLong = tInt64, +#else + tLong = tInt32, +#endif +} NumarrayType; + +#define nNumarrayType PyArray_NTYPES + +#define HAS_UINT64 1 + +typedef enum +{ + NUM_LITTLE_ENDIAN=0, + NUM_BIG_ENDIAN = 1 +} NumarrayByteOrder; + +typedef struct { Float32 r, i; } Complex32; +typedef struct { Float64 r, i; } Complex64; + +#define WRITABLE NPY_WRITEABLE +#define CHECKOVERFLOW 0x800 +#define UPDATEDICT 0x1000 +#define FORTRAN_CONTIGUOUS NPY_FORTRAN +#define IS_CARRAY (NPY_CONTIGUOUS | NPY_ALIGNED) + +#define PyArray(m) ((PyArrayObject *)(m)) +#define PyArray_ISFORTRAN_CONTIGUOUS(m) (((PyArray(m))->flags & FORTRAN_CONTIGUOUS) != 0) +#define PyArray_ISWRITABLE PyArray_ISWRITEABLE + + +#endif Property changes on: trunk/numpy/numarray/include/numpy/arraybase.h ___________________________________________________________________ Name: svn:keywords + Id Author Name: svn:eol-style + native Copied: trunk/numpy/numarray/include/numpy/cfunc.h (from rev 8211, trunk/numpy/numarray/numpy/cfunc.h) =================================================================== --- trunk/numpy/numarray/include/numpy/cfunc.h (rev 0) +++ trunk/numpy/numarray/include/numpy/cfunc.h 2010-02-21 02:50:19 UTC (rev 8212) @@ -0,0 +1,78 @@ +#if !defined(__cfunc__) +#define __cfunc__ 1 + +typedef PyObject *(*CFUNCasPyValue)(void *); +typedef int (*UFUNC)(long, long, long, void **, long*); +/* typedef void (*CFUNC_2ARG)(long, void *, void *); */ +/* typedef void (*CFUNC_3ARG)(long, void *, void *, void *); */ +typedef int (*CFUNCfromPyValue)(PyObject *, void *); +typedef int (*CFUNC_STRIDE_CONV_FUNC)(long, long, maybelong *, + void *, long, maybelong*, void *, long, maybelong *); + +typedef int (*CFUNC_STRIDED_FUNC)(PyObject *, long, PyArrayObject **, + char **data); + +#define MAXARRAYS 16 + +typedef enum { + CFUNC_UFUNC, + CFUNC_STRIDING, + CFUNC_NSTRIDING, + CFUNC_AS_PY_VALUE, + CFUNC_FROM_PY_VALUE +} eCfuncType; + +typedef struct { + char *name; + void *fptr; /* Pointer to "un-wrapped" c function */ + eCfuncType type; /* UFUNC, STRIDING, AsPyValue, FromPyValue */ + Bool chkself; /* CFUNC does own alignment/bounds checking */ + Bool align; /* CFUNC requires aligned buffer pointers */ + Int8 wantIn, wantOut; /* required input/output arg counts. */ + Int8 sizes[MAXARRAYS]; /* array of align/itemsizes. */ + Int8 iters[MAXARRAYS]; /* array of element counts. 0 --> niter. */ +} CfuncDescriptor; + +typedef struct { + PyObject_HEAD + CfuncDescriptor descr; +} CfuncObject; + +#define SELF_CHECKED_CFUNC_DESCR(name, type) \ + static CfuncDescriptor name##_descr = { #name, (void *) name, type, 1 } + +#define CHECK_ALIGN 1 + +#define CFUNC_DESCR(name, type, align, iargs, oargs, s1, s2, s3, i1, i2, i3) \ + static CfuncDescriptor name##_descr = \ + { #name, (void *)name, type, 0, align, iargs, oargs, {s1, s2, s3}, {i1, i2, i3} } + +#define UFUNC_DESCR1(name, s1) \ + CFUNC_DESCR(name, CFUNC_UFUNC, CHECK_ALIGN, 0, 1, s1, 0, 0, 0, 0, 0) + +#define UFUNC_DESCR2(name, s1, s2) \ + CFUNC_DESCR(name, CFUNC_UFUNC, CHECK_ALIGN, 1, 1, s1, s2, 0, 0, 0, 0) + +#define UFUNC_DESCR3(name, s1, s2, s3) \ + CFUNC_DESCR(name, CFUNC_UFUNC, CHECK_ALIGN, 2, 1, s1, s2, s3, 0, 0, 0) + +#define UFUNC_DESCR3sv(name, s1, s2, s3) \ + CFUNC_DESCR(name, CFUNC_UFUNC, CHECK_ALIGN, 2, 1, s1, s2, s3, 1, 0, 0) + +#define UFUNC_DESCR3vs(name, s1, s2, s3) \ + CFUNC_DESCR(name, CFUNC_UFUNC, CHECK_ALIGN, 2, 1, s1, s2, s3, 0, 1, 0) + +#define STRIDING_DESCR2(name, align, s1, s2) \ + CFUNC_DESCR(name, CFUNC_STRIDING, align, 1, 1, s1, s2, 0, 0, 0, 0) + +#define NSTRIDING_DESCR1(name) \ + CFUNC_DESCR(name, CFUNC_NSTRIDING, 0, 0, 1, 0, 0, 0, 0, 0, 0) + +#define NSTRIDING_DESCR2(name) \ + CFUNC_DESCR(name, CFUNC_NSTRIDING, 0, 1, 1, 0, 0, 0, 0, 0, 0) + +#define NSTRIDING_DESCR3(name) \ + CFUNC_DESCR(name, CFUNC_NSTRIDING, 0, 2, 1, 0, 0, 0, 0, 0, 0) + +#endif + Property changes on: trunk/numpy/numarray/include/numpy/cfunc.h ___________________________________________________________________ Name: svn:keywords + Id Author Name: svn:eol-style + native Copied: trunk/numpy/numarray/include/numpy/ieeespecial.h (from rev 8211, trunk/numpy/numarray/numpy/ieeespecial.h) =================================================================== --- trunk/numpy/numarray/include/numpy/ieeespecial.h (rev 0) +++ trunk/numpy/numarray/include/numpy/ieeespecial.h 2010-02-21 02:50:19 UTC (rev 8212) @@ -0,0 +1,124 @@ +/* 32-bit special value ranges */ + +#if defined(_MSC_VER) +#define MKINT(x) (x##UL) +#define MKINT64(x) (x##Ui64) +#define BIT(x) (1Ui64 << (x)) +#else +#define MKINT(x) (x##U) +#define MKINT64(x) (x##ULL) +#define BIT(x) (1ULL << (x)) +#endif + + +#define NEG_QUIET_NAN_MIN32 MKINT(0xFFC00001) +#define NEG_QUIET_NAN_MAX32 MKINT(0xFFFFFFFF) + +#define INDETERMINATE_MIN32 MKINT(0xFFC00000) +#define INDETERMINATE_MAX32 MKINT(0xFFC00000) + +#define NEG_SIGNAL_NAN_MIN32 MKINT(0xFF800001) +#define NEG_SIGNAL_NAN_MAX32 MKINT(0xFFBFFFFF) + +#define NEG_INFINITY_MIN32 MKINT(0xFF800000) + +#define NEG_NORMALIZED_MIN32 MKINT(0x80800000) +#define NEG_NORMALIZED_MAX32 MKINT(0xFF7FFFFF) + +#define NEG_DENORMALIZED_MIN32 MKINT(0x80000001) +#define NEG_DENORMALIZED_MAX32 MKINT(0x807FFFFF) + +#define NEG_ZERO_MIN32 MKINT(0x80000000) +#define NEG_ZERO_MAX32 MKINT(0x80000000) + +#define POS_ZERO_MIN32 MKINT(0x00000000) +#define POS_ZERO_MAX32 MKINT(0x00000000) + +#define POS_DENORMALIZED_MIN32 MKINT(0x00000001) +#define POS_DENORMALIZED_MAX32 MKINT(0x007FFFFF) + +#define POS_NORMALIZED_MIN32 MKINT(0x00800000) +#define POS_NORMALIZED_MAX32 MKINT(0x7F7FFFFF) + +#define POS_INFINITY_MIN32 MKINT(0x7F800000) +#define POS_INFINITY_MAX32 MKINT(0x7F800000) + +#define POS_SIGNAL_NAN_MIN32 MKINT(0x7F800001) +#define POS_SIGNAL_NAN_MAX32 MKINT(0x7FBFFFFF) + +#define POS_QUIET_NAN_MIN32 MKINT(0x7FC00000) +#define POS_QUIET_NAN_MAX32 MKINT(0x7FFFFFFF) + +/* 64-bit special value ranges */ + +#define NEG_QUIET_NAN_MIN64 MKINT64(0xFFF8000000000001) +#define NEG_QUIET_NAN_MAX64 MKINT64(0xFFFFFFFFFFFFFFFF) + +#define INDETERMINATE_MIN64 MKINT64(0xFFF8000000000000) +#define INDETERMINATE_MAX64 MKINT64(0xFFF8000000000000) + +#define NEG_SIGNAL_NAN_MIN64 MKINT64(0xFFF7FFFFFFFFFFFF) +#define NEG_SIGNAL_NAN_MAX64 MKINT64(0xFFF0000000000001) + +#define NEG_INFINITY_MIN64 MKINT64(0xFFF0000000000000) + +#define NEG_NORMALIZED_MIN64 MKINT64(0xFFEFFFFFFFFFFFFF) +#define NEG_NORMALIZED_MAX64 MKINT64(0x8010000000000000) + +#define NEG_DENORMALIZED_MIN64 MKINT64(0x800FFFFFFFFFFFFF) +#define NEG_DENORMALIZED_MAX64 MKINT64(0x8000000000000001) + +#define NEG_ZERO_MIN64 MKINT64(0x8000000000000000) +#define NEG_ZERO_MAX64 MKINT64(0x8000000000000000) + +#define POS_ZERO_MIN64 MKINT64(0x0000000000000000) +#define POS_ZERO_MAX64 MKINT64(0x0000000000000000) + +#define POS_DENORMALIZED_MIN64 MKINT64(0x0000000000000001) +#define POS_DENORMALIZED_MAX64 MKINT64(0x000FFFFFFFFFFFFF) + +#define POS_NORMALIZED_MIN64 MKINT64(0x0010000000000000) +#define POS_NORMALIZED_MAX64 MKINT64(0x7FEFFFFFFFFFFFFF) + +#define POS_INFINITY_MIN64 MKINT64(0x7FF0000000000000) +#define POS_INFINITY_MAX64 MKINT64(0x7FF0000000000000) + +#define POS_SIGNAL_NAN_MIN64 MKINT64(0x7FF0000000000001) +#define POS_SIGNAL_NAN_MAX64 MKINT64(0x7FF7FFFFFFFFFFFF) + +#define POS_QUIET_NAN_MIN64 MKINT64(0x7FF8000000000000) +#define POS_QUIET_NAN_MAX64 MKINT64(0x7FFFFFFFFFFFFFFF) + +typedef enum +{ + POS_QNAN_BIT, + NEG_QNAN_BIT, + POS_SNAN_BIT, + NEG_SNAN_BIT, + POS_INF_BIT, + NEG_INF_BIT, + POS_DEN_BIT, + NEG_DEN_BIT, + POS_NOR_BIT, + NEG_NOR_BIT, + POS_ZERO_BIT, + NEG_ZERO_BIT, + INDETERM_BIT, + BUG_BIT +} ieee_selects; + +#define MSK_POS_QNAN BIT(POS_QNAN_BIT) +#define MSK_POS_SNAN BIT(POS_SNAN_BIT) +#define MSK_POS_INF BIT(POS_INF_BIT) +#define MSK_POS_DEN BIT(POS_DEN_BIT) +#define MSK_POS_NOR BIT(POS_NOR_BIT) +#define MSK_POS_ZERO BIT(POS_ZERO_BIT) +#define MSK_NEG_QNAN BIT(NEG_QNAN_BIT) +#define MSK_NEG_SNAN BIT(NEG_SNAN_BIT) +#define MSK_NEG_INF BIT(NEG_INF_BIT) +#define MSK_NEG_DEN BIT(NEG_DEN_BIT) +#define MSK_NEG_NOR BIT(NEG_NOR_BIT) +#define MSK_NEG_ZERO BIT(NEG_ZERO_BIT) +#define MSK_INDETERM BIT(INDETERM_BIT) +#define MSK_BUG BIT(BUG_BIT) + Property changes on: trunk/numpy/numarray/include/numpy/ieeespecial.h ___________________________________________________________________ Name: svn:keywords + Id Author Name: svn:eol-style + native Copied: trunk/numpy/numarray/include/numpy/libnumarray.h (from rev 8211, trunk/numpy/numarray/numpy/libnumarray.h) =================================================================== --- trunk/numpy/numarray/include/numpy/libnumarray.h (rev 0) +++ trunk/numpy/numarray/include/numpy/libnumarray.h 2010-02-21 02:50:19 UTC (rev 8212) @@ -0,0 +1,611 @@ +/* Compatibility with numarray. Do not use in new code. + */ + +#ifndef NUMPY_LIBNUMARRAY_H +#define NUMPY_LIBNUMARRAY_H + +#include "numpy/arrayobject.h" +#include "arraybase.h" +#include "nummacro.h" +#include "numcomplex.h" +#include "ieeespecial.h" +#include "cfunc.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Header file for libnumarray */ + +#if !defined(_libnumarray_MODULE) + +/* +Extensions constructed from seperate compilation units can access the +C-API defined here by defining "libnumarray_UNIQUE_SYMBOL" to a global +name unique to the extension. Doing this circumvents the requirement +to import libnumarray into each compilation unit, but is nevertheless +mildly discouraged as "outside the Python norm" and potentially +leading to problems. Looking around at "existing Python art", most +extension modules are monolithic C files, and likely for good reason. +*/ + +/* C API address pointer */ +#if defined(NO_IMPORT) || defined(NO_IMPORT_ARRAY) +extern void **libnumarray_API; +#else +#if defined(libnumarray_UNIQUE_SYMBOL) +void **libnumarray_API; +#else +static void **libnumarray_API; +#endif +#endif + +#define _import_libnumarray() \ + { \ + PyObject *module = PyImport_ImportModule("numpy.numarray._capi"); \ + if (module != NULL) { \ + PyObject *module_dict = PyModule_GetDict(module); \ + PyObject *c_api_object = \ + PyDict_GetItemString(module_dict, "_C_API"); \ + if (c_api_object && PyCObject_Check(c_api_object)) { \ + libnumarray_API = (void **)PyCObject_AsVoidPtr(c_api_object); \ + } else { \ + PyErr_Format(PyExc_ImportError, \ + "Can't get API for module 'numpy.numarray._capi'"); \ + } \ + } \ + } + +#define import_libnumarray() _import_libnumarray(); if (PyErr_Occurred()) { PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.numarray._capi failed to import.\n"); return; } + +#endif + + +#define libnumarray_FatalApiError (Py_FatalError("Call to API function without first calling import_libnumarray() in " __FILE__), NULL) + + +/* Macros defining components of function prototypes */ + +#ifdef _libnumarray_MODULE + /* This section is used when compiling libnumarray */ + +static PyObject *_Error; + +static PyObject* getBuffer (PyObject*o); + +static int isBuffer (PyObject*o); + +static int getWriteBufferDataPtr (PyObject*o,void**p); + +static int isBufferWriteable (PyObject*o); + +static int getReadBufferDataPtr (PyObject*o,void**p); + +static int getBufferSize (PyObject*o); + +static double num_log (double x); + +static double num_log10 (double x); + +static double num_pow (double x, double y); + +static double num_acosh (double x); + +static double num_asinh (double x); + +static double num_atanh (double x); + +static double num_round (double x); + +static int int_dividebyzero_error (long value, long unused); + +static int int_overflow_error (Float64 value); + +static int umult64_overflow (UInt64 a, UInt64 b); + +static int smult64_overflow (Int64 a0, Int64 b0); + +static void NA_Done (void); + +static PyArrayObject* NA_NewAll (int ndim, maybelong* shape, NumarrayType type, void* buffer, maybelong byteoffset, maybelong bytestride, int byteorder, int aligned, int writeable); + +static PyArrayObject* NA_NewAllStrides (int ndim, maybelong* shape, maybelong* strides, NumarrayType type, void* buffer, maybelong byteoffset, int byteorder, int aligned, int writeable); + +static PyArrayObject* NA_New (void* buffer, NumarrayType type, int ndim,...); + +static PyArrayObject* NA_Empty (int ndim, maybelong* shape, NumarrayType type); + +static PyArrayObject* NA_NewArray (void* buffer, NumarrayType type, int ndim, ...); + +static PyArrayObject* NA_vNewArray (void* buffer, NumarrayType type, int ndim, maybelong *shape); + +static PyObject* NA_ReturnOutput (PyObject*,PyArrayObject*); + +static long NA_getBufferPtrAndSize (PyObject*,int,void**); + +static int NA_checkIo (char*,int,int,int,int); + +static int NA_checkOneCBuffer (char*,long,void*,long,size_t); + +static int NA_checkNCBuffers (char*,int,long,void**,long*,Int8*,Int8*); + +static int NA_checkOneStriding (char*,long,maybelong*,long,maybelong*,long,long,int); + +static PyObject* NA_new_cfunc (CfuncDescriptor*); + +static int NA_add_cfunc (PyObject*,char*,CfuncDescriptor*); + +static PyArrayObject* NA_InputArray (PyObject*,NumarrayType,int); + +static PyArrayObject* NA_OutputArray (PyObject*,NumarrayType,int); + +static PyArrayObject* NA_IoArray (PyObject*,NumarrayType,int); + +static PyArrayObject* NA_OptionalOutputArray (PyObject*,NumarrayType,int,PyArrayObject*); + +static long NA_get_offset (PyArrayObject*,int,...); + +static Float64 NA_get_Float64 (PyArrayObject*,long); + +static void NA_set_Float64 (PyArrayObject*,long,Float64); + +static Complex64 NA_get_Complex64 (PyArrayObject*,long); + +static void NA_set_Complex64 (PyArrayObject*,long,Complex64); + +static Int64 NA_get_Int64 (PyArrayObject*,long); + +static void NA_set_Int64 (PyArrayObject*,long,Int64); + +static Float64 NA_get1_Float64 (PyArrayObject*,long); + +static Float64 NA_get2_Float64 (PyArrayObject*,long,long); + +static Float64 NA_get3_Float64 (PyArrayObject*,long,long,long); + +static void NA_set1_Float64 (PyArrayObject*,long,Float64); + +static void NA_set2_Float64 (PyArrayObject*,long,long,Float64); + +static void NA_set3_Float64 (PyArrayObject*,long,long,long,Float64); + +static Complex64 NA_get1_Complex64 (PyArrayObject*,long); + +static Complex64 NA_get2_Complex64 (PyArrayObject*,long,long); + +static Complex64 NA_get3_Complex64 (PyArrayObject*,long,long,long); + +static void NA_set1_Complex64 (PyArrayObject*,long,Complex64); + +static void NA_set2_Complex64 (PyArrayObject*,long,long,Complex64); + +static void NA_set3_Complex64 (PyArrayObject*,long,long,long,Complex64); + +static Int64 NA_get1_Int64 (PyArrayObject*,long); + +static Int64 NA_get2_Int64 (PyArrayObject*,long,long); + +static Int64 NA_get3_Int64 (PyArrayObject*,long,long,long); + +static void NA_set1_Int64 (PyArrayObject*,long,Int64); + +static void NA_set2_Int64 (PyArrayObject*,long,long,Int64); + +static void NA_set3_Int64 (PyArrayObject*,long,long,long,Int64); + +static int NA_get1D_Float64 (PyArrayObject*,long,int,Float64*); + +static int NA_set1D_Float64 (PyArrayObject*,long,int,Float64*); + +static int NA_get1D_Int64 (PyArrayObject*,long,int,Int64*); + +static int NA_set1D_Int64 (PyArrayObject*,long,int,Int64*); + +static int NA_get1D_Complex64 (PyArrayObject*,long,int,Complex64*); + +static int NA_set1D_Complex64 (PyArrayObject*,long,int,Complex64*); + +static int NA_ShapeEqual (PyArrayObject*,PyArrayObject*); + +static int NA_ShapeLessThan (PyArrayObject*,PyArrayObject*); + +static int NA_ByteOrder (void); + +static Bool NA_IeeeSpecial32 (Float32*,Int32*); + +static Bool NA_IeeeSpecial64 (Float64*,Int32*); + +static PyArrayObject* NA_updateDataPtr (PyArrayObject*); + +static char* NA_typeNoToName (int); + +static int NA_nameToTypeNo (char*); + +static PyObject* NA_typeNoToTypeObject (int); + +static PyObject* NA_intTupleFromMaybeLongs (int,maybelong*); + +static long NA_maybeLongsFromIntTuple (int,maybelong*,PyObject*); + +static int NA_intTupleProduct (PyObject *obj, long *product); + +static long NA_isIntegerSequence (PyObject*); + +static PyObject* NA_setArrayFromSequence (PyArrayObject*,PyObject*); + +static int NA_maxType (PyObject*); + +static int NA_isPythonScalar (PyObject *obj); + +static PyObject* NA_getPythonScalar (PyArrayObject*,long); + +static int NA_setFromPythonScalar (PyArrayObject*,long,PyObject*); + +static int NA_NDArrayCheck (PyObject*); + +static int NA_NumArrayCheck (PyObject*); + +static int NA_ComplexArrayCheck (PyObject*); + +static unsigned long NA_elements (PyArrayObject*); + +static int NA_typeObjectToTypeNo (PyObject*); + +static int NA_copyArray (PyArrayObject* to, const PyArrayObject* from); + +static PyArrayObject* NA_copy (PyArrayObject*); + +static PyObject* NA_getType (PyObject *typeobj_or_name); + +static PyObject * NA_callCUFuncCore (PyObject *cfunc, long niter, long ninargs, long noutargs, PyObject **BufferObj, long *offset); + +static PyObject * NA_callStrideConvCFuncCore (PyObject *cfunc, int nshape, maybelong *shape, PyObject *inbuffObj, long inboffset, int nstrides0, maybelong *inbstrides, PyObject *outbuffObj, long outboffset, int nstrides1, maybelong *outbstrides, long nbytes); + +static void NA_stridesFromShape (int nshape, maybelong *shape, maybelong bytestride, maybelong *strides); + +static int NA_OperatorCheck (PyObject *obj); + +static int NA_ConverterCheck (PyObject *obj); + +static int NA_UfuncCheck (PyObject *obj); + +static int NA_CfuncCheck (PyObject *obj); + +static int NA_getByteOffset (PyArrayObject *array, int nindices, maybelong *indices, long *offset); + +static int NA_swapAxes (PyArrayObject *array, int x, int y); + +static PyObject * NA_initModuleGlobal (char *module, char *global); + +static NumarrayType NA_NumarrayType (PyObject *seq); + +static PyArrayObject * NA_NewAllFromBuffer (int ndim, maybelong *shape, NumarrayType type, PyObject *bufferObject, maybelong byteoffset, maybelong bytestride, int byteorder, int aligned, int writeable); + +static Float64 * NA_alloc1D_Float64 (PyArrayObject *a, long offset, int cnt); + +static Int64 * NA_alloc1D_Int64 (PyArrayObject *a, long offset, int cnt); + +static void NA_updateAlignment (PyArrayObject *self); + +static void NA_updateContiguous (PyArrayObject *self); + +static void NA_updateStatus (PyArrayObject *self); + +static int NA_NumArrayCheckExact (PyObject *op); + +static int NA_NDArrayCheckExact (PyObject *op); + +static int NA_OperatorCheckExact (PyObject *op); + +static int NA_ConverterCheckExact (PyObject *op); + +static int NA_UfuncCheckExact (PyObject *op); + +static int NA_CfuncCheckExact (PyObject *op); + +static char * NA_getArrayData (PyArrayObject *ap); + +static void NA_updateByteswap (PyArrayObject *ap); + +static PyArray_Descr * NA_DescrFromType (int type); + +static PyObject * NA_Cast (PyArrayObject *a, int type); + +static int NA_checkFPErrors (void); + +static void NA_clearFPErrors (void); + +static int NA_checkAndReportFPErrors (char *name); + +static Bool NA_IeeeMask32 (Float32,Int32); + +static Bool NA_IeeeMask64 (Float64,Int32); + +static int _NA_callStridingHelper (PyObject *aux, long dim, long nnumarray, PyArrayObject *numarray[], char *data[], CFUNC_STRIDED_FUNC f); + +static PyArrayObject * NA_FromDimsStridesDescrAndData (int nd, maybelong *dims, maybelong *strides, PyArray_Descr *descr, char *data); + +static PyArrayObject * NA_FromDimsTypeAndData (int nd, maybelong *dims, int type, char *data); + +static PyArrayObject * NA_FromDimsStridesTypeAndData (int nd, maybelong *dims, maybelong *strides, int type, char *data); + +static int NA_scipy_typestr (NumarrayType t, int byteorder, char *typestr); + +static PyArrayObject * NA_FromArrayStruct (PyObject *a); + + +#else + /* This section is used in modules that use libnumarray */ + +#define getBuffer (libnumarray_API ? (*(PyObject* (*) (PyObject*o) ) libnumarray_API[ 0 ]) : (*(PyObject* (*) (PyObject*o) ) libnumarray_FatalApiError)) + +#define isBuffer (libnumarray_API ? (*(int (*) (PyObject*o) ) libnumarray_API[ 1 ]) : (*(int (*) (PyObject*o) ) libnumarray_FatalApiError)) + +#define getWriteBufferDataPtr (libnumarray_API ? (*(int (*) (PyObject*o,void**p) ) libnumarray_API[ 2 ]) : (*(int (*) (PyObject*o,void**p) ) libnumarray_FatalApiError)) + +#define isBufferWriteable (libnumarray_API ? (*(int (*) (PyObject*o) ) libnumarray_API[ 3 ]) : (*(int (*) (PyObject*o) ) libnumarray_FatalApiError)) + +#define getReadBufferDataPtr (libnumarray_API ? (*(int (*) (PyObject*o,void**p) ) libnumarray_API[ 4 ]) : (*(int (*) (PyObject*o,void**p) ) libnumarray_FatalApiError)) + +#define getBufferSize (libnumarray_API ? (*(int (*) (PyObject*o) ) libnumarray_API[ 5 ]) : (*(int (*) (PyObject*o) ) libnumarray_FatalApiError)) + +#define num_log (libnumarray_API ? (*(double (*) (double x) ) libnumarray_API[ 6 ]) : (*(double (*) (double x) ) libnumarray_FatalApiError)) + +#define num_log10 (libnumarray_API ? (*(double (*) (double x) ) libnumarray_API[ 7 ]) : (*(double (*) (double x) ) libnumarray_FatalApiError)) + +#define num_pow (libnumarray_API ? (*(double (*) (double x, double y) ) libnumarray_API[ 8 ]) : (*(double (*) (double x, double y) ) libnumarray_FatalApiError)) + +#define num_acosh (libnumarray_API ? (*(double (*) (double x) ) libnumarray_API[ 9 ]) : (*(double (*) (double x) ) libnumarray_FatalApiError)) + +#define num_asinh (libnumarray_API ? (*(double (*) (double x) ) libnumarray_API[ 10 ]) : (*(double (*) (double x) ) libnumarray_FatalApiError)) + +#define num_atanh (libnumarray_API ? (*(double (*) (double x) ) libnumarray_API[ 11 ]) : (*(double (*) (double x) ) libnumarray_FatalApiError)) + +#define num_round (libnumarray_API ? (*(double (*) (double x) ) libnumarray_API[ 12 ]) : (*(double (*) (double x) ) libnumarray_FatalApiError)) + +#define int_dividebyzero_error (libnumarray_API ? (*(int (*) (long value, long unused) ) libnumarray_API[ 13 ]) : (*(int (*) (long value, long unused) ) libnumarray_FatalApiError)) + +#define int_overflow_error (libnumarray_API ? (*(int (*) (Float64 value) ) libnumarray_API[ 14 ]) : (*(int (*) (Float64 value) ) libnumarray_FatalApiError)) + +#define umult64_overflow (libnumarray_API ? (*(int (*) (UInt64 a, UInt64 b) ) libnumarray_API[ 15 ]) : (*(int (*) (UInt64 a, UInt64 b) ) libnumarray_FatalApiError)) + +#define smult64_overflow (libnumarray_API ? (*(int (*) (Int64 a0, Int64 b0) ) libnumarray_API[ 16 ]) : (*(int (*) (Int64 a0, Int64 b0) ) libnumarray_FatalApiError)) + +#define NA_Done (libnumarray_API ? (*(void (*) (void) ) libnumarray_API[ 17 ]) : (*(void (*) (void) ) libnumarray_FatalApiError)) + +#define NA_NewAll (libnumarray_API ? (*(PyArrayObject* (*) (int ndim, maybelong* shape, NumarrayType type, void* buffer, maybelong byteoffset, maybelong bytestride, int byteorder, int aligned, int writeable) ) libnumarray_API[ 18 ]) : (*(PyArrayObject* (*) (int ndim, maybelong* shape, NumarrayType type, void* buffer, maybelong byteoffset, maybelong bytestride, int byteorder, int aligned, int writeable) ) libnumarray_FatalApiError)) + +#define NA_NewAllStrides (libnumarray_API ? (*(PyArrayObject* (*) (int ndim, maybelong* shape, maybelong* strides, NumarrayType type, void* buffer, maybelong byteoffset, int byteorder, int aligned, int writeable) ) libnumarray_API[ 19 ]) : (*(PyArrayObject* (*) (int ndim, maybelong* shape, maybelong* strides, NumarrayType type, void* buffer, maybelong byteoffset, int byteorder, int aligned, int writeable) ) libnumarray_FatalApiError)) + +#define NA_New (libnumarray_API ? (*(PyArrayObject* (*) (void* buffer, NumarrayType type, int ndim,...) ) libnumarray_API[ 20 ]) : (*(PyArrayObject* (*) (void* buffer, NumarrayType type, int ndim,...) ) libnumarray_FatalApiError)) + +#define NA_Empty (libnumarray_API ? (*(PyArrayObject* (*) (int ndim, maybelong* shape, NumarrayType type) ) libnumarray_API[ 21 ]) : (*(PyArrayObject* (*) (int ndim, maybelong* shape, NumarrayType type) ) libnumarray_FatalApiError)) + +#define NA_NewArray (libnumarray_API ? (*(PyArrayObject* (*) (void* buffer, NumarrayType type, int ndim, ...) ) libnumarray_API[ 22 ]) : (*(PyArrayObject* (*) (void* buffer, NumarrayType type, int ndim, ...) ) libnumarray_FatalApiError)) + +#define NA_vNewArray (libnumarray_API ? (*(PyArrayObject* (*) (void* buffer, NumarrayType type, int ndim, maybelong *shape) ) libnumarray_API[ 23 ]) : (*(PyArrayObject* (*) (void* buffer, NumarrayType type, int ndim, maybelong *shape) ) libnumarray_FatalApiError)) + +#define NA_ReturnOutput (libnumarray_API ? (*(PyObject* (*) (PyObject*,PyArrayObject*) ) libnumarray_API[ 24 ]) : (*(PyObject* (*) (PyObject*,PyArrayObject*) ) libnumarray_FatalApiError)) + +#define NA_getBufferPtrAndSize (libnumarray_API ? (*(long (*) (PyObject*,int,void**) ) libnumarray_API[ 25 ]) : (*(long (*) (PyObject*,int,void**) ) libnumarray_FatalApiError)) + +#define NA_checkIo (libnumarray_API ? (*(int (*) (char*,int,int,int,int) ) libnumarray_API[ 26 ]) : (*(int (*) (char*,int,int,int,int) ) libnumarray_FatalApiError)) + +#define NA_checkOneCBuffer (libnumarray_API ? (*(int (*) (char*,long,void*,long,size_t) ) libnumarray_API[ 27 ]) : (*(int (*) (char*,long,void*,long,size_t) ) libnumarray_FatalApiError)) + +#define NA_checkNCBuffers (libnumarray_API ? (*(int (*) (char*,int,long,void**,long*,Int8*,Int8*) ) libnumarray_API[ 28 ]) : (*(int (*) (char*,int,long,void**,long*,Int8*,Int8*) ) libnumarray_FatalApiError)) + +#define NA_checkOneStriding (libnumarray_API ? (*(int (*) (char*,long,maybelong*,long,maybelong*,long,long,int) ) libnumarray_API[ 29 ]) : (*(int (*) (char*,long,maybelong*,long,maybelong*,long,long,int) ) libnumarray_FatalApiError)) + +#define NA_new_cfunc (libnumarray_API ? (*(PyObject* (*) (CfuncDescriptor*) ) libnumarray_API[ 30 ]) : (*(PyObject* (*) (CfuncDescriptor*) ) libnumarray_FatalApiError)) + +#define NA_add_cfunc (libnumarray_API ? (*(int (*) (PyObject*,char*,CfuncDescriptor*) ) libnumarray_API[ 31 ]) : (*(int (*) (PyObject*,char*,CfuncDescriptor*) ) libnumarray_FatalApiError)) + +#define NA_InputArray (libnumarray_API ? (*(PyArrayObject* (*) (PyObject*,NumarrayType,int) ) libnumarray_API[ 32 ]) : (*(PyArrayObject* (*) (PyObject*,NumarrayType,int) ) libnumarray_FatalApiError)) + +#define NA_OutputArray (libnumarray_API ? (*(PyArrayObject* (*) (PyObject*,NumarrayType,int) ) libnumarray_API[ 33 ]) : (*(PyArrayObject* (*) (PyObject*,NumarrayType,int) ) libnumarray_FatalApiError)) + +#define NA_IoArray (libnumarray_API ? (*(PyArrayObject* (*) (PyObject*,NumarrayType,int) ) libnumarray_API[ 34 ]) : (*(PyArrayObject* (*) (PyObject*,NumarrayType,int) ) libnumarray_FatalApiError)) + +#define NA_OptionalOutputArray (libnumarray_API ? (*(PyArrayObject* (*) (PyObject*,NumarrayType,int,PyArrayObject*) ) libnumarray_API[ 35 ]) : (*(PyArrayObject* (*) (PyObject*,NumarrayType,int,PyArrayObject*) ) libnumarray_FatalApiError)) + +#define NA_get_offset (libnumarray_API ? (*(long (*) (PyArrayObject*,int,...) ) libnumarray_API[ 36 ]) : (*(long (*) (PyArrayObject*,int,...) ) libnumarray_FatalApiError)) + +#define NA_get_Float64 (libnumarray_API ? (*(Float64 (*) (PyArrayObject*,long) ) libnumarray_API[ 37 ]) : (*(Float64 (*) (PyArrayObject*,long) ) libnumarray_FatalApiError)) + +#define NA_set_Float64 (libnumarray_API ? (*(void (*) (PyArrayObject*,long,Float64) ) libnumarray_API[ 38 ]) : (*(void (*) (PyArrayObject*,long,Float64) ) libnumarray_FatalApiError)) + +#define NA_get_Complex64 (libnumarray_API ? (*(Complex64 (*) (PyArrayObject*,long) ) libnumarray_API[ 39 ]) : (*(Complex64 (*) (PyArrayObject*,long) ) libnumarray_FatalApiError)) + +#define NA_set_Complex64 (libnumarray_API ? (*(void (*) (PyArrayObject*,long,Complex64) ) libnumarray_API[ 40 ]) : (*(void (*) (PyArrayObject*,long,Complex64) ) libnumarray_FatalApiError)) + +#define NA_get_Int64 (libnumarray_API ? (*(Int64 (*) (PyArrayObject*,long) ) libnumarray_API[ 41 ]) : (*(Int64 (*) (PyArrayObject*,long) ) libnumarray_FatalApiError)) + +#define NA_set_Int64 (libnumarray_API ? (*(void (*) (PyArrayObject*,long,Int64) ) libnumarray_API[ 42 ]) : (*(void (*) (PyArrayObject*,long,Int64) ) libnumarray_FatalApiError)) + +#define NA_get1_Float64 (libnumarray_API ? (*(Float64 (*) (PyArrayObject*,long) ) libnumarray_API[ 43 ]) : (*(Float64 (*) (PyArrayObject*,long) ) libnumarray_FatalApiError)) + +#define NA_get2_Float64 (libnumarray_API ? (*(Float64 (*) (PyArrayObject*,long,long) ) libnumarray_API[ 44 ]) : (*(Float64 (*) (PyArrayObject*,long,long) ) libnumarray_FatalApiError)) + +#define NA_get3_Float64 (libnumarray_API ? (*(Float64 (*) (PyArrayObject*,long,long,long) ) libnumarray_API[ 45 ]) : (*(Float64 (*) (PyArrayObject*,long,long,long) ) libnumarray_FatalApiError)) + +#define NA_set1_Float64 (libnumarray_API ? (*(void (*) (PyArrayObject*,long,Float64) ) libnumarray_API[ 46 ]) : (*(void (*) (PyArrayObject*,long,Float64) ) libnumarray_FatalApiError)) + +#define NA_set2_Float64 (libnumarray_API ? (*(void (*) (PyArrayObject*,long,long,Float64) ) libnumarray_API[ 47 ]) : (*(void (*) (PyArrayObject*,long,long,Float64) ) libnumarray_FatalApiError)) + +#define NA_set3_Float64 (libnumarray_API ? (*(void (*) (PyArrayObject*,long,long,long,Float64) ) libnumarray_API[ 48 ]) : (*(void (*) (PyArrayObject*,long,long,long,Float64) ) libnumarray_FatalApiError)) + +#define NA_get1_Complex64 (libnumarray_API ? (*(Complex64 (*) (PyArrayObject*,long) ) libnumarray_API[ 49 ]) : (*(Complex64 (*) (PyArrayObject*,long) ) libnumarray_FatalApiError)) + +#define NA_get2_Complex64 (libnumarray_API ? (*(Complex64 (*) (PyArrayObject*,long,long) ) libnumarray_API[ 50 ]) : (*(Complex64 (*) (PyArrayObject*,long,long) ) libnumarray_FatalApiError)) + +#define NA_get3_Complex64 (libnumarray_API ? (*(Complex64 (*) (PyArrayObject*,long,long,long) ) libnumarray_API[ 51 ]) : (*(Complex64 (*) (PyArrayObject*,long,long,long) ) libnumarray_FatalApiError)) + +#define NA_set1_Complex64 (libnumarray_API ? (*(void (*) (PyArrayObject*,long,Complex64) ) libnumarray_API[ 52 ]) : (*(void (*) (PyArrayObject*,long,Complex64) ) libnumarray_FatalApiError)) + +#define NA_set2_Complex64 (libnumarray_API ? (*(void (*) (PyArrayObject*,long,long,Complex64) ) libnumarray_API[ 53 ]) : (*(void (*) (PyArrayObject*,long,long,Complex64) ) libnumarray_FatalApiError)) + +#define NA_set3_Complex64 (libnumarray_API ? (*(void (*) (PyArrayObject*,long,long,long,Complex64) ) libnumarray_API[ 54 ]) : (*(void (*) (PyArrayObject*,long,long,long,Complex64) ) libnumarray_FatalApiError)) + +#define NA_get1_Int64 (libnumarray_API ? (*(Int64 (*) (PyArrayObject*,long) ) libnumarray_API[ 55 ]) : (*(Int64 (*) (PyArrayObject*,long) ) libnumarray_FatalApiError)) + +#define NA_get2_Int64 (libnumarray_API ? (*(Int64 (*) (PyArrayObject*,long,long) ) libnumarray_API[ 56 ]) : (*(Int64 (*) (PyArrayObject*,long,long) ) libnumarray_FatalApiError)) + +#define NA_get3_Int64 (libnumarray_API ? (*(Int64 (*) (PyArrayObject*,long,long,long) ) libnumarray_API[ 57 ]) : (*(Int64 (*) (PyArrayObject*,long,long,long) ) libnumarray_FatalApiError)) + +#define NA_set1_Int64 (libnumarray_API ? (*(void (*) (PyArrayObject*,long,Int64) ) libnumarray_API[ 58 ]) : (*(void (*) (PyArrayObject*,long,Int64) ) libnumarray_FatalApiError)) + +#define NA_set2_Int64 (libnumarray_API ? (*(void (*) (PyArrayObject*,long,long,Int64) ) libnumarray_API[ 59 ]) : (*(void (*) (PyArrayObject*,long,long,Int64) ) libnumarray_FatalApiError)) + +#define NA_set3_Int64 (libnumarray_API ? (*(void (*) (PyArrayObject*,long,long,long,Int64) ) libnumarray_API[ 60 ]) : (*(void (*) (PyArrayObject*,long,long,long,Int64) ) libnumarray_FatalApiError)) + +#define NA_get1D_Float64 (libnumarray_API ? (*(int (*) (PyArrayObject*,long,int,Float64*) ) libnumarray_API[ 61 ]) : (*(int (*) (PyArrayObject*,long,int,Float64*) ) libnumarray_FatalApiError)) + +#define NA_set1D_Float64 (libnumarray_API ? (*(int (*) (PyArrayObject*,long,int,Float64*) ) libnumarray_API[ 62 ]) : (*(int (*) (PyArrayObject*,long,int,Float64*) ) libnumarray_FatalApiError)) + +#define NA_get1D_Int64 (libnumarray_API ? (*(int (*) (PyArrayObject*,long,int,Int64*) ) libnumarray_API[ 63 ]) : (*(int (*) (PyArrayObject*,long,int,Int64*) ) libnumarray_FatalApiError)) + +#define NA_set1D_Int64 (libnumarray_API ? (*(int (*) (PyArrayObject*,long,int,Int64*) ) libnumarray_API[ 64 ]) : (*(int (*) (PyArrayObject*,long,int,Int64*) ) libnumarray_FatalApiError)) + +#define NA_get1D_Complex64 (libnumarray_API ? (*(int (*) (PyArrayObject*,long,int,Complex64*) ) libnumarray_API[ 65 ]) : (*(int (*) (PyArrayObject*,long,int,Complex64*) ) libnumarray_FatalApiError)) + +#define NA_set1D_Complex64 (libnumarray_API ? (*(int (*) (PyArrayObject*,long,int,Complex64*) ) libnumarray_API[ 66 ]) : (*(int (*) (PyArrayObject*,long,int,Complex64*) ) libnumarray_FatalApiError)) + +#define NA_ShapeEqual (libnumarray_API ? (*(int (*) (PyArrayObject*,PyArrayObject*) ) libnumarray_API[ 67 ]) : (*(int (*) (PyArrayObject*,PyArrayObject*) ) libnumarray_FatalApiError)) + +#define NA_ShapeLessThan (libnumarray_API ? (*(int (*) (PyArrayObject*,PyArrayObject*) ) libnumarray_API[ 68 ]) : (*(int (*) (PyArrayObject*,PyArrayObject*) ) libnumarray_FatalApiError)) + +#define NA_ByteOrder (libnumarray_API ? (*(int (*) (void) ) libnumarray_API[ 69 ]) : (*(int (*) (void) ) libnumarray_FatalApiError)) + +#define NA_IeeeSpecial32 (libnumarray_API ? (*(Bool (*) (Float32*,Int32*) ) libnumarray_API[ 70 ]) : (*(Bool (*) (Float32*,Int32*) ) libnumarray_FatalApiError)) + +#define NA_IeeeSpecial64 (libnumarray_API ? (*(Bool (*) (Float64*,Int32*) ) libnumarray_API[ 71 ]) : (*(Bool (*) (Float64*,Int32*) ) libnumarray_FatalApiError)) + +#define NA_updateDataPtr (libnumarray_API ? (*(PyArrayObject* (*) (PyArrayObject*) ) libnumarray_API[ 72 ]) : (*(PyArrayObject* (*) (PyArrayObject*) ) libnumarray_FatalApiError)) + +#define NA_typeNoToName (libnumarray_API ? (*(char* (*) (int) ) libnumarray_API[ 73 ]) : (*(char* (*) (int) ) libnumarray_FatalApiError)) + +#define NA_nameToTypeNo (libnumarray_API ? (*(int (*) (char*) ) libnumarray_API[ 74 ]) : (*(int (*) (char*) ) libnumarray_FatalApiError)) + +#define NA_typeNoToTypeObject (libnumarray_API ? (*(PyObject* (*) (int) ) libnumarray_API[ 75 ]) : (*(PyObject* (*) (int) ) libnumarray_FatalApiError)) + +#define NA_intTupleFromMaybeLongs (libnumarray_API ? (*(PyObject* (*) (int,maybelong*) ) libnumarray_API[ 76 ]) : (*(PyObject* (*) (int,maybelong*) ) libnumarray_FatalApiError)) + +#define NA_maybeLongsFromIntTuple (libnumarray_API ? (*(long (*) (int,maybelong*,PyObject*) ) libnumarray_API[ 77 ]) : (*(long (*) (int,maybelong*,PyObject*) ) libnumarray_FatalApiError)) + +#define NA_intTupleProduct (libnumarray_API ? (*(int (*) (PyObject *obj, long *product) ) libnumarray_API[ 78 ]) : (*(int (*) (PyObject *obj, long *product) ) libnumarray_FatalApiError)) + +#define NA_isIntegerSequence (libnumarray_API ? (*(long (*) (PyObject*) ) libnumarray_API[ 79 ]) : (*(long (*) (PyObject*) ) libnumarray_FatalApiError)) + +#define NA_setArrayFromSequence (libnumarray_API ? (*(PyObject* (*) (PyArrayObject*,PyObject*) ) libnumarray_API[ 80 ]) : (*(PyObject* (*) (PyArrayObject*,PyObject*) ) libnumarray_FatalApiError)) + +#define NA_maxType (libnumarray_API ? (*(int (*) (PyObject*) ) libnumarray_API[ 81 ]) : (*(int (*) (PyObject*) ) libnumarray_FatalApiError)) + +#define NA_isPythonScalar (libnumarray_API ? (*(int (*) (PyObject *obj) ) libnumarray_API[ 82 ]) : (*(int (*) (PyObject *obj) ) libnumarray_FatalApiError)) + +#define NA_getPythonScalar (libnumarray_API ? (*(PyObject* (*) (PyArrayObject*,long) ) libnumarray_API[ 83 ]) : (*(PyObject* (*) (PyArrayObject*,long) ) libnumarray_FatalApiError)) + +#define NA_setFromPythonScalar (libnumarray_API ? (*(int (*) (PyArrayObject*,long,PyObject*) ) libnumarray_API[ 84 ]) : (*(int (*) (PyArrayObject*,long,PyObject*) ) libnumarray_FatalApiError)) + +#define NA_NDArrayCheck (libnumarray_API ? (*(int (*) (PyObject*) ) libnumarray_API[ 85 ]) : (*(int (*) (PyObject*) ) libnumarray_FatalApiError)) + +#define NA_NumArrayCheck (libnumarray_API ? (*(int (*) (PyObject*) ) libnumarray_API[ 86 ]) : (*(int (*) (PyObject*) ) libnumarray_FatalApiError)) + +#define NA_ComplexArrayCheck (libnumarray_API ? (*(int (*) (PyObject*) ) libnumarray_API[ 87 ]) : (*(int (*) (PyObject*) ) libnumarray_FatalApiError)) + +#define NA_elements (libnumarray_API ? (*(unsigned long (*) (PyArrayObject*) ) libnumarray_API[ 88 ]) : (*(unsigned long (*) (PyArrayObject*) ) libnumarray_FatalApiError)) + +#define NA_typeObjectToTypeNo (libnumarray_API ? (*(int (*) (PyObject*) ) libnumarray_API[ 89 ]) : (*(int (*) (PyObject*) ) libnumarray_FatalApiError)) + +#define NA_copyArray (libnumarray_API ? (*(int (*) (PyArrayObject* to, const PyArrayObject* from) ) libnumarray_API[ 90 ]) : (*(int (*) (PyArrayObject* to, const PyArrayObject* from) ) libnumarray_FatalApiError)) + +#define NA_copy (libnumarray_API ? (*(PyArrayObject* (*) (PyArrayObject*) ) libnumarray_API[ 91 ]) : (*(PyArrayObject* (*) (PyArrayObject*) ) libnumarray_FatalApiError)) + +#define NA_getType (libnumarray_API ? (*(PyObject* (*) (PyObject *typeobj_or_name) ) libnumarray_API[ 92 ]) : (*(PyObject* (*) (PyObject *typeobj_or_name) ) libnumarray_FatalApiError)) + +#define NA_callCUFuncCore (libnumarray_API ? (*(PyObject * (*) (PyObject *cfunc, long niter, long ninargs, long noutargs, PyObject **BufferObj, long *offset) ) libnumarray_API[ 93 ]) : (*(PyObject * (*) (PyObject *cfunc, long niter, long ninargs, long noutargs, PyObject **BufferObj, long *offset) ) libnumarray_FatalApiError)) + +#define NA_callStrideConvCFuncCore (libnumarray_API ? (*(PyObject * (*) (PyObject *cfunc, int nshape, maybelong *shape, PyObject *inbuffObj, long inboffset, int nstrides0, maybelong *inbstrides, PyObject *outbuffObj, long outboffset, int nstrides1, maybelong *outbstrides, long nbytes) ) libnumarray_API[ 94 ]) : (*(PyObject * (*) (PyObject *cfunc, int nshape, maybelong *shape, PyObject *inbuffObj, long inboffset, int nstrides0, maybelong *inbstrides, PyObject *outbuffObj, long outboffset, int nstrides1, maybelong *outbstrides, long nbytes) ) libnumarray_FatalApiError)) + +#define NA_stridesFromShape (libnumarray_API ? (*(void (*) (int nshape, maybelong *shape, maybelong bytestride, maybelong *strides) ) libnumarray_API[ 95 ]) : (*(void (*) (int nshape, maybelong *shape, maybelong bytestride, maybelong *strides) ) libnumarray_FatalApiError)) + +#define NA_OperatorCheck (libnumarray_API ? (*(int (*) (PyObject *obj) ) libnumarray_API[ 96 ]) : (*(int (*) (PyObject *obj) ) libnumarray_FatalApiError)) + +#define NA_ConverterCheck (libnumarray_API ? (*(int (*) (PyObject *obj) ) libnumarray_API[ 97 ]) : (*(int (*) (PyObject *obj) ) libnumarray_FatalApiError)) + +#define NA_UfuncCheck (libnumarray_API ? (*(int (*) (PyObject *obj) ) libnumarray_API[ 98 ]) : (*(int (*) (PyObject *obj) ) libnumarray_FatalApiError)) + +#define NA_CfuncCheck (libnumarray_API ? (*(int (*) (PyObject *obj) ) libnumarray_API[ 99 ]) : (*(int (*) (PyObject *obj) ) libnumarray_FatalApiError)) + +#define NA_getByteOffset (libnumarray_API ? (*(int (*) (PyArrayObject *array, int nindices, maybelong *indices, long *offset) ) libnumarray_API[ 100 ]) : (*(int (*) (PyArrayObject *array, int nindices, maybelong *indices, long *offset) ) libnumarray_FatalApiError)) + +#define NA_swapAxes (libnumarray_API ? (*(int (*) (PyArrayObject *array, int x, int y) ) libnumarray_API[ 101 ]) : (*(int (*) (PyArrayObject *array, int x, int y) ) libnumarray_FatalApiError)) + +#define NA_initModuleGlobal (libnumarray_API ? (*(PyObject * (*) (char *module, char *global) ) libnumarray_API[ 102 ]) : (*(PyObject * (*) (char *module, char *global) ) libnumarray_FatalApiError)) + +#define NA_NumarrayType (libnumarray_API ? (*(NumarrayType (*) (PyObject *seq) ) libnumarray_API[ 103 ]) : (*(NumarrayType (*) (PyObject *seq) ) libnumarray_FatalApiError)) + +#define NA_NewAllFromBuffer (libnumarray_API ? (*(PyArrayObject * (*) (int ndim, maybelong *shape, NumarrayType type, PyObject *bufferObject, maybelong byteoffset, maybelong bytestride, int byteorder, int aligned, int writeable) ) libnumarray_API[ 104 ]) : (*(PyArrayObject * (*) (int ndim, maybelong *shape, NumarrayType type, PyObject *bufferObject, maybelong byteoffset, maybelong bytestride, int byteorder, int aligned, int writeable) ) libnumarray_FatalApiError)) + +#define NA_alloc1D_Float64 (libnumarray_API ? (*(Float64 * (*) (PyArrayObject *a, long offset, int cnt) ) libnumarray_API[ 105 ]) : (*(Float64 * (*) (PyArrayObject *a, long offset, int cnt) ) libnumarray_FatalApiError)) + +#define NA_alloc1D_Int64 (libnumarray_API ? (*(Int64 * (*) (PyArrayObject *a, long offset, int cnt) ) libnumarray_API[ 106 ]) : (*(Int64 * (*) (PyArrayObject *a, long offset, int cnt) ) libnumarray_FatalApiError)) + +#define NA_updateAlignment (libnumarray_API ? (*(void (*) (PyArrayObject *self) ) libnumarray_API[ 107 ]) : (*(void (*) (PyArrayObject *self) ) libnumarray_FatalApiError)) + +#define NA_updateContiguous (libnumarray_API ? (*(void (*) (PyArrayObject *self) ) libnumarray_API[ 108 ]) : (*(void (*) (PyArrayObject *self) ) libnumarray_FatalApiError)) + +#define NA_updateStatus (libnumarray_API ? (*(void (*) (PyArrayObject *self) ) libnumarray_API[ 109 ]) : (*(void (*) (PyArrayObject *self) ) libnumarray_FatalApiError)) + +#define NA_NumArrayCheckExact (libnumarray_API ? (*(int (*) (PyObject *op) ) libnumarray_API[ 110 ]) : (*(int (*) (PyObject *op) ) libnumarray_FatalApiError)) + +#define NA_NDArrayCheckExact (libnumarray_API ? (*(int (*) (PyObject *op) ) libnumarray_API[ 111 ]) : (*(int (*) (PyObject *op) ) libnumarray_FatalApiError)) + +#define NA_OperatorCheckExact (libnumarray_API ? (*(int (*) (PyObject *op) ) libnumarray_API[ 112 ]) : (*(int (*) (PyObject *op) ) libnumarray_FatalApiError)) + +#define NA_ConverterCheckExact (libnumarray_API ? (*(int (*) (PyObject *op) ) libnumarray_API[ 113 ]) : (*(int (*) (PyObject *op) ) libnumarray_FatalApiError)) + +#define NA_UfuncCheckExact (libnumarray_API ? (*(int (*) (PyObject *op) ) libnumarray_API[ 114 ]) : (*(int (*) (PyObject *op) ) libnumarray_FatalApiError)) + +#define NA_CfuncCheckExact (libnumarray_API ? (*(int (*) (PyObject *op) ) libnumarray_API[ 115 ]) : (*(int (*) (PyObject *op) ) libnumarray_FatalApiError)) + +#define NA_getArrayData (libnumarray_API ? (*(char * (*) (PyArrayObject *ap) ) libnumarray_API[ 116 ]) : (*(char * (*) (PyArrayObject *ap) ) libnumarray_FatalApiError)) + +#define NA_updateByteswap (libnumarray_API ? (*(void (*) (PyArrayObject *ap) ) libnumarray_API[ 117 ]) : (*(void (*) (PyArrayObject *ap) ) libnumarray_FatalApiError)) + +#define NA_DescrFromType (libnumarray_API ? (*(PyArray_Descr * (*) (int type) ) libnumarray_API[ 118 ]) : (*(PyArray_Descr * (*) (int type) ) libnumarray_FatalApiError)) + +#define NA_Cast (libnumarray_API ? (*(PyObject * (*) (PyArrayObject *a, int type) ) libnumarray_API[ 119 ]) : (*(PyObject * (*) (PyArrayObject *a, int type) ) libnumarray_FatalApiError)) + +#define NA_checkFPErrors (libnumarray_API ? (*(int (*) (void) ) libnumarray_API[ 120 ]) : (*(int (*) (void) ) libnumarray_FatalApiError)) + +#define NA_clearFPErrors (libnumarray_API ? (*(void (*) (void) ) libnumarray_API[ 121 ]) : (*(void (*) (void) ) libnumarray_FatalApiError)) + +#define NA_checkAndReportFPErrors (libnumarray_API ? (*(int (*) (char *name) ) libnumarray_API[ 122 ]) : (*(int (*) (char *name) ) libnumarray_FatalApiError)) + +#define NA_IeeeMask32 (libnumarray_API ? (*(Bool (*) (Float32,Int32) ) libnumarray_API[ 123 ]) : (*(Bool (*) (Float32,Int32) ) libnumarray_FatalApiError)) + +#define NA_IeeeMask64 (libnumarray_API ? (*(Bool (*) (Float64,Int32) ) libnumarray_API[ 124 ]) : (*(Bool (*) (Float64,Int32) ) libnumarray_FatalApiError)) + +#define _NA_callStridingHelper (libnumarray_API ? (*(int (*) (PyObject *aux, long dim, long nnumarray, PyArrayObject *numarray[], char *data[], CFUNC_STRIDED_FUNC f) ) libnumarray_API[ 125 ]) : (*(int (*) (PyObject *aux, long dim, long nnumarray, PyArrayObject *numarray[], char *data[], CFUNC_STRIDED_FUNC f) ) libnumarray_FatalApiError)) + +#define NA_FromDimsStridesDescrAndData (libnumarray_API ? (*(PyArrayObject * (*) (int nd, maybelong *dims, maybelong *strides, PyArray_Descr *descr, char *data) ) libnumarray_API[ 126 ]) : (*(PyArrayObject * (*) (int nd, maybelong *dims, maybelong *strides, PyArray_Descr *descr, char *data) ) libnumarray_FatalApiError)) + +#define NA_FromDimsTypeAndData (libnumarray_API ? (*(PyArrayObject * (*) (int nd, maybelong *dims, int type, char *data) ) libnumarray_API[ 127 ]) : (*(PyArrayObject * (*) (int nd, maybelong *dims, int type, char *data) ) libnumarray_FatalApiError)) + +#define NA_FromDimsStridesTypeAndData (libnumarray_API ? (*(PyArrayObject * (*) (int nd, maybelong *dims, maybelong *strides, int type, char *data) ) libnumarray_API[ 128 ]) : (*(PyArrayObject * (*) (int nd, maybelong *dims, maybelong *strides, int type, char *data) ) libnumarray_FatalApiError)) + +#define NA_scipy_typestr (libnumarray_API ? (*(int (*) (NumarrayType t, int byteorder, char *typestr) ) libnumarray_API[ 129 ]) : (*(int (*) (NumarrayType t, int byteorder, char *typestr) ) libnumarray_FatalApiError)) + +#define NA_FromArrayStruct (libnumarray_API ? (*(PyArrayObject * (*) (PyObject *a) ) libnumarray_API[ 130 ]) : (*(PyArrayObject * (*) (PyObject *a) ) libnumarray_FatalApiError)) + +#endif + + /* Total number of C API pointers */ +#define libnumarray_API_pointers 131 + +#ifdef __cplusplus +} +#endif + +#endif /* NUMPY_LIBNUMARRAY_H */ Property changes on: trunk/numpy/numarray/include/numpy/libnumarray.h ___________________________________________________________________ Name: svn:keywords + Id Author Name: svn:eol-style + native Copied: trunk/numpy/numarray/include/numpy/numcomplex.h (from rev 8211, trunk/numpy/numarray/numpy/numcomplex.h) =================================================================== --- trunk/numpy/numarray/include/numpy/numcomplex.h (rev 0) +++ trunk/numpy/numarray/include/numpy/numcomplex.h 2010-02-21 02:50:19 UTC (rev 8212) @@ -0,0 +1,252 @@ +/* See numarray.h for Complex32, Complex64: + +typedef struct { Float32 r, i; } Complex32; +typedef struct { Float64 r, i; } Complex64; + +*/ +typedef struct { Float32 a, theta; } PolarComplex32; +typedef struct { Float64 a, theta; } PolarComplex64; + +#define NUM_SQ(x) ((x)*(x)) + +#define NUM_CABSSQ(p) (NUM_SQ((p).r) + NUM_SQ((p).i)) + +#define NUM_CABS(p) sqrt(NUM_CABSSQ(p)) + +#define NUM_C_TO_P(c, p) (p).a = NUM_CABS(c); \ + (p).theta = atan2((c).i, (c).r); + +#define NUM_P_TO_C(p, c) (c).r = (p).a*cos((p).theta); \ + (c).i = (p).a*sin((p).theta); + +#define NUM_CASS(p, q) (q).r = (p).r, (q).i = (p).i + +#define NUM_CADD(p, q, s) (s).r = (p).r + (q).r, \ + (s).i = (p).i + (q).i + +#define NUM_CSUB(p, q, s) (s).r = (p).r - (q).r, \ + (s).i = (p).i - (q).i + +#define NUM_CMUL(p, q, s) \ + { Float64 rp = (p).r; \ + Float64 rq = (q).r; \ + (s).r = rp*rq - (p).i*(q).i; \ + (s).i = rp*(q).i + rq*(p).i; \ + } + +#define NUM_CDIV(p, q, s) \ + { \ + Float64 rp = (p).r; \ + Float64 ip = (p).i; \ + Float64 rq = (q).r; \ + if ((q).i != 0) { \ + Float64 temp = NUM_CABSSQ(q); \ + (s).r = (rp*rq+(p).i*(q).i)/temp; \ + (s).i = (rq*(p).i-(q).i*rp)/temp; \ + } else { \ + (s).r = rp/rq; \ + (s).i = ip/rq; \ + } \ + } + +#define NUM_CREM(p, q, s) \ + { Complex64 r; \ + NUM_CDIV(p, q, r); \ + r.r = floor(r.r); \ + r.i = 0; \ + NUM_CMUL(r, q, r); \ + NUM_CSUB(p, r, s); \ + } + +#define NUM_CMINUS(p, s) (s).r = -(p).r; (s).i = -(p).i; +#define NUM_CNEG NUM_CMINUS + +#define NUM_CEQ(p, q) (((p).r == (q).r) && ((p).i == (q).i)) +#define NUM_CNE(p, q) (((p).r != (q).r) || ((p).i != (q).i)) +#define NUM_CLT(p, q) ((p).r < (q).r) +#define NUM_CGT(p, q) ((p).r > (q).r) +#define NUM_CLE(p, q) ((p).r <= (q).r) +#define NUM_CGE(p, q) ((p).r >= (q).r) + +/* e**z = e**x * (cos(y)+ i*sin(y)) where z = x + i*y + so e**z = e**x * cos(y) + i * e**x * sin(y) +*/ +#define NUM_CEXP(p, s) \ + { Float64 ex = exp((p).r); \ + (s).r = ex * cos((p).i); \ + (s).i = ex * sin((p).i); \ + } + +/* e**w = z; w = u + i*v; z = r * e**(i*theta); + +e**u * e**(i*v) = r * e**(i*theta); + +log(z) = w; log(z) = log(r) + i*theta; + */ +#define NUM_CLOG(p, s) \ + { PolarComplex64 temp; NUM_C_TO_P(p, temp); \ + (s).r = num_log(temp.a); \ + (s).i = temp.theta; \ + } + +#define NUM_LOG10_E 0.43429448190325182 + +#define NUM_CLOG10(p, s) \ + { NUM_CLOG(p, s); \ + (s).r *= NUM_LOG10_E; \ + (s).i *= NUM_LOG10_E; \ + } + +/* s = p ** q */ +#define NUM_CPOW(p, q, s) { if (NUM_CABSSQ(p) == 0) { \ + if ((q).r == 0 && (q).i == 0) { \ + (s).r = (s).i = 1; \ + } else { \ + (s).r = (s).i = 0; \ + } \ + } else { \ + NUM_CLOG(p, s); \ + NUM_CMUL(s, q, s); \ + NUM_CEXP(s, s); \ + } \ + } + +#define NUM_CSQRT(p, s) { Complex64 temp; temp.r = 0.5; temp.i=0; \ + NUM_CPOW(p, temp, s); \ + } + +#define NUM_CSQR(p, s) { Complex64 temp; temp.r = 2.0; temp.i=0; \ + NUM_CPOW(p, temp, s); \ + } + +#define NUM_CSIN(p, s) { Float64 sp = sin((p).r); \ + Float64 cp = cos((p).r); \ + (s).r = cosh((p).i) * sp; \ + (s).i = sinh((p).i) * cp; \ + } + +#define NUM_CCOS(p, s) { Float64 sp = sin((p).r); \ + Float64 cp = cos((p).r); \ + (s).r = cosh((p).i) * cp; \ + (s).i = -sinh((p).i) * sp; \ + } + +#define NUM_CTAN(p, s) { Complex64 ss, cs; \ + NUM_CSIN(p, ss); \ + NUM_CCOS(p, cs); \ + NUM_CDIV(ss, cs, s); \ + } + +#define NUM_CSINH(p, s) { Float64 sp = sin((p).i); \ + Float64 cp = cos((p).i); \ + (s).r = sinh((p).r) * cp; \ + (s).i = cosh((p).r) * sp; \ + } + +#define NUM_CCOSH(p, s) { Float64 sp = sin((p).i); \ + Float64 cp = cos((p).i); \ + (s).r = cosh((p).r) * cp; \ + (s).i = sinh((p).r) * sp; \ + } + +#define NUM_CTANH(p, s) { Complex64 ss, cs; \ + NUM_CSINH(p, ss); \ + NUM_CCOSH(p, cs); \ + NUM_CDIV(ss, cs, s); \ + } + +#define NUM_CRPOW(p, v, s) { Complex64 cr; cr.r = v; cr.i = 0; \ + NUM_CPOW(p,cr,s); \ + } + +#define NUM_CRMUL(p, v, s) (s).r = (p).r * v; (s).i = (p).i * v; + +#define NUM_CIMUL(p, s) { Float64 temp = (s).r; \ + (s).r = -(p).i; (s).i = temp; \ + } + +/* asin(z) = -i * log(i*z + (1 - z**2)**0.5) */ +#define NUM_CASIN(p, s) { Complex64 p1; NUM_CASS(p, p1); \ + NUM_CIMUL(p, p1); \ + NUM_CMUL(p, p, s); \ + NUM_CNEG(s, s); \ + (s).r += 1; \ + NUM_CRPOW(s, 0.5, s); \ + NUM_CADD(p1, s, s); \ + NUM_CLOG(s, s); \ + NUM_CIMUL(s, s); \ + NUM_CNEG(s, s); \ + } + +/* acos(z) = -i * log(z + i*(1 - z**2)**0.5) */ +#define NUM_CACOS(p, s) { Complex64 p1; NUM_CASS(p, p1); \ + NUM_CMUL(p, p, s); \ + NUM_CNEG(s, s); \ + (s).r += 1; \ + NUM_CRPOW(s, 0.5, s); \ + NUM_CIMUL(s, s); \ + NUM_CADD(p1, s, s); \ + NUM_CLOG(s, s); \ + NUM_CIMUL(s, s); \ + NUM_CNEG(s, s); \ + } + +/* atan(z) = i/2 * log( (i+z) / (i - z) ) */ +#define NUM_CATAN(p, s) { Complex64 p1, p2; \ + NUM_CASS(p, p1); NUM_CNEG(p, p2); \ + p1.i += 1; \ + p2.i += 1; \ + NUM_CDIV(p1, p2, s); \ + NUM_CLOG(s, s); \ + NUM_CIMUL(s, s); \ + NUM_CRMUL(s, 0.5, s); \ + } + +/* asinh(z) = log( z + (z**2 + 1)**0.5 ) */ +#define NUM_CASINH(p, s) { Complex64 p1; NUM_CASS(p, p1); \ + NUM_CMUL(p, p, s); \ + (s).r += 1; \ + NUM_CRPOW(s, 0.5, s); \ + NUM_CADD(p1, s, s); \ + NUM_CLOG(s, s); \ + } + +/* acosh(z) = log( z + (z**2 - 1)**0.5 ) */ +#define NUM_CACOSH(p, s) { Complex64 p1; NUM_CASS(p, p1); \ + NUM_CMUL(p, p, s); \ + (s).r -= 1; \ + NUM_CRPOW(s, 0.5, s); \ + NUM_CADD(p1, s, s); \ + NUM_CLOG(s, s); \ + } + +/* atanh(z) = 1/2 * log( (1+z)/(1-z) ) */ +#define NUM_CATANH(p, s) { Complex64 p1, p2; \ + NUM_CASS(p, p1); NUM_CNEG(p, p2); \ + p1.r += 1; \ + p2.r += 1; \ + NUM_CDIV(p1, p2, s); \ + NUM_CLOG(s, s); \ + NUM_CRMUL(s, 0.5, s); \ + } + + +#define NUM_CMIN(p, q) (NUM_CLE(p, q) ? p : q) +#define NUM_CMAX(p, q) (NUM_CGE(p, q) ? p : q) + +#define NUM_CNZ(p) (((p).r != 0) || ((p).i != 0)) +#define NUM_CLAND(p, q) (NUM_CNZ(p) & NUM_CNZ(q)) +#define NUM_CLOR(p, q) (NUM_CNZ(p) | NUM_CNZ(q)) +#define NUM_CLXOR(p, q) (NUM_CNZ(p) ^ NUM_CNZ(q)) +#define NUM_CLNOT(p) (!NUM_CNZ(p)) + +#define NUM_CFLOOR(p, s) (s).r = floor((p).r); (s).i = floor((p).i); +#define NUM_CCEIL(p, s) (s).r = ceil((p).r); (s).i = ceil((p).i); + +#define NUM_CFABS(p, s) (s).r = fabs((p).r); (s).i = fabs((p).i); +#define NUM_CROUND(p, s) (s).r = num_round((p).r); (s).i = num_round((p).i); +#define NUM_CHYPOT(p, q, s) { Complex64 t; \ + NUM_CSQR(p, s); NUM_CSQR(q, t); \ + NUM_CADD(s, t, s); \ + NUM_CSQRT(s, s); \ + } Property changes on: trunk/numpy/numarray/include/numpy/numcomplex.h ___________________________________________________________________ Name: svn:keywords + Id Author Name: svn:eol-style + native Copied: trunk/numpy/numarray/include/numpy/nummacro.h (from rev 8211, trunk/numpy/numarray/numpy/nummacro.h) =================================================================== --- trunk/numpy/numarray/include/numpy/nummacro.h (rev 0) +++ trunk/numpy/numarray/include/numpy/nummacro.h 2010-02-21 02:50:19 UTC (rev 8212) @@ -0,0 +1,447 @@ +/* Primarily for compatibility with numarray C-API */ + +#if !defined(_ndarraymacro) +#define _ndarraymacro + +/* The structs defined here are private implementation details of numarray +which are subject to change w/o notice. +*/ + +#define PY_BOOL_CHAR "b" +#define PY_INT8_CHAR "b" +#define PY_INT16_CHAR "h" +#define PY_INT32_CHAR "i" +#define PY_FLOAT32_CHAR "f" +#define PY_FLOAT64_CHAR "d" +#define PY_UINT8_CHAR "h" +#define PY_UINT16_CHAR "i" +#define PY_UINT32_CHAR "i" /* Unless longer int available */ +#define PY_COMPLEX64_CHAR "D" +#define PY_COMPLEX128_CHAR "D" + +#define PY_LONG_CHAR "l" +#define PY_LONG_LONG_CHAR "L" + +#define pyFPE_DIVIDE_BY_ZERO 1 +#define pyFPE_OVERFLOW 2 +#define pyFPE_UNDERFLOW 4 +#define pyFPE_INVALID 8 + +#define isNonZERO(x) (x != 0) /* to convert values to boolean 1's or 0's */ + +typedef enum +{ + NUM_CONTIGUOUS=1, + NUM_NOTSWAPPED=0x0200, + NUM_ALIGNED=0x0100, + NUM_WRITABLE=0x0400, + NUM_COPY=0x0020, + + NUM_C_ARRAY = (NUM_CONTIGUOUS | NUM_ALIGNED | NUM_NOTSWAPPED), + NUM_UNCONVERTED = 0 +} NumRequirements; + +#define UNCONVERTED 0 +#define C_ARRAY (NUM_CONTIGUOUS | NUM_NOTSWAPPED | NUM_ALIGNED) + +#define MUST_BE_COMPUTED 2 + +#define NUM_FLOORDIVIDE(a,b,out) (out) = floor((a)/(b)) + +#define NA_Begin() Py_Initialize(); import_libnumarray(); +#define NA_End() NA_Done(); Py_Finalize(); + +#define NA_OFFSETDATA(num) ((void *) PyArray_DATA(num)) + +/* unaligned NA_COPY functions */ +#define NA_COPY1(i, o) (*(o) = *(i)) +#define NA_COPY2(i, o) NA_COPY1(i, o), NA_COPY1(i+1, o+1) +#define NA_COPY4(i, o) NA_COPY2(i, o), NA_COPY2(i+2, o+2) +#define NA_COPY8(i, o) NA_COPY4(i, o), NA_COPY4(i+4, o+4) +#define NA_COPY16(i, o) NA_COPY8(i, o), NA_COPY8(i+8, o+8) + +/* byteswapping macros: these fail if i==o */ +#define NA_SWAP1(i, o) NA_COPY1(i, o) +#define NA_SWAP2(i, o) NA_SWAP1(i, o+1), NA_SWAP1(i+1, o) +#define NA_SWAP4(i, o) NA_SWAP2(i, o+2), NA_SWAP2(i+2, o) +#define NA_SWAP8(i, o) NA_SWAP4(i, o+4), NA_SWAP4(i+4, o) +#define NA_SWAP16(i, o) NA_SWAP8(i, o+8), NA_SWAP8(i+8, o) + +/* complex byteswaps must swap each part (real, imag) independently */ +#define NA_COMPLEX_SWAP8(i, o) NA_SWAP4(i, o), NA_SWAP4(i+4, o+4) +#define NA_COMPLEX_SWAP16(i, o) NA_SWAP8(i, o), NA_SWAP8(i+8, o+8) + +/* byteswapping macros: these work even if i == o */ +#define NA_TSWAP1(i, o, t) NA_COPY1(i, t), NA_SWAP1(t, o) +#define NA_TSWAP2(i, o, t) NA_COPY2(i, t), NA_SWAP2(t, o) +#define NA_TSWAP4(i, o, t) NA_COPY4(i, t), NA_SWAP4(t, o) +#define NA_TSWAP8(i, o, t) NA_COPY8(i, t), NA_SWAP8(t, o) + +/* fast copy functions for %N aligned i and o */ +#define NA_ACOPY1(i, o) (((Int8 *)o)[0] = ((Int8 *)i)[0]) +#define NA_ACOPY2(i, o) (((Int16 *)o)[0] = ((Int16 *)i)[0]) +#define NA_ACOPY4(i, o) (((Int32 *)o)[0] = ((Int32 *)i)[0]) +#define NA_ACOPY8(i, o) (((Float64 *)o)[0] = ((Float64 *)i)[0]) +#define NA_ACOPY16(i, o) (((Complex64 *)o)[0] = ((Complex64 *)i)[0]) + +/* from here down, type("ai") is NDInfo* */ + +#define NA_PTR(ai) ((char *) NA_OFFSETDATA((ai))) +#define NA_PTR1(ai, i) (NA_PTR(ai) + \ + (i)*(ai)->strides[0]) +#define NA_PTR2(ai, i, j) (NA_PTR(ai) + \ + (i)*(ai)->strides[0] + \ + (j)*(ai)->strides[1]) +#define NA_PTR3(ai, i, j, k) (NA_PTR(ai) + \ + (i)*(ai)->strides[0] + \ + (j)*(ai)->strides[1] + \ + (k)*(ai)->strides[2]) + +#define NA_SET_TEMP(ai, type, v) (((type *) &__temp__)[0] = v) + +#define NA_SWAPComplex64 NA_COMPLEX_SWAP16 +#define NA_SWAPComplex32 NA_COMPLEX_SWAP8 +#define NA_SWAPFloat64 NA_SWAP8 +#define NA_SWAPFloat32 NA_SWAP4 +#define NA_SWAPInt64 NA_SWAP8 +#define NA_SWAPUInt64 NA_SWAP8 +#define NA_SWAPInt32 NA_SWAP4 +#define NA_SWAPUInt32 NA_SWAP4 +#define NA_SWAPInt16 NA_SWAP2 +#define NA_SWAPUInt16 NA_SWAP2 +#define NA_SWAPInt8 NA_SWAP1 +#define NA_SWAPUInt8 NA_SWAP1 +#define NA_SWAPBool NA_SWAP1 + +#define NA_COPYComplex64 NA_COPY16 +#define NA_COPYComplex32 NA_COPY8 +#define NA_COPYFloat64 NA_COPY8 +#define NA_COPYFloat32 NA_COPY4 +#define NA_COPYInt64 NA_COPY8 +#define NA_COPYUInt64 NA_COPY8 +#define NA_COPYInt32 NA_COPY4 +#define NA_COPYUInt32 NA_COPY4 +#define NA_COPYInt16 NA_COPY2 +#define NA_COPYUInt16 NA_COPY2 +#define NA_COPYInt8 NA_COPY1 +#define NA_COPYUInt8 NA_COPY1 +#define NA_COPYBool NA_COPY1 + +#ifdef __cplusplus +extern "C" { +#endif + +#define _makeGetPb(type) \ +static type _NA_GETPb_##type(char *ptr) \ +{ \ + type temp; \ + NA_SWAP##type(ptr, (char *)&temp); \ + return temp; \ +} + +#define _makeGetPa(type) \ +static type _NA_GETPa_##type(char *ptr) \ +{ \ + type temp; \ + NA_COPY##type(ptr, (char *)&temp); \ + return temp; \ +} + +_makeGetPb(Complex64) +_makeGetPb(Complex32) +_makeGetPb(Float64) +_makeGetPb(Float32) +_makeGetPb(Int64) +_makeGetPb(UInt64) +_makeGetPb(Int32) +_makeGetPb(UInt32) +_makeGetPb(Int16) +_makeGetPb(UInt16) +_makeGetPb(Int8) +_makeGetPb(UInt8) +_makeGetPb(Bool) + +_makeGetPa(Complex64) +_makeGetPa(Complex32) +_makeGetPa(Float64) +_makeGetPa(Float32) +_makeGetPa(Int64) +_makeGetPa(UInt64) +_makeGetPa(Int32) +_makeGetPa(UInt32) +_makeGetPa(Int16) +_makeGetPa(UInt16) +_makeGetPa(Int8) +_makeGetPa(UInt8) +_makeGetPa(Bool) + +#undef _makeGetPb +#undef _makeGetPa + +#define _makeSetPb(type) \ +static void _NA_SETPb_##type(char *ptr, type v) \ +{ \ + NA_SWAP##type(((char *)&v), ptr); \ + return; \ +} + +#define _makeSetPa(type) \ +static void _NA_SETPa_##type(char *ptr, type v) \ +{ \ + NA_COPY##type(((char *)&v), ptr); \ + return; \ +} + +_makeSetPb(Complex64) +_makeSetPb(Complex32) +_makeSetPb(Float64) +_makeSetPb(Float32) +_makeSetPb(Int64) +_makeSetPb(UInt64) +_makeSetPb(Int32) +_makeSetPb(UInt32) +_makeSetPb(Int16) +_makeSetPb(UInt16) +_makeSetPb(Int8) +_makeSetPb(UInt8) +_makeSetPb(Bool) + +_makeSetPa(Complex64) +_makeSetPa(Complex32) +_makeSetPa(Float64) +_makeSetPa(Float32) +_makeSetPa(Int64) +_makeSetPa(UInt64) +_makeSetPa(Int32) +_makeSetPa(UInt32) +_makeSetPa(Int16) +_makeSetPa(UInt16) +_makeSetPa(Int8) +_makeSetPa(UInt8) +_makeSetPa(Bool) + +#undef _makeSetPb +#undef _makeSetPa + +#ifdef __cplusplus + } +#endif + +/* ========================== ptr get/set ================================ */ + +/* byteswapping */ +#define NA_GETPb(ai, type, ptr) _NA_GETPb_##type(ptr) + +/* aligning */ +#define NA_GETPa(ai, type, ptr) _NA_GETPa_##type(ptr) + +/* fast (aligned, !byteswapped) */ +#define NA_GETPf(ai, type, ptr) (*((type *) (ptr))) + +#define NA_GETP(ai, type, ptr) \ + (PyArray_ISCARRAY(ai) ? NA_GETPf(ai, type, ptr) \ + : (PyArray_ISBYTESWAPPED(ai) ? \ + NA_GETPb(ai, type, ptr) \ + : NA_GETPa(ai, type, ptr))) + +/* NOTE: NA_SET* macros cannot be used as values. */ + +/* byteswapping */ +#define NA_SETPb(ai, type, ptr, v) _NA_SETPb_##type(ptr, v) + +/* aligning */ +#define NA_SETPa(ai, type, ptr, v) _NA_SETPa_##type(ptr, v) + +/* fast (aligned, !byteswapped) */ +#define NA_SETPf(ai, type, ptr, v) ((*((type *) ptr)) = (v)) + +#define NA_SETP(ai, type, ptr, v) \ + if (PyArray_ISCARRAY(ai)) { \ + NA_SETPf((ai), type, (ptr), (v)); \ + } else if (PyArray_ISBYTESWAPPED(ai)) { \ + NA_SETPb((ai), type, (ptr), (v)); \ + } else \ + NA_SETPa((ai), type, (ptr), (v)) + +/* ========================== 1 index get/set ============================ */ + +/* byteswapping */ +#define NA_GET1b(ai, type, i) NA_GETPb(ai, type, NA_PTR1(ai, i)) +/* aligning */ +#define NA_GET1a(ai, type, i) NA_GETPa(ai, type, NA_PTR1(ai, i)) +/* fast (aligned, !byteswapped) */ +#define NA_GET1f(ai, type, i) NA_GETPf(ai, type, NA_PTR1(ai, i)) +/* testing */ +#define NA_GET1(ai, type, i) NA_GETP(ai, type, NA_PTR1(ai, i)) + +/* byteswapping */ +#define NA_SET1b(ai, type, i, v) NA_SETPb(ai, type, NA_PTR1(ai, i), v) +/* aligning */ +#define NA_SET1a(ai, type, i, v) NA_SETPa(ai, type, NA_PTR1(ai, i), v) +/* fast (aligned, !byteswapped) */ +#define NA_SET1f(ai, type, i, v) NA_SETPf(ai, type, NA_PTR1(ai, i), v) +/* testing */ +#define NA_SET1(ai, type, i, v) NA_SETP(ai, type, NA_PTR1(ai, i), v) + +/* ========================== 2 index get/set ============================= */ + +/* byteswapping */ +#define NA_GET2b(ai, type, i, j) NA_GETPb(ai, type, NA_PTR2(ai, i, j)) +/* aligning */ +#define NA_GET2a(ai, type, i, j) NA_GETPa(ai, type, NA_PTR2(ai, i, j)) +/* fast (aligned, !byteswapped) */ +#define NA_GET2f(ai, type, i, j) NA_GETPf(ai, type, NA_PTR2(ai, i, j)) +/* testing */ +#define NA_GET2(ai, type, i, j) NA_GETP(ai, type, NA_PTR2(ai, i, j)) + +/* byteswapping */ +#define NA_SET2b(ai, type, i, j, v) NA_SETPb(ai, type, NA_PTR2(ai, i, j), v) +/* aligning */ +#define NA_SET2a(ai, type, i, j, v) NA_SETPa(ai, type, NA_PTR2(ai, i, j), v) +/* fast (aligned, !byteswapped) */ +#define NA_SET2f(ai, type, i, j, v) NA_SETPf(ai, type, NA_PTR2(ai, i, j), v) + +#define NA_SET2(ai, type, i, j, v) NA_SETP(ai, type, NA_PTR2(ai, i, j), v) + +/* ========================== 3 index get/set ============================= */ + +/* byteswapping */ +#define NA_GET3b(ai, type, i, j, k) NA_GETPb(ai, type, NA_PTR3(ai, i, j, k)) +/* aligning */ +#define NA_GET3a(ai, type, i, j, k) NA_GETPa(ai, type, NA_PTR3(ai, i, j, k)) +/* fast (aligned, !byteswapped) */ +#define NA_GET3f(ai, type, i, j, k) NA_GETPf(ai, type, NA_PTR3(ai, i, j, k)) +/* testing */ +#define NA_GET3(ai, type, i, j, k) NA_GETP(ai, type, NA_PTR3(ai, i, j, k)) + +/* byteswapping */ +#define NA_SET3b(ai, type, i, j, k, v) \ + NA_SETPb(ai, type, NA_PTR3(ai, i, j, k), v) +/* aligning */ +#define NA_SET3a(ai, type, i, j, k, v) \ + NA_SETPa(ai, type, NA_PTR3(ai, i, j, k), v) +/* fast (aligned, !byteswapped) */ +#define NA_SET3f(ai, type, i, j, k, v) \ + NA_SETPf(ai, type, NA_PTR3(ai, i, j, k), v) +#define NA_SET3(ai, type, i, j, k, v) \ + NA_SETP(ai, type, NA_PTR3(ai, i, j, k), v) + +/* ========================== 1D get/set ================================== */ + +#define NA_GET1Db(ai, type, base, cnt, out) \ + { int i, stride = ai->strides[ai->nd-1]; \ + for(i=0; istrides[ai->nd-1]; \ + for(i=0; istrides[ai->nd-1]; \ + for(i=0; istrides[ai->nd-1]; \ + for(i=0; istrides[ai->nd-1]; \ + for(i=0; istrides[ai->nd-1]; \ + for(i=0; i=(y)) ? (x) : (y)) +#endif + +#if !defined(ABS) +#define ABS(x) (((x) >= 0) ? (x) : -(x)) +#endif + +#define ELEM(x) (sizeof(x)/sizeof(x[0])) + +#define BOOLEAN_BITWISE_NOT(x) ((x) ^ 1) + +#define NA_NBYTES(a) (a->descr->elsize * NA_elements(a)) + +#if defined(NA_SMP) +#define BEGIN_THREADS Py_BEGIN_ALLOW_THREADS +#define END_THREADS Py_END_ALLOW_THREADS +#else +#define BEGIN_THREADS +#define END_THREADS +#endif + +#if !defined(NA_isnan) + +#define U32(u) (* (Int32 *) &(u) ) +#define U64(u) (* (Int64 *) &(u) ) + +#define NA_isnan32(u) \ + ( (( U32(u) & 0x7f800000) == 0x7f800000) && ((U32(u) & 0x007fffff) != 0)) ? 1:0 + +#if !defined(_MSC_VER) +#define NA_isnan64(u) \ + ( (( U64(u) & 0x7ff0000000000000LL) == 0x7ff0000000000000LL) && ((U64(u) & 0x000fffffffffffffLL) != 0)) ? 1:0 +#else +#define NA_isnan64(u) \ + ( (( U64(u) & 0x7ff0000000000000i64) == 0x7ff0000000000000i64) && ((U64(u) & 0x000fffffffffffffi64) != 0)) ? 1:0 +#endif + +#define NA_isnanC32(u) (NA_isnan32(((Complex32 *)&(u))->r) || NA_isnan32(((Complex32 *)&(u))->i)) +#define NA_isnanC64(u) (NA_isnan64(((Complex64 *)&(u))->r) || NA_isnan64(((Complex64 *)&(u))->i)) + +#endif /* NA_isnan */ + + +#endif /* _ndarraymacro */ Property changes on: trunk/numpy/numarray/include/numpy/nummacro.h ___________________________________________________________________ Name: svn:keywords + Id Author Name: svn:eol-style + native Deleted: trunk/numpy/numarray/numpy/arraybase.h =================================================================== --- trunk/numpy/numarray/numpy/arraybase.h 2010-02-21 02:49:39 UTC (rev 8211) +++ trunk/numpy/numarray/numpy/arraybase.h 2010-02-21 02:50:19 UTC (rev 8212) @@ -1,71 +0,0 @@ -#if !defined(__arraybase_h) -#define _arraybase_h 1 - -#define SZ_BUF 79 -#define MAXDIM NPY_MAXDIMS -#define MAXARGS 18 - -typedef npy_intp maybelong; -typedef npy_bool Bool; -typedef npy_int8 Int8; -typedef npy_uint8 UInt8; -typedef npy_int16 Int16; -typedef npy_uint16 UInt16; -typedef npy_int32 Int32; -typedef npy_uint32 UInt32; -typedef npy_int64 Int64; -typedef npy_uint64 UInt64; -typedef npy_float32 Float32; -typedef npy_float64 Float64; - -typedef enum -{ - tAny=-1, - tBool=PyArray_BOOL, - tInt8=PyArray_INT8, - tUInt8=PyArray_UINT8, - tInt16=PyArray_INT16, - tUInt16=PyArray_UINT16, - tInt32=PyArray_INT32, - tUInt32=PyArray_UINT32, - tInt64=PyArray_INT64, - tUInt64=PyArray_UINT64, - tFloat32=PyArray_FLOAT32, - tFloat64=PyArray_FLOAT64, - tComplex32=PyArray_COMPLEX64, - tComplex64=PyArray_COMPLEX128, - tObject=PyArray_OBJECT, /* placeholder... does nothing */ - tMaxType=PyArray_NTYPES, - tDefault = tFloat64, -#if NPY_BITSOF_LONG == 64 - tLong = tInt64, -#else - tLong = tInt32, -#endif -} NumarrayType; - -#define nNumarrayType PyArray_NTYPES - -#define HAS_UINT64 1 - -typedef enum -{ - NUM_LITTLE_ENDIAN=0, - NUM_BIG_ENDIAN = 1 -} NumarrayByteOrder; - -typedef struct { Float32 r, i; } Complex32; -typedef struct { Float64 r, i; } Complex64; - -#define WRITABLE NPY_WRITEABLE -#define CHECKOVERFLOW 0x800 -#define UPDATEDICT 0x1000 -#define FORTRAN_CONTIGUOUS NPY_FORTRAN -#define IS_CARRAY (NPY_CONTIGUOUS | NPY_ALIGNED) - -#define PyArray(m) ((PyArrayObject *)(m)) -#define PyArray_ISFORTRAN_CONTIGUOUS(m) (((PyArray(m))->flags & FORTRAN_CONTIGUOUS) != 0) -#define PyArray_ISWRITABLE PyArray_ISWRITEABLE - - -#endif Deleted: trunk/numpy/numarray/numpy/cfunc.h =================================================================== --- trunk/numpy/numarray/numpy/cfunc.h 2010-02-21 02:49:39 UTC (rev 8211) +++ trunk/numpy/numarray/numpy/cfunc.h 2010-02-21 02:50:19 UTC (rev 8212) @@ -1,78 +0,0 @@ -#if !defined(__cfunc__) -#define __cfunc__ 1 - -typedef PyObject *(*CFUNCasPyValue)(void *); -typedef int (*UFUNC)(long, long, long, void **, long*); -/* typedef void (*CFUNC_2ARG)(long, void *, void *); */ -/* typedef void (*CFUNC_3ARG)(long, void *, void *, void *); */ -typedef int (*CFUNCfromPyValue)(PyObject *, void *); -typedef int (*CFUNC_STRIDE_CONV_FUNC)(long, long, maybelong *, - void *, long, maybelong*, void *, long, maybelong *); - -typedef int (*CFUNC_STRIDED_FUNC)(PyObject *, long, PyArrayObject **, - char **data); - -#define MAXARRAYS 16 - -typedef enum { - CFUNC_UFUNC, - CFUNC_STRIDING, - CFUNC_NSTRIDING, - CFUNC_AS_PY_VALUE, - CFUNC_FROM_PY_VALUE -} eCfuncType; - -typedef struct { - char *name; - void *fptr; /* Pointer to "un-wrapped" c function */ - eCfuncType type; /* UFUNC, STRIDING, AsPyValue, FromPyValue */ - Bool chkself; /* CFUNC does own alignment/bounds checking */ - Bool align; /* CFUNC requires aligned buffer pointers */ - Int8 wantIn, wantOut; /* required input/output arg counts. */ - Int8 sizes[MAXARRAYS]; /* array of align/itemsizes. */ - Int8 iters[MAXARRAYS]; /* array of element counts. 0 --> niter. */ -} CfuncDescriptor; - -typedef struct { - PyObject_HEAD - CfuncDescriptor descr; -} CfuncObject; - -#define SELF_CHECKED_CFUNC_DESCR(name, type) \ - static CfuncDescriptor name##_descr = { #name, (void *) name, type, 1 } - -#define CHECK_ALIGN 1 - -#define CFUNC_DESCR(name, type, align, iargs, oargs, s1, s2, s3, i1, i2, i3) \ - static CfuncDescriptor name##_descr = \ - { #name, (void *)name, type, 0, align, iargs, oargs, {s1, s2, s3}, {i1, i2, i3} } - -#define UFUNC_DESCR1(name, s1) \ - CFUNC_DESCR(name, CFUNC_UFUNC, CHECK_ALIGN, 0, 1, s1, 0, 0, 0, 0, 0) - -#define UFUNC_DESCR2(name, s1, s2) \ - CFUNC_DESCR(name, CFUNC_UFUNC, CHECK_ALIGN, 1, 1, s1, s2, 0, 0, 0, 0) - -#define UFUNC_DESCR3(name, s1, s2, s3) \ - CFUNC_DESCR(name, CFUNC_UFUNC, CHECK_ALIGN, 2, 1, s1, s2, s3, 0, 0, 0) - -#define UFUNC_DESCR3sv(name, s1, s2, s3) \ - CFUNC_DESCR(name, CFUNC_UFUNC, CHECK_ALIGN, 2, 1, s1, s2, s3, 1, 0, 0) - -#define UFUNC_DESCR3vs(name, s1, s2, s3) \ - CFUNC_DESCR(name, CFUNC_UFUNC, CHECK_ALIGN, 2, 1, s1, s2, s3, 0, 1, 0) - -#define STRIDING_DESCR2(name, align, s1, s2) \ - CFUNC_DESCR(name, CFUNC_STRIDING, align, 1, 1, s1, s2, 0, 0, 0, 0) - -#define NSTRIDING_DESCR1(name) \ - CFUNC_DESCR(name, CFUNC_NSTRIDING, 0, 0, 1, 0, 0, 0, 0, 0, 0) - -#define NSTRIDING_DESCR2(name) \ - CFUNC_DESCR(name, CFUNC_NSTRIDING, 0, 1, 1, 0, 0, 0, 0, 0, 0) - -#define NSTRIDING_DESCR3(name) \ - CFUNC_DESCR(name, CFUNC_NSTRIDING, 0, 2, 1, 0, 0, 0, 0, 0, 0) - -#endif - Deleted: trunk/numpy/numarray/numpy/ieeespecial.h =================================================================== --- trunk/numpy/numarray/numpy/ieeespecial.h 2010-02-21 02:49:39 UTC (rev 8211) +++ trunk/numpy/numarray/numpy/ieeespecial.h 2010-02-21 02:50:19 UTC (rev 8212) @@ -1,124 +0,0 @@ -/* 32-bit special value ranges */ - -#if defined(_MSC_VER) -#define MKINT(x) (x##UL) -#define MKINT64(x) (x##Ui64) -#define BIT(x) (1Ui64 << (x)) -#else -#define MKINT(x) (x##U) -#define MKINT64(x) (x##ULL) -#define BIT(x) (1ULL << (x)) -#endif - - -#define NEG_QUIET_NAN_MIN32 MKINT(0xFFC00001) -#define NEG_QUIET_NAN_MAX32 MKINT(0xFFFFFFFF) - -#define INDETERMINATE_MIN32 MKINT(0xFFC00000) -#define INDETERMINATE_MAX32 MKINT(0xFFC00000) - -#define NEG_SIGNAL_NAN_MIN32 MKINT(0xFF800001) -#define NEG_SIGNAL_NAN_MAX32 MKINT(0xFFBFFFFF) - -#define NEG_INFINITY_MIN32 MKINT(0xFF800000) - -#define NEG_NORMALIZED_MIN32 MKINT(0x80800000) -#define NEG_NORMALIZED_MAX32 MKINT(0xFF7FFFFF) - -#define NEG_DENORMALIZED_MIN32 MKINT(0x80000001) -#define NEG_DENORMALIZED_MAX32 MKINT(0x807FFFFF) - -#define NEG_ZERO_MIN32 MKINT(0x80000000) -#define NEG_ZERO_MAX32 MKINT(0x80000000) - -#define POS_ZERO_MIN32 MKINT(0x00000000) -#define POS_ZERO_MAX32 MKINT(0x00000000) - -#define POS_DENORMALIZED_MIN32 MKINT(0x00000001) -#define POS_DENORMALIZED_MAX32 MKINT(0x007FFFFF) - -#define POS_NORMALIZED_MIN32 MKINT(0x00800000) -#define POS_NORMALIZED_MAX32 MKINT(0x7F7FFFFF) - -#define POS_INFINITY_MIN32 MKINT(0x7F800000) -#define POS_INFINITY_MAX32 MKINT(0x7F800000) - -#define POS_SIGNAL_NAN_MIN32 MKINT(0x7F800001) -#define POS_SIGNAL_NAN_MAX32 MKINT(0x7FBFFFFF) - -#define POS_QUIET_NAN_MIN32 MKINT(0x7FC00000) -#define POS_QUIET_NAN_MAX32 MKINT(0x7FFFFFFF) - -/* 64-bit special value ranges */ - -#define NEG_QUIET_NAN_MIN64 MKINT64(0xFFF8000000000001) -#define NEG_QUIET_NAN_MAX64 MKINT64(0xFFFFFFFFFFFFFFFF) - -#define INDETERMINATE_MIN64 MKINT64(0xFFF8000000000000) -#define INDETERMINATE_MAX64 MKINT64(0xFFF8000000000000) - -#define NEG_SIGNAL_NAN_MIN64 MKINT64(0xFFF7FFFFFFFFFFFF) -#define NEG_SIGNAL_NAN_MAX64 MKINT64(0xFFF0000000000001) - -#define NEG_INFINITY_MIN64 MKINT64(0xFFF0000000000000) - -#define NEG_NORMALIZED_MIN64 MKINT64(0xFFEFFFFFFFFFFFFF) -#define NEG_NORMALIZED_MAX64 MKINT64(0x8010000000000000) - -#define NEG_DENORMALIZED_MIN64 MKINT64(0x800FFFFFFFFFFFFF) -#define NEG_DENORMALIZED_MAX64 MKINT64(0x8000000000000001) - -#define NEG_ZERO_MIN64 MKINT64(0x8000000000000000) -#define NEG_ZERO_MAX64 MKINT64(0x8000000000000000) - -#define POS_ZERO_MIN64 MKINT64(0x0000000000000000) -#define POS_ZERO_MAX64 MKINT64(0x0000000000000000) - -#define POS_DENORMALIZED_MIN64 MKINT64(0x0000000000000001) -#define POS_DENORMALIZED_MAX64 MKINT64(0x000FFFFFFFFFFFFF) - -#define POS_NORMALIZED_MIN64 MKINT64(0x0010000000000000) -#define POS_NORMALIZED_MAX64 MKINT64(0x7FEFFFFFFFFFFFFF) - -#define POS_INFINITY_MIN64 MKINT64(0x7FF0000000000000) -#define POS_INFINITY_MAX64 MKINT64(0x7FF0000000000000) - -#define POS_SIGNAL_NAN_MIN64 MKINT64(0x7FF0000000000001) -#define POS_SIGNAL_NAN_MAX64 MKINT64(0x7FF7FFFFFFFFFFFF) - -#define POS_QUIET_NAN_MIN64 MKINT64(0x7FF8000000000000) -#define POS_QUIET_NAN_MAX64 MKINT64(0x7FFFFFFFFFFFFFFF) - -typedef enum -{ - POS_QNAN_BIT, - NEG_QNAN_BIT, - POS_SNAN_BIT, - NEG_SNAN_BIT, - POS_INF_BIT, - NEG_INF_BIT, - POS_DEN_BIT, - NEG_DEN_BIT, - POS_NOR_BIT, - NEG_NOR_BIT, - POS_ZERO_BIT, - NEG_ZERO_BIT, - INDETERM_BIT, - BUG_BIT -} ieee_selects; - -#define MSK_POS_QNAN BIT(POS_QNAN_BIT) -#define MSK_POS_SNAN BIT(POS_SNAN_BIT) -#define MSK_POS_INF BIT(POS_INF_BIT) -#define MSK_POS_DEN BIT(POS_DEN_BIT) -#define MSK_POS_NOR BIT(POS_NOR_BIT) -#define MSK_POS_ZERO BIT(POS_ZERO_BIT) -#define MSK_NEG_QNAN BIT(NEG_QNAN_BIT) -#define MSK_NEG_SNAN BIT(NEG_SNAN_BIT) -#define MSK_NEG_INF BIT(NEG_INF_BIT) -#define MSK_NEG_DEN BIT(NEG_DEN_BIT) -#define MSK_NEG_NOR BIT(NEG_NOR_BIT) -#define MSK_NEG_ZERO BIT(NEG_ZERO_BIT) -#define MSK_INDETERM BIT(INDETERM_BIT) -#define MSK_BUG BIT(BUG_BIT) - Deleted: trunk/numpy/numarray/numpy/libnumarray.h =================================================================== --- trunk/numpy/numarray/numpy/libnumarray.h 2010-02-21 02:49:39 UTC (rev 8211) +++ trunk/numpy/numarray/numpy/libnumarray.h 2010-02-21 02:50:19 UTC (rev 8212) @@ -1,611 +0,0 @@ -/* Compatibility with numarray. Do not use in new code. - */ - -#ifndef NUMPY_LIBNUMARRAY_H -#define NUMPY_LIBNUMARRAY_H - -#include "numpy/arrayobject.h" -#include "arraybase.h" -#include "nummacro.h" -#include "numcomplex.h" -#include "ieeespecial.h" -#include "cfunc.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Header file for libnumarray */ - -#if !defined(_libnumarray_MODULE) - -/* -Extensions constructed from seperate compilation units can access the -C-API defined here by defining "libnumarray_UNIQUE_SYMBOL" to a global -name unique to the extension. Doing this circumvents the requirement -to import libnumarray into each compilation unit, but is nevertheless -mildly discouraged as "outside the Python norm" and potentially -leading to problems. Looking around at "existing Python art", most -extension modules are monolithic C files, and likely for good reason. -*/ - -/* C API address pointer */ -#if defined(NO_IMPORT) || defined(NO_IMPORT_ARRAY) -extern void **libnumarray_API; -#else -#if defined(libnumarray_UNIQUE_SYMBOL) -void **libnumarray_API; -#else -static void **libnumarray_API; -#endif -#endif - -#define _import_libnumarray() \ - { \ - PyObject *module = PyImport_ImportModule("numpy.numarray._capi"); \ - if (module != NULL) { \ - PyObject *module_dict = PyModule_GetDict(module); \ - PyObject *c_api_object = \ - PyDict_GetItemString(module_dict, "_C_API"); \ - if (c_api_object && PyCObject_Check(c_api_object)) { \ - libnumarray_API = (void **)PyCObject_AsVoidPtr(c_api_object); \ - } else { \ - PyErr_Format(PyExc_ImportError, \ - "Can't get API for module 'numpy.numarray._capi'"); \ - } \ - } \ - } - -#define import_libnumarray() _import_libnumarray(); if (PyErr_Occurred()) { PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.numarray._capi failed to import.\n"); return; } - -#endif - - -#define libnumarray_FatalApiError (Py_FatalError("Call to API function without first calling import_libnumarray() in " __FILE__), NULL) - - -/* Macros defining components of function prototypes */ - -#ifdef _libnumarray_MODULE - /* This section is used when compiling libnumarray */ - -static PyObject *_Error; - -static PyObject* getBuffer (PyObject*o); - -static int isBuffer (PyObject*o); - -static int getWriteBufferDataPtr (PyObject*o,void**p); - -static int isBufferWriteable (PyObject*o); - -static int getReadBufferDataPtr (PyObject*o,void**p); - -static int getBufferSize (PyObject*o); - -static double num_log (double x); - -static double num_log10 (double x); - -static double num_pow (double x, double y); - -static double num_acosh (double x); - -static double num_asinh (double x); - -static double num_atanh (double x); - -static double num_round (double x); - -static int int_dividebyzero_error (long value, long unused); - -static int int_overflow_error (Float64 value); - -static int umult64_overflow (UInt64 a, UInt64 b); - -static int smult64_overflow (Int64 a0, Int64 b0); - -static void NA_Done (void); - -static PyArrayObject* NA_NewAll (int ndim, maybelong* shape, NumarrayType type, void* buffer, maybelong byteoffset, maybelong bytestride, int byteorder, int aligned, int writeable); - -static PyArrayObject* NA_NewAllStrides (int ndim, maybelong* shape, maybelong* strides, NumarrayType type, void* buffer, maybelong byteoffset, int byteorder, int aligned, int writeable); - -static PyArrayObject* NA_New (void* buffer, NumarrayType type, int ndim,...); - -static PyArrayObject* NA_Empty (int ndim, maybelong* shape, NumarrayType type); - -static PyArrayObject* NA_NewArray (void* buffer, NumarrayType type, int ndim, ...); - -static PyArrayObject* NA_vNewArray (void* buffer, NumarrayType type, int ndim, maybelong *shape); - -static PyObject* NA_ReturnOutput (PyObject*,PyArrayObject*); - -static long NA_getBufferPtrAndSize (PyObject*,int,void**); - -static int NA_checkIo (char*,int,int,int,int); - -static int NA_checkOneCBuffer (char*,long,void*,long,size_t); - -static int NA_checkNCBuffers (char*,int,long,void**,long*,Int8*,Int8*); - -static int NA_checkOneStriding (char*,long,maybelong*,long,maybelong*,long,long,int); - -static PyObject* NA_new_cfunc (CfuncDescriptor*); - -static int NA_add_cfunc (PyObject*,char*,CfuncDescriptor*); - -static PyArrayObject* NA_InputArray (PyObject*,NumarrayType,int); - -static PyArrayObject* NA_OutputArray (PyObject*,NumarrayType,int); - -static PyArrayObject* NA_IoArray (PyObject*,NumarrayType,int); - -static PyArrayObject* NA_OptionalOutputArray (PyObject*,NumarrayType,int,PyArrayObject*); - -static long NA_get_offset (PyArrayObject*,int,...); - -static Float64 NA_get_Float64 (PyArrayObject*,long); - -static void NA_set_Float64 (PyArrayObject*,long,Float64); - -static Complex64 NA_get_Complex64 (PyArrayObject*,long); - -static void NA_set_Complex64 (PyArrayObject*,long,Complex64); - -static Int64 NA_get_Int64 (PyArrayObject*,long); - -static void NA_set_Int64 (PyArrayObject*,long,Int64); - -static Float64 NA_get1_Float64 (PyArrayObject*,long); - -static Float64 NA_get2_Float64 (PyArrayObject*,long,long); - -static Float64 NA_get3_Float64 (PyArrayObject*,long,long,long); - -static void NA_set1_Float64 (PyArrayObject*,long,Float64); - -static void NA_set2_Float64 (PyArrayObject*,long,long,Float64); - -static void NA_set3_Float64 (PyArrayObject*,long,long,long,Float64); - -static Complex64 NA_get1_Complex64 (PyArrayObject*,long); - -static Complex64 NA_get2_Complex64 (PyArrayObject*,long,long); - -static Complex64 NA_get3_Complex64 (PyArrayObject*,long,long,long); - -static void NA_set1_Complex64 (PyArrayObject*,long,Complex64); - -static void NA_set2_Complex64 (PyArrayObject*,long,long,Complex64); - -static void NA_set3_Complex64 (PyArrayObject*,long,long,long,Complex64); - -static Int64 NA_get1_Int64 (PyArrayObject*,long); - -static Int64 NA_get2_Int64 (PyArrayObject*,long,long); - -static Int64 NA_get3_Int64 (PyArrayObject*,long,long,long); - -static void NA_set1_Int64 (PyArrayObject*,long,Int64); - -static void NA_set2_Int64 (PyArrayObject*,long,long,Int64); - -static void NA_set3_Int64 (PyArrayObject*,long,long,long,Int64); - -static int NA_get1D_Float64 (PyArrayObject*,long,int,Float64*); - -static int NA_set1D_Float64 (PyArrayObject*,long,int,Float64*); - -static int NA_get1D_Int64 (PyArrayObject*,long,int,Int64*); - -static int NA_set1D_Int64 (PyArrayObject*,long,int,Int64*); - -static int NA_get1D_Complex64 (PyArrayObject*,long,int,Complex64*); - -static int NA_set1D_Complex64 (PyArrayObject*,long,int,Complex64*); - -static int NA_ShapeEqual (PyArrayObject*,PyArrayObject*); - -static int NA_ShapeLessThan (PyArrayObject*,PyArrayObject*); - -static int NA_ByteOrder (void); - -static Bool NA_IeeeSpecial32 (Float32*,Int32*); - -static Bool NA_IeeeSpecial64 (Float64*,Int32*); - -static PyArrayObject* NA_updateDataPtr (PyArrayObject*); - -static char* NA_typeNoToName (int); - -static int NA_nameToTypeNo (char*); - -static PyObject* NA_typeNoToTypeObject (int); - -static PyObject* NA_intTupleFromMaybeLongs (int,maybelong*); - -static long NA_maybeLongsFromIntTuple (int,maybelong*,PyObject*); - -static int NA_intTupleProduct (PyObject *obj, long *product); - -static long NA_isIntegerSequence (PyObject*); - -static PyObject* NA_setArrayFromSequence (PyArrayObject*,PyObject*); - -static int NA_maxType (PyObject*); - -static int NA_isPythonScalar (PyObject *obj); - -static PyObject* NA_getPythonScalar (PyArrayObject*,long); - -static int NA_setFromPythonScalar (PyArrayObject*,long,PyObject*); - -static int NA_NDArrayCheck (PyObject*); - -static int NA_NumArrayCheck (PyObject*); - -static int NA_ComplexArrayCheck (PyObject*); - -static unsigned long NA_elements (PyArrayObject*); - -static int NA_typeObjectToTypeNo (PyObject*); - -static int NA_copyArray (PyArrayObject* to, const PyArrayObject* from); - -static PyArrayObject* NA_copy (PyArrayObject*); - -static PyObject* NA_getType (PyObject *typeobj_or_name); - -static PyObject * NA_callCUFuncCore (PyObject *cfunc, long niter, long ninargs, long noutargs, PyObject **BufferObj, long *offset); - -static PyObject * NA_callStrideConvCFuncCore (PyObject *cfunc, int nshape, maybelong *shape, PyObject *inbuffObj, long inboffset, int nstrides0, maybelong *inbstrides, PyObject *outbuffObj, long outboffset, int nstrides1, maybelong *outbstrides, long nbytes); - -static void NA_stridesFromShape (int nshape, maybelong *shape, maybelong bytestride, maybelong *strides); - -static int NA_OperatorCheck (PyObject *obj); - -static int NA_ConverterCheck (PyObject *obj); - -static int NA_UfuncCheck (PyObject *obj); - -static int NA_CfuncCheck (PyObject *obj); - -static int NA_getByteOffset (PyArrayObject *array, int nindices, maybelong *indices, long *offset); - -static int NA_swapAxes (PyArrayObject *array, int x, int y); - -static PyObject * NA_initModuleGlobal (char *module, char *global); - -static NumarrayType NA_NumarrayType (PyObject *seq); - -static PyArrayObject * NA_NewAllFromBuffer (int ndim, maybelong *shape, NumarrayType type, PyObject *bufferObject, maybelong byteoffset, maybelong bytestride, int byteorder, int aligned, int writeable); - -static Float64 * NA_alloc1D_Float64 (PyArrayObject *a, long offset, int cnt); - -static Int64 * NA_alloc1D_Int64 (PyArrayObject *a, long offset, int cnt); - -static void NA_updateAlignment (PyArrayObject *self); - -static void NA_updateContiguous (PyArrayObject *self); - -static void NA_updateStatus (PyArrayObject *self); - -static int NA_NumArrayCheckExact (PyObject *op); - -static int NA_NDArrayCheckExact (PyObject *op); - -static int NA_OperatorCheckExact (PyObject *op); - -static int NA_ConverterCheckExact (PyObject *op); - -static int NA_UfuncCheckExact (PyObject *op); - -static int NA_CfuncCheckExact (PyObject *op); - -static char * NA_getArrayData (PyArrayObject *ap); - -static void NA_updateByteswap (PyArrayObject *ap); - -static PyArray_Descr * NA_DescrFromType (int type); - -static PyObject * NA_Cast (PyArrayObject *a, int type); - -static int NA_checkFPErrors (void); - -static void NA_clearFPErrors (void); - -static int NA_checkAndReportFPErrors (char *name); - -static Bool NA_IeeeMask32 (Float32,Int32); - -static Bool NA_IeeeMask64 (Float64,Int32); - -static int _NA_callStridingHelper (PyObject *aux, long dim, long nnumarray, PyArrayObject *numarray[], char *data[], CFUNC_STRIDED_FUNC f); - -static PyArrayObject * NA_FromDimsStridesDescrAndData (int nd, maybelong *dims, maybelong *strides, PyArray_Descr *descr, char *data); - -static PyArrayObject * NA_FromDimsTypeAndData (int nd, maybelong *dims, int type, char *data); - -static PyArrayObject * NA_FromDimsStridesTypeAndData (int nd, maybelong *dims, maybelong *strides, int type, char *data); - -static int NA_scipy_typestr (NumarrayType t, int byteorder, char *typestr); - -static PyArrayObject * NA_FromArrayStruct (PyObject *a); - - -#else - /* This section is used in modules that use libnumarray */ - -#define getBuffer (libnumarray_API ? (*(PyObject* (*) (PyObject*o) ) libnumarray_API[ 0 ]) : (*(PyObject* (*) (PyObject*o) ) libnumarray_FatalApiError)) - -#define isBuffer (libnumarray_API ? (*(int (*) (PyObject*o) ) libnumarray_API[ 1 ]) : (*(int (*) (PyObject*o) ) libnumarray_FatalApiError)) - -#define getWriteBufferDataPtr (libnumarray_API ? (*(int (*) (PyObject*o,void**p) ) libnumarray_API[ 2 ]) : (*(int (*) (PyObject*o,void**p) ) libnumarray_FatalApiError)) - -#define isBufferWriteable (libnumarray_API ? (*(int (*) (PyObject*o) ) libnumarray_API[ 3 ]) : (*(int (*) (PyObject*o) ) libnumarray_FatalApiError)) - -#define getReadBufferDataPtr (libnumarray_API ? (*(int (*) (PyObject*o,void**p) ) libnumarray_API[ 4 ]) : (*(int (*) (PyObject*o,void**p) ) libnumarray_FatalApiError)) - -#define getBufferSize (libnumarray_API ? (*(int (*) (PyObject*o) ) libnumarray_API[ 5 ]) : (*(int (*) (PyObject*o) ) libnumarray_FatalApiError)) - -#define num_log (libnumarray_API ? (*(double (*) (double x) ) libnumarray_API[ 6 ]) : (*(double (*) (double x) ) libnumarray_FatalApiError)) - -#define num_log10 (libnumarray_API ? (*(double (*) (double x) ) libnumarray_API[ 7 ]) : (*(double (*) (double x) ) libnumarray_FatalApiError)) - -#define num_pow (libnumarray_API ? (*(double (*) (double x, double y) ) libnumarray_API[ 8 ]) : (*(double (*) (double x, double y) ) libnumarray_FatalApiError)) - -#define num_acosh (libnumarray_API ? (*(double (*) (double x) ) libnumarray_API[ 9 ]) : (*(double (*) (double x) ) libnumarray_FatalApiError)) - -#define num_asinh (libnumarray_API ? (*(double (*) (double x) ) libnumarray_API[ 10 ]) : (*(double (*) (double x) ) libnumarray_FatalApiError)) - -#define num_atanh (libnumarray_API ? (*(double (*) (double x) ) libnumarray_API[ 11 ]) : (*(double (*) (double x) ) libnumarray_FatalApiError)) - -#define num_round (libnumarray_API ? (*(double (*) (double x) ) libnumarray_API[ 12 ]) : (*(double (*) (double x) ) libnumarray_FatalApiError)) - -#define int_dividebyzero_error (libnumarray_API ? (*(int (*) (long value, long unused) ) libnumarray_API[ 13 ]) : (*(int (*) (long value, long unused) ) libnumarray_FatalApiError)) - -#define int_overflow_error (libnumarray_API ? (*(int (*) (Float64 value) ) libnumarray_API[ 14 ]) : (*(int (*) (Float64 value) ) libnumarray_FatalApiError)) - -#define umult64_overflow (libnumarray_API ? (*(int (*) (UInt64 a, UInt64 b) ) libnumarray_API[ 15 ]) : (*(int (*) (UInt64 a, UInt64 b) ) libnumarray_FatalApiError)) - -#define smult64_overflow (libnumarray_API ? (*(int (*) (Int64 a0, Int64 b0) ) libnumarray_API[ 16 ]) : (*(int (*) (Int64 a0, Int64 b0) ) libnumarray_FatalApiError)) - -#define NA_Done (libnumarray_API ? (*(void (*) (void) ) libnumarray_API[ 17 ]) : (*(void (*) (void) ) libnumarray_FatalApiError)) - -#define NA_NewAll (libnumarray_API ? (*(PyArrayObject* (*) (int ndim, maybelong* shape, NumarrayType type, void* buffer, maybelong byteoffset, maybelong bytestride, int byteorder, int aligned, int writeable) ) libnumarray_API[ 18 ]) : (*(PyArrayObject* (*) (int ndim, maybelong* shape, NumarrayType type, void* buffer, maybelong byteoffset, maybelong bytestride, int byteorder, int aligned, int writeable) ) libnumarray_FatalApiError)) - -#define NA_NewAllStrides (libnumarray_API ? (*(PyArrayObject* (*) (int ndim, maybelong* shape, maybelong* strides, NumarrayType type, void* buffer, maybelong byteoffset, int byteorder, int aligned, int writeable) ) libnumarray_API[ 19 ]) : (*(PyArrayObject* (*) (int ndim, maybelong* shape, maybelong* strides, NumarrayType type, void* buffer, maybelong byteoffset, int byteorder, int aligned, int writeable) ) libnumarray_FatalApiError)) - -#define NA_New (libnumarray_API ? (*(PyArrayObject* (*) (void* buffer, NumarrayType type, int ndim,...) ) libnumarray_API[ 20 ]) : (*(PyArrayObject* (*) (void* buffer, NumarrayType type, int ndim,...) ) libnumarray_FatalApiError)) - -#define NA_Empty (libnumarray_API ? (*(PyArrayObject* (*) (int ndim, maybelong* shape, NumarrayType type) ) libnumarray_API[ 21 ]) : (*(PyArrayObject* (*) (int ndim, maybelong* shape, NumarrayType type) ) libnumarray_FatalApiError)) - -#define NA_NewArray (libnumarray_API ? (*(PyArrayObject* (*) (void* buffer, NumarrayType type, int ndim, ...) ) libnumarray_API[ 22 ]) : (*(PyArrayObject* (*) (void* buffer, NumarrayType type, int ndim, ...) ) libnumarray_FatalApiError)) - -#define NA_vNewArray (libnumarray_API ? (*(PyArrayObject* (*) (void* buffer, NumarrayType type, int ndim, maybelong *shape) ) libnumarray_API[ 23 ]) : (*(PyArrayObject* (*) (void* buffer, NumarrayType type, int ndim, maybelong *shape) ) libnumarray_FatalApiError)) - -#define NA_ReturnOutput (libnumarray_API ? (*(PyObject* (*) (PyObject*,PyArrayObject*) ) libnumarray_API[ 24 ]) : (*(PyObject* (*) (PyObject*,PyArrayObject*) ) libnumarray_FatalApiError)) - -#define NA_getBufferPtrAndSize (libnumarray_API ? (*(long (*) (PyObject*,int,void**) ) libnumarray_API[ 25 ]) : (*(long (*) (PyObject*,int,void**) ) libnumarray_FatalApiError)) - -#define NA_checkIo (libnumarray_API ? (*(int (*) (char*,int,int,int,int) ) libnumarray_API[ 26 ]) : (*(int (*) (char*,int,int,int,int) ) libnumarray_FatalApiError)) - -#define NA_checkOneCBuffer (libnumarray_API ? (*(int (*) (char*,long,void*,long,size_t) ) libnumarray_API[ 27 ]) : (*(int (*) (char*,long,void*,long,size_t) ) libnumarray_FatalApiError)) - -#define NA_checkNCBuffers (libnumarray_API ? (*(int (*) (char*,int,long,void**,long*,Int8*,Int8*) ) libnumarray_API[ 28 ]) : (*(int (*) (char*,int,long,void**,long*,Int8*,Int8*) ) libnumarray_FatalApiError)) - -#define NA_checkOneStriding (libnumarray_API ? (*(int (*) (char*,long,maybelong*,long,maybelong*,long,long,int) ) libnumarray_API[ 29 ]) : (*(int (*) (char*,long,maybelong*,long,maybelong*,long,long,int) ) libnumarray_FatalApiError)) - -#define NA_new_cfunc (libnumarray_API ? (*(PyObject* (*) (CfuncDescriptor*) ) libnumarray_API[ 30 ]) : (*(PyObject* (*) (CfuncDescriptor*) ) libnumarray_FatalApiError)) - -#define NA_add_cfunc (libnumarray_API ? (*(int (*) (PyObject*,char*,CfuncDescriptor*) ) libnumarray_API[ 31 ]) : (*(int (*) (PyObject*,char*,CfuncDescriptor*) ) libnumarray_FatalApiError)) - -#define NA_InputArray (libnumarray_API ? (*(PyArrayObject* (*) (PyObject*,NumarrayType,int) ) libnumarray_API[ 32 ]) : (*(PyArrayObject* (*) (PyObject*,NumarrayType,int) ) libnumarray_FatalApiError)) - -#define NA_OutputArray (libnumarray_API ? (*(PyArrayObject* (*) (PyObject*,NumarrayType,int) ) libnumarray_API[ 33 ]) : (*(PyArrayObject* (*) (PyObject*,NumarrayType,int) ) libnumarray_FatalApiError)) - -#define NA_IoArray (libnumarray_API ? (*(PyArrayObject* (*) (PyObject*,NumarrayType,int) ) libnumarray_API[ 34 ]) : (*(PyArrayObject* (*) (PyObject*,NumarrayType,int) ) libnumarray_FatalApiError)) - -#define NA_OptionalOutputArray (libnumarray_API ? (*(PyArrayObject* (*) (PyObject*,NumarrayType,int,PyArrayObject*) ) libnumarray_API[ 35 ]) : (*(PyArrayObject* (*) (PyObject*,NumarrayType,int,PyArrayObject*) ) libnumarray_FatalApiError)) - -#define NA_get_offset (libnumarray_API ? (*(long (*) (PyArrayObject*,int,...) ) libnumarray_API[ 36 ]) : (*(long (*) (PyArrayObject*,int,...) ) libnumarray_FatalApiError)) - -#define NA_get_Float64 (libnumarray_API ? (*(Float64 (*) (PyArrayObject*,long) ) libnumarray_API[ 37 ]) : (*(Float64 (*) (PyArrayObject*,long) ) libnumarray_FatalApiError)) - -#define NA_set_Float64 (libnumarray_API ? (*(void (*) (PyArrayObject*,long,Float64) ) libnumarray_API[ 38 ]) : (*(void (*) (PyArrayObject*,long,Float64) ) libnumarray_FatalApiError)) - -#define NA_get_Complex64 (libnumarray_API ? (*(Complex64 (*) (PyArrayObject*,long) ) libnumarray_API[ 39 ]) : (*(Complex64 (*) (PyArrayObject*,long) ) libnumarray_FatalApiError)) - -#define NA_set_Complex64 (libnumarray_API ? (*(void (*) (PyArrayObject*,long,Complex64) ) libnumarray_API[ 40 ]) : (*(void (*) (PyArrayObject*,long,Complex64) ) libnumarray_FatalApiError)) - -#define NA_get_Int64 (libnumarray_API ? (*(Int64 (*) (PyArrayObject*,long) ) libnumarray_API[ 41 ]) : (*(Int64 (*) (PyArrayObject*,long) ) libnumarray_FatalApiError)) - -#define NA_set_Int64 (libnumarray_API ? (*(void (*) (PyArrayObject*,long,Int64) ) libnumarray_API[ 42 ]) : (*(void (*) (PyArrayObject*,long,Int64) ) libnumarray_FatalApiError)) - -#define NA_get1_Float64 (libnumarray_API ? (*(Float64 (*) (PyArrayObject*,long) ) libnumarray_API[ 43 ]) : (*(Float64 (*) (PyArrayObject*,long) ) libnumarray_FatalApiError)) - -#define NA_get2_Float64 (libnumarray_API ? (*(Float64 (*) (PyArrayObject*,long,long) ) libnumarray_API[ 44 ]) : (*(Float64 (*) (PyArrayObject*,long,long) ) libnumarray_FatalApiError)) - -#define NA_get3_Float64 (libnumarray_API ? (*(Float64 (*) (PyArrayObject*,long,long,long) ) libnumarray_API[ 45 ]) : (*(Float64 (*) (PyArrayObject*,long,long,long) ) libnumarray_FatalApiError)) - -#define NA_set1_Float64 (libnumarray_API ? (*(void (*) (PyArrayObject*,long,Float64) ) libnumarray_API[ 46 ]) : (*(void (*) (PyArrayObject*,long,Float64) ) libnumarray_FatalApiError)) - -#define NA_set2_Float64 (libnumarray_API ? (*(void (*) (PyArrayObject*,long,long,Float64) ) libnumarray_API[ 47 ]) : (*(void (*) (PyArrayObject*,long,long,Float64) ) libnumarray_FatalApiError)) - -#define NA_set3_Float64 (libnumarray_API ? (*(void (*) (PyArrayObject*,long,long,long,Float64) ) libnumarray_API[ 48 ]) : (*(void (*) (PyArrayObject*,long,long,long,Float64) ) libnumarray_FatalApiError)) - -#define NA_get1_Complex64 (libnumarray_API ? (*(Complex64 (*) (PyArrayObject*,long) ) libnumarray_API[ 49 ]) : (*(Complex64 (*) (PyArrayObject*,long) ) libnumarray_FatalApiError)) - -#define NA_get2_Complex64 (libnumarray_API ? (*(Complex64 (*) (PyArrayObject*,long,long) ) libnumarray_API[ 50 ]) : (*(Complex64 (*) (PyArrayObject*,long,long) ) libnumarray_FatalApiError)) - -#define NA_get3_Complex64 (libnumarray_API ? (*(Complex64 (*) (PyArrayObject*,long,long,long) ) libnumarray_API[ 51 ]) : (*(Complex64 (*) (PyArrayObject*,long,long,long) ) libnumarray_FatalApiError)) - -#define NA_set1_Complex64 (libnumarray_API ? (*(void (*) (PyArrayObject*,long,Complex64) ) libnumarray_API[ 52 ]) : (*(void (*) (PyArrayObject*,long,Complex64) ) libnumarray_FatalApiError)) - -#define NA_set2_Complex64 (libnumarray_API ? (*(void (*) (PyArrayObject*,long,long,Complex64) ) libnumarray_API[ 53 ]) : (*(void (*) (PyArrayObject*,long,long,Complex64) ) libnumarray_FatalApiError)) - -#define NA_set3_Complex64 (libnumarray_API ? (*(void (*) (PyArrayObject*,long,long,long,Complex64) ) libnumarray_API[ 54 ]) : (*(void (*) (PyArrayObject*,long,long,long,Complex64) ) libnumarray_FatalApiError)) - -#define NA_get1_Int64 (libnumarray_API ? (*(Int64 (*) (PyArrayObject*,long) ) libnumarray_API[ 55 ]) : (*(Int64 (*) (PyArrayObject*,long) ) libnumarray_FatalApiError)) - -#define NA_get2_Int64 (libnumarray_API ? (*(Int64 (*) (PyArrayObject*,long,long) ) libnumarray_API[ 56 ]) : (*(Int64 (*) (PyArrayObject*,long,long) ) libnumarray_FatalApiError)) - -#define NA_get3_Int64 (libnumarray_API ? (*(Int64 (*) (PyArrayObject*,long,long,long) ) libnumarray_API[ 57 ]) : (*(Int64 (*) (PyArrayObject*,long,long,long) ) libnumarray_FatalApiError)) - -#define NA_set1_Int64 (libnumarray_API ? (*(void (*) (PyArrayObject*,long,Int64) ) libnumarray_API[ 58 ]) : (*(void (*) (PyArrayObject*,long,Int64) ) libnumarray_FatalApiError)) - -#define NA_set2_Int64 (libnumarray_API ? (*(void (*) (PyArrayObject*,long,long,Int64) ) libnumarray_API[ 59 ]) : (*(void (*) (PyArrayObject*,long,long,Int64) ) libnumarray_FatalApiError)) - -#define NA_set3_Int64 (libnumarray_API ? (*(void (*) (PyArrayObject*,long,long,long,Int64) ) libnumarray_API[ 60 ]) : (*(void (*) (PyArrayObject*,long,long,long,Int64) ) libnumarray_FatalApiError)) - -#define NA_get1D_Float64 (libnumarray_API ? (*(int (*) (PyArrayObject*,long,int,Float64*) ) libnumarray_API[ 61 ]) : (*(int (*) (PyArrayObject*,long,int,Float64*) ) libnumarray_FatalApiError)) - -#define NA_set1D_Float64 (libnumarray_API ? (*(int (*) (PyArrayObject*,long,int,Float64*) ) libnumarray_API[ 62 ]) : (*(int (*) (PyArrayObject*,long,int,Float64*) ) libnumarray_FatalApiError)) - -#define NA_get1D_Int64 (libnumarray_API ? (*(int (*) (PyArrayObject*,long,int,Int64*) ) libnumarray_API[ 63 ]) : (*(int (*) (PyArrayObject*,long,int,Int64*) ) libnumarray_FatalApiError)) - -#define NA_set1D_Int64 (libnumarray_API ? (*(int (*) (PyArrayObject*,long,int,Int64*) ) libnumarray_API[ 64 ]) : (*(int (*) (PyArrayObject*,long,int,Int64*) ) libnumarray_FatalApiError)) - -#define NA_get1D_Complex64 (libnumarray_API ? (*(int (*) (PyArrayObject*,long,int,Complex64*) ) libnumarray_API[ 65 ]) : (*(int (*) (PyArrayObject*,long,int,Complex64*) ) libnumarray_FatalApiError)) - -#define NA_set1D_Complex64 (libnumarray_API ? (*(int (*) (PyArrayObject*,long,int,Complex64*) ) libnumarray_API[ 66 ]) : (*(int (*) (PyArrayObject*,long,int,Complex64*) ) libnumarray_FatalApiError)) - -#define NA_ShapeEqual (libnumarray_API ? (*(int (*) (PyArrayObject*,PyArrayObject*) ) libnumarray_API[ 67 ]) : (*(int (*) (PyArrayObject*,PyArrayObject*) ) libnumarray_FatalApiError)) - -#define NA_ShapeLessThan (libnumarray_API ? (*(int (*) (PyArrayObject*,PyArrayObject*) ) libnumarray_API[ 68 ]) : (*(int (*) (PyArrayObject*,PyArrayObject*) ) libnumarray_FatalApiError)) - -#define NA_ByteOrder (libnumarray_API ? (*(int (*) (void) ) libnumarray_API[ 69 ]) : (*(int (*) (void) ) libnumarray_FatalApiError)) - -#define NA_IeeeSpecial32 (libnumarray_API ? (*(Bool (*) (Float32*,Int32*) ) libnumarray_API[ 70 ]) : (*(Bool (*) (Float32*,Int32*) ) libnumarray_FatalApiError)) - -#define NA_IeeeSpecial64 (libnumarray_API ? (*(Bool (*) (Float64*,Int32*) ) libnumarray_API[ 71 ]) : (*(Bool (*) (Float64*,Int32*) ) libnumarray_FatalApiError)) - -#define NA_updateDataPtr (libnumarray_API ? (*(PyArrayObject* (*) (PyArrayObject*) ) libnumarray_API[ 72 ]) : (*(PyArrayObject* (*) (PyArrayObject*) ) libnumarray_FatalApiError)) - -#define NA_typeNoToName (libnumarray_API ? (*(char* (*) (int) ) libnumarray_API[ 73 ]) : (*(char* (*) (int) ) libnumarray_FatalApiError)) - -#define NA_nameToTypeNo (libnumarray_API ? (*(int (*) (char*) ) libnumarray_API[ 74 ]) : (*(int (*) (char*) ) libnumarray_FatalApiError)) - -#define NA_typeNoToTypeObject (libnumarray_API ? (*(PyObject* (*) (int) ) libnumarray_API[ 75 ]) : (*(PyObject* (*) (int) ) libnumarray_FatalApiError)) - -#define NA_intTupleFromMaybeLongs (libnumarray_API ? (*(PyObject* (*) (int,maybelong*) ) libnumarray_API[ 76 ]) : (*(PyObject* (*) (int,maybelong*) ) libnumarray_FatalApiError)) - -#define NA_maybeLongsFromIntTuple (libnumarray_API ? (*(long (*) (int,maybelong*,PyObject*) ) libnumarray_API[ 77 ]) : (*(long (*) (int,maybelong*,PyObject*) ) libnumarray_FatalApiError)) - -#define NA_intTupleProduct (libnumarray_API ? (*(int (*) (PyObject *obj, long *product) ) libnumarray_API[ 78 ]) : (*(int (*) (PyObject *obj, long *product) ) libnumarray_FatalApiError)) - -#define NA_isIntegerSequence (libnumarray_API ? (*(long (*) (PyObject*) ) libnumarray_API[ 79 ]) : (*(long (*) (PyObject*) ) libnumarray_FatalApiError)) - -#define NA_setArrayFromSequence (libnumarray_API ? (*(PyObject* (*) (PyArrayObject*,PyObject*) ) libnumarray_API[ 80 ]) : (*(PyObject* (*) (PyArrayObject*,PyObject*) ) libnumarray_FatalApiError)) - -#define NA_maxType (libnumarray_API ? (*(int (*) (PyObject*) ) libnumarray_API[ 81 ]) : (*(int (*) (PyObject*) ) libnumarray_FatalApiError)) - -#define NA_isPythonScalar (libnumarray_API ? (*(int (*) (PyObject *obj) ) libnumarray_API[ 82 ]) : (*(int (*) (PyObject *obj) ) libnumarray_FatalApiError)) - -#define NA_getPythonScalar (libnumarray_API ? (*(PyObject* (*) (PyArrayObject*,long) ) libnumarray_API[ 83 ]) : (*(PyObject* (*) (PyArrayObject*,long) ) libnumarray_FatalApiError)) - -#define NA_setFromPythonScalar (libnumarray_API ? (*(int (*) (PyArrayObject*,long,PyObject*) ) libnumarray_API[ 84 ]) : (*(int (*) (PyArrayObject*,long,PyObject*) ) libnumarray_FatalApiError)) - -#define NA_NDArrayCheck (libnumarray_API ? (*(int (*) (PyObject*) ) libnumarray_API[ 85 ]) : (*(int (*) (PyObject*) ) libnumarray_FatalApiError)) - -#define NA_NumArrayCheck (libnumarray_API ? (*(int (*) (PyObject*) ) libnumarray_API[ 86 ]) : (*(int (*) (PyObject*) ) libnumarray_FatalApiError)) - -#define NA_ComplexArrayCheck (libnumarray_API ? (*(int (*) (PyObject*) ) libnumarray_API[ 87 ]) : (*(int (*) (PyObject*) ) libnumarray_FatalApiError)) - -#define NA_elements (libnumarray_API ? (*(unsigned long (*) (PyArrayObject*) ) libnumarray_API[ 88 ]) : (*(unsigned long (*) (PyArrayObject*) ) libnumarray_FatalApiError)) - -#define NA_typeObjectToTypeNo (libnumarray_API ? (*(int (*) (PyObject*) ) libnumarray_API[ 89 ]) : (*(int (*) (PyObject*) ) libnumarray_FatalApiError)) - -#define NA_copyArray (libnumarray_API ? (*(int (*) (PyArrayObject* to, const PyArrayObject* from) ) libnumarray_API[ 90 ]) : (*(int (*) (PyArrayObject* to, const PyArrayObject* from) ) libnumarray_FatalApiError)) - -#define NA_copy (libnumarray_API ? (*(PyArrayObject* (*) (PyArrayObject*) ) libnumarray_API[ 91 ]) : (*(PyArrayObject* (*) (PyArrayObject*) ) libnumarray_FatalApiError)) - -#define NA_getType (libnumarray_API ? (*(PyObject* (*) (PyObject *typeobj_or_name) ) libnumarray_API[ 92 ]) : (*(PyObject* (*) (PyObject *typeobj_or_name) ) libnumarray_FatalApiError)) - -#define NA_callCUFuncCore (libnumarray_API ? (*(PyObject * (*) (PyObject *cfunc, long niter, long ninargs, long noutargs, PyObject **BufferObj, long *offset) ) libnumarray_API[ 93 ]) : (*(PyObject * (*) (PyObject *cfunc, long niter, long ninargs, long noutargs, PyObject **BufferObj, long *offset) ) libnumarray_FatalApiError)) - -#define NA_callStrideConvCFuncCore (libnumarray_API ? (*(PyObject * (*) (PyObject *cfunc, int nshape, maybelong *shape, PyObject *inbuffObj, long inboffset, int nstrides0, maybelong *inbstrides, PyObject *outbuffObj, long outboffset, int nstrides1, maybelong *outbstrides, long nbytes) ) libnumarray_API[ 94 ]) : (*(PyObject * (*) (PyObject *cfunc, int nshape, maybelong *shape, PyObject *inbuffObj, long inboffset, int nstrides0, maybelong *inbstrides, PyObject *outbuffObj, long outboffset, int nstrides1, maybelong *outbstrides, long nbytes) ) libnumarray_FatalApiError)) - -#define NA_stridesFromShape (libnumarray_API ? (*(void (*) (int nshape, maybelong *shape, maybelong bytestride, maybelong *strides) ) libnumarray_API[ 95 ]) : (*(void (*) (int nshape, maybelong *shape, maybelong bytestride, maybelong *strides) ) libnumarray_FatalApiError)) - -#define NA_OperatorCheck (libnumarray_API ? (*(int (*) (PyObject *obj) ) libnumarray_API[ 96 ]) : (*(int (*) (PyObject *obj) ) libnumarray_FatalApiError)) - -#define NA_ConverterCheck (libnumarray_API ? (*(int (*) (PyObject *obj) ) libnumarray_API[ 97 ]) : (*(int (*) (PyObject *obj) ) libnumarray_FatalApiError)) - -#define NA_UfuncCheck (libnumarray_API ? (*(int (*) (PyObject *obj) ) libnumarray_API[ 98 ]) : (*(int (*) (PyObject *obj) ) libnumarray_FatalApiError)) - -#define NA_CfuncCheck (libnumarray_API ? (*(int (*) (PyObject *obj) ) libnumarray_API[ 99 ]) : (*(int (*) (PyObject *obj) ) libnumarray_FatalApiError)) - -#define NA_getByteOffset (libnumarray_API ? (*(int (*) (PyArrayObject *array, int nindices, maybelong *indices, long *offset) ) libnumarray_API[ 100 ]) : (*(int (*) (PyArrayObject *array, int nindices, maybelong *indices, long *offset) ) libnumarray_FatalApiError)) - -#define NA_swapAxes (libnumarray_API ? (*(int (*) (PyArrayObject *array, int x, int y) ) libnumarray_API[ 101 ]) : (*(int (*) (PyArrayObject *array, int x, int y) ) libnumarray_FatalApiError)) - -#define NA_initModuleGlobal (libnumarray_API ? (*(PyObject * (*) (char *module, char *global) ) libnumarray_API[ 102 ]) : (*(PyObject * (*) (char *module, char *global) ) libnumarray_FatalApiError)) - -#define NA_NumarrayType (libnumarray_API ? (*(NumarrayType (*) (PyObject *seq) ) libnumarray_API[ 103 ]) : (*(NumarrayType (*) (PyObject *seq) ) libnumarray_FatalApiError)) - -#define NA_NewAllFromBuffer (libnumarray_API ? (*(PyArrayObject * (*) (int ndim, maybelong *shape, NumarrayType type, PyObject *bufferObject, maybelong byteoffset, maybelong bytestride, int byteorder, int aligned, int writeable) ) libnumarray_API[ 104 ]) : (*(PyArrayObject * (*) (int ndim, maybelong *shape, NumarrayType type, PyObject *bufferObject, maybelong byteoffset, maybelong bytestride, int byteorder, int aligned, int writeable) ) libnumarray_FatalApiError)) - -#define NA_alloc1D_Float64 (libnumarray_API ? (*(Float64 * (*) (PyArrayObject *a, long offset, int cnt) ) libnumarray_API[ 105 ]) : (*(Float64 * (*) (PyArrayObject *a, long offset, int cnt) ) libnumarray_FatalApiError)) - -#define NA_alloc1D_Int64 (libnumarray_API ? (*(Int64 * (*) (PyArrayObject *a, long offset, int cnt) ) libnumarray_API[ 106 ]) : (*(Int64 * (*) (PyArrayObject *a, long offset, int cnt) ) libnumarray_FatalApiError)) - -#define NA_updateAlignment (libnumarray_API ? (*(void (*) (PyArrayObject *self) ) libnumarray_API[ 107 ]) : (*(void (*) (PyArrayObject *self) ) libnumarray_FatalApiError)) - -#define NA_updateContiguous (libnumarray_API ? (*(void (*) (PyArrayObject *self) ) libnumarray_API[ 108 ]) : (*(void (*) (PyArrayObject *self) ) libnumarray_FatalApiError)) - -#define NA_updateStatus (libnumarray_API ? (*(void (*) (PyArrayObject *self) ) libnumarray_API[ 109 ]) : (*(void (*) (PyArrayObject *self) ) libnumarray_FatalApiError)) - -#define NA_NumArrayCheckExact (libnumarray_API ? (*(int (*) (PyObject *op) ) libnumarray_API[ 110 ]) : (*(int (*) (PyObject *op) ) libnumarray_FatalApiError)) - -#define NA_NDArrayCheckExact (libnumarray_API ? (*(int (*) (PyObject *op) ) libnumarray_API[ 111 ]) : (*(int (*) (PyObject *op) ) libnumarray_FatalApiError)) - -#define NA_OperatorCheckExact (libnumarray_API ? (*(int (*) (PyObject *op) ) libnumarray_API[ 112 ]) : (*(int (*) (PyObject *op) ) libnumarray_FatalApiError)) - -#define NA_ConverterCheckExact (libnumarray_API ? (*(int (*) (PyObject *op) ) libnumarray_API[ 113 ]) : (*(int (*) (PyObject *op) ) libnumarray_FatalApiError)) - -#define NA_UfuncCheckExact (libnumarray_API ? (*(int (*) (PyObject *op) ) libnumarray_API[ 114 ]) : (*(int (*) (PyObject *op) ) libnumarray_FatalApiError)) - -#define NA_CfuncCheckExact (libnumarray_API ? (*(int (*) (PyObject *op) ) libnumarray_API[ 115 ]) : (*(int (*) (PyObject *op) ) libnumarray_FatalApiError)) - -#define NA_getArrayData (libnumarray_API ? (*(char * (*) (PyArrayObject *ap) ) libnumarray_API[ 116 ]) : (*(char * (*) (PyArrayObject *ap) ) libnumarray_FatalApiError)) - -#define NA_updateByteswap (libnumarray_API ? (*(void (*) (PyArrayObject *ap) ) libnumarray_API[ 117 ]) : (*(void (*) (PyArrayObject *ap) ) libnumarray_FatalApiError)) - -#define NA_DescrFromType (libnumarray_API ? (*(PyArray_Descr * (*) (int type) ) libnumarray_API[ 118 ]) : (*(PyArray_Descr * (*) (int type) ) libnumarray_FatalApiError)) - -#define NA_Cast (libnumarray_API ? (*(PyObject * (*) (PyArrayObject *a, int type) ) libnumarray_API[ 119 ]) : (*(PyObject * (*) (PyArrayObject *a, int type) ) libnumarray_FatalApiError)) - -#define NA_checkFPErrors (libnumarray_API ? (*(int (*) (void) ) libnumarray_API[ 120 ]) : (*(int (*) (void) ) libnumarray_FatalApiError)) - -#define NA_clearFPErrors (libnumarray_API ? (*(void (*) (void) ) libnumarray_API[ 121 ]) : (*(void (*) (void) ) libnumarray_FatalApiError)) - -#define NA_checkAndReportFPErrors (libnumarray_API ? (*(int (*) (char *name) ) libnumarray_API[ 122 ]) : (*(int (*) (char *name) ) libnumarray_FatalApiError)) - -#define NA_IeeeMask32 (libnumarray_API ? (*(Bool (*) (Float32,Int32) ) libnumarray_API[ 123 ]) : (*(Bool (*) (Float32,Int32) ) libnumarray_FatalApiError)) - -#define NA_IeeeMask64 (libnumarray_API ? (*(Bool (*) (Float64,Int32) ) libnumarray_API[ 124 ]) : (*(Bool (*) (Float64,Int32) ) libnumarray_FatalApiError)) - -#define _NA_callStridingHelper (libnumarray_API ? (*(int (*) (PyObject *aux, long dim, long nnumarray, PyArrayObject *numarray[], char *data[], CFUNC_STRIDED_FUNC f) ) libnumarray_API[ 125 ]) : (*(int (*) (PyObject *aux, long dim, long nnumarray, PyArrayObject *numarray[], char *data[], CFUNC_STRIDED_FUNC f) ) libnumarray_FatalApiError)) - -#define NA_FromDimsStridesDescrAndData (libnumarray_API ? (*(PyArrayObject * (*) (int nd, maybelong *dims, maybelong *strides, PyArray_Descr *descr, char *data) ) libnumarray_API[ 126 ]) : (*(PyArrayObject * (*) (int nd, maybelong *dims, maybelong *strides, PyArray_Descr *descr, char *data) ) libnumarray_FatalApiError)) - -#define NA_FromDimsTypeAndData (libnumarray_API ? (*(PyArrayObject * (*) (int nd, maybelong *dims, int type, char *data) ) libnumarray_API[ 127 ]) : (*(PyArrayObject * (*) (int nd, maybelong *dims, int type, char *data) ) libnumarray_FatalApiError)) - -#define NA_FromDimsStridesTypeAndData (libnumarray_API ? (*(PyArrayObject * (*) (int nd, maybelong *dims, maybelong *strides, int type, char *data) ) libnumarray_API[ 128 ]) : (*(PyArrayObject * (*) (int nd, maybelong *dims, maybelong *strides, int type, char *data) ) libnumarray_FatalApiError)) - -#define NA_scipy_typestr (libnumarray_API ? (*(int (*) (NumarrayType t, int byteorder, char *typestr) ) libnumarray_API[ 129 ]) : (*(int (*) (NumarrayType t, int byteorder, char *typestr) ) libnumarray_FatalApiError)) - -#define NA_FromArrayStruct (libnumarray_API ? (*(PyArrayObject * (*) (PyObject *a) ) libnumarray_API[ 130 ]) : (*(PyArrayObject * (*) (PyObject *a) ) libnumarray_FatalApiError)) - -#endif - - /* Total number of C API pointers */ -#define libnumarray_API_pointers 131 - -#ifdef __cplusplus -} -#endif - -#endif /* NUMPY_LIBNUMARRAY_H */ Deleted: trunk/numpy/numarray/numpy/numcomplex.h =================================================================== --- trunk/numpy/numarray/numpy/numcomplex.h 2010-02-21 02:49:39 UTC (rev 8211) +++ trunk/numpy/numarray/numpy/numcomplex.h 2010-02-21 02:50:19 UTC (rev 8212) @@ -1,252 +0,0 @@ -/* See numarray.h for Complex32, Complex64: - -typedef struct { Float32 r, i; } Complex32; -typedef struct { Float64 r, i; } Complex64; - -*/ -typedef struct { Float32 a, theta; } PolarComplex32; -typedef struct { Float64 a, theta; } PolarComplex64; - -#define NUM_SQ(x) ((x)*(x)) - -#define NUM_CABSSQ(p) (NUM_SQ((p).r) + NUM_SQ((p).i)) - -#define NUM_CABS(p) sqrt(NUM_CABSSQ(p)) - -#define NUM_C_TO_P(c, p) (p).a = NUM_CABS(c); \ - (p).theta = atan2((c).i, (c).r); - -#define NUM_P_TO_C(p, c) (c).r = (p).a*cos((p).theta); \ - (c).i = (p).a*sin((p).theta); - -#define NUM_CASS(p, q) (q).r = (p).r, (q).i = (p).i - -#define NUM_CADD(p, q, s) (s).r = (p).r + (q).r, \ - (s).i = (p).i + (q).i - -#define NUM_CSUB(p, q, s) (s).r = (p).r - (q).r, \ - (s).i = (p).i - (q).i - -#define NUM_CMUL(p, q, s) \ - { Float64 rp = (p).r; \ - Float64 rq = (q).r; \ - (s).r = rp*rq - (p).i*(q).i; \ - (s).i = rp*(q).i + rq*(p).i; \ - } - -#define NUM_CDIV(p, q, s) \ - { \ - Float64 rp = (p).r; \ - Float64 ip = (p).i; \ - Float64 rq = (q).r; \ - if ((q).i != 0) { \ - Float64 temp = NUM_CABSSQ(q); \ - (s).r = (rp*rq+(p).i*(q).i)/temp; \ - (s).i = (rq*(p).i-(q).i*rp)/temp; \ - } else { \ - (s).r = rp/rq; \ - (s).i = ip/rq; \ - } \ - } - -#define NUM_CREM(p, q, s) \ - { Complex64 r; \ - NUM_CDIV(p, q, r); \ - r.r = floor(r.r); \ - r.i = 0; \ - NUM_CMUL(r, q, r); \ - NUM_CSUB(p, r, s); \ - } - -#define NUM_CMINUS(p, s) (s).r = -(p).r; (s).i = -(p).i; -#define NUM_CNEG NUM_CMINUS - -#define NUM_CEQ(p, q) (((p).r == (q).r) && ((p).i == (q).i)) -#define NUM_CNE(p, q) (((p).r != (q).r) || ((p).i != (q).i)) -#define NUM_CLT(p, q) ((p).r < (q).r) -#define NUM_CGT(p, q) ((p).r > (q).r) -#define NUM_CLE(p, q) ((p).r <= (q).r) -#define NUM_CGE(p, q) ((p).r >= (q).r) - -/* e**z = e**x * (cos(y)+ i*sin(y)) where z = x + i*y - so e**z = e**x * cos(y) + i * e**x * sin(y) -*/ -#define NUM_CEXP(p, s) \ - { Float64 ex = exp((p).r); \ - (s).r = ex * cos((p).i); \ - (s).i = ex * sin((p).i); \ - } - -/* e**w = z; w = u + i*v; z = r * e**(i*theta); - -e**u * e**(i*v) = r * e**(i*theta); - -log(z) = w; log(z) = log(r) + i*theta; - */ -#define NUM_CLOG(p, s) \ - { PolarComplex64 temp; NUM_C_TO_P(p, temp); \ - (s).r = num_log(temp.a); \ - (s).i = temp.theta; \ - } - -#define NUM_LOG10_E 0.43429448190325182 - -#define NUM_CLOG10(p, s) \ - { NUM_CLOG(p, s); \ - (s).r *= NUM_LOG10_E; \ - (s).i *= NUM_LOG10_E; \ - } - -/* s = p ** q */ -#define NUM_CPOW(p, q, s) { if (NUM_CABSSQ(p) == 0) { \ - if ((q).r == 0 && (q).i == 0) { \ - (s).r = (s).i = 1; \ - } else { \ - (s).r = (s).i = 0; \ - } \ - } else { \ - NUM_CLOG(p, s); \ - NUM_CMUL(s, q, s); \ - NUM_CEXP(s, s); \ - } \ - } - -#define NUM_CSQRT(p, s) { Complex64 temp; temp.r = 0.5; temp.i=0; \ - NUM_CPOW(p, temp, s); \ - } - -#define NUM_CSQR(p, s) { Complex64 temp; temp.r = 2.0; temp.i=0; \ - NUM_CPOW(p, temp, s); \ - } - -#define NUM_CSIN(p, s) { Float64 sp = sin((p).r); \ - Float64 cp = cos((p).r); \ - (s).r = cosh((p).i) * sp; \ - (s).i = sinh((p).i) * cp; \ - } - -#define NUM_CCOS(p, s) { Float64 sp = sin((p).r); \ - Float64 cp = cos((p).r); \ - (s).r = cosh((p).i) * cp; \ - (s).i = -sinh((p).i) * sp; \ - } - -#define NUM_CTAN(p, s) { Complex64 ss, cs; \ - NUM_CSIN(p, ss); \ - NUM_CCOS(p, cs); \ - NUM_CDIV(ss, cs, s); \ - } - -#define NUM_CSINH(p, s) { Float64 sp = sin((p).i); \ - Float64 cp = cos((p).i); \ - (s).r = sinh((p).r) * cp; \ - (s).i = cosh((p).r) * sp; \ - } - -#define NUM_CCOSH(p, s) { Float64 sp = sin((p).i); \ - Float64 cp = cos((p).i); \ - (s).r = cosh((p).r) * cp; \ - (s).i = sinh((p).r) * sp; \ - } - -#define NUM_CTANH(p, s) { Complex64 ss, cs; \ - NUM_CSINH(p, ss); \ - NUM_CCOSH(p, cs); \ - NUM_CDIV(ss, cs, s); \ - } - -#define NUM_CRPOW(p, v, s) { Complex64 cr; cr.r = v; cr.i = 0; \ - NUM_CPOW(p,cr,s); \ - } - -#define NUM_CRMUL(p, v, s) (s).r = (p).r * v; (s).i = (p).i * v; - -#define NUM_CIMUL(p, s) { Float64 temp = (s).r; \ - (s).r = -(p).i; (s).i = temp; \ - } - -/* asin(z) = -i * log(i*z + (1 - z**2)**0.5) */ -#define NUM_CASIN(p, s) { Complex64 p1; NUM_CASS(p, p1); \ - NUM_CIMUL(p, p1); \ - NUM_CMUL(p, p, s); \ - NUM_CNEG(s, s); \ - (s).r += 1; \ - NUM_CRPOW(s, 0.5, s); \ - NUM_CADD(p1, s, s); \ - NUM_CLOG(s, s); \ - NUM_CIMUL(s, s); \ - NUM_CNEG(s, s); \ - } - -/* acos(z) = -i * log(z + i*(1 - z**2)**0.5) */ -#define NUM_CACOS(p, s) { Complex64 p1; NUM_CASS(p, p1); \ - NUM_CMUL(p, p, s); \ - NUM_CNEG(s, s); \ - (s).r += 1; \ - NUM_CRPOW(s, 0.5, s); \ - NUM_CIMUL(s, s); \ - NUM_CADD(p1, s, s); \ - NUM_CLOG(s, s); \ - NUM_CIMUL(s, s); \ - NUM_CNEG(s, s); \ - } - -/* atan(z) = i/2 * log( (i+z) / (i - z) ) */ -#define NUM_CATAN(p, s) { Complex64 p1, p2; \ - NUM_CASS(p, p1); NUM_CNEG(p, p2); \ - p1.i += 1; \ - p2.i += 1; \ - NUM_CDIV(p1, p2, s); \ - NUM_CLOG(s, s); \ - NUM_CIMUL(s, s); \ - NUM_CRMUL(s, 0.5, s); \ - } - -/* asinh(z) = log( z + (z**2 + 1)**0.5 ) */ -#define NUM_CASINH(p, s) { Complex64 p1; NUM_CASS(p, p1); \ - NUM_CMUL(p, p, s); \ - (s).r += 1; \ - NUM_CRPOW(s, 0.5, s); \ - NUM_CADD(p1, s, s); \ - NUM_CLOG(s, s); \ - } - -/* acosh(z) = log( z + (z**2 - 1)**0.5 ) */ -#define NUM_CACOSH(p, s) { Complex64 p1; NUM_CASS(p, p1); \ - NUM_CMUL(p, p, s); \ - (s).r -= 1; \ - NUM_CRPOW(s, 0.5, s); \ - NUM_CADD(p1, s, s); \ - NUM_CLOG(s, s); \ - } - -/* atanh(z) = 1/2 * log( (1+z)/(1-z) ) */ -#define NUM_CATANH(p, s) { Complex64 p1, p2; \ - NUM_CASS(p, p1); NUM_CNEG(p, p2); \ - p1.r += 1; \ - p2.r += 1; \ - NUM_CDIV(p1, p2, s); \ - NUM_CLOG(s, s); \ - NUM_CRMUL(s, 0.5, s); \ - } - - -#define NUM_CMIN(p, q) (NUM_CLE(p, q) ? p : q) -#define NUM_CMAX(p, q) (NUM_CGE(p, q) ? p : q) - -#define NUM_CNZ(p) (((p).r != 0) || ((p).i != 0)) -#define NUM_CLAND(p, q) (NUM_CNZ(p) & NUM_CNZ(q)) -#define NUM_CLOR(p, q) (NUM_CNZ(p) | NUM_CNZ(q)) -#define NUM_CLXOR(p, q) (NUM_CNZ(p) ^ NUM_CNZ(q)) -#define NUM_CLNOT(p) (!NUM_CNZ(p)) - -#define NUM_CFLOOR(p, s) (s).r = floor((p).r); (s).i = floor((p).i); -#define NUM_CCEIL(p, s) (s).r = ceil((p).r); (s).i = ceil((p).i); - -#define NUM_CFABS(p, s) (s).r = fabs((p).r); (s).i = fabs((p).i); -#define NUM_CROUND(p, s) (s).r = num_round((p).r); (s).i = num_round((p).i); -#define NUM_CHYPOT(p, q, s) { Complex64 t; \ - NUM_CSQR(p, s); NUM_CSQR(q, t); \ - NUM_CADD(s, t, s); \ - NUM_CSQRT(s, s); \ - } Deleted: trunk/numpy/numarray/numpy/nummacro.h =================================================================== --- trunk/numpy/numarray/numpy/nummacro.h 2010-02-21 02:49:39 UTC (rev 8211) +++ trunk/numpy/numarray/numpy/nummacro.h 2010-02-21 02:50:19 UTC (rev 8212) @@ -1,447 +0,0 @@ -/* Primarily for compatibility with numarray C-API */ - -#if !defined(_ndarraymacro) -#define _ndarraymacro - -/* The structs defined here are private implementation details of numarray -which are subject to change w/o notice. -*/ - -#define PY_BOOL_CHAR "b" -#define PY_INT8_CHAR "b" -#define PY_INT16_CHAR "h" -#define PY_INT32_CHAR "i" -#define PY_FLOAT32_CHAR "f" -#define PY_FLOAT64_CHAR "d" -#define PY_UINT8_CHAR "h" -#define PY_UINT16_CHAR "i" -#define PY_UINT32_CHAR "i" /* Unless longer int available */ -#define PY_COMPLEX64_CHAR "D" -#define PY_COMPLEX128_CHAR "D" - -#define PY_LONG_CHAR "l" -#define PY_LONG_LONG_CHAR "L" - -#define pyFPE_DIVIDE_BY_ZERO 1 -#define pyFPE_OVERFLOW 2 -#define pyFPE_UNDERFLOW 4 -#define pyFPE_INVALID 8 - -#define isNonZERO(x) (x != 0) /* to convert values to boolean 1's or 0's */ - -typedef enum -{ - NUM_CONTIGUOUS=1, - NUM_NOTSWAPPED=0x0200, - NUM_ALIGNED=0x0100, - NUM_WRITABLE=0x0400, - NUM_COPY=0x0020, - - NUM_C_ARRAY = (NUM_CONTIGUOUS | NUM_ALIGNED | NUM_NOTSWAPPED), - NUM_UNCONVERTED = 0 -} NumRequirements; - -#define UNCONVERTED 0 -#define C_ARRAY (NUM_CONTIGUOUS | NUM_NOTSWAPPED | NUM_ALIGNED) - -#define MUST_BE_COMPUTED 2 - -#define NUM_FLOORDIVIDE(a,b,out) (out) = floor((a)/(b)) - -#define NA_Begin() Py_Initialize(); import_libnumarray(); -#define NA_End() NA_Done(); Py_Finalize(); - -#define NA_OFFSETDATA(num) ((void *) PyArray_DATA(num)) - -/* unaligned NA_COPY functions */ -#define NA_COPY1(i, o) (*(o) = *(i)) -#define NA_COPY2(i, o) NA_COPY1(i, o), NA_COPY1(i+1, o+1) -#define NA_COPY4(i, o) NA_COPY2(i, o), NA_COPY2(i+2, o+2) -#define NA_COPY8(i, o) NA_COPY4(i, o), NA_COPY4(i+4, o+4) -#define NA_COPY16(i, o) NA_COPY8(i, o), NA_COPY8(i+8, o+8) - -/* byteswapping macros: these fail if i==o */ -#define NA_SWAP1(i, o) NA_COPY1(i, o) -#define NA_SWAP2(i, o) NA_SWAP1(i, o+1), NA_SWAP1(i+1, o) -#define NA_SWAP4(i, o) NA_SWAP2(i, o+2), NA_SWAP2(i+2, o) -#define NA_SWAP8(i, o) NA_SWAP4(i, o+4), NA_SWAP4(i+4, o) -#define NA_SWAP16(i, o) NA_SWAP8(i, o+8), NA_SWAP8(i+8, o) - -/* complex byteswaps must swap each part (real, imag) independently */ -#define NA_COMPLEX_SWAP8(i, o) NA_SWAP4(i, o), NA_SWAP4(i+4, o+4) -#define NA_COMPLEX_SWAP16(i, o) NA_SWAP8(i, o), NA_SWAP8(i+8, o+8) - -/* byteswapping macros: these work even if i == o */ -#define NA_TSWAP1(i, o, t) NA_COPY1(i, t), NA_SWAP1(t, o) -#define NA_TSWAP2(i, o, t) NA_COPY2(i, t), NA_SWAP2(t, o) -#define NA_TSWAP4(i, o, t) NA_COPY4(i, t), NA_SWAP4(t, o) -#define NA_TSWAP8(i, o, t) NA_COPY8(i, t), NA_SWAP8(t, o) - -/* fast copy functions for %N aligned i and o */ -#define NA_ACOPY1(i, o) (((Int8 *)o)[0] = ((Int8 *)i)[0]) -#define NA_ACOPY2(i, o) (((Int16 *)o)[0] = ((Int16 *)i)[0]) -#define NA_ACOPY4(i, o) (((Int32 *)o)[0] = ((Int32 *)i)[0]) -#define NA_ACOPY8(i, o) (((Float64 *)o)[0] = ((Float64 *)i)[0]) -#define NA_ACOPY16(i, o) (((Complex64 *)o)[0] = ((Complex64 *)i)[0]) - -/* from here down, type("ai") is NDInfo* */ - -#define NA_PTR(ai) ((char *) NA_OFFSETDATA((ai))) -#define NA_PTR1(ai, i) (NA_PTR(ai) + \ - (i)*(ai)->strides[0]) -#define NA_PTR2(ai, i, j) (NA_PTR(ai) + \ - (i)*(ai)->strides[0] + \ - (j)*(ai)->strides[1]) -#define NA_PTR3(ai, i, j, k) (NA_PTR(ai) + \ - (i)*(ai)->strides[0] + \ - (j)*(ai)->strides[1] + \ - (k)*(ai)->strides[2]) - -#define NA_SET_TEMP(ai, type, v) (((type *) &__temp__)[0] = v) - -#define NA_SWAPComplex64 NA_COMPLEX_SWAP16 -#define NA_SWAPComplex32 NA_COMPLEX_SWAP8 -#define NA_SWAPFloat64 NA_SWAP8 -#define NA_SWAPFloat32 NA_SWAP4 -#define NA_SWAPInt64 NA_SWAP8 -#define NA_SWAPUInt64 NA_SWAP8 -#define NA_SWAPInt32 NA_SWAP4 -#define NA_SWAPUInt32 NA_SWAP4 -#define NA_SWAPInt16 NA_SWAP2 -#define NA_SWAPUInt16 NA_SWAP2 -#define NA_SWAPInt8 NA_SWAP1 -#define NA_SWAPUInt8 NA_SWAP1 -#define NA_SWAPBool NA_SWAP1 - -#define NA_COPYComplex64 NA_COPY16 -#define NA_COPYComplex32 NA_COPY8 -#define NA_COPYFloat64 NA_COPY8 -#define NA_COPYFloat32 NA_COPY4 -#define NA_COPYInt64 NA_COPY8 -#define NA_COPYUInt64 NA_COPY8 -#define NA_COPYInt32 NA_COPY4 -#define NA_COPYUInt32 NA_COPY4 -#define NA_COPYInt16 NA_COPY2 -#define NA_COPYUInt16 NA_COPY2 -#define NA_COPYInt8 NA_COPY1 -#define NA_COPYUInt8 NA_COPY1 -#define NA_COPYBool NA_COPY1 - -#ifdef __cplusplus -extern "C" { -#endif - -#define _makeGetPb(type) \ -static type _NA_GETPb_##type(char *ptr) \ -{ \ - type temp; \ - NA_SWAP##type(ptr, (char *)&temp); \ - return temp; \ -} - -#define _makeGetPa(type) \ -static type _NA_GETPa_##type(char *ptr) \ -{ \ - type temp; \ - NA_COPY##type(ptr, (char *)&temp); \ - return temp; \ -} - -_makeGetPb(Complex64) -_makeGetPb(Complex32) -_makeGetPb(Float64) -_makeGetPb(Float32) -_makeGetPb(Int64) -_makeGetPb(UInt64) -_makeGetPb(Int32) -_makeGetPb(UInt32) -_makeGetPb(Int16) -_makeGetPb(UInt16) -_makeGetPb(Int8) -_makeGetPb(UInt8) -_makeGetPb(Bool) - -_makeGetPa(Complex64) -_makeGetPa(Complex32) -_makeGetPa(Float64) -_makeGetPa(Float32) -_makeGetPa(Int64) -_makeGetPa(UInt64) -_makeGetPa(Int32) -_makeGetPa(UInt32) -_makeGetPa(Int16) -_makeGetPa(UInt16) -_makeGetPa(Int8) -_makeGetPa(UInt8) -_makeGetPa(Bool) - -#undef _makeGetPb -#undef _makeGetPa - -#define _makeSetPb(type) \ -static void _NA_SETPb_##type(char *ptr, type v) \ -{ \ - NA_SWAP##type(((char *)&v), ptr); \ - return; \ -} - -#define _makeSetPa(type) \ -static void _NA_SETPa_##type(char *ptr, type v) \ -{ \ - NA_COPY##type(((char *)&v), ptr); \ - return; \ -} - -_makeSetPb(Complex64) -_makeSetPb(Complex32) -_makeSetPb(Float64) -_makeSetPb(Float32) -_makeSetPb(Int64) -_makeSetPb(UInt64) -_makeSetPb(Int32) -_makeSetPb(UInt32) -_makeSetPb(Int16) -_makeSetPb(UInt16) -_makeSetPb(Int8) -_makeSetPb(UInt8) -_makeSetPb(Bool) - -_makeSetPa(Complex64) -_makeSetPa(Complex32) -_makeSetPa(Float64) -_makeSetPa(Float32) -_makeSetPa(Int64) -_makeSetPa(UInt64) -_makeSetPa(Int32) -_makeSetPa(UInt32) -_makeSetPa(Int16) -_makeSetPa(UInt16) -_makeSetPa(Int8) -_makeSetPa(UInt8) -_makeSetPa(Bool) - -#undef _makeSetPb -#undef _makeSetPa - -#ifdef __cplusplus - } -#endif - -/* ========================== ptr get/set ================================ */ - -/* byteswapping */ -#define NA_GETPb(ai, type, ptr) _NA_GETPb_##type(ptr) - -/* aligning */ -#define NA_GETPa(ai, type, ptr) _NA_GETPa_##type(ptr) - -/* fast (aligned, !byteswapped) */ -#define NA_GETPf(ai, type, ptr) (*((type *) (ptr))) - -#define NA_GETP(ai, type, ptr) \ - (PyArray_ISCARRAY(ai) ? NA_GETPf(ai, type, ptr) \ - : (PyArray_ISBYTESWAPPED(ai) ? \ - NA_GETPb(ai, type, ptr) \ - : NA_GETPa(ai, type, ptr))) - -/* NOTE: NA_SET* macros cannot be used as values. */ - -/* byteswapping */ -#define NA_SETPb(ai, type, ptr, v) _NA_SETPb_##type(ptr, v) - -/* aligning */ -#define NA_SETPa(ai, type, ptr, v) _NA_SETPa_##type(ptr, v) - -/* fast (aligned, !byteswapped) */ -#define NA_SETPf(ai, type, ptr, v) ((*((type *) ptr)) = (v)) - -#define NA_SETP(ai, type, ptr, v) \ - if (PyArray_ISCARRAY(ai)) { \ - NA_SETPf((ai), type, (ptr), (v)); \ - } else if (PyArray_ISBYTESWAPPED(ai)) { \ - NA_SETPb((ai), type, (ptr), (v)); \ - } else \ - NA_SETPa((ai), type, (ptr), (v)) - -/* ========================== 1 index get/set ============================ */ - -/* byteswapping */ -#define NA_GET1b(ai, type, i) NA_GETPb(ai, type, NA_PTR1(ai, i)) -/* aligning */ -#define NA_GET1a(ai, type, i) NA_GETPa(ai, type, NA_PTR1(ai, i)) -/* fast (aligned, !byteswapped) */ -#define NA_GET1f(ai, type, i) NA_GETPf(ai, type, NA_PTR1(ai, i)) -/* testing */ -#define NA_GET1(ai, type, i) NA_GETP(ai, type, NA_PTR1(ai, i)) - -/* byteswapping */ -#define NA_SET1b(ai, type, i, v) NA_SETPb(ai, type, NA_PTR1(ai, i), v) -/* aligning */ -#define NA_SET1a(ai, type, i, v) NA_SETPa(ai, type, NA_PTR1(ai, i), v) -/* fast (aligned, !byteswapped) */ -#define NA_SET1f(ai, type, i, v) NA_SETPf(ai, type, NA_PTR1(ai, i), v) -/* testing */ -#define NA_SET1(ai, type, i, v) NA_SETP(ai, type, NA_PTR1(ai, i), v) - -/* ========================== 2 index get/set ============================= */ - -/* byteswapping */ -#define NA_GET2b(ai, type, i, j) NA_GETPb(ai, type, NA_PTR2(ai, i, j)) -/* aligning */ -#define NA_GET2a(ai, type, i, j) NA_GETPa(ai, type, NA_PTR2(ai, i, j)) -/* fast (aligned, !byteswapped) */ -#define NA_GET2f(ai, type, i, j) NA_GETPf(ai, type, NA_PTR2(ai, i, j)) -/* testing */ -#define NA_GET2(ai, type, i, j) NA_GETP(ai, type, NA_PTR2(ai, i, j)) - -/* byteswapping */ -#define NA_SET2b(ai, type, i, j, v) NA_SETPb(ai, type, NA_PTR2(ai, i, j), v) -/* aligning */ -#define NA_SET2a(ai, type, i, j, v) NA_SETPa(ai, type, NA_PTR2(ai, i, j), v) -/* fast (aligned, !byteswapped) */ -#define NA_SET2f(ai, type, i, j, v) NA_SETPf(ai, type, NA_PTR2(ai, i, j), v) - -#define NA_SET2(ai, type, i, j, v) NA_SETP(ai, type, NA_PTR2(ai, i, j), v) - -/* ========================== 3 index get/set ============================= */ - -/* byteswapping */ -#define NA_GET3b(ai, type, i, j, k) NA_GETPb(ai, type, NA_PTR3(ai, i, j, k)) -/* aligning */ -#define NA_GET3a(ai, type, i, j, k) NA_GETPa(ai, type, NA_PTR3(ai, i, j, k)) -/* fast (aligned, !byteswapped) */ -#define NA_GET3f(ai, type, i, j, k) NA_GETPf(ai, type, NA_PTR3(ai, i, j, k)) -/* testing */ -#define NA_GET3(ai, type, i, j, k) NA_GETP(ai, type, NA_PTR3(ai, i, j, k)) - -/* byteswapping */ -#define NA_SET3b(ai, type, i, j, k, v) \ - NA_SETPb(ai, type, NA_PTR3(ai, i, j, k), v) -/* aligning */ -#define NA_SET3a(ai, type, i, j, k, v) \ - NA_SETPa(ai, type, NA_PTR3(ai, i, j, k), v) -/* fast (aligned, !byteswapped) */ -#define NA_SET3f(ai, type, i, j, k, v) \ - NA_SETPf(ai, type, NA_PTR3(ai, i, j, k), v) -#define NA_SET3(ai, type, i, j, k, v) \ - NA_SETP(ai, type, NA_PTR3(ai, i, j, k), v) - -/* ========================== 1D get/set ================================== */ - -#define NA_GET1Db(ai, type, base, cnt, out) \ - { int i, stride = ai->strides[ai->nd-1]; \ - for(i=0; istrides[ai->nd-1]; \ - for(i=0; istrides[ai->nd-1]; \ - for(i=0; istrides[ai->nd-1]; \ - for(i=0; istrides[ai->nd-1]; \ - for(i=0; istrides[ai->nd-1]; \ - for(i=0; i=(y)) ? (x) : (y)) -#endif - -#if !defined(ABS) -#define ABS(x) (((x) >= 0) ? (x) : -(x)) -#endif - -#define ELEM(x) (sizeof(x)/sizeof(x[0])) - -#define BOOLEAN_BITWISE_NOT(x) ((x) ^ 1) - -#define NA_NBYTES(a) (a->descr->elsize * NA_elements(a)) - -#if defined(NA_SMP) -#define BEGIN_THREADS Py_BEGIN_ALLOW_THREADS -#define END_THREADS Py_END_ALLOW_THREADS -#else -#define BEGIN_THREADS -#define END_THREADS -#endif - -#if !defined(NA_isnan) - -#define U32(u) (* (Int32 *) &(u) ) -#define U64(u) (* (Int64 *) &(u) ) - -#define NA_isnan32(u) \ - ( (( U32(u) & 0x7f800000) == 0x7f800000) && ((U32(u) & 0x007fffff) != 0)) ? 1:0 - -#if !defined(_MSC_VER) -#define NA_isnan64(u) \ - ( (( U64(u) & 0x7ff0000000000000LL) == 0x7ff0000000000000LL) && ((U64(u) & 0x000fffffffffffffLL) != 0)) ? 1:0 -#else -#define NA_isnan64(u) \ - ( (( U64(u) & 0x7ff0000000000000i64) == 0x7ff0000000000000i64) && ((U64(u) & 0x000fffffffffffffi64) != 0)) ? 1:0 -#endif - -#define NA_isnanC32(u) (NA_isnan32(((Complex32 *)&(u))->r) || NA_isnan32(((Complex32 *)&(u))->i)) -#define NA_isnanC64(u) (NA_isnan64(((Complex64 *)&(u))->r) || NA_isnan64(((Complex64 *)&(u))->i)) - -#endif /* NA_isnan */ - - -#endif /* _ndarraymacro */ Modified: trunk/numpy/numarray/setup.py =================================================================== --- trunk/numpy/numarray/setup.py 2010-02-21 02:49:39 UTC (rev 8211) +++ trunk/numpy/numarray/setup.py 2010-02-21 02:50:19 UTC (rev 8212) @@ -4,7 +4,7 @@ from numpy.distutils.misc_util import Configuration config = Configuration('numarray',parent_package,top_path) - config.add_data_files('numpy/*') + config.add_data_files('include/numpy/*') config.add_extension('_capi', sources=['_capi.c'], Modified: trunk/numpy/numarray/setupscons.py =================================================================== --- trunk/numpy/numarray/setupscons.py 2010-02-21 02:49:39 UTC (rev 8211) +++ trunk/numpy/numarray/setupscons.py 2010-02-21 02:50:19 UTC (rev 8212) @@ -4,7 +4,7 @@ from numpy.distutils.misc_util import Configuration config = Configuration('numarray',parent_package,top_path) - config.add_data_files('numpy/') + config.add_data_files('include/numpy/') config.add_sconscript('SConstruct', source_files = ['_capi.c']) return config Modified: trunk/numpy/numarray/util.py =================================================================== --- trunk/numpy/numarray/util.py 2010-02-21 02:49:39 UTC (rev 8211) +++ trunk/numpy/numarray/util.py 2010-02-21 02:50:19 UTC (rev 8212) @@ -35,5 +35,5 @@ def get_numarray_include_dirs(): base = os.path.dirname(numpy.__file__) - newdirs = [os.path.join(base, 'numarray')] + newdirs = [os.path.join(base, 'numarray', 'include')] return newdirs From numpy-svn at scipy.org Sat Feb 20 21:50:35 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 20:50:35 -0600 (CST) Subject: [Numpy-svn] r8213 - trunk/numpy/numarray Message-ID: <20100221025035.6C172C7C059@scipy.org> Author: ptvirtan Date: 2010-02-20 20:50:34 -0600 (Sat, 20 Feb 2010) New Revision: 8213 Modified: trunk/numpy/numarray/functions.py Log: 3K: ENH: make numpy.numarray to import Modified: trunk/numpy/numarray/functions.py =================================================================== --- trunk/numpy/numarray/functions.py 2010-02-21 02:50:19 UTC (rev 8212) +++ trunk/numpy/numarray/functions.py 2010-02-21 02:50:34 UTC (rev 8213) @@ -54,6 +54,9 @@ from numerictypes import typefrom +if sys.version_info[0] >= 3: + import copyreg as copy_reg + isBigEndian = sys.byteorder != 'little' value = tcode = 'f' tname = 'Float32' From numpy-svn at scipy.org Sat Feb 20 21:50:49 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 20:50:49 -0600 (CST) Subject: [Numpy-svn] r8214 - trunk/numpy/ma Message-ID: <20100221025049.66BF1C7C059@scipy.org> Author: ptvirtan Date: 2010-02-20 20:50:49 -0600 (Sat, 20 Feb 2010) New Revision: 8214 Modified: trunk/numpy/ma/core.py Log: 3K: ENH: ma: implement data-preserving __ifloordiv__ and __itruediv__ Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2010-02-21 02:50:34 UTC (rev 8213) +++ trunk/numpy/ma/core.py 2010-02-21 02:50:49 UTC (rev 8214) @@ -3726,6 +3726,36 @@ self._mask |= new_mask ndarray.__idiv__(self._data, np.where(self._mask, 1, other_data)) return self + #.... + def __ifloordiv__(self, other): + "Floor divide self by other in-place." + other_data = getdata(other) + dom_mask = _DomainSafeDivide().__call__(self._data, other_data) + other_mask = getmask(other) + new_mask = mask_or(other_mask, dom_mask) + # The following 3 lines control the domain filling + if dom_mask.any(): + (_, fval) = ufunc_fills[np.floor_divide] + other_data = np.where(dom_mask, fval, other_data) +# self._mask = mask_or(self._mask, new_mask) + self._mask |= new_mask + ndarray.__ifloordiv__(self._data, np.where(self._mask, 1, other_data)) + return self + #.... + def __itruediv__(self, other): + "True divide self by other in-place." + other_data = getdata(other) + dom_mask = _DomainSafeDivide().__call__(self._data, other_data) + other_mask = getmask(other) + new_mask = mask_or(other_mask, dom_mask) + # The following 3 lines control the domain filling + if dom_mask.any(): + (_, fval) = ufunc_fills[np.true_divide] + other_data = np.where(dom_mask, fval, other_data) +# self._mask = mask_or(self._mask, new_mask) + self._mask |= new_mask + ndarray.__itruediv__(self._data, np.where(self._mask, 1, other_data)) + return self #... def __ipow__(self, other): "Raise self to the power other, in place." From numpy-svn at scipy.org Sat Feb 20 21:51:05 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 20:51:05 -0600 (CST) Subject: [Numpy-svn] r8215 - trunk/numpy/ma/tests Message-ID: <20100221025105.66051C7C059@scipy.org> Author: ptvirtan Date: 2010-02-20 20:51:05 -0600 (Sat, 20 Feb 2010) New Revision: 8215 Modified: trunk/numpy/ma/tests/test_core.py trunk/numpy/ma/tests/test_mrecords.py Log: 3K: ma: solve some bytes vs. str issues in tests Modified: trunk/numpy/ma/tests/test_core.py =================================================================== --- trunk/numpy/ma/tests/test_core.py 2010-02-21 02:50:49 UTC (rev 8214) +++ trunk/numpy/ma/tests/test_core.py 2010-02-21 02:51:05 UTC (rev 8215) @@ -17,6 +17,8 @@ import numpy.ma.core from numpy.ma.core import * +from numpy.compat import asbytes, asbytes_nested + pi = np.pi import sys @@ -1292,7 +1294,7 @@ assert_equal(fval, default_fill_value(0)) # fval = _check_fill_value(0, "|S3") - assert_equal(fval, "0") + assert_equal(fval, asbytes("0")) fval = _check_fill_value(None, "|S3") assert_equal(fval, default_fill_value("|S3")) # @@ -1346,7 +1348,7 @@ "Tests the behavior of fill_value during conversion" # We had a tailored comment to make sure special attributes are properly # dealt with - a = array(['3', '4', '5']) + a = array(asbytes_nested(['3', '4', '5'])) a._optinfo.update({'comment':"updated!"}) # b = array(a, dtype=int) @@ -1376,14 +1378,14 @@ mtype = [('f', float), ('s', '|S3')] x = array([(1, 'a'), (2, 'b'), (pi, 'pi')], dtype=mtype) x.fill_value = 999 - assert_equal(x.fill_value.item(), [999., '999']) + assert_equal(x.fill_value.item(), [999., asbytes('999')]) assert_equal(x['f'].fill_value, 999) - assert_equal(x['s'].fill_value, '999') + assert_equal(x['s'].fill_value, asbytes('999')) # x.fill_value = (9, '???') - assert_equal(x.fill_value.item(), (9, '???')) + assert_equal(x.fill_value.item(), (9, asbytes('???'))) assert_equal(x['f'].fill_value, 9) - assert_equal(x['s'].fill_value, '???') + assert_equal(x['s'].fill_value, asbytes('???')) # x = array([1, 2, 3.1]) x.fill_value = 999 @@ -2374,7 +2376,9 @@ dtype=[('a', int), ('b', float), ('c', '|S8')]) x[-1] = masked assert_equal(x.tolist(), - [(1, 1.1, 'one'), (2, 2.2, 'two'), (None, None, None)]) + [(1, 1.1, asbytes('one')), + (2, 2.2, asbytes('two')), + (None, None, None)]) # ... on structured array w/ masked fields a = array([(1, 2,), (3, 4)], mask=[(0, 1), (0, 0)], dtype=[('a', int), ('b', int)]) @@ -3215,7 +3219,8 @@ assert_equal(base_b._data, [pi, 2.2, 3.3, 4.4, 5.5]) assert_equal(base_c.dtype, '|S8') - assert_equal(base_c._data, ['pi', 'two', 'three', 'four', 'five']) + assert_equal(base_c._data, + asbytes_nested(['pi', 'two', 'three', 'four', 'five'])) def test_set_record_slice(self): base = self.data['base'] @@ -3229,7 +3234,8 @@ assert_equal(base_b._data, [pi, pi, pi, 4.4, 5.5]) assert_equal(base_c.dtype, '|S8') - assert_equal(base_c._data, ['pi', 'pi', 'pi', 'four', 'five']) + assert_equal(base_c._data, + asbytes_nested(['pi', 'pi', 'pi', 'four', 'five'])) def test_mask_element(self): "Check record access" Modified: trunk/numpy/ma/tests/test_mrecords.py =================================================================== --- trunk/numpy/ma/tests/test_mrecords.py 2010-02-21 02:50:49 UTC (rev 8214) +++ trunk/numpy/ma/tests/test_mrecords.py 2010-02-21 02:51:05 UTC (rev 8215) @@ -14,7 +14,7 @@ from numpy.core.records import fromrecords as recfromrecords, \ fromarrays as recfromarrays -from numpy.compat import asbytes +from numpy.compat import asbytes, asbytes_nested import numpy.ma.testutils from numpy.ma.testutils import * @@ -68,7 +68,7 @@ mbase_first = mbase[0] assert isinstance(mbase_first, mrecarray) assert_equal(mbase_first.dtype, mbase.dtype) - assert_equal(mbase_first.tolist(), (1,1.1,'one')) + assert_equal(mbase_first.tolist(), (1,1.1,asbytes('one'))) # Used to be mask, now it's recordmask assert_equal(mbase_first.recordmask, nomask) assert_equal(mbase_first._mask.item(), (False, False, False)) @@ -222,7 +222,8 @@ assert_equal(mbase.a._mask, [0,0,0,0,1]) assert_equal(mbase.b._data, [5.,5.,3.3,4.4,5.5]) assert_equal(mbase.b._mask, [0,0,0,0,1]) - assert_equal(mbase.c._data, ['5','5','three','four','five']) + assert_equal(mbase.c._data, + asbytes_nested(['5','5','three','four','five'])) assert_equal(mbase.b._mask, [0,0,0,0,1]) # mbase = base.view(mrecarray).copy() @@ -231,7 +232,8 @@ assert_equal(mbase.a._mask, [1,1,0,0,1]) assert_equal(mbase.b._data, [1.1,2.2,3.3,4.4,5.5]) assert_equal(mbase.b._mask, [1,1,0,0,1]) - assert_equal(mbase.c._data, ['one','two','three','four','five']) + assert_equal(mbase.c._data, + asbytes_nested(['one','two','three','four','five'])) assert_equal(mbase.b._mask, [1,1,0,0,1]) # def test_setslices_hardmask(self): @@ -243,7 +245,8 @@ mbase[-2:] = (5,5,5) assert_equal(mbase.a._data, [1,2,3,5,5]) assert_equal(mbase.b._data, [1.1,2.2,3.3,5,5.5]) - assert_equal(mbase.c._data, ['one','two','three','5','five']) + assert_equal(mbase.c._data, + asbytes_nested(['one','two','three','5','five'])) assert_equal(mbase.a._mask, [0,1,0,0,1]) assert_equal(mbase.b._mask, mbase.a._mask) assert_equal(mbase.b._mask, mbase.c._mask) @@ -315,7 +318,8 @@ fill_value=(99999,99999.,'N/A')) # assert_equal(mrec.tolist(), - [(1,1.1,None),(2,2.2,'two'),(None,None,'three')]) + [(1,1.1,None),(2,2.2,asbytes('two')), + (None,None,asbytes('three'))]) # @@ -329,7 +333,7 @@ "Test that 'exotic' formats are processed properly" easy = mrecarray(1, dtype=[('i',int), ('s','|S8'), ('f',float)]) easy[0] = masked - assert_equal(easy.filled(1).item(), (1,'1',1.)) + assert_equal(easy.filled(1).item(), (1,asbytes('1'),1.)) # solo = mrecarray(1, dtype=[('f0', ' Author: ptvirtan Date: 2010-02-20 20:51:20 -0600 (Sat, 20 Feb 2010) New Revision: 8216 Modified: trunk/numpy/core/tests/test_regression.py Log: 3K: core: mark int('0xff',16) test as known failure on Python3 -- we don't anyway support that call signature for all integer types even on Py2 Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2010-02-21 02:51:05 UTC (rev 8215) +++ trunk/numpy/core/tests/test_regression.py 2010-02-21 02:51:20 UTC (rev 8216) @@ -136,6 +136,9 @@ self.assertRaises(TypeError,np.dtype, {'names':['a'],'formats':['foo']},align=1) + @dec.knownfailureif(sys.version_info[0] >= 3, + "numpy.intp('0xff', 16) not supported on Py3, " + "as it does not inherit from Python int") def test_intp(self,level=rlevel): """Ticket #99""" i_width = np.int_(0).nbytes*2 - 1 From numpy-svn at scipy.org Sat Feb 20 21:51:35 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 20:51:35 -0600 (CST) Subject: [Numpy-svn] r8217 - trunk/numpy/lib Message-ID: <20100221025135.1D0ACC7C059@scipy.org> Author: ptvirtan Date: 2010-02-20 20:51:34 -0600 (Sat, 20 Feb 2010) New Revision: 8217 Modified: trunk/numpy/lib/polynomial.py Log: 3K: lib: implement __rtruediv__ for poly1d Modified: trunk/numpy/lib/polynomial.py =================================================================== --- trunk/numpy/lib/polynomial.py 2010-02-21 02:51:20 UTC (rev 8216) +++ trunk/numpy/lib/polynomial.py 2010-02-21 02:51:34 UTC (rev 8217) @@ -1156,6 +1156,8 @@ other = poly1d(other) return polydiv(other, self) + __rtruediv__ = __rdiv__ + def __eq__(self, other): return NX.alltrue(self.coeffs == other.coeffs) From numpy-svn at scipy.org Sat Feb 20 21:51:48 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 20:51:48 -0600 (CST) Subject: [Numpy-svn] r8218 - trunk/doc Message-ID: <20100221025148.8ACB1C7C059@scipy.org> Author: ptvirtan Date: 2010-02-20 20:51:48 -0600 (Sat, 20 Feb 2010) New Revision: 8218 Modified: trunk/doc/Py3K.txt Log: 3K: doc: note about consequences of removed Py_TPFLAGS_CHECKTYPES Modified: trunk/doc/Py3K.txt =================================================================== --- trunk/doc/Py3K.txt 2010-02-21 02:51:34 UTC (rev 8217) +++ trunk/doc/Py3K.txt 2010-02-21 02:51:48 UTC (rev 8218) @@ -263,7 +263,28 @@ These use Py_SIZE, etc. macros now. The macros are also defined in npy_3kcompat.h for the Python versions that don't have them natively. +Py_TPFLAGS_CHECKTYPES +--------------------- +Python 3 no longer supports type coercion in arithmetic. + +Py_TPFLAGS_CHECKTYPES is now on by default, and so the C-level +interface, ``nb_*`` methods, still unconditionally receive whatever +types as their two arguments. + +However, this will affect Python-level code: previously if you +inherited from a Py_TPFLAGS_CHECKTYPES enabled class that implemented +a ``__mul__`` method, the same ``__mul__`` method would still be +called also as when a ``__rmul__`` was required, but with swapped +arguments (see Python/Objects/typeobject.c:wrap_binaryfunc_r). +However, on Python 3, arguments are swapped only if both are of same +(sub-)type, and otherwise things fail. + +This means that ``ndarray``-derived subclasses must now implement all +relevant ``__r*__`` methods, since they cannot any more automatically +fall back to ndarray code. + + PyNumberMethods --------------- From numpy-svn at scipy.org Sat Feb 20 21:52:03 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 20:52:03 -0600 (CST) Subject: [Numpy-svn] r8219 - trunk/numpy/ma Message-ID: <20100221025203.B8D6AC7C059@scipy.org> Author: ptvirtan Date: 2010-02-20 20:52:02 -0600 (Sat, 20 Feb 2010) New Revision: 8219 Modified: trunk/numpy/ma/core.py Log: 3K: ma: implement __rtruediv__, __rfloordiv__, __rpow__ for masked arrays Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2010-02-21 02:51:48 UTC (rev 8218) +++ trunk/numpy/ma/core.py 2010-02-21 02:52:02 UTC (rev 8219) @@ -3667,13 +3667,25 @@ "Divide other into self, and return a new masked array." return true_divide(self, other) # + def __rtruediv__(self, other): + "Divide other into self, and return a new masked array." + return true_divide(other, self) + # def __floordiv__(self, other): "Divide other into self, and return a new masked array." return floor_divide(self, other) # + def __rfloordiv__(self, other): + "Divide other into self, and return a new masked array." + return floor_divide(other, self) + # def __pow__(self, other): "Raise self to the power other, masking the potential NaNs/Infs" return power(self, other) + # + def __rpow__(self, other): + "Raise self to the power other, masking the potential NaNs/Infs" + return power(other, self) #............................................ def __iadd__(self, other): "Add other to self in-place." From numpy-svn at scipy.org Sat Feb 20 21:52:20 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 20:52:20 -0600 (CST) Subject: [Numpy-svn] r8220 - trunk/numpy/core/src/multiarray Message-ID: <20100221025220.5F962C7C059@scipy.org> Author: ptvirtan Date: 2010-02-20 20:52:20 -0600 (Sat, 20 Feb 2010) New Revision: 8220 Modified: trunk/numpy/core/src/multiarray/arraytypes.c.src Log: 3K: ENH: core: void.item() -> byte array; simple memoryview -> Bytes Modified: trunk/numpy/core/src/multiarray/arraytypes.c.src =================================================================== --- trunk/numpy/core/src/multiarray/arraytypes.c.src 2010-02-21 02:52:02 UTC (rev 8219) +++ trunk/numpy/core/src/multiarray/arraytypes.c.src 2010-02-21 02:52:20 UTC (rev 8220) @@ -440,7 +440,7 @@ temp = PyUnicode_AsASCIIString(op); if (temp == NULL) return -1; } - else if (PyBytes_Check(op)) { + else if (PyBytes_Check(op) || PyMemoryView_Check(op)) { temp = PyObject_Bytes(op); if (temp == NULL) { return -1; @@ -616,31 +616,38 @@ return NULL; } itemsize = ap->descr->elsize; - if (PyArray_ISWRITEABLE(ap)) { #if defined(NPY_PY3K) -#warning XXX -- needs implementation - PyErr_SetString(PyExc_RuntimeError, "XXX -- not implemented"); - u = NULL; + /* + * Return a byte array; there are no plain buffer objects on Py3 + */ + { + intp dims[1], strides[1]; + PyArray_Descr *descr; + dims[0] = itemsize; + strides[0] = 1; + descr = PyArray_DescrNewFromType(PyArray_BYTE); + u = PyArray_NewFromDescr(&PyArray_Type, descr, 1, dims, strides, + ip, + PyArray_ISWRITEABLE(ap) ? NPY_WRITEABLE : 0, + NULL); + ((PyArrayObject*)u)->base = ap; + Py_INCREF(ap); + } #else + /* + * default is to return buffer object pointing to + * current item a view of it + */ + if (PyArray_ISWRITEABLE(ap)) { u = PyBuffer_FromReadWriteMemory(ip, itemsize); -#endif } else { -#if defined(NPY_PY3K) -#warning XXX -- needs implementation - PyErr_SetString(PyExc_RuntimeError, "XXX -- not implemented"); - u = NULL; -#else u = PyBuffer_FromMemory(ip, itemsize); + } #endif - } if (u == NULL) { goto fail; } - /* - * default is to return buffer object pointing to - * current item a view of it - */ return u; fail: From numpy-svn at scipy.org Sat Feb 20 21:52:39 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 20:52:39 -0600 (CST) Subject: [Numpy-svn] r8221 - in trunk/numpy/core: . src/multiarray tests Message-ID: <20100221025239.DD855C7C059@scipy.org> Author: ptvirtan Date: 2010-02-20 20:52:39 -0600 (Sat, 20 Feb 2010) New Revision: 8221 Modified: trunk/numpy/core/_internal.py trunk/numpy/core/src/multiarray/buffer.c trunk/numpy/core/tests/test_multiarray.py Log: 3K: ENH: core: support BOOL and VOID better in PEP 3118 buffers Modified: trunk/numpy/core/_internal.py =================================================================== --- trunk/numpy/core/_internal.py 2010-02-21 02:52:20 UTC (rev 8220) +++ trunk/numpy/core/_internal.py 2010-02-21 02:52:39 UTC (rev 8221) @@ -351,6 +351,7 @@ # construct a Numpy dtype _pep3118_map = { + '?': '?', 'b': 'b', 'B': 'B', 'h': 'h', @@ -373,6 +374,7 @@ 'O': 'O', 'x': 'V', # padding } +_pep3118_typechars = ''.join(_pep3118_map.keys()) def _dtype_from_pep3118(spec, byteorder='=', is_subdtype=False): from numpy.core.multiarray import dtype @@ -421,10 +423,10 @@ if itemsize != 1: # Not supported raise ValueError("Non item-size 1 structures not supported") - elif spec[0].isalpha(): + elif spec[0] in _pep3118_typechars: j = 1 for j in xrange(1, len(spec)): - if not spec[j].isalpha(): + if spec[j] not in _pep3118_typechars: break typechar = spec[:j] spec = spec[j:] @@ -446,16 +448,18 @@ value = dtype((value, shape)) # Field name + this_explicit_name = False if spec and spec.startswith(':'): i = spec[1:].index(':') + 1 name = spec[1:i] spec = spec[i+1:] explicit_name = True + this_explicit_name = True else: name = 'f%d' % findex findex += 1 - if not is_padding: + if not is_padding or this_explicit_name: fields[name] = (value, offset) offset += value.itemsize Modified: trunk/numpy/core/src/multiarray/buffer.c =================================================================== --- trunk/numpy/core/src/multiarray/buffer.c 2010-02-21 02:52:20 UTC (rev 8220) +++ trunk/numpy/core/src/multiarray/buffer.c 2010-02-21 02:52:39 UTC (rev 8221) @@ -238,6 +238,7 @@ } switch (descr->type_num) { + case NPY_BOOL: if (_append_char(str, '?')) return -1; break; case NPY_BYTE: if (_append_char(str, 'b')) return -1; break; case NPY_UBYTE: if (_append_char(str, 'B')) return -1; break; case NPY_SHORT: if (_append_char(str, 'h')) return -1; break; @@ -254,6 +255,9 @@ case NPY_CFLOAT: if (_append_str(str, "Zf")) return -1; break; case NPY_CDOUBLE: if (_append_str(str, "Zd")) return -1; break; case NPY_CLONGDOUBLE: if (_append_str(str, "Zg")) return -1; break; + /* XXX: datetime */ + /* XXX: timedelta */ + case NPY_OBJECT: if (_append_char(str, 'O')) return -1; break; case NPY_STRING: { char buf[128]; PyOS_snprintf(buf, sizeof(buf), "%ds", descr->elsize); @@ -268,9 +272,15 @@ if (_append_str(str, buf)) return -1; break; } - case NPY_OBJECT: if (_append_char(str, 'O')) return -1; break; + case NPY_VOID: { + /* Insert padding bytes */ + char buf[128]; + PyOS_snprintf(buf, sizeof(buf), "%dx", descr->elsize); + if (_append_str(str, buf)) return -1; + break; + } default: - PyErr_Format(PyExc_ValueError, "unknown dtype code %d", + PyErr_Format(PyExc_ValueError, "cannot convert dtype %d to buffer", descr->type_num); return -1; } Modified: trunk/numpy/core/tests/test_multiarray.py =================================================================== --- trunk/numpy/core/tests/test_multiarray.py 2010-02-21 02:52:20 UTC (rev 8220) +++ trunk/numpy/core/tests/test_multiarray.py 2010-02-21 02:52:39 UTC (rev 8221) @@ -1491,9 +1491,11 @@ ('j', np.double), ('k', np.longdouble), ('l', 'S4'), - ('m', 'U4')] + ('m', 'U4'), + ('n', 'V3'), + ('o', '?')] x = np.array([(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - asbytes('aaaa'), 'bbbb')], + asbytes('aaaa'), 'bbbb', asbytes('xxx'), True)], dtype=dt) self._check_roundtrip(x) @@ -1549,17 +1551,19 @@ ('j', np.double), ('k', np.longdouble), ('l', 'S4'), - ('m', 'U4')] + ('m', 'U4'), + ('n', 'V3'), + ('o', '?')] x = np.array([(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - asbytes('aaaa'), 'bbbb')], + asbytes('aaaa'), 'bbbb', asbytes(' '), True)], dtype=dt) y = memoryview(x) - assert y.format == 'T{b:a:=h:b:=l:c:=q:d:B:e:=H:f:=L:g:=Q:h:=d:i:=d:j:=g:k:4s:l:=4w:m:}' + assert y.format == 'T{b:a:=h:b:=l:c:=q:d:B:e:=H:f:=L:g:=Q:h:=d:i:=d:j:=g:k:4s:l:=4w:m:3x:n:?:o:}' assert y.shape == (1,) assert y.ndim == 1 - assert y.strides == (78,) + assert y.strides == (82,) assert y.suboffsets is None - assert y.itemsize == 78 + assert y.itemsize == 82 def test_export_subarray(self): x = np.array(([[1,2],[3,4]],), dtype=[('a', (int, (2,2)))]) From numpy-svn at scipy.org Sat Feb 20 21:52:56 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 20:52:56 -0600 (CST) Subject: [Numpy-svn] r8222 - in trunk/numpy/ma: . tests Message-ID: <20100221025256.61A6AC7C059@scipy.org> Author: ptvirtan Date: 2010-02-20 20:52:56 -0600 (Sat, 20 Feb 2010) New Revision: 8222 Modified: trunk/numpy/ma/core.py trunk/numpy/ma/tests/test_core.py Log: BUG: ma: _check_fill_value shouldn't rely on implicit array() string casting Since array([12345678.9, 'a']) == array(['12345678', 'a'], dtype='|S8') ie., automatic string conversion uses only the size of the minimal data type, not the size of the string representation, code should not rely on array() casting items implicitly to object arrays. Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2010-02-21 02:52:39 UTC (rev 8221) +++ trunk/numpy/ma/core.py 2010-02-21 02:52:56 UTC (rev 8222) @@ -405,6 +405,7 @@ raise ValueError(err_msg % (fill_value, fdtype)) else: descr = ndtype.descr + fill_value = np.asarray(fill_value, dtype=object) fill_value = np.array(_recursive_set_fill_value(fill_value, descr), dtype=ndtype) else: Modified: trunk/numpy/ma/tests/test_core.py =================================================================== --- trunk/numpy/ma/tests/test_core.py 2010-02-21 02:52:39 UTC (rev 8221) +++ trunk/numpy/ma/tests/test_core.py 2010-02-21 02:52:56 UTC (rev 8222) @@ -1307,41 +1307,41 @@ _check_fill_value = np.ma.core._check_fill_value ndtype = [('a', int), ('b', float), ('c', "|S3")] # A check on a list should return a single record - fval = _check_fill_value([-999, -999.9, "???"], ndtype) + fval = _check_fill_value([-999, -12345678.9, "???"], ndtype) self.assertTrue(isinstance(fval, ndarray)) - assert_equal(fval.item(), [-999, -999.9, "???"]) + assert_equal(fval.item(), [-999, -12345678.9, asbytes("???")]) # A check on None should output the defaults fval = _check_fill_value(None, ndtype) self.assertTrue(isinstance(fval, ndarray)) assert_equal(fval.item(), [default_fill_value(0), default_fill_value(0.), - default_fill_value("0")]) + asbytes(default_fill_value("0"))]) #.....Using a structured type as fill_value should work - fill_val = np.array((-999, -999.9, "???"), dtype=ndtype) + fill_val = np.array((-999, -12345678.9, "???"), dtype=ndtype) fval = _check_fill_value(fill_val, ndtype) self.assertTrue(isinstance(fval, ndarray)) - assert_equal(fval.item(), [-999, -999.9, "???"]) + assert_equal(fval.item(), [-999, -12345678.9, asbytes("???")]) #.....Using a flexible type w/ a different type shouldn't matter - fill_val = np.array((-999, -999.9, "???"), + fill_val = np.array((-999, -12345678.9, "???"), dtype=[("A", int), ("B", float), ("C", "|S3")]) fval = _check_fill_value(fill_val, ndtype) self.assertTrue(isinstance(fval, ndarray)) - assert_equal(fval.item(), [-999, -999.9, "???"]) + assert_equal(fval.item(), [-999, -12345678.9, asbytes("???")]) #.....Using an object-array shouldn't matter either - fill_value = np.array((-999, -999.9, "???"), dtype=object) + fill_value = np.array((-999, -12345678.9, "???"), dtype=object) fval = _check_fill_value(fill_val, ndtype) self.assertTrue(isinstance(fval, ndarray)) - assert_equal(fval.item(), [-999, -999.9, "???"]) + assert_equal(fval.item(), [-999, -12345678.9, asbytes("???")]) # - fill_value = np.array((-999, -999.9, "???")) + fill_value = np.array((-999, -12345678.9, "???")) fval = _check_fill_value(fill_val, ndtype) self.assertTrue(isinstance(fval, ndarray)) - assert_equal(fval.item(), [-999, -999.9, "???"]) + assert_equal(fval.item(), [-999, -12345678.9, asbytes("???")]) #.....One-field-only flexible type should work as well ndtype = [("a", int)] - fval = _check_fill_value(-999, ndtype) + fval = _check_fill_value(-999999999, ndtype) self.assertTrue(isinstance(fval, ndarray)) - assert_equal(fval.item(), (-999,)) + assert_equal(fval.item(), (-999999999,)) def test_fillvalue_conversion(self): From numpy-svn at scipy.org Sat Feb 20 21:53:10 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 20:53:10 -0600 (CST) Subject: [Numpy-svn] r8223 - trunk/numpy/ma Message-ID: <20100221025310.791B9C7C059@scipy.org> Author: ptvirtan Date: 2010-02-20 20:53:10 -0600 (Sat, 20 Feb 2010) New Revision: 8223 Modified: trunk/numpy/ma/core.py Log: BUG: ma: fix inoperative error state set/restore Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2010-02-21 02:52:56 UTC (rev 8222) +++ trunk/numpy/ma/core.py 2010-02-21 02:53:10 UTC (rev 8223) @@ -1057,9 +1057,6 @@ # Get the data and the mask (da, db) = (getdata(a, subok=False), getdata(b, subok=False)) (ma, mb) = (getmask(a), getmask(b)) - # Save the current error status - err_status_ini = np.geterr() - np.seterr(divide='ignore', invalid='ignore') # Get the result err_status_ini = np.geterr() try: @@ -1067,8 +1064,6 @@ result = self.f(da, db, *args, **kwargs) finally: np.seterr(**err_status_ini) - # Reset the error status - np.seterr(**err_status_ini) # Get the mask as a combination of ma, mb and invalid m = ~umath.isfinite(result) m |= ma From numpy-svn at scipy.org Sat Feb 20 21:53:27 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 20:53:27 -0600 (CST) Subject: [Numpy-svn] r8224 - trunk/numpy/ma/tests Message-ID: <20100221025327.26B1EC7C059@scipy.org> Author: ptvirtan Date: 2010-02-20 20:53:26 -0600 (Sat, 20 Feb 2010) New Revision: 8224 Modified: trunk/numpy/ma/tests/test_core.py trunk/numpy/ma/tests/test_mrecords.py trunk/numpy/ma/tests/test_old_ma.py Log: 3K: ENH: ma: fix str vs bytes and int issues in ma tests Modified: trunk/numpy/ma/tests/test_core.py =================================================================== --- trunk/numpy/ma/tests/test_core.py 2010-02-21 02:53:10 UTC (rev 8223) +++ trunk/numpy/ma/tests/test_core.py 2010-02-21 02:53:26 UTC (rev 8224) @@ -803,13 +803,19 @@ def test_count_func (self): "Tests count" ott = array([0., 1., 2., 3.], mask=[1, 0, 0, 0]) - self.assertTrue(isinstance(count(ott), int)) + if sys.version_info[0] >= 3: + self.assertTrue(isinstance(count(ott), np.integer)) + else: + self.assertTrue(isinstance(count(ott), int)) assert_equal(3, count(ott)) assert_equal(1, count(1)) assert_equal(0, array(1, mask=[1])) ott = ott.reshape((2, 2)) assert isinstance(count(ott, 0), ndarray) - assert isinstance(count(ott), types.IntType) + if sys.version_info[0] >= 3: + assert isinstance(count(ott), np.integer) + else: + assert isinstance(count(ott), types.IntType) assert_equal(3, count(ott)) assert getmask(count(ott, 0)) is nomask assert_equal([1, 2], count(ott, 0)) Modified: trunk/numpy/ma/tests/test_mrecords.py =================================================================== --- trunk/numpy/ma/tests/test_mrecords.py 2010-02-21 02:53:10 UTC (rev 8223) +++ trunk/numpy/ma/tests/test_mrecords.py 2010-02-21 02:53:26 UTC (rev 8224) @@ -36,11 +36,9 @@ "Generic setup" ilist = [1,2,3,4,5] flist = [1.1,2.2,3.3,4.4,5.5] - slist = ['one','two','three','four','five'] + slist = asbytes_nested(['one','two','three','four','five']) ddtype = [('a',int),('b',float),('c','|S8')] mask = [0,1,0,0,1] - if sys.version_info[0] >= 3: - slist = list(map(asbytes, slist)) self.base = ma.array(list(zip(ilist,flist,slist)), mask=mask, dtype=ddtype) @@ -120,7 +118,7 @@ assert_equal(mbase.c.mask, [1]*5) assert_equal(mbase.c.recordmask, [1]*5) assert_equal(ma.getmaskarray(mbase['c']), [1]*5) - assert_equal(ma.getdata(mbase['c']), ['N/A']*5) + assert_equal(ma.getdata(mbase['c']), [asbytes('N/A')]*5) assert_equal(mbase._mask.tolist(), np.array([(0,0,1),(0,1,1),(0,0,1),(0,0,1),(0,1,1)], dtype=bool)) Modified: trunk/numpy/ma/tests/test_old_ma.py =================================================================== --- trunk/numpy/ma/tests/test_old_ma.py 2010-02-21 02:53:10 UTC (rev 8223) +++ trunk/numpy/ma/tests/test_old_ma.py 2010-02-21 02:53:26 UTC (rev 8224) @@ -153,13 +153,19 @@ def test_xtestCount (self): "Test count" ott = array([0.,1.,2.,3.], mask=[1,0,0,0]) - self.assertTrue( isinstance(count(ott), types.IntType)) + if sys.version_info[0] >= 3: + self.assertTrue( isinstance(count(ott), numpy.integer)) + else: + self.assertTrue( isinstance(count(ott), types.IntType)) self.assertEqual(3, count(ott)) self.assertEqual(1, count(1)) self.assertTrue (eq(0, array(1,mask=[1]))) ott=ott.reshape((2,2)) assert isinstance(count(ott,0),numpy.ndarray) - assert isinstance(count(ott), types.IntType) + if sys.version_info[0] >= 3: + assert isinstance(count(ott), numpy.integer) + else: + assert isinstance(count(ott), types.IntType) self.assertTrue (eq(3, count(ott))) assert getmask(count(ott,0)) is nomask self.assertTrue (eq([1,2],count(ott,0))) From numpy-svn at scipy.org Sat Feb 20 21:56:38 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 20:56:38 -0600 (CST) Subject: [Numpy-svn] r8225 - trunk/numpy/lib Message-ID: <20100221025638.A7E91C7C059@scipy.org> Author: charris Date: 2010-02-20 20:56:38 -0600 (Sat, 20 Feb 2010) New Revision: 8225 Modified: trunk/numpy/lib/io.py Log: WHT: Whitespace removal. Modified: trunk/numpy/lib/io.py =================================================================== --- trunk/numpy/lib/io.py 2010-02-21 02:53:26 UTC (rev 8224) +++ trunk/numpy/lib/io.py 2010-02-21 02:56:38 UTC (rev 8225) @@ -906,7 +906,7 @@ if seq and not isinstance(seq[0], tuple): # Only one group is in the regexp. # Create the new array as a single data-type and then - # re-interpret as a single-field structured array. + # re-interpret as a single-field structured array. newdtype = np.dtype(dtype[dtype.names[0]]) output = np.array(seq, dtype=newdtype) output.dtype = dtype @@ -1601,4 +1601,3 @@ else: output = output.view(np.recarray) return output - From numpy-svn at scipy.org Sat Feb 20 21:56:43 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 20:56:43 -0600 (CST) Subject: [Numpy-svn] r8226 - trunk/numpy/lib Message-ID: <20100221025643.C4992C7C059@scipy.org> Author: charris Date: 2010-02-20 20:56:43 -0600 (Sat, 20 Feb 2010) New Revision: 8226 Modified: trunk/numpy/lib/recfunctions.py Log: PY3: The izip function is no longer available in itertools. Be explicit about using itertools.izip to 2to3 can make the fix. Modified: trunk/numpy/lib/recfunctions.py =================================================================== --- trunk/numpy/lib/recfunctions.py 2010-02-21 02:56:38 UTC (rev 8225) +++ trunk/numpy/lib/recfunctions.py 2010-02-21 02:56:43 UTC (rev 8226) @@ -7,12 +7,13 @@ """ - +import sys import itertools -from itertools import chain as iterchain, repeat as iterrepeat, izip as iterizip import numpy as np +import numpy.ma as ma +from itertools import chain as iterchain +from itertools import repeat as iterrepeat from numpy import ndarray, recarray -import numpy.ma as ma from numpy.ma import MaskedArray from numpy.ma.mrecords import MaskedRecords @@ -214,7 +215,7 @@ >>> rfn.get_fieldstructure(ndtype) ... # XXX: possible regression, order of BBA and BBB is swapped {'A': [], 'B': [], 'BA': ['B'], 'BB': ['B'], 'BBA': ['B', 'BB'], 'BBB': ['B', 'BB']} - + """ if parents is None: parents = {} @@ -276,8 +277,8 @@ Sequence of arrays. fill_value : {None, integer} Value used to pad shorter iterables. - flatten : {True, False}, - Whether to + flatten : {True, False}, + Whether to """ # OK, that's a complete ripoff from Python2.6 itertools.izip_longest def sentinel(counter = ([fill_value]*(len(seqarrays)-1)).pop): @@ -285,7 +286,7 @@ yield counter() # fillers = iterrepeat(fill_value) - iters = [iterchain(it, sentinel(), fillers) for it in seqarrays] + iters = [iterchain(it, sentinel(), fillers) for it in seqarrays] # Should we flatten the items, or just use a nested approach if flatten: zipfunc = _izip_fields_flat @@ -293,7 +294,7 @@ zipfunc = _izip_fields # try: - for tup in iterizip(*iters): + for tup in itertools.izip(*iters): yield tuple(zipfunc(tup)) except IndexError: pass @@ -463,13 +464,13 @@ >>> a = np.array([(1, (2, 3.0)), (4, (5, 6.0))], ... dtype=[('a', int), ('b', [('ba', float), ('bb', int)])]) >>> rfn.drop_fields(a, 'a') - array([((2.0, 3),), ((5.0, 6),)], + array([((2.0, 3),), ((5.0, 6),)], dtype=[('b', [('ba', '>> rfn.drop_fields(a, 'ba') - array([(1, (3,)), (4, (6,))], + array([(1, (3,)), (4, (6,))], dtype=[('a', '>> rfn.drop_fields(a, ['ba', 'bb']) - array([(1,), (4,)], + array([(1,), (4,)], dtype=[('a', '>> a = np.array([(1, (2, [3.0, 30.])), (4, (5, [6.0, 60.]))], ... dtype=[('a', int),('b', [('ba', float), ('bb', (float, 2))])]) >>> rfn.rename_fields(a, {'a':'A', 'bb':'BB'}) - array([(1, (2.0, [3.0, 30.0])), (4, (5.0, [6.0, 60.0]))], + array([(1, (2.0, [3.0, 30.0])), (4, (5.0, [6.0, 60.0]))], dtype=[('A', '>> from numpy.lib import recfunctions as rfn >>> ndtype = [('a', int)] - >>> a = np.ma.array([1, 1, 1, 2, 2, 3, 3], + >>> a = np.ma.array([1, 1, 1, 2, 2, 3, 3], ... mask=[0, 0, 1, 0, 0, 0, 1]).view(ndtype) >>> rfn.find_duplicates(a, ignoremask=True, return_index=True) ... # XXX: judging by the output, the ignoremask flag has no effect From numpy-svn at scipy.org Sat Feb 20 22:09:11 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 21:09:11 -0600 (CST) Subject: [Numpy-svn] r8227 - trunk/numpy/lib Message-ID: <20100221030911.BAEC8C7C059@scipy.org> Author: charris Date: 2010-02-20 21:09:11 -0600 (Sat, 20 Feb 2010) New Revision: 8227 Modified: trunk/numpy/lib/recfunctions.py Log: STY: Remove unneeded import. Modified: trunk/numpy/lib/recfunctions.py =================================================================== --- trunk/numpy/lib/recfunctions.py 2010-02-21 02:56:43 UTC (rev 8226) +++ trunk/numpy/lib/recfunctions.py 2010-02-21 03:09:11 UTC (rev 8227) @@ -16,13 +16,8 @@ from numpy import ndarray, recarray from numpy.ma import MaskedArray from numpy.ma.mrecords import MaskedRecords - from numpy.lib._iotools import _is_string_like -import sys -if sys.version_info[0] >= 3: - iterizip = zip - _check_fill_value = np.ma.core._check_fill_value __all__ = ['append_fields', From numpy-svn at scipy.org Sat Feb 20 22:21:22 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 21:21:22 -0600 (CST) Subject: [Numpy-svn] r8228 - trunk/numpy/numarray Message-ID: <20100221032122.9F665C7C059@scipy.org> Author: ptvirtan Date: 2010-02-20 21:21:22 -0600 (Sat, 20 Feb 2010) New Revision: 8228 Modified: trunk/numpy/numarray/_capi.c Log: BUG: fix numarray._capi compilation Modified: trunk/numpy/numarray/_capi.c =================================================================== --- trunk/numpy/numarray/_capi.c 2010-02-21 03:09:11 UTC (rev 8227) +++ trunk/numpy/numarray/_capi.c 2010-02-21 03:21:22 UTC (rev 8228) @@ -1,7 +1,7 @@ #include #define _libnumarray_MODULE -#include "numpy/libnumarray.h" +#include "include/numpy/libnumarray.h" #include "npy_config.h" #include From numpy-svn at scipy.org Sat Feb 20 22:22:16 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 21:22:16 -0600 (CST) Subject: [Numpy-svn] r8229 - trunk/numpy/lib Message-ID: <20100221032216.2D758C7C059@scipy.org> Author: charris Date: 2010-02-20 21:22:16 -0600 (Sat, 20 Feb 2010) New Revision: 8229 Modified: trunk/numpy/lib/recfunctions.py Log: STY: Use explicit itertools namespace for all itertools functions. Modified: trunk/numpy/lib/recfunctions.py =================================================================== --- trunk/numpy/lib/recfunctions.py 2010-02-21 03:21:22 UTC (rev 8228) +++ trunk/numpy/lib/recfunctions.py 2010-02-21 03:22:16 UTC (rev 8229) @@ -11,8 +11,6 @@ import itertools import numpy as np import numpy.ma as ma -from itertools import chain as iterchain -from itertools import repeat as iterrepeat from numpy import ndarray, recarray from numpy.ma import MaskedArray from numpy.ma.mrecords import MaskedRecords @@ -280,8 +278,8 @@ "Yields the fill_value or raises IndexError" yield counter() # - fillers = iterrepeat(fill_value) - iters = [iterchain(it, sentinel(), fillers) for it in seqarrays] + fillers = itertools.repeat(fill_value) + iters = [itertools.chain(it, sentinel(), fillers) for it in seqarrays] # Should we flatten the items, or just use a nested approach if flatten: zipfunc = _izip_fields_flat @@ -414,8 +412,8 @@ else: fmsk = True nbmissing = (maxlength-len(a)) - seqdata[i] = iterchain(a, [fval]*nbmissing) - seqmask[i] = iterchain(m, [fmsk]*nbmissing) + seqdata[i] = itertools.chain(a, [fval]*nbmissing) + seqmask[i] = itertools.chain(m, [fmsk]*nbmissing) # data = izip_records(seqdata, flatten=flatten) data = tuple(data) From numpy-svn at scipy.org Sat Feb 20 22:25:33 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 21:25:33 -0600 (CST) Subject: [Numpy-svn] r8230 - trunk/numpy/numarray Message-ID: <20100221032533.D8457C7C059@scipy.org> Author: ptvirtan Date: 2010-02-20 21:25:33 -0600 (Sat, 20 Feb 2010) New Revision: 8230 Removed: trunk/numpy/numarray/numpy/ Log: Remove a leftover empty directory From numpy-svn at scipy.org Sat Feb 20 22:34:02 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 21:34:02 -0600 (CST) Subject: [Numpy-svn] r8231 - trunk/numpy/numarray Message-ID: <20100221033402.792B4C7C059@scipy.org> Author: charris Date: 2010-02-20 21:34:02 -0600 (Sat, 20 Feb 2010) New Revision: 8231 Modified: trunk/numpy/numarray/util.py Log: STY: Use import numpy as np. This seems to fix an import error introduced by 2to3, but that may have been an artifact from a previous build. In anycase, no harm done. Modified: trunk/numpy/numarray/util.py =================================================================== --- trunk/numpy/numarray/util.py 2010-02-21 03:25:33 UTC (rev 8230) +++ trunk/numpy/numarray/util.py 2010-02-21 03:34:02 UTC (rev 8231) @@ -1,16 +1,24 @@ import os -import numpy +import numpy as np __all__ = ['MathDomainError', 'UnderflowError', 'NumOverflowError', 'handleError', 'get_numarray_include_dirs'] -class MathDomainError(ArithmeticError): pass -class UnderflowError(ArithmeticError): pass -class NumOverflowError(OverflowError, ArithmeticError): pass +class MathDomainError(ArithmeticError): + pass + +class UnderflowError(ArithmeticError): + pass + + +class NumOverflowError(OverflowError, ArithmeticError): + pass + + def handleError(errorStatus, sourcemsg): """Take error status and use error mode to handle it.""" - modes = numpy.geterr() + modes = np.geterr() if errorStatus & numpy.FPE_INVALID: if modes['invalid'] == "warn": print "Warning: Encountered invalid numeric result(s)", sourcemsg From numpy-svn at scipy.org Sat Feb 20 22:51:48 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 20 Feb 2010 21:51:48 -0600 (CST) Subject: [Numpy-svn] r8232 - trunk/numpy/linalg/tests Message-ID: <20100221035148.E96BAC7C059@scipy.org> Author: charris Date: 2010-02-20 21:51:48 -0600 (Sat, 20 Feb 2010) New Revision: 8232 Modified: trunk/numpy/linalg/tests/test_build.py Log: DEP: Fix one more deprecated unittest function. Modified: trunk/numpy/linalg/tests/test_build.py =================================================================== --- trunk/numpy/linalg/tests/test_build.py 2010-02-21 03:34:02 UTC (rev 8231) +++ trunk/numpy/linalg/tests/test_build.py 2010-02-21 03:51:48 UTC (rev 8232) @@ -44,7 +44,7 @@ f = FindDependenciesLdd() deps = f.grep_dependencies(lapack_lite.__file__, asbytes_nested(['libg2c', 'libgfortran'])) - self.failIf(len(deps) > 1, + self.assertFalse(len(deps) > 1, """Both g77 and gfortran runtimes linked in lapack_lite ! This is likely to cause random crashes and wrong results. See numpy INSTALL.txt for more information.""") From numpy-svn at scipy.org Sun Feb 21 01:12:59 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 21 Feb 2010 00:12:59 -0600 (CST) Subject: [Numpy-svn] r8233 - trunk/numpy/core/tests Message-ID: <20100221061259.368F6C7C084@scipy.org> Author: charris Date: 2010-02-21 00:12:59 -0600 (Sun, 21 Feb 2010) New Revision: 8233 Modified: trunk/numpy/core/tests/test_umath.py Log: BUG: Fix the invalid value warnings in test_umath.py Modified: trunk/numpy/core/tests/test_umath.py =================================================================== --- trunk/numpy/core/tests/test_umath.py 2010-02-21 03:51:48 UTC (rev 8232) +++ trunk/numpy/core/tests/test_umath.py 2010-02-21 06:12:59 UTC (rev 8233) @@ -75,10 +75,14 @@ assert_array_equal(x.imag, y.imag) for z in [complex(0, np.inf), complex(1, np.inf)]: + err = np.seterr(invalid="ignore") z = np.array([z], dtype=np.complex_) - assert_complex_equal(z**1, z) - assert_complex_equal(z**2, z*z) - assert_complex_equal(z**3, z*z*z) + try: + assert_complex_equal(z**1, z) + assert_complex_equal(z**2, z*z) + assert_complex_equal(z**3, z*z*z) + finally: + np.seterr(**err) class TestLog2(TestCase): def test_log2_values(self) : @@ -121,15 +125,19 @@ assert_almost_equal(np.logaddexp2(logxf, logyf), logzf) def test_inf(self) : + err = np.seterr(invalid='ignore') inf = np.inf x = [inf, -inf, inf, -inf, inf, 1, -inf, 1] y = [inf, inf, -inf, -inf, 1, inf, 1, -inf] z = [inf, inf, inf, -inf, inf, inf, 1, 1] - for dt in ['f','d','g'] : - logxf = np.array(x, dtype=dt) - logyf = np.array(y, dtype=dt) - logzf = np.array(z, dtype=dt) - assert_equal(np.logaddexp2(logxf, logyf), logzf) + try: + for dt in ['f','d','g'] : + logxf = np.array(x, dtype=dt) + logyf = np.array(y, dtype=dt) + logzf = np.array(z, dtype=dt) + assert_equal(np.logaddexp2(logxf, logyf), logzf) + finally: + np.seterr(**err) def test_nan(self): assert np.isnan(np.logaddexp2(np.nan, np.inf)) @@ -180,15 +188,19 @@ assert_almost_equal(np.logaddexp(logxf, logyf), logzf) def test_inf(self) : + err = np.seterr(invalid='ignore') inf = np.inf x = [inf, -inf, inf, -inf, inf, 1, -inf, 1] y = [inf, inf, -inf, -inf, 1, inf, 1, -inf] z = [inf, inf, inf, -inf, inf, inf, 1, 1] - for dt in ['f','d','g'] : - logxf = np.array(x, dtype=dt) - logyf = np.array(y, dtype=dt) - logzf = np.array(z, dtype=dt) - assert_equal(np.logaddexp(logxf, logyf), logzf) + try: + for dt in ['f','d','g'] : + logxf = np.array(x, dtype=dt) + logyf = np.array(y, dtype=dt) + logzf = np.array(z, dtype=dt) + assert_equal(np.logaddexp(logxf, logyf), logzf) + finally: + np.seterr(**err) def test_nan(self): assert np.isnan(np.logaddexp(np.nan, np.inf)) @@ -213,7 +225,11 @@ assert_almost_equal(ncu.hypot(0, 0), 0) def assert_hypot_isnan(x, y): - assert np.isnan(ncu.hypot(x, y)), "hypot(%s, %s) is %s, not nan" % (x, y, ncu.hypot(x, y)) + err = np.seterr(invalid='ignore') + try: + assert np.isnan(ncu.hypot(x, y)), "hypot(%s, %s) is %s, not nan" % (x, y, ncu.hypot(x, y)) + finally: + np.seterr(**err) def assert_hypot_isinf(x, y): assert np.isinf(ncu.hypot(x, y)), "hypot(%s, %s) is %s, not inf" % (x, y, ncu.hypot(x, y)) @@ -870,15 +886,19 @@ return _test_nextafter(np.longdouble) def _test_spacing(t): + err = np.seterr(invalid='ignore') one = t(1) eps = np.finfo(t).eps nan = t(np.nan) inf = t(np.inf) - assert np.spacing(one) == eps - assert np.isnan(np.spacing(nan)) - assert np.isnan(np.spacing(inf)) - assert np.isnan(np.spacing(-inf)) - assert np.spacing(t(1e30)) != 0 + try: + assert np.spacing(one) == eps + assert np.isnan(np.spacing(nan)) + assert np.isnan(np.spacing(inf)) + assert np.isnan(np.spacing(-inf)) + assert np.spacing(t(1e30)) != 0 + finally: + np.seterr(**err) def test_spacing(): return _test_spacing(np.float64) From numpy-svn at scipy.org Sun Feb 21 06:24:24 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 21 Feb 2010 05:24:24 -0600 (CST) Subject: [Numpy-svn] r8234 - trunk/numpy/core/tests Message-ID: <20100221112424.EACBAC7C116@scipy.org> Author: ptvirtan Date: 2010-02-21 05:24:24 -0600 (Sun, 21 Feb 2010) New Revision: 8234 Modified: trunk/numpy/core/tests/test_multiarray.py Log: ENH: core: use assert_equal(x, y) instead of assert x==y -- test failures are easier to trace that way Modified: trunk/numpy/core/tests/test_multiarray.py =================================================================== --- trunk/numpy/core/tests/test_multiarray.py 2010-02-21 06:12:59 UTC (rev 8233) +++ trunk/numpy/core/tests/test_multiarray.py 2010-02-21 11:24:24 UTC (rev 8234) @@ -1464,9 +1464,9 @@ y2 = np.array(x) assert not y.flags.owndata assert y2.flags.owndata - assert y.dtype == obj.dtype, (obj, y) + assert_equal(y.dtype, obj.dtype) assert_array_equal(obj, y) - assert y2.dtype == obj.dtype, (obj, y2) + assert_equal(y2.dtype, obj.dtype) assert_array_equal(obj, y2) def test_roundtrip(self): @@ -1511,32 +1511,32 @@ def test_export_simple_1d(self): x = np.array([1,2,3,4,5], dtype='i4') y = memoryview(x) - assert y.format == '=l' - assert y.shape == (5,) - assert y.ndim == 1 - assert y.strides == (4,) - assert y.suboffsets is None - assert y.itemsize == 4 + assert_equal(y.format, '=l') + assert_equal(y.shape, (5,)) + assert_equal(y.ndim, 1) + assert_equal(y.strides, (4,)) + assert_equal(y.suboffsets, None) + assert_equal(y.itemsize, 4) def test_export_simple_nd(self): x = np.array([[1,2],[3,4]], dtype=np.float64) y = memoryview(x) - assert y.format == '=d' - assert y.shape == (2, 2) - assert y.ndim == 2 - assert y.strides == (16, 8) - assert y.suboffsets is None - assert y.itemsize == 8 + assert_equal(y.format, '=d') + assert_equal(y.shape, (2, 2)) + assert_equal(y.ndim, 2) + assert_equal(y.strides, (16, 8)) + assert_equal(y.suboffsets, None) + assert_equal(y.itemsize, 8) def test_export_discontiguous(self): x = np.zeros((3,3,3), dtype=np.float32)[:,0,:] y = memoryview(x) - assert y.format == '=f' - assert y.shape == (3, 3) - assert y.ndim == 2 - assert y.strides == (36, 4) - assert y.suboffsets is None - assert y.itemsize == 4 + assert_equal(y.format, '=f') + assert_equal(y.shape, (3, 3)) + assert_equal(y.ndim, 2) + assert_equal(y.strides, (36, 4)) + assert_equal(y.suboffsets, None) + assert_equal(y.itemsize, 4) def test_export_record(self): dt = [('a', np.int8), @@ -1558,37 +1558,37 @@ asbytes('aaaa'), 'bbbb', asbytes(' '), True)], dtype=dt) y = memoryview(x) - assert y.format == 'T{b:a:=h:b:=l:c:=q:d:B:e:=H:f:=L:g:=Q:h:=d:i:=d:j:=g:k:4s:l:=4w:m:3x:n:?:o:}' - assert y.shape == (1,) - assert y.ndim == 1 - assert y.strides == (82,) - assert y.suboffsets is None - assert y.itemsize == 82 + assert_equal(y.format, 'T{b:a:=h:b:=l:c:=q:d:B:e:=H:f:=L:g:=Q:h:=d:i:=d:j:=g:k:4s:l:=4w:m:3x:n:?:o:}') + assert_equal(y.shape, (1,)) + assert_equal(y.ndim, 1) + assert_equal(y.strides, (82,)) + assert_equal(y.suboffsets, None) + assert_equal(y.itemsize, 82) def test_export_subarray(self): x = np.array(([[1,2],[3,4]],), dtype=[('a', (int, (2,2)))]) y = memoryview(x) - assert y.format == 'T{(2,2)=l:a:}' - assert y.shape is None - assert y.ndim == 0 - assert y.strides is None - assert y.suboffsets is None - assert y.itemsize == 16 + assert_equal(y.format, 'T{(2,2)=l:a:}') + assert_equal(y.shape, None) + assert_equal(y.ndim, 0) + assert_equal(y.strides, None) + assert_equal(y.suboffsets, None) + assert_equal(y.itemsize, 16) def test_export_endian(self): x = np.array([1,2,3], dtype='>i4') y = memoryview(x) if sys.byteorder == 'little': - assert y.format in '>l' + assert_equal(y.format, '>l') else: - assert y.format == '=l' + assert_equal(y.format, '=l') x = np.array([1,2,3], dtype=' Author: ptvirtan Date: 2010-02-21 05:24:45 -0600 (Sun, 21 Feb 2010) New Revision: 8235 Modified: trunk/numpy/testing/nosetester.py Log: ENH: testing: always enable --detailed-errors assert introspection in nose Modified: trunk/numpy/testing/nosetester.py =================================================================== --- trunk/numpy/testing/nosetester.py 2010-02-21 11:24:24 UTC (rev 8234) +++ trunk/numpy/testing/nosetester.py 2010-02-21 11:24:45 UTC (rev 8235) @@ -230,6 +230,9 @@ argv+=['--cover-package=%s' % self.package_name, '--with-coverage', '--cover-tests', '--cover-inclusive', '--cover-erase'] + # enable assert introspection + argv += ['--detailed-errors'] + # bypass these samples under distutils argv += ['--exclude','f2py_ext'] argv += ['--exclude','f2py_f90_ext'] From numpy-svn at scipy.org Sun Feb 21 06:36:36 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 21 Feb 2010 05:36:36 -0600 (CST) Subject: [Numpy-svn] r8236 - trunk/numpy/core/include/numpy Message-ID: <20100221113636.66AC0C7C0EC@scipy.org> Author: cdavid Date: 2010-02-21 05:36:36 -0600 (Sun, 21 Feb 2010) New Revision: 8236 Modified: trunk/numpy/core/include/numpy/npy_cpu.h Log: BUG: fix ppc detection macro on AIX. Modified: trunk/numpy/core/include/numpy/npy_cpu.h =================================================================== --- trunk/numpy/core/include/numpy/npy_cpu.h 2010-02-21 11:24:45 UTC (rev 8235) +++ trunk/numpy/core/include/numpy/npy_cpu.h 2010-02-21 11:36:36 UTC (rev 8236) @@ -32,10 +32,11 @@ * _M_AMD64 defined by MS compiler */ #define NPY_CPU_AMD64 -#elif defined(__ppc__) || defined(__powerpc__) +#elif defined(__ppc__) || defined(__powerpc__) || defined(_ARCH_PPC) /* * __ppc__ is defined by gcc, I remember having seen __powerpc__ once, * but can't find it ATM + * _ARCH_PPC is used by at least gcc on AIX */ #define NPY_CPU_PPC #elif defined(__ppc64__) From numpy-svn at scipy.org Sun Feb 21 06:58:38 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 21 Feb 2010 05:58:38 -0600 (CST) Subject: [Numpy-svn] r8237 - trunk/numpy/ma Message-ID: <20100221115838.174EDC7C0E5@scipy.org> Author: ptvirtan Date: 2010-02-21 05:58:38 -0600 (Sun, 21 Feb 2010) New Revision: 8237 Modified: trunk/numpy/ma/core.py Log: ENH: ma: use domains also in _DomainedBinaryOperation.__call__ (previously they were used only in __array_wrap__, which wouldn't be called from __div__ et al. which call the domained operations directly) Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2010-02-21 11:36:36 UTC (rev 8236) +++ trunk/numpy/ma/core.py 2010-02-21 11:58:38 UTC (rev 8237) @@ -1068,6 +1068,10 @@ m = ~umath.isfinite(result) m |= ma m |= mb + # Apply the domain + domain = ufunc_domain.get(self.f, None) + if domain is not None: + m |= filled(domain(da, db), True) # Take care of the scalar case first if (not m.ndim): if m: From numpy-svn at scipy.org Sun Feb 21 06:59:06 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 21 Feb 2010 05:59:06 -0600 (CST) Subject: [Numpy-svn] r8238 - in trunk/numpy/core: code_generators src/umath Message-ID: <20100221115906.801ADC7C0E5@scipy.org> Author: ptvirtan Date: 2010-02-21 05:59:06 -0600 (Sun, 21 Feb 2010) New Revision: 8238 Modified: trunk/numpy/core/code_generators/generate_umath.py trunk/numpy/core/src/umath/umathmodule.c.src Log: 3K: BUG: alias divide -> true_divide correctly; just replacing the name in generate_umath.py is not the correct thing to do Modified: trunk/numpy/core/code_generators/generate_umath.py =================================================================== --- trunk/numpy/core/code_generators/generate_umath.py 2010-02-21 11:58:38 UTC (rev 8237) +++ trunk/numpy/core/code_generators/generate_umath.py 2010-02-21 11:59:06 UTC (rev 8238) @@ -682,7 +682,8 @@ } if sys.version_info[0] >= 3: - defdict['divide'] = defdict['true_divide'] + # Will be aliased to true_divide in umathmodule.c.src:InitOtherOperators + del defdict['divide'] def indent(st,spaces): indention = ' '*spaces Modified: trunk/numpy/core/src/umath/umathmodule.c.src =================================================================== --- trunk/numpy/core/src/umath/umathmodule.c.src 2010-02-21 11:58:38 UTC (rev 8237) +++ trunk/numpy/core/src/umath/umathmodule.c.src 2010-02-21 11:59:06 UTC (rev 8238) @@ -225,6 +225,12 @@ "Compute y = x1 * 2**x2.",0); PyDict_SetItemString(dictionary, "ldexp", f); Py_DECREF(f); + +#if defined(NPY_PY3K) + f = PyDict_GetItemString(dictionary, "true_divide"); + PyDict_SetItemString(dictionary, "divide", f); + Py_DECREF(f); +#endif return; } From numpy-svn at scipy.org Sun Feb 21 07:25:57 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 21 Feb 2010 06:25:57 -0600 (CST) Subject: [Numpy-svn] r8239 - trunk/numpy/core/tests Message-ID: <20100221122557.C5462C7C0E5@scipy.org> Author: ptvirtan Date: 2010-02-21 06:25:57 -0600 (Sun, 21 Feb 2010) New Revision: 8239 Modified: trunk/numpy/core/tests/test_multiarray.py Log: BUG: core: use C int size specifiers in the PEP 3118 tests, to make things work on 32 and 64 bits platforms Modified: trunk/numpy/core/tests/test_multiarray.py =================================================================== --- trunk/numpy/core/tests/test_multiarray.py 2010-02-21 11:59:06 UTC (rev 8238) +++ trunk/numpy/core/tests/test_multiarray.py 2010-02-21 12:25:57 UTC (rev 8239) @@ -1479,14 +1479,16 @@ x = np.zeros((3,3,3), dtype=np.float32)[:,0,:] self._check_roundtrip(x) - dt = [('a', np.int8), - ('b', np.int16), - ('c', np.int32), - ('d', np.int64), - ('e', np.uint8), - ('f', np.uint16), - ('g', np.uint32), - ('h', np.uint64), + dt = [('a', 'b'), + ('b', 'h'), + ('c', 'i'), + ('d', 'l'), + ('dx', 'q'), + ('e', 'B'), + ('f', 'H'), + ('g', 'I'), + ('h', 'L'), + ('hx', 'Q'), ('i', np.float), ('j', np.double), ('k', np.longdouble), @@ -1494,7 +1496,7 @@ ('m', 'U4'), ('n', 'V3'), ('o', '?')] - x = np.array([(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + x = np.array([(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, asbytes('aaaa'), 'bbbb', asbytes('xxx'), True)], dtype=dt) self._check_roundtrip(x) @@ -1509,9 +1511,9 @@ self._check_roundtrip(x) def test_export_simple_1d(self): - x = np.array([1,2,3,4,5], dtype='i4') + x = np.array([1,2,3,4,5], dtype='i') y = memoryview(x) - assert_equal(y.format, '=l') + assert_equal(y.format, '=i') assert_equal(y.shape, (5,)) assert_equal(y.ndim, 1) assert_equal(y.strides, (4,)) @@ -1539,14 +1541,16 @@ assert_equal(y.itemsize, 4) def test_export_record(self): - dt = [('a', np.int8), - ('b', np.int16), - ('c', np.int32), - ('d', np.int64), - ('e', np.uint8), - ('f', np.uint16), - ('g', np.uint32), - ('h', np.uint64), + dt = [('a', 'b'), + ('b', 'h'), + ('c', 'i'), + ('d', 'l'), + ('dx', 'q'), + ('e', 'B'), + ('f', 'H'), + ('g', 'I'), + ('h', 'L'), + ('hx', 'Q'), ('i', np.float), ('j', np.double), ('k', np.longdouble), @@ -1554,21 +1558,25 @@ ('m', 'U4'), ('n', 'V3'), ('o', '?')] - x = np.array([(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + x = np.array([(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, asbytes('aaaa'), 'bbbb', asbytes(' '), True)], dtype=dt) y = memoryview(x) - assert_equal(y.format, 'T{b:a:=h:b:=l:c:=q:d:B:e:=H:f:=L:g:=Q:h:=d:i:=d:j:=g:k:4s:l:=4w:m:3x:n:?:o:}') + assert_equal(y.format, 'T{b:a:=h:b:=i:c:=l:d:=q:dx:B:e:=H:f:=I:g:=L:h:=Q:hx:=d:i:=d:j:=g:k:4s:l:=4w:m:3x:n:?:o:}') assert_equal(y.shape, (1,)) assert_equal(y.ndim, 1) - assert_equal(y.strides, (82,)) assert_equal(y.suboffsets, None) - assert_equal(y.itemsize, 82) + if dtype('l').itemsize == 4: + assert_equal(y.strides, (90,)) + assert_equal(y.itemsize, 90) + else: + assert_equal(y.strides, (102,)) + assert_equal(y.itemsize, 102) def test_export_subarray(self): - x = np.array(([[1,2],[3,4]],), dtype=[('a', (int, (2,2)))]) + x = np.array(([[1,2],[3,4]],), dtype=[('a', ('i', (2,2)))]) y = memoryview(x) - assert_equal(y.format, 'T{(2,2)=l:a:}') + assert_equal(y.format, 'T{(2,2)=i:a:}') assert_equal(y.shape, None) assert_equal(y.ndim, 0) assert_equal(y.strides, None) @@ -1576,14 +1584,14 @@ assert_equal(y.itemsize, 16) def test_export_endian(self): - x = np.array([1,2,3], dtype='>i4') + x = np.array([1,2,3], dtype='>l') y = memoryview(x) if sys.byteorder == 'little': assert_equal(y.format, '>l') else: assert_equal(y.format, '=l') - x = np.array([1,2,3], dtype=' Author: ptvirtan Date: 2010-02-21 09:36:18 -0600 (Sun, 21 Feb 2010) New Revision: 8240 Modified: trunk/numpy/core/_internal.py trunk/numpy/core/src/multiarray/buffer.c trunk/numpy/core/tests/test_multiarray.py Log: ENH: core: better support for native vs. standard sizes and alignments in the PEP 3118 interface Also, try to produce minimal buffer format strings without unnecessary alignment characters. Modified: trunk/numpy/core/_internal.py =================================================================== --- trunk/numpy/core/_internal.py 2010-02-21 12:25:57 UTC (rev 8239) +++ trunk/numpy/core/_internal.py 2010-02-21 15:36:18 UTC (rev 8240) @@ -350,7 +350,7 @@ # Given a string containing a PEP 3118 format specifier, # construct a Numpy dtype -_pep3118_map = { +_pep3118_native_map = { '?': '?', 'b': 'b', 'B': 'B', @@ -365,7 +365,6 @@ 'f': 'f', 'd': 'd', 'g': 'g', - 'Q': 'Q', 'Zf': 'F', 'Zd': 'D', 'Zg': 'G', @@ -374,9 +373,32 @@ 'O': 'O', 'x': 'V', # padding } -_pep3118_typechars = ''.join(_pep3118_map.keys()) +_pep3118_native_typechars = ''.join(_pep3118_native_map.keys()) -def _dtype_from_pep3118(spec, byteorder='=', is_subdtype=False): +_pep3118_standard_map = { + '?': '?', + 'b': 'b', + 'B': 'B', + 'h': 'i2', + 'H': 'u2', + 'i': 'i4', + 'I': 'u4', + 'l': 'i4', + 'L': 'u4', + 'q': 'i8', + 'Q': 'u8', + 'f': 'f', + 'd': 'd', + 'Zf': 'F', + 'Zd': 'D', + 's': 'S', + 'w': 'U', + 'O': 'O', + 'x': 'V', # padding +} +_pep3118_standard_typechars = ''.join(_pep3118_standard_map.keys()) + +def _dtype_from_pep3118(spec, byteorder='@', is_subdtype=False): from numpy.core.multiarray import dtype fields = {} @@ -400,10 +422,18 @@ spec = spec[j+1:] # Byte order - if spec[0] in ('=', '<', '>'): + if spec[0] in ('@', '=', '<', '>', '^'): byteorder = spec[0] spec = spec[1:] + # Byte order characters also control native vs. standard type sizes + if byteorder in ('@', '^'): + type_map = _pep3118_native_map + type_map_chars = _pep3118_native_typechars + else: + type_map = _pep3118_standard_map + type_map_chars = _pep3118_standard_typechars + # Item sizes itemsize = 1 if spec[0].isdigit(): @@ -423,22 +453,41 @@ if itemsize != 1: # Not supported raise ValueError("Non item-size 1 structures not supported") - elif spec[0] in _pep3118_typechars: + elif spec[0] in type_map_chars: j = 1 for j in xrange(1, len(spec)): - if spec[j] not in _pep3118_typechars: + if spec[j] not in type_map_chars: break typechar = spec[:j] spec = spec[j:] is_padding = (typechar == 'x') - dtypechar = _pep3118_map[typechar] + dtypechar = type_map[typechar] if dtypechar in 'USV': dtypechar += '%d' % itemsize itemsize = 1 - value = dtype(byteorder + dtypechar) + numpy_byteorder = {'@': '=', '^': '='}.get(byteorder, byteorder) + value = dtype(numpy_byteorder + dtypechar) else: raise ValueError("Unknown PEP 3118 data type specifier %r" % spec) + # Native alignment may require padding + # + # XXX: here we assume that the presence of a '@' character implies + # that the start of the array is *also* aligned. + extra_offset = 0 + if byteorder == '@': + start_padding = offset % value.alignment + intra_padding = value.itemsize % value.alignment + + offset += start_padding + + if intra_padding != 0: + if itemsize > 1 or shape is not None: + value = dtype([('f0', value), + ('pad', '%dV' % intra_padding)]) + else: + extra_offset += intra_padding + # Convert itemsize to sub-array if itemsize != 1: value = dtype((value, (itemsize,))) @@ -462,8 +511,8 @@ if not is_padding or this_explicit_name: fields[name] = (value, offset) offset += value.itemsize + offset += extra_offset - if len(fields.keys()) == 1 and not explicit_name and fields['f0'][1] == 0: ret = fields['f0'][0] else: Modified: trunk/numpy/core/src/multiarray/buffer.c =================================================================== --- trunk/numpy/core/src/multiarray/buffer.c 2010-02-21 12:25:57 UTC (rev 8239) +++ trunk/numpy/core/src/multiarray/buffer.c 2010-02-21 15:36:18 UTC (rev 8240) @@ -142,12 +142,56 @@ return 0; } +/* + * Return non-zero if a type is aligned in each item in the given array, + * AND, the descr element size is a multiple of the alignment, + * AND, the array data is positioned to alignment granularity. + */ static int +_is_natively_aligned_at(PyArray_Descr *descr, + PyArrayObject *arr, Py_ssize_t offset) +{ + int k; + + if ((Py_ssize_t)(arr->data) % descr->alignment != 0) { + return 0; + } + + if (offset % descr->alignment != 0) { + return 0; + } + + if (descr->elsize % descr->alignment) { + return 0; + } + + for (k = 0; k < arr->nd; ++k) { + if (arr->dimensions[k] > 1) { + if (arr->strides[k] % descr->alignment != 0) { + return 0; + } + } + } + + return 1; +} + +static int _buffer_format_string(PyArray_Descr *descr, _tmp_string_t *str, - Py_ssize_t *offset) + PyArrayObject* arr, Py_ssize_t *offset, + char *active_byteorder) { int k; + char _active_byteorder = '@'; + Py_ssize_t _offset = 0; + if (active_byteorder == NULL) { + active_byteorder = &_active_byteorder; + } + if (offset == NULL) { + offset = &_offset; + } + if (descr->subarray) { PyObject *item, *repr; Py_ssize_t total_count = 1; @@ -170,7 +214,8 @@ } _append_char(str, ')'); old_offset = *offset; - ret = _buffer_format_string(descr->subarray->base, str, offset); + ret = _buffer_format_string(descr->subarray->base, str, arr, offset, + active_byteorder); *offset = old_offset + (*offset - old_offset) * total_count; return ret; } @@ -198,7 +243,8 @@ *offset += child->elsize; /* Insert child item */ - _buffer_format_string(child, str, offset); + _buffer_format_string(child, str, arr, offset, + active_byteorder); /* Insert field name */ #if defined(NPY_PY3K) @@ -232,11 +278,50 @@ _append_char(str, '}'); } else { - if (descr->byteorder == '<' || descr->byteorder == '>' || - descr->byteorder == '=') { - _append_char(str, descr->byteorder); + int is_standard_size = 1; + int is_native_only_type = (descr->type_num == NPY_LONGDOUBLE || + descr->type_num == NPY_CLONGDOUBLE); +#if NPY_SIZEOF_LONG_LONG != 8 + is_native_only_type = is_native_only_type || ( + descr->type_num == NPY_LONGLONG || + descr->type_num == NPY_ULONGLONG); +#endif + + if (descr->byteorder == '=' && + _is_natively_aligned_at(descr, arr, *offset)) { + /* Prefer native types, to cater for Cython */ + is_standard_size = 0; + if (*active_byteorder != '@') { + _append_char(str, '@'); + *active_byteorder = '@'; + } } + else if (descr->byteorder == '=' && is_native_only_type) { + /* Data types that have no standard size */ + is_standard_size = 0; + if (*active_byteorder != '^') { + _append_char(str, '^'); + *active_byteorder = '^'; + } + } + else if (descr->byteorder == '<' || descr->byteorder == '>' || + descr->byteorder == '=') { + is_standard_size = 1; + if (*active_byteorder != descr->byteorder) { + _append_char(str, descr->byteorder); + *active_byteorder = descr->byteorder; + } + if (is_native_only_type) { + /* It's not possible to express native-only data types + in non-native byte orders */ + PyErr_Format(PyExc_ValueError, + "cannot expose native-only dtype '%c' in " + "non-native byte order '%c' via buffer interface", + descr->type, descr->byteorder); + } + } + switch (descr->type_num) { case NPY_BOOL: if (_append_char(str, '?')) return -1; break; case NPY_BYTE: if (_append_char(str, 'b')) return -1; break; @@ -245,8 +330,22 @@ case NPY_USHORT: if (_append_char(str, 'H')) return -1; break; case NPY_INT: if (_append_char(str, 'i')) return -1; break; case NPY_UINT: if (_append_char(str, 'I')) return -1; break; - case NPY_LONG: if (_append_char(str, 'l')) return -1; break; - case NPY_ULONG: if (_append_char(str, 'L')) return -1; break; + case NPY_LONG: + if (is_standard_size && (NPY_SIZEOF_LONG == 8)) { + if (_append_char(str, 'q')) return -1; + } + else { + if (_append_char(str, 'l')) return -1; + } + break; + case NPY_ULONG: + if (is_standard_size && (NPY_SIZEOF_LONG == 8)) { + if (_append_char(str, 'Q')) return -1; + } + else { + if (_append_char(str, 'L')) return -1; + } + break; case NPY_LONGLONG: if (_append_char(str, 'q')) return -1; break; case NPY_ULONGLONG: if (_append_char(str, 'Q')) return -1; break; case NPY_FLOAT: if (_append_char(str, 'f')) return -1; break; @@ -280,8 +379,9 @@ break; } default: - PyErr_Format(PyExc_ValueError, "cannot convert dtype %d to buffer", - descr->type_num); + PyErr_Format(PyExc_ValueError, + "cannot include dtype '%c' in a buffer", + descr->type); return -1; } } @@ -322,14 +422,13 @@ _buffer_info_new(PyArrayObject *arr) { _buffer_info_t *info; - Py_ssize_t offset = 0; _tmp_string_t fmt = {0,0,0}; int k; info = (_buffer_info_t*)malloc(sizeof(_buffer_info_t)); /* Fill in format */ - if (_buffer_format_string(PyArray_DESCR(arr), &fmt, &offset) != 0) { + if (_buffer_format_string(PyArray_DESCR(arr), &fmt, arr, NULL, NULL) != 0) { free(info); return NULL; } Modified: trunk/numpy/core/tests/test_multiarray.py =================================================================== --- trunk/numpy/core/tests/test_multiarray.py 2010-02-21 12:25:57 UTC (rev 8239) +++ trunk/numpy/core/tests/test_multiarray.py 2010-02-21 15:36:18 UTC (rev 8240) @@ -1504,16 +1504,35 @@ x = np.array(([[1,2],[3,4]],), dtype=[('a', (int, (2,2)))]) self._check_roundtrip(x) + x = np.array([1,2,3], dtype='>i2') + self._check_roundtrip(x) + + x = np.array([1,2,3], dtype='l') else: - assert_equal(y.format, '=l') + assert_equal(y.format, 'l') x = np.array([1,2,3], dtype=' Author: ptvirtan Date: 2010-02-21 09:36:40 -0600 (Sun, 21 Feb 2010) New Revision: 8241 Modified: trunk/numpy/core/tests/test_multiarray.py Log: BUG: core: fix PEP 3118 tests to account for variation in native long sizes Modified: trunk/numpy/core/tests/test_multiarray.py =================================================================== --- trunk/numpy/core/tests/test_multiarray.py 2010-02-21 15:36:18 UTC (rev 8240) +++ trunk/numpy/core/tests/test_multiarray.py 2010-02-21 15:36:40 UTC (rev 8241) @@ -1489,14 +1489,17 @@ ('g', 'I'), ('h', 'L'), ('hx', 'Q'), - ('i', np.float), + ('i', np.single), ('j', np.double), ('k', np.longdouble), + ('ix', np.csingle), + ('jx', np.cdouble), + ('kx', np.clongdouble), ('l', 'S4'), ('m', 'U4'), ('n', 'V3'), ('o', '?')] - x = np.array([(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + x = np.array([(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, asbytes('aaaa'), 'bbbb', asbytes('xxx'), True)], dtype=dt) self._check_roundtrip(x) @@ -1519,14 +1522,14 @@ # Native-only data types can be passed through the buffer interface # only in native byte order if sys.byteorder == 'little': - x = np.array([1,2,3], dtype='>i8') + x = np.array([1,2,3], dtype='>q') assert_raises(ValueError, self._check_roundtrip, x) - x = np.array([1,2,3], dtype='l') + assert_equal(y.format, '>i') else: - assert_equal(y.format, 'l') + assert_equal(y.format, 'i') - x = np.array([1,2,3], dtype=' Author: ptvirtan Date: 2010-02-21 09:37:06 -0600 (Sun, 21 Feb 2010) New Revision: 8242 Modified: trunk/numpy/core/src/multiarray/numpymemoryview.c Log: ENH: core: export format string as UString in numpymemoryview (Py2.6) Modified: trunk/numpy/core/src/multiarray/numpymemoryview.c =================================================================== --- trunk/numpy/core/src/multiarray/numpymemoryview.c 2010-02-21 15:36:40 UTC (rev 8241) +++ trunk/numpy/core/src/multiarray/numpymemoryview.c 2010-02-21 15:37:06 UTC (rev 8242) @@ -131,7 +131,7 @@ static PyObject * memorysimpleview_format_get(PyMemorySimpleViewObject *self) { - return PyUnicode_FromString(self->view.format); + return PyUString_FromString(self->view.format); } static PyObject * From numpy-svn at scipy.org Sun Feb 21 11:16:29 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 21 Feb 2010 10:16:29 -0600 (CST) Subject: [Numpy-svn] r8243 - trunk/numpy/core/tests Message-ID: <20100221161629.500A9C7C03C@scipy.org> Author: charris Date: 2010-02-21 10:16:29 -0600 (Sun, 21 Feb 2010) New Revision: 8243 Modified: trunk/numpy/core/tests/test_datetime.py Log: WHT: Remove trailing whitespace. Modified: trunk/numpy/core/tests/test_datetime.py =================================================================== --- trunk/numpy/core/tests/test_datetime.py 2010-02-21 15:37:06 UTC (rev 8242) +++ trunk/numpy/core/tests/test_datetime.py 2010-02-21 16:16:29 UTC (rev 8243) @@ -6,12 +6,12 @@ def test_creation(self): for unit in ['Y', 'M', 'W', 'B', 'D', 'h', 'm', 's', 'ms', 'us', - 'ns', 'ps', 'fs', 'as']: + 'ns', 'ps', 'fs', 'as']: dt1 = np.dtype('M8[750%s]'%unit) assert dt1 == np.dtype('datetime64[750%s]' % unit) dt2 = np.dtype('m8[%s]' % unit) assert dt2 == np.dtype('timedelta64[%s]' % unit) - + def test_divisor_conversion_year(self): assert np.dtype('M8[Y/4]') == np.dtype('M8[3M]') assert np.dtype('M8[Y/13]') == np.dtype('M8[4W]') @@ -26,8 +26,8 @@ assert np.dtype('m8[W/5]') == np.dtype('m8[B]') assert np.dtype('m8[W/7]') == np.dtype('m8[D]') assert np.dtype('m8[3W/14]') == np.dtype('m8[36h]') - assert np.dtype('m8[5W/140]') == np.dtype('m8[360m]') - + assert np.dtype('m8[5W/140]') == np.dtype('m8[360m]') + def test_divisor_conversion_bday(self): assert np.dtype('M8[B/12]') == np.dtype('M8[2h]') assert np.dtype('M8[B/120]') == np.dtype('M8[12m]') @@ -56,4 +56,3 @@ def test_divisor_conversion_as(self): self.assertRaises(ValueError, lambda : np.dtype('M8[as/10]')) - From numpy-svn at scipy.org Sun Feb 21 11:16:34 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 21 Feb 2010 10:16:34 -0600 (CST) Subject: [Numpy-svn] r8244 - trunk/numpy/core Message-ID: <20100221161634.5C060C7C03C@scipy.org> Author: charris Date: 2010-02-21 10:16:34 -0600 (Sun, 21 Feb 2010) New Revision: 8244 Modified: trunk/numpy/core/arrayprint.py Log: BUG: Work around warning raised by np.isinf(np.inf). The isinf warning should be fixed at a lower level and tested separately. In the meantime, this fix avoids a lot of irrelevant warning messages in the tests. Modified: trunk/numpy/core/arrayprint.py =================================================================== --- trunk/numpy/core/arrayprint.py 2010-02-21 16:16:29 UTC (rev 8243) +++ trunk/numpy/core/arrayprint.py 2010-02-21 16:16:34 UTC (rev 8244) @@ -18,6 +18,7 @@ from multiarray import format_longfloat from fromnumeric import ravel + def product(x, y): return x*y _summaryEdgeItems = 3 # repr N leading and trailing items of each dimension @@ -412,6 +413,7 @@ self.exp_format = True finally: _nc.seterr(**errstate) + if self.exp_format: self.large_exponent = 0 < min_val < 1e-99 or max_val >= 1e100 self.max_str_len = 8 + self.precision @@ -444,13 +446,19 @@ self.format = format def __call__(self, x, strip_zeros=True): - if isnan(x): - return self.special_fmt % (_nan_str,) - elif isinf(x): - if x > 0: - return self.special_fmt % (_inf_str,) - else: - return self.special_fmt % ('-' + _inf_str,) + import numeric as _nc + err = _nc.seterr(invalid='ignore') + try: + if isnan(x): + return self.special_fmt % (_nan_str,) + elif isinf(x): + if x > 0: + return self.special_fmt % (_inf_str,) + else: + return self.special_fmt % ('-' + _inf_str,) + finally: + _nc.seterr(**err) + s = self.format % x if self.large_exponent: # 3-digit exponent From numpy-svn at scipy.org Sun Feb 21 11:16:40 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 21 Feb 2010 10:16:40 -0600 (CST) Subject: [Numpy-svn] r8245 - in trunk/numpy: core/tests testing Message-ID: <20100221161640.9DCE6C7C03C@scipy.org> Author: charris Date: 2010-02-21 10:16:40 -0600 (Sun, 21 Feb 2010) New Revision: 8245 Modified: trunk/numpy/core/tests/test_umath.py trunk/numpy/testing/utils.py Log: BUG: More workarounds for np.isinf warning in tests. Modified: trunk/numpy/core/tests/test_umath.py =================================================================== --- trunk/numpy/core/tests/test_umath.py 2010-02-21 16:16:34 UTC (rev 8244) +++ trunk/numpy/core/tests/test_umath.py 2010-02-21 16:16:40 UTC (rev 8245) @@ -232,7 +232,11 @@ np.seterr(**err) def assert_hypot_isinf(x, y): - assert np.isinf(ncu.hypot(x, y)), "hypot(%s, %s) is %s, not inf" % (x, y, ncu.hypot(x, y)) + err = np.seterr(invalid='ignore') + try: + assert np.isinf(ncu.hypot(x, y)), "hypot(%s, %s) is %s, not inf" % (x, y, ncu.hypot(x, y)) + finally: + np.seterr(**err) class TestHypotSpecialValues(TestCase): def test_nan_outputs(self): Modified: trunk/numpy/testing/utils.py =================================================================== --- trunk/numpy/testing/utils.py 2010-02-21 16:16:34 UTC (rev 8244) +++ trunk/numpy/testing/utils.py 2010-02-21 16:16:40 UTC (rev 8245) @@ -61,10 +61,14 @@ exception is always raised. This should be removed once this problem is solved at the Ufunc level.""" - from numpy.core import isfinite - st = isfinite(x) - if isinstance(st, types.NotImplementedType): - raise TypeError("isfinite not supported for this type") + from numpy.core import isfinite, seterr + err = seterr(invalid='ignore') + try: + st = isfinite(x) + if isinstance(st, types.NotImplementedType): + raise TypeError("isfinite not supported for this type") + finally: + seterr(**err) return st def gisinf(x): @@ -78,10 +82,14 @@ exception is always raised. This should be removed once this problem is solved at the Ufunc level.""" - from numpy.core import isinf - st = isinf(x) - if isinstance(st, types.NotImplementedType): - raise TypeError("isinf not supported for this type") + from numpy.core import isinf, seterr + err = seterr(invalid='ignore') + try: + st = isinf(x) + if isinstance(st, types.NotImplementedType): + raise TypeError("isinf not supported for this type") + finally: + seterr(**err) return st def rand(*args): From numpy-svn at scipy.org Sun Feb 21 11:38:55 2010 From: numpy-svn at scipy.org (Best ED Meds) Date: Sun, 21 Feb 2010 10:38:55 -0600 (CST) Subject: [Numpy-svn] For numpy-svn, we cut prices to -80% Message-ID: <20100221163855.52A4339CB00@scipy.org> An HTML attachment was scrubbed... URL: From numpy-svn at scipy.org Sun Feb 21 13:31:55 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 21 Feb 2010 12:31:55 -0600 (CST) Subject: [Numpy-svn] r8246 - trunk/numpy/lib/tests Message-ID: <20100221183155.E8EE739CAF9@scipy.org> Author: charris Date: 2010-02-21 12:31:55 -0600 (Sun, 21 Feb 2010) New Revision: 8246 Modified: trunk/numpy/lib/tests/test_type_check.py Log: BUG: Fix possibly unbalanced seterr pairs. Fixes change in state of invalid after running test(). Modified: trunk/numpy/lib/tests/test_type_check.py =================================================================== --- trunk/numpy/lib/tests/test_type_check.py 2010-02-21 16:16:40 UTC (rev 8245) +++ trunk/numpy/lib/tests/test_type_check.py 2010-02-21 18:31:55 UTC (rev 8246) @@ -69,7 +69,9 @@ #assert_equal(mintypecode('idF',savespace=1),'F') assert_equal(mintypecode('idD'),'D') + class TestIsscalar(TestCase): + def test_basic(self): assert(isscalar(3)) assert(not isscalar([3])) @@ -78,7 +80,9 @@ assert(isscalar(10L)) assert(isscalar(4.0)) + class TestReal(TestCase): + def test_real(self): y = rand(10,) assert_array_equal(y,real(y)) @@ -87,7 +91,9 @@ y = rand(10,)+1j*rand(10,) assert_array_equal(y.real,real(y)) + class TestImag(TestCase): + def test_real(self): y = rand(10,) assert_array_equal(0,imag(y)) @@ -96,7 +102,9 @@ y = rand(10,)+1j*rand(10,) assert_array_equal(y.imag,imag(y)) + class TestIscomplex(TestCase): + def test_fail(self): z = array([-1,0,1]) res = iscomplex(z) @@ -106,7 +114,9 @@ res = iscomplex(z) assert_array_equal(res,[1,0,0]) + class TestIsreal(TestCase): + def test_pass(self): z = array([-1,0,1j]) res = isreal(z) @@ -116,13 +126,17 @@ res = isreal(z) assert_array_equal(res,[0,1,1]) + class TestIscomplexobj(TestCase): + def test_basic(self): z = array([-1,0,1]) assert(not iscomplexobj(z)) z = array([-1j,0,-1]) assert(iscomplexobj(z)) + + class TestIsrealobj(TestCase): def test_basic(self): z = array([-1,0,1]) @@ -130,136 +144,207 @@ z = array([-1j,0,-1]) assert(not isrealobj(z)) + class TestIsnan(TestCase): + def test_goodvalues(self): z = array((-1.,0.,1.)) res = isnan(z) == 0 assert_all(alltrue(res,axis=0)) + def test_posinf(self): olderr = seterr(divide='ignore') - assert_all(isnan(array((1.,))/0.) == 0) - seterr(**olderr) + try: + assert_all(isnan(array((1.,))/0.) == 0) + finally: + seterr(**olderr) + def test_neginf(self): olderr = seterr(divide='ignore') - assert_all(isnan(array((-1.,))/0.) == 0) - seterr(**olderr) + try: + assert_all(isnan(array((-1.,))/0.) == 0) + finally: + seterr(**olderr) + def test_ind(self): olderr = seterr(divide='ignore', invalid='ignore') - assert_all(isnan(array((0.,))/0.) == 1) - seterr(**olderr) + try: + assert_all(isnan(array((0.,))/0.) == 1) + finally: + seterr(**olderr) + #def test_qnan(self): log(-1) return pi*j now # assert_all(isnan(log(-1.)) == 1) + def test_integer(self): assert_all(isnan(1) == 0) + def test_complex(self): assert_all(isnan(1+1j) == 0) + def test_complex1(self): olderr = seterr(divide='ignore', invalid='ignore') - assert_all(isnan(array(0+0j)/0.) == 1) - seterr(**olderr) + try: + assert_all(isnan(array(0+0j)/0.) == 1) + finally: + seterr(**olderr) + class TestIsfinite(TestCase): + def test_goodvalues(self): z = array((-1.,0.,1.)) res = isfinite(z) == 1 assert_all(alltrue(res,axis=0)) + def test_posinf(self): olderr = seterr(divide='ignore') - assert_all(isfinite(array((1.,))/0.) == 0) - seterr(**olderr) + try: + assert_all(isfinite(array((1.,))/0.) == 0) + finally: + seterr(**olderr) + def test_neginf(self): olderr = seterr(divide='ignore') - assert_all(isfinite(array((-1.,))/0.) == 0) - seterr(**olderr) + try: + assert_all(isfinite(array((-1.,))/0.) == 0) + finally: + seterr(**olderr) + def test_ind(self): olderr = seterr(divide='ignore', invalid='ignore') - assert_all(isfinite(array((0.,))/0.) == 0) - seterr(**olderr) + try: + assert_all(isfinite(array((0.,))/0.) == 0) + finally: + seterr(**olderr) + #def test_qnan(self): # assert_all(isfinite(log(-1.)) == 0) + def test_integer(self): assert_all(isfinite(1) == 1) + def test_complex(self): assert_all(isfinite(1+1j) == 1) + def test_complex1(self): olderr = seterr(divide='ignore', invalid='ignore') - assert_all(isfinite(array(1+1j)/0.) == 0) - seterr(**olderr) + try: + assert_all(isfinite(array(1+1j)/0.) == 0) + finally: + seterr(**olderr) + class TestIsinf(TestCase): + def test_goodvalues(self): z = array((-1.,0.,1.)) res = isinf(z) == 0 assert_all(alltrue(res,axis=0)) + def test_posinf(self): olderr = seterr(divide='ignore') - assert_all(isinf(array((1.,))/0.) == 1) - seterr(**olderr) + try: + assert_all(isinf(array((1.,))/0.) == 1) + finally: + seterr(**olderr) + def test_posinf_scalar(self): olderr = seterr(divide='ignore') - assert_all(isinf(array(1.,)/0.) == 1) - seterr(**olderr) + try: + assert_all(isinf(array(1.,)/0.) == 1) + finally: + seterr(**olderr) + def test_neginf(self): olderr = seterr(divide='ignore') - assert_all(isinf(array((-1.,))/0.) == 1) - seterr(**olderr) + try: + assert_all(isinf(array((-1.,))/0.) == 1) + finally: + seterr(**olderr) + def test_neginf_scalar(self): olderr = seterr(divide='ignore') - assert_all(isinf(array(-1.)/0.) == 1) - seterr(**olderr) + try: + assert_all(isinf(array(-1.)/0.) == 1) + finally: + seterr(**olderr) + def test_ind(self): olderr = seterr(divide='ignore', invalid='ignore') - assert_all(isinf(array((0.,))/0.) == 0) - seterr(**olderr) + try: + assert_all(isinf(array((0.,))/0.) == 0) + finally: + seterr(**olderr) + #def test_qnan(self): # assert_all(isinf(log(-1.)) == 0) # assert_all(isnan(log(-1.)) == 1) + class TestIsposinf(TestCase): + def test_generic(self): olderr = seterr(divide='ignore', invalid='ignore') - vals = isposinf(array((-1.,0,1))/0.) - seterr(**olderr) + try: + vals = isposinf(array((-1.,0,1))/0.) + finally: + seterr(**olderr) assert(vals[0] == 0) assert(vals[1] == 0) assert(vals[2] == 1) + class TestIsneginf(TestCase): def test_generic(self): olderr = seterr(divide='ignore', invalid='ignore') - vals = isneginf(array((-1.,0,1))/0.) - seterr(**olderr) + try: + vals = isneginf(array((-1.,0,1))/0.) + finally: + seterr(**olderr) assert(vals[0] == 1) assert(vals[1] == 0) assert(vals[2] == 0) + class TestNanToNum(TestCase): + def test_generic(self): olderr = seterr(divide='ignore', invalid='ignore') - vals = nan_to_num(array((-1.,0,1))/0.) - seterr(**olderr) + try: + vals = nan_to_num(array((-1.,0,1))/0.) + finally: + seterr(**olderr) assert_all(vals[0] < -1e10) and assert_all(isfinite(vals[0])) assert(vals[1] == 0) assert_all(vals[2] > 1e10) and assert_all(isfinite(vals[2])) + def test_integer(self): vals = nan_to_num(1) assert_all(vals == 1) + def test_complex_good(self): vals = nan_to_num(1+1j) assert_all(vals == 1+1j) + def test_complex_bad(self): v = 1+1j olderr = seterr(divide='ignore', invalid='ignore') - v += array(0+1.j)/0. - seterr(**olderr) + try: + v += array(0+1.j)/0. + finally: + seterr(**olderr) vals = nan_to_num(v) # !! This is actually (unexpectedly) zero assert_all(isfinite(vals)) + def test_complex_bad2(self): v = 1+1j olderr = seterr(divide='ignore', invalid='ignore') - v += array(-1+1.j)/0. - seterr(**olderr) + try: + v += array(-1+1.j)/0. + finally: + seterr(**olderr) vals = nan_to_num(v) assert_all(isfinite(vals)) #assert_all(vals.imag > 1e10) and assert_all(isfinite(vals)) @@ -270,6 +355,7 @@ class TestRealIfClose(TestCase): + def test_basic(self): a = rand(10) b = real_if_close(a+1e-15j) @@ -280,7 +366,9 @@ b = real_if_close(a+1e-7j,tol=1e-6) assert_all(isrealobj(b)) + class TestArrayConversion(TestCase): + def test_asfarray(self): a = asfarray(array([1,2,3])) assert_equal(a.__class__,ndarray) From numpy-svn at scipy.org Sun Feb 21 13:32:03 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 21 Feb 2010 12:32:03 -0600 (CST) Subject: [Numpy-svn] r8247 - in trunk/numpy: core/tests ma/tests Message-ID: <20100221183203.D201739CAF9@scipy.org> Author: charris Date: 2010-02-21 12:32:03 -0600 (Sun, 21 Feb 2010) New Revision: 8247 Modified: trunk/numpy/core/tests/test_numeric.py trunk/numpy/core/tests/test_umath_complex.py trunk/numpy/ma/tests/test_old_ma.py Log: BUG: Fix possibly unbalanced seterr calls. Fixes change of divide state after running np.test(). Modified: trunk/numpy/core/tests/test_numeric.py =================================================================== --- trunk/numpy/core/tests/test_numeric.py 2010-02-21 18:31:55 UTC (rev 8246) +++ trunk/numpy/core/tests/test_numeric.py 2010-02-21 18:32:03 UTC (rev 8247) @@ -223,26 +223,32 @@ class TestSeterr(TestCase): def test_set(self): err = seterr() - old = seterr(divide='warn') - self.assertTrue(err == old) - new = seterr() - self.assertTrue(new['divide'] == 'warn') - seterr(over='raise') - self.assertTrue(geterr()['over'] == 'raise') - self.assertTrue(new['divide'] == 'warn') - seterr(**old) - self.assertTrue(geterr() == old) + try: + old = seterr(divide='warn') + self.assertTrue(err == old) + new = seterr() + self.assertTrue(new['divide'] == 'warn') + seterr(over='raise') + self.assertTrue(geterr()['over'] == 'raise') + self.assertTrue(new['divide'] == 'warn') + seterr(**old) + self.assertTrue(geterr() == old) + finally: + seterr(**err) def test_divide_err(self): - seterr(divide='raise') + err = seterr(divide='raise') try: + try: + array([1.]) / array([0.]) + except FloatingPointError: + pass + else: + self.fail() + seterr(divide='ignore') array([1.]) / array([0.]) - except FloatingPointError: - pass - else: - self.fail() - seterr(divide='ignore') - array([1.]) / array([0.]) + finally: + seterr(**err) class TestFromiter(TestCase): Modified: trunk/numpy/core/tests/test_umath_complex.py =================================================================== --- trunk/numpy/core/tests/test_umath_complex.py 2010-02-21 18:31:55 UTC (rev 8246) +++ trunk/numpy/core/tests/test_umath_complex.py 2010-02-21 18:32:03 UTC (rev 8247) @@ -465,12 +465,16 @@ assert_almost_equal(f(z1), x) def check_complex_value(f, x1, y1, x2, y2, exact=True): + err = np.seterr(invalid='ignore') z1 = np.array([complex(x1, y1)]) z2 = np.complex(x2, y2) - if exact: - assert_equal(f(z1), z2) - else: - assert_almost_equal(f(z1), z2) + try: + if exact: + assert_equal(f(z1), z2) + else: + assert_almost_equal(f(z1), z2) + finally: + np.seterr(**err) if __name__ == "__main__": run_module_suite() Modified: trunk/numpy/ma/tests/test_old_ma.py =================================================================== --- trunk/numpy/ma/tests/test_old_ma.py 2010-02-21 18:31:55 UTC (rev 8246) +++ trunk/numpy/ma/tests/test_old_ma.py 2010-02-21 18:32:03 UTC (rev 8247) @@ -89,14 +89,18 @@ self.assertTrue(eq(x - y, xm - ym)) self.assertTrue(eq(x * y, xm * ym)) olderr = numpy.seterr(divide='ignore', invalid='ignore') - self.assertTrue(eq(x / y, xm / ym)) - numpy.seterr(**olderr) + try: + self.assertTrue(eq(x / y, xm / ym)) + finally: + numpy.seterr(**olderr) self.assertTrue(eq(a10 + y, a10 + ym)) self.assertTrue(eq(a10 - y, a10 - ym)) self.assertTrue(eq(a10 * y, a10 * ym)) olderr = numpy.seterr(divide='ignore', invalid='ignore') - self.assertTrue(eq(a10 / y, a10 / ym)) - numpy.seterr(**olderr) + try: + self.assertTrue(eq(a10 / y, a10 / ym)) + finally: + numpy.seterr(**olderr) self.assertTrue(eq(x + a10, xm + a10)) self.assertTrue(eq(x - a10, xm - a10)) self.assertTrue(eq(x * a10, xm * a10)) @@ -108,8 +112,10 @@ self.assertTrue(eq(numpy.subtract(x,y), subtract(xm, ym))) self.assertTrue(eq(numpy.multiply(x,y), multiply(xm, ym))) olderr = numpy.seterr(divide='ignore', invalid='ignore') - self.assertTrue(eq(numpy.divide(x,y), divide(xm, ym))) - numpy.seterr(**olderr) + try: + self.assertTrue(eq(numpy.divide(x,y), divide(xm, ym))) + finally: + numpy.seterr(**olderr) def test_testMixedArithmetic(self): @@ -128,10 +134,12 @@ self.assertTrue (eq(numpy.tan(x), tan(xm))) self.assertTrue (eq(numpy.tanh(x), tanh(xm))) olderr = numpy.seterr(divide='ignore', invalid='ignore') - self.assertTrue (eq(numpy.sqrt(abs(x)), sqrt(xm))) - self.assertTrue (eq(numpy.log(abs(x)), log(xm))) - self.assertTrue (eq(numpy.log10(abs(x)), log10(xm))) - numpy.seterr(**olderr) + try: + self.assertTrue (eq(numpy.sqrt(abs(x)), sqrt(xm))) + self.assertTrue (eq(numpy.log(abs(x)), log(xm))) + self.assertTrue (eq(numpy.log10(abs(x)), log10(xm))) + finally: + numpy.seterr(**olderr) self.assertTrue (eq(numpy.exp(x), exp(xm))) self.assertTrue (eq(numpy.arcsin(z), arcsin(zm))) self.assertTrue (eq(numpy.arccos(z), arccos(zm))) @@ -658,25 +666,28 @@ def test_testUfuncRegression(self): + f_invalid_ignore = ['sqrt', 'arctanh', 'arcsin', 'arccos', + 'arccosh', 'arctanh', 'log', 'log10','divide', + 'true_divide', 'floor_divide', 'remainder', 'fmod'] for f in ['sqrt', 'log', 'log10', 'exp', 'conjugate', - 'sin', 'cos', 'tan', - 'arcsin', 'arccos', 'arctan', - 'sinh', 'cosh', 'tanh', - 'arcsinh', - 'arccosh', - 'arctanh', - 'absolute', 'fabs', 'negative', - # 'nonzero', 'around', - 'floor', 'ceil', - # 'sometrue', 'alltrue', - 'logical_not', - 'add', 'subtract', 'multiply', - 'divide', 'true_divide', 'floor_divide', - 'remainder', 'fmod', 'hypot', 'arctan2', - 'equal', 'not_equal', 'less_equal', 'greater_equal', - 'less', 'greater', - 'logical_and', 'logical_or', 'logical_xor', - ]: + 'sin', 'cos', 'tan', + 'arcsin', 'arccos', 'arctan', + 'sinh', 'cosh', 'tanh', + 'arcsinh', + 'arccosh', + 'arctanh', + 'absolute', 'fabs', 'negative', + # 'nonzero', 'around', + 'floor', 'ceil', + # 'sometrue', 'alltrue', + 'logical_not', + 'add', 'subtract', 'multiply', + 'divide', 'true_divide', 'floor_divide', + 'remainder', 'fmod', 'hypot', 'arctan2', + 'equal', 'not_equal', 'less_equal', 'greater_equal', + 'less', 'greater', + 'logical_and', 'logical_or', 'logical_xor', + ]: try: uf = getattr(umath, f) except AttributeError: @@ -684,17 +695,15 @@ mf = getattr(numpy.ma, f) args = self.d[:uf.nin] olderr = numpy.geterr() - f_invalid_ignore = ['sqrt', 'arctanh', 'arcsin', 'arccos', - 'arccosh', 'arctanh', 'log', 'log10','divide', - 'true_divide', 'floor_divide', 'remainder', - 'fmod'] - if f in f_invalid_ignore: - numpy.seterr(invalid='ignore') - if f in ['arctanh', 'log', 'log10']: - numpy.seterr(divide='ignore') - ur = uf(*args) - mr = mf(*args) - numpy.seterr(**olderr) + try: + if f in f_invalid_ignore: + numpy.seterr(invalid='ignore') + if f in ['arctanh', 'log', 'log10']: + numpy.seterr(divide='ignore') + ur = uf(*args) + mr = mf(*args) + finally: + numpy.seterr(**olderr) self.assertTrue(eq(ur.filled(0), mr.filled(0), f)) self.assertTrue(eqmask(ur.mask, mr.mask)) From numpy-svn at scipy.org Sun Feb 21 13:33:12 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 21 Feb 2010 12:33:12 -0600 (CST) Subject: [Numpy-svn] r8248 - trunk/doc Message-ID: <20100221183312.1D11239CB0E@scipy.org> Author: ptvirtan Date: 2010-02-21 12:33:11 -0600 (Sun, 21 Feb 2010) New Revision: 8248 Modified: trunk/doc/Py3K.txt Log: 3K: doc: some updates to 3K porting notes Modified: trunk/doc/Py3K.txt =================================================================== --- trunk/doc/Py3K.txt 2010-02-21 18:32:03 UTC (rev 8247) +++ trunk/doc/Py3K.txt 2010-02-21 18:33:11 UTC (rev 8248) @@ -125,6 +125,13 @@ More can be added as needed. +Bytes vs. strings +----------------- + +At many points in Numpy, bytes literals are needed. These can be created via +numpy.compat.asbytes and asbytes_nested. + + Exception syntax ---------------- @@ -374,7 +381,7 @@ .. todo:: We will also have to make sure the - *_true_divide variants are defined. This should also be done for + ``*_true_divide`` variants are defined. This should also be done for python < 3.x, but that introduces a requirement for the Py_TPFLAGS_HAVE_CLASS in the type flag. @@ -408,12 +415,9 @@ - VOID_getitem - In some cases, this returns a buffer object, built from scratch to - point to a region of memory. However, in Py3 there is no stand-alone - buffer object: the MemoryView always piggy-packs on some other object. + In some cases, this returns a buffer object on Python 2. On Python 3, + there is no stand-alone buffer object, so we return a byte array instead. - Should it actually return a Bytes object containing a copy of the data? - - multiarray.int_asbuffer Converts an integer to a void* pointer -- in Python. @@ -421,6 +425,7 @@ Should we just remove this for Py3? It doesn't seem like it is used anywhere, and it doesn't sound very useful. + The Py2/Py3 compatible PyBufferMethods definition looks like:: NPY_NO_EXPORT PyBufferProcs array_as_buffer = { @@ -449,19 +454,11 @@ .. todo:: - Is there a cleaner way out of the ``bf_releasebuffer`` issue? It - seems a bit that on Py2.6, the new buffer interface is a bit - troublesome, as apparently Numpy will be the first piece of code - exercising it more fully. + Figure out what to do with int_asbuffer - It seems we should submit patches to Python on this. At least "s#" - implementation on Py3 won't work at all, since the old buffer - interface is no more present. But perhaps Py3 users should just give - up using "s#" in ParseTuple, and use the 3118 interface instead. - .. todo:: - Make ndarray shape and strides natively Py_ssize_t? + There's stuff to clean up in numarray/_capi.c PyBuffer (consumer) @@ -567,7 +564,7 @@ things to build. This definition will be removed when Py3 support is finished. -Where *_AsStringAndSize is used, more care needs to be taken, as +Where ``*_AsStringAndSize`` is used, more care needs to be taken, as encoding Unicode to Bytes may needed. If this cannot be avoided, the encoding should be ASCII, unless there is a very strong reason to do otherwise. Especially, I don't believe we should silently fall back to @@ -644,10 +641,12 @@ Fate of the 'S' dtype --------------------- -"Strings" in Py3 are now Unicode, so it would make sense to +"Strings" in Py3 are now Unicode, so it might make sense to re-associate Numpy's dtype letter 'S' with Unicode, and introduce a separate letter for Bytes. +Already I changed str_ == unicode_. + The Bytes dtype can probably not be wholly dropped -- there may be some use for 1-byte character strings in e.g. genetics? @@ -657,7 +656,7 @@ .. todo:: - All dtype code should be checked for usage of *_STRINGLTR. + All dtype code should be checked for usage of ``*_STRINGLTR``. .. todo:: @@ -778,6 +777,20 @@ character as Bytes... +Module initialization +--------------------- + +The module initialization API changed in Python 3.1. + +Most Numpy modules are now converted. + +.. todo:: + + Except numarray/_capi.c and _blasdot.c show compilation warnings. + This indicates return values are not handled OK -- the init function + is not void any more. + + PyTypeObject ------------ @@ -938,10 +951,10 @@ from the Python file object. There are, however, new PyFile_* functions for writing and reading data from the file. -Temporary compatibility wrappers that return a `fdopen` file pointer -are in private/npy_3kcompat.h. However, this is an unsatisfactory -approach, since the FILE* pointer returned by `fdopen` cannot be freed -as `fclose` on it would also close the underlying file. +Temporary compatibility wrappers that return a dup-ed `fdopen` file pointer are +in private/npy_3kcompat.h. This causes more flushing to be necessary, but it +appears there is no alternative solution. The FILE pointer so obtained must be +closed with fclose after use. .. todo:: @@ -959,14 +972,6 @@ These were replaced, as READONLY is present also on Py2. -Py_TPFLAGS_CHECKTYPES ---------------------- - -This has vanished and is always on in Py3K. - -It is currently #ifdef'd out for Py3. - - PyOS ---- @@ -988,3 +993,17 @@ .. todo:: Do the right thing for PyInstance checks. + + +PyCObject / PyCapsule +--------------------- + +The PyCObject API is removed in Python 3.2, so we need to rewrite it +using PyCapsule. + +.. todo:: + + This probably requires adding some backwards compatibility PyCapsule_* + definitions in npy_py3kcompat.h, and using only PyCapsule_* throughout + Numpy. + From numpy-svn at scipy.org Sun Feb 21 17:05:39 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 21 Feb 2010 16:05:39 -0600 (CST) Subject: [Numpy-svn] r8249 - trunk/numpy/core/tests Message-ID: <20100221220539.7A3CD39CB0B@scipy.org> Author: charris Date: 2010-02-21 16:05:39 -0600 (Sun, 21 Feb 2010) New Revision: 8249 Modified: trunk/numpy/core/tests/test_umath_complex.py Log: BUG: Fix unhandled divide-by-zero errors and invalid values in tests. Add some tests to check that divide-by-zero errors are raised when desired. Modified: trunk/numpy/core/tests/test_umath_complex.py =================================================================== --- trunk/numpy/core/tests/test_umath_complex.py 2010-02-21 18:33:11 UTC (rev 8248) +++ trunk/numpy/core/tests/test_umath_complex.py 2010-02-21 22:05:39 UTC (rev 8249) @@ -8,7 +8,7 @@ class TestCexp(object): def test_simple(self): - check = check_complex_value + check = check_complex_value f = np.exp yield check, f, 1, 0, np.exp(1), 0, False @@ -20,7 +20,7 @@ def test_special_values(self): # C99: Section G 6.3.1 - check = check_complex_value + check = check_complex_value f = np.exp # cexp(+-0 + 0i) is 1 + 0i @@ -52,38 +52,54 @@ # cexp(-inf + inf i) is +-0 +- 0i (signs unspecified) def _check_ninf_inf(dummy): - z = f(np.array(np.complex(-np.inf, np.inf))) - if z.real != 0 or z.imag != 0: - raise AssertionError( - "cexp(-inf, inf) is (%f, %f), expected (+-0, +-0)" \ - % (z.real, z.imag)) + msgform = "cexp(-inf, inf) is (%f, %f), expected (+-0, +-0)" + err = np.seterr(invalid='ignore') + try: + z = f(np.array(np.complex(-np.inf, np.inf))) + if z.real != 0 or z.imag != 0: + raise AssertionError(msgform %(z.real, z.imag)) + finally: + np.seterr(**err) + yield _check_ninf_inf, None # cexp(inf + inf i) is +-inf + NaNi and raised invalid FPU ex. def _check_inf_inf(dummy): - z = f(np.array(np.complex(np.inf, np.inf))) - if not np.isinf(z.real) or not np.isnan(z.imag): - raise AssertionError( - "cexp(inf, inf) is (%f, %f), expected (+-inf, nan)" \ - % (z.real, z.imag)) + msgform = "cexp(inf, inf) is (%f, %f), expected (+-inf, nan)" + err = np.seterr(invalid='ignore') + try: + z = f(np.array(np.complex(np.inf, np.inf))) + if not np.isinf(z.real) or not np.isnan(z.imag): + raise AssertionError(msgform % (z.real, z.imag)) + finally: + np.seterr(**err) + yield _check_inf_inf, None # cexp(-inf + nan i) is +-0 +- 0i def _check_ninf_nan(dummy): - z = f(np.array(np.complex(-np.inf, np.nan))) - if z.real != 0 or z.imag != 0: - raise AssertionError( - "cexp(-inf, nan) is (%f, %f), expected (+-0, +-0)" \ - % (z.real, z.imag)) + msgform = "cexp(-inf, nan) is (%f, %f), expected (+-0, +-0)" + err = np.seterr(invalid='ignore') + try: + z = f(np.array(np.complex(-np.inf, np.nan))) + if z.real != 0 or z.imag != 0: + raise AssertionError(msgform % (z.real, z.imag)) + finally: + np.seterr(**err) + yield _check_ninf_nan, None # cexp(inf + nan i) is +-inf + nan def _check_inf_nan(dummy): - z = f(np.array(np.complex(np.inf, np.nan))) - if not np.isinf(z.real) or not np.isnan(z.imag): - raise AssertionError( - "cexp(-inf, nan) is (%f, %f), expected (+-inf, nan)" \ - % (z.real, z.imag)) + msgform = "cexp(-inf, nan) is (%f, %f), expected (+-inf, nan)" + err = np.seterr(invalid='ignore') + try: + z = f(np.array(np.complex(np.inf, np.nan))) + if not np.isinf(z.real) or not np.isnan(z.imag): + raise AssertionError(msgform % (z.real, z.imag)) + finally: + np.seterr(**err) + yield _check_inf_nan, None # cexp(nan + yi) is nan + nani for y != 0 (optional: raises invalid FPU @@ -117,20 +133,35 @@ # From C99 std (Sec 6.3.2) # XXX: check exceptions raised + # --- raise for invalid fails. # clog(-0 + i0) returns -inf + i pi and raises the 'divide-by-zero' # floating-point exception. - x = np.array([np.NZERO], dtype=np.complex) - y = np.complex(-np.inf, np.pi) - assert_almost_equal(np.log(x), y) + err = np.seterr(divide='raise') + try: + x = np.array([np.NZERO], dtype=np.complex) + y = np.complex(-np.inf, np.pi) + self.assertRaises(FloatingPointError, np.log, x) + np.seterr(divide='ignore') + assert_almost_equal(np.log(x), y) + finally: + np.seterr(**err) + xl.append(x) yl.append(y) # clog(+0 + i0) returns -inf + i0 and raises the 'divide-by-zero' # floating-point exception. - x = np.array([0], dtype=np.complex) - y = np.complex(-np.inf, 0) - assert_almost_equal(np.log(x), y) + err = np.seterr(divide='raise') + try: + x = np.array([0], dtype=np.complex) + y = np.complex(-np.inf, 0) + self.assertRaises(FloatingPointError, np.log, x) + np.seterr(divide='ignore') + assert_almost_equal(np.log(x), y) + finally: + np.seterr(**err) + xl.append(x) yl.append(y) @@ -148,14 +179,28 @@ # clog(x + iNaN) returns NaN + iNaN and optionally raises the # 'invalid' floating- point exception, for finite x. - x = np.array([complex(1., np.nan)], dtype=np.complex) - y = np.complex(np.nan, np.nan) - assert_almost_equal(np.log(x), y) + err = np.seterr(invalid='raise') + try: + x = np.array([complex(1., np.nan)], dtype=np.complex) + y = np.complex(np.nan, np.nan) + #self.assertRaises(FloatingPointError, np.log, x) + np.seterr(invalid='ignore') + assert_almost_equal(np.log(x), y) + finally: + np.seterr(**err) + xl.append(x) yl.append(y) - x = np.array([np.inf + np.nan * 1j], dtype=np.complex) - assert_almost_equal(np.log(x), y) + err = np.seterr(invalid='raise') + try: + x = np.array([np.inf + 1j * np.nan], dtype=np.complex) + #self.assertRaises(FloatingPointError, np.log, x) + np.seterr(invalid='ignore') + assert_almost_equal(np.log(x), y) + finally: + np.seterr(**err) + xl.append(x) yl.append(y) @@ -224,10 +269,15 @@ # clog(conj(z)) = conj(clog(z)). xa = np.array(xl, dtype=np.complex) ya = np.array(yl, dtype=np.complex) - for i in range(len(xa)): - assert_almost_equal(np.log(np.conj(xa[i])), np.conj(np.log(xa[i]))) + err = np.seterr(divide='ignore') + try: + for i in range(len(xa)): + assert_almost_equal(np.log(np.conj(xa[i])), np.conj(np.log(xa[i]))) + finally: + np.seterr(**err) class TestCsqrt(object): + def test_simple(self): # sqrt(1) yield check_complex_value, np.sqrt, 1, 0, 1, 0 @@ -248,7 +298,7 @@ # _check_branch_cut(f, -1, 0, 1, -1) def test_special_values(self): - check = check_complex_value + check = check_complex_value f = np.sqrt # C99: Sec G 6.4.2 @@ -281,11 +331,15 @@ # csqrt(-inf + nani) is nan +- infi (both +i infi are valid) def _check_ninf_nan(dummy): + msgform = "csqrt(-inf, nan) is (%f, %f), expected (nan, +-inf)" z = np.sqrt(np.array(np.complex(-np.inf, np.nan))) - if not np.isnan(z.real) or not np.isinf(z.imag): - raise AssertionError( - "csqrt(-inf, nan) is (%f, %f), expected (nan, +-inf)" \ - % (z.real, z.imag)) + #Fixme: ugly workaround for isinf bug. + err = np.seterr(invalid='ignore') + try: + if not (np.isnan(z.real) and np.isinf(z.imag)): + raise AssertionError(msgform % (z.real, z.imag)) + finally: + np.seterr(**err) yield _check_ninf_nan, None @@ -304,10 +358,14 @@ class TestCpow(TestCase): def test_simple(self): x = np.array([1+1j, 0+2j, 1+2j, np.inf, np.nan]) - y_r = x ** 2 - y = np.power(x, 2) - for i in range(len(x)): - assert_almost_equal(y[i], y_r[i]) + err = np.seterr(invalid='ignore') + try: + y_r = x ** 2 + y = np.power(x, 2) + for i in range(len(x)): + assert_almost_equal(y[i], y_r[i]) + finally: + np.seterr(**err) def test_scalar(self): x = np.array([1, 1j, 2, 2.5+.37j, np.inf, np.nan]) @@ -318,9 +376,13 @@ # Substitute a result allowed by C99 standard p_r[4] = complex(np.inf, np.nan) # Do the same with numpy complex scalars - n_r = [x[i] ** y[i] for i in lx] - for i in lx: - assert_almost_equal(n_r[i], p_r[i], err_msg='Loop %d\n' % i) + err = np.seterr(invalid='ignore') + try: + n_r = [x[i] ** y[i] for i in lx] + for i in lx: + assert_almost_equal(n_r[i], p_r[i], err_msg='Loop %d\n' % i) + finally: + np.seterr(**err) def test_array(self): x = np.array([1, 1j, 2, 2.5+.37j, np.inf, np.nan]) @@ -331,9 +393,13 @@ # Substitute a result allowed by C99 standard p_r[4] = complex(np.inf, np.nan) # Do the same with numpy arrays - n_r = x ** y - for i in lx: - assert_almost_equal(n_r[i], p_r[i], err_msg='Loop %d\n' % i) + err = np.seterr(invalid='ignore') + try: + n_r = x ** y + for i in lx: + assert_almost_equal(n_r[i], p_r[i], err_msg='Loop %d\n' % i) + finally: + np.seterr(**err) class TestCabs(object): def test_simple(self): From numpy-svn at scipy.org Sun Feb 21 17:05:45 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 21 Feb 2010 16:05:45 -0600 (CST) Subject: [Numpy-svn] r8250 - trunk/numpy/lib/tests Message-ID: <20100221220545.EF2BE39CB12@scipy.org> Author: charris Date: 2010-02-21 16:05:45 -0600 (Sun, 21 Feb 2010) New Revision: 8250 Modified: trunk/numpy/lib/tests/test_type_check.py Log: BUG: Workarounds for isfinite/isinf invalid values. Modified: trunk/numpy/lib/tests/test_type_check.py =================================================================== --- trunk/numpy/lib/tests/test_type_check.py 2010-02-21 22:05:39 UTC (rev 8249) +++ trunk/numpy/lib/tests/test_type_check.py 2010-02-21 22:05:45 UTC (rev 8250) @@ -198,14 +198,14 @@ assert_all(alltrue(res,axis=0)) def test_posinf(self): - olderr = seterr(divide='ignore') + olderr = seterr(divide='ignore', invalid='ignore') try: assert_all(isfinite(array((1.,))/0.) == 0) finally: seterr(**olderr) def test_neginf(self): - olderr = seterr(divide='ignore') + olderr = seterr(divide='ignore', invalid='ignore') try: assert_all(isfinite(array((-1.,))/0.) == 0) finally: @@ -243,28 +243,28 @@ assert_all(alltrue(res,axis=0)) def test_posinf(self): - olderr = seterr(divide='ignore') + olderr = seterr(divide='ignore', invalid='ignore') try: assert_all(isinf(array((1.,))/0.) == 1) finally: seterr(**olderr) def test_posinf_scalar(self): - olderr = seterr(divide='ignore') + olderr = seterr(divide='ignore', invalid='ignore') try: assert_all(isinf(array(1.,)/0.) == 1) finally: seterr(**olderr) def test_neginf(self): - olderr = seterr(divide='ignore') + olderr = seterr(divide='ignore', invalid='ignore') try: assert_all(isinf(array((-1.,))/0.) == 1) finally: seterr(**olderr) def test_neginf_scalar(self): - olderr = seterr(divide='ignore') + olderr = seterr(divide='ignore', invalid='ignore') try: assert_all(isinf(array(-1.)/0.) == 1) finally: From numpy-svn at scipy.org Sun Feb 21 18:17:54 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 21 Feb 2010 17:17:54 -0600 (CST) Subject: [Numpy-svn] r8251 - trunk/numpy/testing Message-ID: <20100221231754.3CE4639CAF9@scipy.org> Author: charris Date: 2010-02-21 17:17:54 -0600 (Sun, 21 Feb 2010) New Revision: 8251 Modified: trunk/numpy/testing/utils.py Log: BUG: Ignore "invalid value" from abs in testing/utils.py Modified: trunk/numpy/testing/utils.py =================================================================== --- trunk/numpy/testing/utils.py 2010-02-21 22:05:45 UTC (rev 8250) +++ trunk/numpy/testing/utils.py 2010-02-21 23:17:54 UTC (rev 8251) @@ -521,9 +521,14 @@ return # Normalized the numbers to be in range (-10.0,10.0) # scale = float(pow(10,math.floor(math.log10(0.5*(abs(desired)+abs(actual)))))) - scale = 0.5*(np.abs(desired) + np.abs(actual)) - scale = np.power(10,np.floor(np.log10(scale))) + err = np.seterr(invalid='ignore') try: + scale = 0.5*(np.abs(desired) + np.abs(actual)) + scale = np.power(10,np.floor(np.log10(scale))) + finally: + np.seterr(**err) + + try: sc_desired = desired/scale except ZeroDivisionError: sc_desired = 0.0 From numpy-svn at scipy.org Mon Feb 22 04:01:19 2010 From: numpy-svn at scipy.org (Best ED Meds) Date: Mon, 22 Feb 2010 03:01:19 -0600 (CST) Subject: [Numpy-svn] For numpy-svn, we cut prices to -80% Message-ID: <20100222090119.F275739CB0A@scipy.org> An HTML attachment was scrubbed... URL: From numpy-svn at scipy.org Mon Feb 22 04:10:19 2010 From: numpy-svn at scipy.org (Approved VIAGRA® Store) Date: Mon, 22 Feb 2010 03:10:19 -0600 (CST) Subject: [Numpy-svn] Please Read Message-ID: <20100222091019.DC07A39CB0E@scipy.org> An HTML attachment was scrubbed... URL: From numpy-svn at scipy.org Mon Feb 22 07:03:42 2010 From: numpy-svn at scipy.org (Best ED Meds) Date: Mon, 22 Feb 2010 06:03:42 -0600 (CST) Subject: [Numpy-svn] For numpy-svn, we cut prices to -80% Message-ID: <20100222120342.4E86139CB12@scipy.org> An HTML attachment was scrubbed... URL: From numpy-svn at scipy.org Mon Feb 22 09:24:36 2010 From: numpy-svn at scipy.org (VIAGRA ® Official Site) Date: Mon, 22 Feb 2010 08:24:36 -0600 (CST) Subject: [Numpy-svn] DISCOUNT ID02396 72% 0FF on Pfizer ! Message-ID: <20100222142436.D863839CB0C@scipy.org> An HTML attachment was scrubbed... URL: From numpy-svn at scipy.org Mon Feb 22 10:28:38 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 22 Feb 2010 09:28:38 -0600 (CST) Subject: [Numpy-svn] r8252 - trunk/numpy/numarray Message-ID: <20100222152838.36C2B39CB16@scipy.org> Author: chanley Date: 2010-02-22 09:28:38 -0600 (Mon, 22 Feb 2010) New Revision: 8252 Modified: trunk/numpy/numarray/util.py Log: Fix bad usage of namespace alias change Modified: trunk/numpy/numarray/util.py =================================================================== --- trunk/numpy/numarray/util.py 2010-02-21 23:17:54 UTC (rev 8251) +++ trunk/numpy/numarray/util.py 2010-02-22 15:28:38 UTC (rev 8252) @@ -19,22 +19,22 @@ def handleError(errorStatus, sourcemsg): """Take error status and use error mode to handle it.""" modes = np.geterr() - if errorStatus & numpy.FPE_INVALID: + if errorStatus & np.FPE_INVALID: if modes['invalid'] == "warn": print "Warning: Encountered invalid numeric result(s)", sourcemsg if modes['invalid'] == "raise": raise MathDomainError(sourcemsg) - if errorStatus & numpy.FPE_DIVIDEBYZERO: + if errorStatus & np.FPE_DIVIDEBYZERO: if modes['dividebyzero'] == "warn": print "Warning: Encountered divide by zero(s)", sourcemsg if modes['dividebyzero'] == "raise": raise ZeroDivisionError(sourcemsg) - if errorStatus & numpy.FPE_OVERFLOW: + if errorStatus & np.FPE_OVERFLOW: if modes['overflow'] == "warn": print "Warning: Encountered overflow(s)", sourcemsg if modes['overflow'] == "raise": raise NumOverflowError(sourcemsg) - if errorStatus & numpy.FPE_UNDERFLOW: + if errorStatus & np.FPE_UNDERFLOW: if modes['underflow'] == "warn": print "Warning: Encountered underflow(s)", sourcemsg if modes['underflow'] == "raise": @@ -42,6 +42,6 @@ def get_numarray_include_dirs(): - base = os.path.dirname(numpy.__file__) + base = os.path.dirname(np.__file__) newdirs = [os.path.join(base, 'numarray', 'include')] return newdirs From numpy-svn at scipy.org Mon Feb 22 14:36:24 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 22 Feb 2010 13:36:24 -0600 (CST) Subject: [Numpy-svn] r8253 - trunk/numpy/core/tests Message-ID: <20100222193624.8B31039CAF1@scipy.org> Author: mdroe Date: 2010-02-22 13:36:24 -0600 (Mon, 22 Feb 2010) New Revision: 8253 Modified: trunk/numpy/core/tests/test_regression.py Log: Add regression test for ticket #1405 Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2010-02-22 15:28:38 UTC (rev 8252) +++ trunk/numpy/core/tests/test_regression.py 2010-02-22 19:36:24 UTC (rev 8253) @@ -1265,5 +1265,11 @@ x = np.array([1,2,3], dtype=np.dtype(' Author: mdroe Date: 2010-02-22 14:54:57 -0600 (Mon, 22 Feb 2010) New Revision: 8254 Modified: trunk/numpy/core/tests/test_regression.py Log: Add very basic sanity test for getting include directories (related to ticket #1405) Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2010-02-22 19:36:24 UTC (rev 8253) +++ trunk/numpy/core/tests/test_regression.py 2010-02-22 20:54:57 UTC (rev 8254) @@ -1271,5 +1271,15 @@ # Just make sure this doesn't throw an exception numarray.handleError(0, "") + def test_include_dirs(self): + """As a sanity check, just test that get_include and + get_numarray_include include something reasonable. Somewhat + related to ticket #1405.""" + include_dirs = [np.get_include(), np.get_numarray_include(), + np.get_numpy_include()] + for path in include_dirs: + assert isinstance(path, (str, unicode)) + assert path != '' + if __name__ == "__main__": run_module_suite() From numpy-svn at scipy.org Mon Feb 22 16:33:56 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 22 Feb 2010 15:33:56 -0600 (CST) Subject: [Numpy-svn] r8255 - trunk/doc Message-ID: <20100222213356.C13D039CB1D@scipy.org> Author: ptvirtan Date: 2010-02-22 15:33:56 -0600 (Mon, 22 Feb 2010) New Revision: 8255 Modified: trunk/doc/Py3K.txt Log: 3K: doc: note that f2py hasn't been really ported yet Modified: trunk/doc/Py3K.txt =================================================================== --- trunk/doc/Py3K.txt 2010-02-22 20:54:57 UTC (rev 8254) +++ trunk/doc/Py3K.txt 2010-02-22 21:33:56 UTC (rev 8255) @@ -125,6 +125,18 @@ More can be added as needed. +numpy.f2py +---------- + +F2py has not yet been ported to Py3. + +It imports, but it's not tested. + +.. todo:: + + Port f2py to Py3 + + Bytes vs. strings ----------------- From numpy-svn at scipy.org Tue Feb 23 04:49:39 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 23 Feb 2010 03:49:39 -0600 (CST) Subject: [Numpy-svn] r8256 - in trunk/numpy: core/code_generators core/src/multiarray core/src/private core/src/umath lib numarray numarray/include/numpy random/mtrand Message-ID: <20100223094939.278DB39CB27@scipy.org> Author: charris Date: 2010-02-23 03:49:38 -0600 (Tue, 23 Feb 2010) New Revision: 8256 Modified: trunk/numpy/core/code_generators/generate_numpy_api.py trunk/numpy/core/code_generators/generate_ufunc_api.py trunk/numpy/core/src/multiarray/arraytypes.c.src trunk/numpy/core/src/multiarray/common.c trunk/numpy/core/src/multiarray/convert_datatype.c trunk/numpy/core/src/multiarray/ctors.c trunk/numpy/core/src/multiarray/descriptor.c trunk/numpy/core/src/multiarray/getset.c trunk/numpy/core/src/multiarray/multiarraymodule.c trunk/numpy/core/src/multiarray/scalarapi.c trunk/numpy/core/src/multiarray/scalartypes.c.src trunk/numpy/core/src/multiarray/scalartypes.h trunk/numpy/core/src/multiarray/usertypes.c trunk/numpy/core/src/private/npy_3kcompat.h trunk/numpy/core/src/umath/ufunc_object.c trunk/numpy/core/src/umath/umathmodule.c.src trunk/numpy/lib/type_check.py trunk/numpy/numarray/_capi.c trunk/numpy/numarray/include/numpy/libnumarray.h trunk/numpy/random/mtrand/Python.pxi trunk/numpy/random/mtrand/mtrand.c Log: BUG: Replace deprecated PyCObject by PyCapsule for Python >= 3.1. Modified: trunk/numpy/core/code_generators/generate_numpy_api.py =================================================================== --- trunk/numpy/core/code_generators/generate_numpy_api.py 2010-02-22 21:33:56 UTC (rev 8255) +++ trunk/numpy/core/code_generators/generate_numpy_api.py 2010-02-23 09:49:38 UTC (rev 8256) @@ -49,14 +49,25 @@ _import_array(void) { int st; - PyObject *numpy = PyImport_ImportModule("numpy.core.multiarray"); + PyObject *numpy = NULL; PyObject *c_api = NULL; - if (numpy == NULL) return -1; - c_api = PyObject_GetAttrString(numpy, "_ARRAY_API"); - if (c_api == NULL) {Py_DECREF(numpy); return -1;} + + + +numpy = PyImport_ImportModule("numpy.core.multiarray"); +if (numpy == NULL) return -1; +c_api = PyObject_GetAttrString(numpy, "_ARRAY_API"); +if (c_api == NULL) {Py_DECREF(numpy); return -1;} + +#if PY_VERSION_HEX >= 0x03010000 + if (PyCapsule_CheckExact(c_api)) { + PyArray_API = (void **)PyCapsule_GetPointer(c_api, NULL); + } +#else if (PyCObject_Check(c_api)) { PyArray_API = (void **)PyCObject_AsVoidPtr(c_api); } +#endif Py_DECREF(c_api); Py_DECREF(numpy); if (PyArray_API == NULL) return -1; @@ -73,10 +84,10 @@ (int) NPY_FEATURE_VERSION, (int) PyArray_GetNDArrayCFeatureVersion()); return -1; } - - /* + + /* * Perform runtime check of endianness and check it matches the one set by - * the headers (npy_endian.h) as a safeguard + * the headers (npy_endian.h) as a safeguard */ st = PyArray_GetEndianness(); if (st == NPY_CPU_UNKNOWN_ENDIAN) { Modified: trunk/numpy/core/code_generators/generate_ufunc_api.py =================================================================== --- trunk/numpy/core/code_generators/generate_ufunc_api.py 2010-02-22 21:33:56 UTC (rev 8255) +++ trunk/numpy/core/code_generators/generate_ufunc_api.py 2010-02-23 09:49:38 UTC (rev 8256) @@ -44,9 +44,16 @@ if (numpy == NULL) return -1; c_api = PyObject_GetAttrString(numpy, "_UFUNC_API"); if (c_api == NULL) {Py_DECREF(numpy); return -1;} + +#if PY_VERSION_HEX >= 0x03010000 + if (PyCapsule_CheckExact(c_api)) { + PyUFunc_API = (void **)PyCapsule_GetPointer(c_api, NULL); + } +#else if (PyCObject_Check(c_api)) { PyUFunc_API = (void **)PyCObject_AsVoidPtr(c_api); } +#endif Py_DECREF(c_api); Py_DECREF(numpy); if (PyUFunc_API == NULL) return -1; Modified: trunk/numpy/core/src/multiarray/arraytypes.c.src =================================================================== --- trunk/numpy/core/src/multiarray/arraytypes.c.src 2010-02-22 21:33:56 UTC (rev 8255) +++ trunk/numpy/core/src/multiarray/arraytypes.c.src 2010-02-23 09:49:38 UTC (rev 8256) @@ -3533,7 +3533,11 @@ dt_data->den = 1; dt_data->events = 1; +#if defined(NPY_PY3K) + cobj = PyCapsule_New((void *)dt_data, NULL, simple_capsule_dtor); +#else cobj = PyCObject_FromVoidPtr((void *)dt_data, _pya_free); +#endif descr->metadata = PyDict_New(); PyDict_SetItemString(descr->metadata, NPY_METADATA_DTSTR, cobj); Py_DECREF(cobj); Modified: trunk/numpy/core/src/multiarray/common.c =================================================================== --- trunk/numpy/core/src/multiarray/common.c 2010-02-22 21:33:56 UTC (rev 8255) +++ trunk/numpy/core/src/multiarray/common.c 2010-02-23 09:49:38 UTC (rev 8256) @@ -257,14 +257,26 @@ if ((ip=PyObject_GetAttrString(op, "__array_struct__")) != NULL) { PyArrayInterface *inter; char buf[40]; + +#if defined(NPY_PY3K) + if (PyCapsule_CheckExact(ip)) { + inter = (PyArrayInterface *)PyCapsule_GetPointer(ip, NULL); + if (inter->two == 2) { + PyOS_snprintf(buf, sizeof(buf), + "|%c%d", inter->typekind, inter->itemsize); + chktype = _array_typedescr_fromstr(buf); + } + } +#else if (PyCObject_Check(ip)) { - inter=(PyArrayInterface *)PyCObject_AsVoidPtr(ip); + inter = (PyArrayInterface *)PyCObject_AsVoidPtr(ip); if (inter->two == 2) { PyOS_snprintf(buf, sizeof(buf), "|%c%d", inter->typekind, inter->itemsize); chktype = _array_typedescr_fromstr(buf); } } +#endif Py_DECREF(ip); if (chktype) { goto finish; Modified: trunk/numpy/core/src/multiarray/convert_datatype.c =================================================================== --- trunk/numpy/core/src/multiarray/convert_datatype.c 2010-02-22 21:33:56 UTC (rev 8255) +++ trunk/numpy/core/src/multiarray/convert_datatype.c 2010-02-23 09:49:38 UTC (rev 8256) @@ -102,9 +102,15 @@ key = PyInt_FromLong(type_num); cobj = PyDict_GetItem(obj, key); Py_DECREF(key); +#if defined(NPY_PY3K) + if (PyCapsule_CheckExact(cobj)) { + castfunc = PyCapsule_GetPointer(cobj, NULL); + } +#else if (PyCObject_Check(cobj)) { castfunc = PyCObject_AsVoidPtr(cobj); } +#endif } } if (PyTypeNum_ISCOMPLEX(descr->type_num) && Modified: trunk/numpy/core/src/multiarray/ctors.c =================================================================== --- trunk/numpy/core/src/multiarray/ctors.c 2010-02-22 21:33:56 UTC (rev 8255) +++ trunk/numpy/core/src/multiarray/ctors.c 2010-02-23 09:49:38 UTC (rev 8256) @@ -1140,9 +1140,15 @@ #endif if ((e = PyObject_GetAttrString(s, "__array_struct__")) != NULL) { d = -1; +#if defined(NPY_PY3K) + if (PyCapsule_CheckExact(e)) { + PyArrayInterface *inter; + inter = (PyArrayInterface *)PyCapsule_GetPointer(e, NULL); +#else if (PyCObject_Check(e)) { PyArrayInterface *inter; inter = (PyArrayInterface *)PyCObject_AsVoidPtr(e); +#endif if (inter->two == 2) { d = inter->nd; } @@ -1565,10 +1571,17 @@ */ PyArray_UpdateFlags(self, UPDATE_ALL); } +#if defined(NPY_PY3K) + if PyCapsule_CheckExact(func) { + /* A C-function is stored here */ + PyArray_FinalizeFunc *cfunc; + cfunc = PyCapsule_GetPointer(func, NULL); +#else if PyCObject_Check(func) { /* A C-function is stored here */ PyArray_FinalizeFunc *cfunc; cfunc = PyCObject_AsVoidPtr(func); +#endif Py_DECREF(func); if (cfunc(self, obj) < 0) { goto fail; @@ -2109,10 +2122,17 @@ PyErr_Clear(); return Py_NotImplemented; } +#if defined(NPY_PY3K) + if (!PyCapsule_CheckExact(attr)) { + goto fail; + } + inter = PyCapsule_GetPointer(attr, NULL); +#else if (!PyCObject_Check(attr)) { goto fail; } inter = PyCObject_AsVoidPtr(attr); +#endif if (inter->two != 2) { goto fail; } Modified: trunk/numpy/core/src/multiarray/descriptor.c =================================================================== --- trunk/numpy/core/src/multiarray/descriptor.c 2010-02-22 21:33:56 UTC (rev 8255) +++ trunk/numpy/core/src/multiarray/descriptor.c 2010-02-23 09:49:38 UTC (rev 8256) @@ -646,7 +646,11 @@ PyArray_DatetimeMetaData *dt_data; PyObject *dt_tuple; +#if defined(NPY_PY3K) + dt_data = PyCapsule_GetPointer(cobj, NULL); +#else dt_data = PyCObject_AsVoidPtr(cobj); +#endif dt_tuple = PyTuple_New(4); PyTuple_SET_ITEM(dt_tuple, 0, @@ -681,7 +685,11 @@ } } +#if defined(NPY_PY3K) + return PyCapsule_New((void *)dt_data, NULL, simple_capsule_dtor); +#else return PyCObject_FromVoidPtr((void *)dt_data, _pya_free); +#endif } static PyArray_Descr * @@ -1544,7 +1552,11 @@ return ret; } tmp = PyDict_GetItemString(self->metadata, NPY_METADATA_DTSTR); +#if defined(NPY_PY3K) + dt_data = PyCapsule_GetPointer(tmp, NULL); +#else dt_data = PyCObject_AsVoidPtr(tmp); +#endif num = dt_data->num; den = dt_data->den; events = dt_data->events; Modified: trunk/numpy/core/src/multiarray/getset.c =================================================================== --- trunk/numpy/core/src/multiarray/getset.c 2010-02-22 21:33:56 UTC (rev 8255) +++ trunk/numpy/core/src/multiarray/getset.c 2010-02-23 09:49:38 UTC (rev 8256) @@ -506,6 +506,7 @@ array_struct_get(PyArrayObject *self) { PyArrayInterface *inter; + PyObject *ret; inter = (PyArrayInterface *)_pya_malloc(sizeof(PyArrayInterface)); if (inter==NULL) { @@ -551,7 +552,13 @@ inter->descr = NULL; } Py_INCREF(self); - return PyCObject_FromVoidPtrAndDesc(inter, self, gentype_struct_free); +#if defined(NPY_PY3K) + ret = PyCapsule_New(inter, NULL, gentype_struct_free); + PyCapsule_SetContext(ret, self); +#else + ret = PyCObject_FromVoidPtrAndDesc(inter, self, gentype_struct_free); +#endif + return ret; } static PyObject * Modified: trunk/numpy/core/src/multiarray/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarray/multiarraymodule.c 2010-02-22 21:33:56 UTC (rev 8255) +++ trunk/numpy/core/src/multiarray/multiarraymodule.c 2010-02-23 09:49:38 UTC (rev 8256) @@ -1350,8 +1350,13 @@ return 1; } +#if defined(NPY_PY3K) + data1 = PyCapsule_GetPointer(cobj1, NULL); + data2 = PyCapsule_GetPointer(cobj2, NULL); +#else data1 = PyCObject_AsVoidPtr(cobj1); data2 = PyCObject_AsVoidPtr(cobj2); +#endif return ((data1->base == data2->base) && (data1->num == data2->num) && (data1->den == data2->den) @@ -3045,7 +3050,11 @@ if (PyType_Ready(&PyArrayFlags_Type) < 0) { return RETVAL; } +#if defined(NPY_PY3K) + c_api = PyCapsule_New((void *)PyArray_API, NULL, NULL); +#else c_api = PyCObject_FromVoidPtr((void *)PyArray_API, NULL); +#endif PyDict_SetItemString(d, "_ARRAY_API", c_api); Py_DECREF(c_api); if (PyErr_Occurred()) { @@ -3076,7 +3085,11 @@ PyDict_SetItemString(d, "METADATA_DTSTR", s); Py_DECREF(s); +#if defined(NPY_PY3K) + s = PyCapsule_New((void *)_datetime_strings, NULL, NULL); +#else s = PyCObject_FromVoidPtr((void *)_datetime_strings, NULL); +#endif PyDict_SetItemString(d, "DATETIMEUNITS", s); Py_DECREF(s); Modified: trunk/numpy/core/src/multiarray/scalarapi.c =================================================================== --- trunk/numpy/core/src/multiarray/scalarapi.c 2010-02-22 21:33:56 UTC (rev 8255) +++ trunk/numpy/core/src/multiarray/scalarapi.c 2010-02-23 09:49:38 UTC (rev 8256) @@ -534,7 +534,11 @@ memcpy(dt_data, &((PyTimedeltaScalarObject *)sc)->obmeta, sizeof(PyArray_DatetimeMetaData)); } +#if defined(NPY_PY3K) + cobj = PyCapsule_New((void *)dt_data, NULL, simple_capsule_dtor); +#else cobj = PyCObject_FromVoidPtr((void *)dt_data, _pya_free); +#endif /* Add correct meta-data to the data-type */ if (descr == NULL) { @@ -666,7 +670,11 @@ PyObject *cobj; PyArray_DatetimeMetaData *dt_data; cobj = PyDict_GetItemString(descr->metadata, NPY_METADATA_DTSTR); +#if defined(NPY_PY3K) + dt_data = PyCapsule_GetPointer(cobj, NULL); +#else dt_data = PyCObject_AsVoidPtr(cobj); +#endif memcpy(&(((PyDatetimeScalarObject *)obj)->obmeta), dt_data, sizeof(PyArray_DatetimeMetaData)); } Modified: trunk/numpy/core/src/multiarray/scalartypes.c.src =================================================================== --- trunk/numpy/core/src/multiarray/scalartypes.c.src 2010-02-22 21:33:56 UTC (rev 8255) +++ trunk/numpy/core/src/multiarray/scalartypes.c.src 2010-02-23 09:49:38 UTC (rev 8256) @@ -810,7 +810,22 @@ return PyInt_FromLong(1); } +#if defined(NPY_PY3K) NPY_NO_EXPORT void +gentype_struct_free(PyObject *ptr) +{ + PyArrayInterface *arrif; + PyObject *context; + + arrif = (PyArrayInterface*)PyCapsule_GetPointer(ptr, NULL); + context = (PyObject *)PyCapsule_GetContext(ptr); + Py_DECREF(context); + Py_XDECREF(arrif->descr); + _pya_free(arrif->shape); + _pya_free(arrif); +} +#else +NPY_NO_EXPORT void gentype_struct_free(void *ptr, void *arg) { PyArrayInterface *arrif = (PyArrayInterface *)ptr; @@ -819,12 +834,14 @@ _pya_free(arrif->shape); _pya_free(arrif); } +#endif static PyObject * gentype_struct_get(PyObject *self) { PyArrayObject *arr; PyArrayInterface *inter; + PyObject *ret; arr = (PyArrayObject *)PyArray_FromScalar(self, NULL); inter = (PyArrayInterface *)_pya_malloc(sizeof(PyArrayInterface)); @@ -840,7 +857,13 @@ inter->data = arr->data; inter->descr = NULL; - return PyCObject_FromVoidPtrAndDesc(inter, arr, gentype_struct_free); +#if defined(NPY_PY3K) + ret = PyCapsule_New(inter, NULL, gentype_struct_free); + PyCapsule_SetContext(ret, arr); +#else + ret = PyCObject_FromVoidPtrAndDesc(inter, arr, gentype_struct_free); +#endif + return ret; } static PyObject * Modified: trunk/numpy/core/src/multiarray/scalartypes.h =================================================================== --- trunk/numpy/core/src/multiarray/scalartypes.h 2010-02-22 21:33:56 UTC (rev 8255) +++ trunk/numpy/core/src/multiarray/scalartypes.h 2010-02-23 09:49:38 UTC (rev 8256) @@ -7,8 +7,13 @@ NPY_NO_EXPORT void format_longdouble(char *buf, size_t buflen, longdouble val, unsigned int prec); +#if defined(NPY_PY3K) NPY_NO_EXPORT void +gentype_struct_free(PyObject *ptr); +#else +NPY_NO_EXPORT void gentype_struct_free(void *ptr, void *arg); +#endif NPY_NO_EXPORT int _typenum_fromtypeobj(PyObject *type, int user); Modified: trunk/numpy/core/src/multiarray/usertypes.c =================================================================== --- trunk/numpy/core/src/multiarray/usertypes.c 2010-02-22 21:33:56 UTC (rev 8255) +++ trunk/numpy/core/src/multiarray/usertypes.c 2010-02-23 09:49:38 UTC (rev 8256) @@ -206,7 +206,11 @@ if (PyErr_Occurred()) { return -1; } +#if defined(NPY_PY3K) + cobj = PyCapsule_New((void *)castfunc, NULL, NULL); +#else cobj = PyCObject_FromVoidPtr((void *)castfunc, NULL); +#endif if (cobj == NULL) { Py_DECREF(key); return -1; Modified: trunk/numpy/core/src/private/npy_3kcompat.h =================================================================== --- trunk/numpy/core/src/private/npy_3kcompat.h 2010-02-22 21:33:56 UTC (rev 8255) +++ trunk/numpy/core/src/private/npy_3kcompat.h 2010-02-23 09:49:38 UTC (rev 8256) @@ -212,4 +212,16 @@ } #endif +/* + * A destructor is needed for PyCapsule objects to + * replace _pya_free. + */ +#if defined(NPY_PY3K) +static void +simple_capsule_dtor(PyObject *cap) +{ + PyArray_free(PyCapsule_GetPointer(cap, NULL)); +} +#endif + #endif /* _NPY_3KCOMPAT_H_ */ Modified: trunk/numpy/core/src/umath/ufunc_object.c =================================================================== --- trunk/numpy/core/src/umath/ufunc_object.c 2010-02-22 21:33:56 UTC (rev 8255) +++ trunk/numpy/core/src/umath/ufunc_object.c 2010-02-23 09:49:38 UTC (rev 8256) @@ -372,7 +372,11 @@ PyUFunc_Loop1d *funcdata; int i; +#if defined(NPY_PY3K) + funcdata = (PyUFunc_Loop1d *)PyCapsule_GetPointer(obj, NULL); +#else funcdata = (PyUFunc_Loop1d *)PyCObject_AsVoidPtr(obj); +#endif while (funcdata != NULL) { for (i = 0; i < nin; i++) { if (!PyArray_CanCoerceScalar(arg_types[i], @@ -517,7 +521,11 @@ * extract the correct function * data and argtypes */ +#if defined(NPY_PY3K) + funcdata = (PyUFunc_Loop1d *)PyCapsule_GetPointer(obj, NULL); +#else funcdata = (PyUFunc_Loop1d *)PyCObject_AsVoidPtr(obj); +#endif while (funcdata != NULL) { if (n != 1) { for (i = 0; i < nargs; i++) { @@ -3876,7 +3884,23 @@ * This frees the linked-list structure when the CObject * is destroyed (removed from the internal dictionary) */ +#if defined(NPY_PY3K) static void +_loop1d_list_free(PyObject *ptr) +{ + PyUFunc_Loop1d *funcdata; + + funcdata = (PyUFunc_Loop1d *)PyCapsule_GetPointer(ptr, NULL); + if (funcdata == NULL) { + return; + } + _pya_free(funcdata->arg_types); + _loop1d_list_free(funcdata->next); + _pya_free(funcdata); +} + +#else +static void _loop1d_list_free(void *ptr) { PyUFunc_Loop1d *funcdata; @@ -3891,6 +3915,7 @@ _loop1d_list_free(funcdata->next); _pya_free(funcdata); } +#endif /*UFUNC_API*/ @@ -3949,7 +3974,11 @@ cobj = PyDict_GetItem(ufunc->userloops, key); /* If it's not there, then make one and return. */ if (cobj == NULL) { +#if defined(NPY_PY3K) + cobj = PyCapsule_New((void *)funcdata, NULL, _loop1d_list_free); +#else cobj = PyCObject_FromVoidPtr((void *)funcdata, _loop1d_list_free); +#endif if (cobj == NULL) { goto fail; } @@ -3967,7 +3996,11 @@ * is exactly like this one, then just replace. * Otherwise insert. */ +#if defined(NPY_PY3K) + current = (PyUFunc_Loop1d *)PyCapsule_GetPointer(cobj, NULL); +#else current = (PyUFunc_Loop1d *)PyCObject_AsVoidPtr(cobj); +#endif while (current != NULL) { cmp = cmp_arg_types(current->arg_types, newtypes, ufunc->nargs); if (cmp >= 0) { Modified: trunk/numpy/core/src/umath/umathmodule.c.src =================================================================== --- trunk/numpy/core/src/umath/umathmodule.c.src 2010-02-22 21:33:56 UTC (rev 8255) +++ trunk/numpy/core/src/umath/umathmodule.c.src 2010-02-23 09:49:38 UTC (rev 8256) @@ -263,6 +263,8 @@ }; #endif +#include + #if defined(NPY_PY3K) #define RETVAL m PyObject *PyInit_umath(void) @@ -303,11 +305,19 @@ /* Add some symbolic constants to the module */ d = PyModule_GetDict(m); +#if defined(NPY_PY3K) + c_api = PyCapsule_New((void *)PyUFunc_API, NULL, NULL); +#else c_api = PyCObject_FromVoidPtr((void *)PyUFunc_API, NULL); - if (PyErr_Occurred()) goto err; +#endif + if (PyErr_Occurred()) { + goto err; + } PyDict_SetItemString(d, "_UFUNC_API", c_api); Py_DECREF(c_api); - if (PyErr_Occurred()) goto err; + if (PyErr_Occurred()) { + goto err; + } s = PyString_FromString("0.4.0"); PyDict_SetItemString(d, "__version__", s); Modified: trunk/numpy/lib/type_check.py =================================================================== --- trunk/numpy/lib/type_check.py 2010-02-22 21:33:56 UTC (rev 8255) +++ trunk/numpy/lib/type_check.py 2010-02-23 09:49:38 UTC (rev 8256) @@ -611,7 +611,7 @@ if dtype.kind not in ['m','M']: raise ValueError, "Not a date-time dtype" - + obj = dtype.metadata[METADATA_DTSTR] class DATETIMEMETA(ctypes.Structure): _fields_ = [('base', ctypes.c_int), @@ -619,11 +619,16 @@ ('den', ctypes.c_int), ('events', ctypes.c_int)] - func = ctypes.pythonapi.PyCObject_AsVoidPtr - func.argtypes = [ctypes.py_object] - func.restype = ctypes.c_void_p - - result = func(ctypes.py_object(obj)) + if sys.version_info[:2] >= (3,1): + func = ctypes.pythonapi.PyCapsule_GetPointer + func.argtypes = [ctypes.py_object, ctypes.c_char_p] + func.restype = ctypes.c_void_p + result = func(ctypes.py_object(obj), ctypes.c_char_p(None)) + else: + func = ctypes.pythonapi.PyCObject_AsVoidPtr + func.argtypes = [ctypes.py_object] + func.restype = ctypes.c_void_p + result = func(ctypes.py_object(obj)) result = ctypes.cast(ctypes.c_void_p(result), ctypes.POINTER(DATETIMEMETA)) struct = result[0] @@ -636,4 +641,4 @@ _unitnum2name = ctypes.cast(ctypes.c_void_p(result), ctypes.POINTER(ctypes.c_char_p)) return (_unitnum2name[base], struct.num, struct.den, struct.events) - + Modified: trunk/numpy/numarray/_capi.c =================================================================== --- trunk/numpy/numarray/_capi.c 2010-02-22 21:33:56 UTC (rev 8255) +++ trunk/numpy/numarray/_capi.c 2010-02-23 09:49:38 UTC (rev 8256) @@ -3380,7 +3380,11 @@ _Error = PyErr_NewException("numpy.numarray._capi.error", NULL, NULL); /* Create a CObject containing the API pointer array's address */ +#if defined(NPY_PY3K) + c_api_object = PyCapsule_New((void *)libnumarray_API, NULL, NULL); +#else c_api_object = PyCObject_FromVoidPtr((void *)libnumarray_API, NULL); +#endif if (c_api_object != NULL) { /* Create a name for this object in the module's namespace */ Modified: trunk/numpy/numarray/include/numpy/libnumarray.h =================================================================== --- trunk/numpy/numarray/include/numpy/libnumarray.h 2010-02-22 21:33:56 UTC (rev 8255) +++ trunk/numpy/numarray/include/numpy/libnumarray.h 2010-02-23 09:49:38 UTC (rev 8256) @@ -1,4 +1,4 @@ -/* Compatibility with numarray. Do not use in new code. +/* Compatibility with numarray. Do not use in new code. */ #ifndef NUMPY_LIBNUMARRAY_H @@ -29,7 +29,7 @@ extension modules are monolithic C files, and likely for good reason. */ -/* C API address pointer */ +/* C API address pointer */ #if defined(NO_IMPORT) || defined(NO_IMPORT_ARRAY) extern void **libnumarray_API; #else @@ -40,37 +40,56 @@ #endif #endif -#define _import_libnumarray() \ - { \ - PyObject *module = PyImport_ImportModule("numpy.numarray._capi"); \ - if (module != NULL) { \ - PyObject *module_dict = PyModule_GetDict(module); \ - PyObject *c_api_object = \ - PyDict_GetItemString(module_dict, "_C_API"); \ - if (c_api_object && PyCObject_Check(c_api_object)) { \ - libnumarray_API = (void **)PyCObject_AsVoidPtr(c_api_object); \ - } else { \ - PyErr_Format(PyExc_ImportError, \ - "Can't get API for module 'numpy.numarray._capi'"); \ - } \ - } \ +#if defined(NPY_PY3K) +#define _import_libnumarray() \ + { \ + PyObject *module = PyImport_ImportModule("numpy.numarray._capi"); \ + if (module != NULL) { \ + PyObject *module_dict = PyModule_GetDict(module); \ + PyObject *c_api_object = \ + PyDict_GetItemString(module_dict, "_C_API"); \ + if (c_api_object && PyCapsule_CheckExact(c_api_object)) { \ + libnumarray_API = (void **)PyCapsule_GetPointer(c_api_object, NULL); \ + } else { \ + PyErr_Format(PyExc_ImportError, \ + "Can't get API for module 'numpy.numarray._capi'"); \ + } \ + } \ } - + +#else +#define _import_libnumarray() \ + { \ + PyObject *module = PyImport_ImportModule("numpy.numarray._capi"); \ + if (module != NULL) { \ + PyObject *module_dict = PyModule_GetDict(module); \ + PyObject *c_api_object = \ + PyDict_GetItemString(module_dict, "_C_API"); \ + if (c_api_object && PyCObject_Check(c_api_object)) { \ + libnumarray_API = (void **)PyCObject_AsVoidPtr(c_api_object); \ + } else { \ + PyErr_Format(PyExc_ImportError, \ + "Can't get API for module 'numpy.numarray._capi'"); \ + } \ + } \ + } +#endif + #define import_libnumarray() _import_libnumarray(); if (PyErr_Occurred()) { PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.numarray._capi failed to import.\n"); return; } - + #endif #define libnumarray_FatalApiError (Py_FatalError("Call to API function without first calling import_libnumarray() in " __FILE__), NULL) - + /* Macros defining components of function prototypes */ #ifdef _libnumarray_MODULE /* This section is used when compiling libnumarray */ static PyObject *_Error; - + static PyObject* getBuffer (PyObject*o); static int isBuffer (PyObject*o); @@ -333,7 +352,7 @@ static PyArrayObject * NA_FromArrayStruct (PyObject *a); - + #else /* This section is used in modules that use libnumarray */ Modified: trunk/numpy/random/mtrand/Python.pxi =================================================================== --- trunk/numpy/random/mtrand/Python.pxi 2010-02-22 21:33:56 UTC (rev 8255) +++ trunk/numpy/random/mtrand/Python.pxi 2010-02-23 09:49:38 UTC (rev 8256) @@ -29,15 +29,15 @@ void Py_XINCREF(object obj) # CObject API - ctypedef void (*destructor1)(void* cobj) - ctypedef void (*destructor2)(void* cobj, void* desc) - int PyCObject_Check(object p) - object PyCObject_FromVoidPtr(void* cobj, destructor1 destr) - object PyCObject_FromVoidPtrAndDesc(void* cobj, void* desc, - destructor2 destr) - void* PyCObject_AsVoidPtr(object self) - void* PyCObject_GetDesc(object self) - int PyCObject_SetVoidPtr(object self, void* cobj) +# ctypedef void (*destructor1)(void* cobj) +# ctypedef void (*destructor2)(void* cobj, void* desc) +# int PyCObject_Check(object p) +# object PyCObject_FromVoidPtr(void* cobj, destructor1 destr) +# object PyCObject_FromVoidPtrAndDesc(void* cobj, void* desc, +# destructor2 destr) +# void* PyCObject_AsVoidPtr(object self) +# void* PyCObject_GetDesc(object self) +# int PyCObject_SetVoidPtr(object self, void* cobj) # TypeCheck API int PyFloat_Check(object obj) @@ -46,7 +46,7 @@ # Error API int PyErr_Occurred() void PyErr_Clear() - + cdef extern from "string.h": void *memcpy(void *s1, void *s2, int n) Modified: trunk/numpy/random/mtrand/mtrand.c =================================================================== --- trunk/numpy/random/mtrand/mtrand.c 2010-02-22 21:33:56 UTC (rev 8255) +++ trunk/numpy/random/mtrand/mtrand.c 2010-02-23 09:49:38 UTC (rev 8256) @@ -1,4 +1,4 @@ -/* Generated by Cython 0.12.1 on Sat Feb 20 22:47:50 2010 */ +/* Generated by Cython 0.12 on Mon Feb 22 20:43:03 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -6,7 +6,6 @@ #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #else - #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif @@ -18,7 +17,6 @@ #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) #define PyDict_Contains(d,o) PySequence_Contains(d,o) #endif - #if PY_VERSION_HEX < 0x02050000 typedef int Py_ssize_t; #define PY_SSIZE_T_MAX INT_MAX @@ -28,9 +26,7 @@ #define PyInt_AsSsize_t(o) PyInt_AsLong(o) #define PyNumber_Index(o) PyNumber_Int(o) #define PyIndex_Check(o) PyNumber_Check(o) - #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) #endif - #if PY_VERSION_HEX < 0x02060000 #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) @@ -40,17 +36,17 @@ #define PyType_Modified(t) typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; + void *buf; + PyObject *obj; + Py_ssize_t len; + Py_ssize_t itemsize; + int readonly; + int ndim; + char *format; + Py_ssize_t *shape; + Py_ssize_t *strides; + Py_ssize_t *suboffsets; + void *internal; } Py_buffer; #define PyBUF_SIMPLE 0 @@ -64,22 +60,18 @@ #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) #endif - #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #endif - #if PY_MAJOR_VERSION >= 3 #define Py_TPFLAGS_CHECKTYPES 0 #define Py_TPFLAGS_HAVE_INDEX 0 #endif - #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif - #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyString_Type PyUnicode_Type @@ -88,7 +80,6 @@ #define PyBytes_Type PyString_Type #define PyBytes_CheckExact PyString_CheckExact #endif - #if PY_MAJOR_VERSION >= 3 #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) @@ -108,13 +99,10 @@ #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) - #endif - #if PY_MAJOR_VERSION >= 3 #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func) #endif - #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall @@ -128,7 +116,6 @@ #else #define _USE_MATH_DEFINES #endif - #if PY_VERSION_HEX < 0x02050000 #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) @@ -138,7 +125,6 @@ #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) #endif - #if PY_VERSION_HEX < 0x02050000 #define __Pyx_NAMESTR(n) ((char *)(n)) #define __Pyx_DOCSTR(n) ((char *)(n)) @@ -161,14 +147,12 @@ #include "distributions.h" #include "initarray.h" -#ifndef CYTHON_INLINE - #if defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #else - #define CYTHON_INLINE - #endif +#ifdef __GNUC__ +#define INLINE __inline__ +#elif _WIN32 +#define INLINE __inline +#else +#define INLINE #endif typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ @@ -190,8 +174,8 @@ #define __Pyx_PyBytes_AsUString(s) ((unsigned char*) __Pyx_PyBytes_AsString(s)) #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); +static INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); #if !defined(T_PYSSIZET) #if PY_VERSION_HEX < 0x02050000 @@ -255,9 +239,9 @@ #endif #endif -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); +static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) @@ -307,7 +291,7 @@ typedef long (*__pyx_t_6mtrand_rk_discd)(rk_state *, double); -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":522 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":522 * return sum * * cdef class RandomState: # <<<<<<<<<<<<<< @@ -374,8 +358,14 @@ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ +static INLINE PyObject* __Pyx_Type(PyObject* o) { + PyObject* type = (PyObject*) Py_TYPE(o); + Py_INCREF(type); + return type; +} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + +static INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); @@ -388,7 +378,7 @@ __Pyx_GetItemInt_List_Fast(o, i, size <= sizeof(long)) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int fits_long) { +static INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int fits_long) { if (likely(o != Py_None)) { if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); @@ -408,7 +398,7 @@ __Pyx_GetItemInt_Tuple_Fast(o, i, size <= sizeof(long)) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int fits_long) { +static INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int fits_long) { if (likely(o != Py_None)) { if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); @@ -429,7 +419,7 @@ __Pyx_GetItemInt_Fast(o, i, size <= sizeof(long)) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int fits_long) { +static INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int fits_long) { PyObject *r; if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) { r = PyList_GET_ITEM(o, i); @@ -448,21 +438,21 @@ return r; } -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); +static INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void); +static INLINE void __Pyx_RaiseTooManyValuesError(void); static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/ static int __Pyx_EndUnpack(PyObject *); /*proto*/ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ -static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, +static INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/ -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ +static INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ -static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) { +static INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (PyList_Append(L, x) < 0) return NULL; Py_INCREF(Py_None); @@ -482,7 +472,7 @@ __Pyx_SetItemInt_Fast(o, i, v, size <= sizeof(long)) : \ __Pyx_SetItemInt_Generic(o, to_py_func(i), v)) -static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { +static INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) { int r; if (!j) return -1; r = PyObject_SetItem(o, j, v); @@ -490,7 +480,7 @@ return r; } -static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int fits_long) { +static INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int fits_long) { if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) { Py_INCREF(v); Py_DECREF(PyList_GET_ITEM(o, i)); @@ -505,49 +495,49 @@ } } -static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); +static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); +static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); +static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *); +static INLINE char __Pyx_PyInt_AsChar(PyObject *); -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *); +static INLINE short __Pyx_PyInt_AsShort(PyObject *); -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *); +static INLINE int __Pyx_PyInt_AsInt(PyObject *); -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); +static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); +static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); +static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); +static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); +static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *); +static INLINE long __Pyx_PyInt_AsLong(PyObject *); -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); +static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); +static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); +static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size, int strict); /*proto*/ +static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size); /*proto*/ static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ @@ -1020,7 +1010,7 @@ static PyObject *__pyx_k_33; static PyObject *__pyx_k_43; -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":128 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":128 * import numpy as np * * cdef object cont0_array(rk_state *state, rk_cont0 func, object size): # <<<<<<<<<<<<<< @@ -1043,7 +1033,7 @@ __Pyx_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":134 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":134 * cdef long i * * if size is None: # <<<<<<<<<<<<<< @@ -1053,7 +1043,7 @@ __pyx_t_1 = (__pyx_v_size == Py_None); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":135 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":135 * * if size is None: * return func(state) # <<<<<<<<<<<<<< @@ -1070,7 +1060,7 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":137 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":137 * return func(state) * else: * array = np.empty(size, np.float64) # <<<<<<<<<<<<<< @@ -1104,7 +1094,7 @@ arrayObject = ((PyArrayObject *)__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":138 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":138 * else: * array = np.empty(size, np.float64) * length = PyArray_SIZE(array) # <<<<<<<<<<<<<< @@ -1113,7 +1103,7 @@ */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":139 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":139 * array = np.empty(size, np.float64) * length = PyArray_SIZE(array) * array_data = array.data # <<<<<<<<<<<<<< @@ -1122,7 +1112,7 @@ */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":140 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":140 * length = PyArray_SIZE(array) * array_data = array.data * for i from 0 <= i < length: # <<<<<<<<<<<<<< @@ -1132,7 +1122,7 @@ __pyx_t_5 = __pyx_v_length; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":141 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":141 * array_data = array.data * for i from 0 <= i < length: * array_data[i] = func(state) # <<<<<<<<<<<<<< @@ -1142,7 +1132,7 @@ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state); } - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":142 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":142 * for i from 0 <= i < length: * array_data[i] = func(state) * return array # <<<<<<<<<<<<<< @@ -1172,7 +1162,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":145 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":145 * * * cdef object cont1_array_sc(rk_state *state, rk_cont1 func, object size, double a): # <<<<<<<<<<<<<< @@ -1195,7 +1185,7 @@ __Pyx_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":151 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":151 * cdef long i * * if size is None: # <<<<<<<<<<<<<< @@ -1205,7 +1195,7 @@ __pyx_t_1 = (__pyx_v_size == Py_None); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":152 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":152 * * if size is None: * return func(state, a) # <<<<<<<<<<<<<< @@ -1222,7 +1212,7 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":154 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":154 * return func(state, a) * else: * array = np.empty(size, np.float64) # <<<<<<<<<<<<<< @@ -1256,7 +1246,7 @@ arrayObject = ((PyArrayObject *)__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":155 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":155 * else: * array = np.empty(size, np.float64) * length = PyArray_SIZE(array) # <<<<<<<<<<<<<< @@ -1265,7 +1255,7 @@ */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":156 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":156 * array = np.empty(size, np.float64) * length = PyArray_SIZE(array) * array_data = array.data # <<<<<<<<<<<<<< @@ -1274,7 +1264,7 @@ */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":157 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":157 * length = PyArray_SIZE(array) * array_data = array.data * for i from 0 <= i < length: # <<<<<<<<<<<<<< @@ -1284,7 +1274,7 @@ __pyx_t_5 = __pyx_v_length; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":158 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":158 * array_data = array.data * for i from 0 <= i < length: * array_data[i] = func(state, a) # <<<<<<<<<<<<<< @@ -1294,7 +1284,7 @@ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, __pyx_v_a); } - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":159 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":159 * for i from 0 <= i < length: * array_data[i] = func(state, a) * return array # <<<<<<<<<<<<<< @@ -1324,7 +1314,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":161 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":161 * return array * * cdef object cont1_array(rk_state *state, rk_cont1 func, object size, ndarray oa): # <<<<<<<<<<<<<< @@ -1353,7 +1343,7 @@ __pyx_v_itera = ((PyArrayIterObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":170 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":170 * cdef broadcast multi * * if size is None: # <<<<<<<<<<<<<< @@ -1363,7 +1353,7 @@ __pyx_t_1 = (__pyx_v_size == Py_None); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":171 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":171 * * if size is None: * array = PyArray_SimpleNew(oa.nd, oa.dimensions, NPY_DOUBLE) # <<<<<<<<<<<<<< @@ -1377,7 +1367,7 @@ arrayObject = ((PyArrayObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":172 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":172 * if size is None: * array = PyArray_SimpleNew(oa.nd, oa.dimensions, NPY_DOUBLE) * length = PyArray_SIZE(array) # <<<<<<<<<<<<<< @@ -1386,7 +1376,7 @@ */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":173 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":173 * array = PyArray_SimpleNew(oa.nd, oa.dimensions, NPY_DOUBLE) * length = PyArray_SIZE(array) * array_data = array.data # <<<<<<<<<<<<<< @@ -1395,7 +1385,7 @@ */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":174 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":174 * length = PyArray_SIZE(array) * array_data = array.data * itera = PyArray_IterNew(oa) # <<<<<<<<<<<<<< @@ -1409,7 +1399,7 @@ __pyx_v_itera = ((PyArrayIterObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":175 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":175 * array_data = array.data * itera = PyArray_IterNew(oa) * for i from 0 <= i < length: # <<<<<<<<<<<<<< @@ -1419,7 +1409,7 @@ __pyx_t_3 = __pyx_v_length; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":176 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":176 * itera = PyArray_IterNew(oa) * for i from 0 <= i < length: * array_data[i] = func(state, ((itera.dataptr))[0]) # <<<<<<<<<<<<<< @@ -1428,7 +1418,7 @@ */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (((double *)__pyx_v_itera->dataptr)[0])); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":177 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":177 * for i from 0 <= i < length: * array_data[i] = func(state, ((itera.dataptr))[0]) * PyArray_ITER_NEXT(itera) # <<<<<<<<<<<<<< @@ -1441,7 +1431,7 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":179 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":179 * PyArray_ITER_NEXT(itera) * else: * array = np.empty(size, np.float64) # <<<<<<<<<<<<<< @@ -1475,7 +1465,7 @@ arrayObject = ((PyArrayObject *)__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":180 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":180 * else: * array = np.empty(size, np.float64) * array_data = array.data # <<<<<<<<<<<<<< @@ -1484,7 +1474,7 @@ */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":182 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":182 * array_data = array.data * multi = PyArray_MultiIterNew(2, array, * oa) # <<<<<<<<<<<<<< @@ -1498,7 +1488,7 @@ __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":183 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":183 * multi = PyArray_MultiIterNew(2, array, * oa) * if (multi.size != PyArray_SIZE(array)): # <<<<<<<<<<<<<< @@ -1508,7 +1498,7 @@ __pyx_t_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":184 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":184 * oa) * if (multi.size != PyArray_SIZE(array)): * raise ValueError("size is not compatible with inputs") # <<<<<<<<<<<<<< @@ -1530,7 +1520,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":185 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":185 * if (multi.size != PyArray_SIZE(array)): * raise ValueError("size is not compatible with inputs") * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<< @@ -1540,7 +1530,7 @@ __pyx_t_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":186 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":186 * raise ValueError("size is not compatible with inputs") * for i from 0 <= i < multi.size: * oa_data = PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<< @@ -1549,7 +1539,7 @@ */ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 1)); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":187 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":187 * for i from 0 <= i < multi.size: * oa_data = PyArray_MultiIter_DATA(multi, 1) * array_data[i] = func(state, oa_data[0]) # <<<<<<<<<<<<<< @@ -1558,7 +1548,7 @@ */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_oa_data[0])); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":188 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":188 * oa_data = PyArray_MultiIter_DATA(multi, 1) * array_data[i] = func(state, oa_data[0]) * PyArray_MultiIter_NEXTi(multi, 1) # <<<<<<<<<<<<<< @@ -1570,7 +1560,7 @@ } __pyx_L3:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":189 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":189 * array_data[i] = func(state, oa_data[0]) * PyArray_MultiIter_NEXTi(multi, 1) * return array # <<<<<<<<<<<<<< @@ -1601,7 +1591,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":191 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":191 * return array * * cdef object cont2_array_sc(rk_state *state, rk_cont2 func, object size, double a, # <<<<<<<<<<<<<< @@ -1624,7 +1614,7 @@ __Pyx_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":198 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":198 * cdef long i * * if size is None: # <<<<<<<<<<<<<< @@ -1634,7 +1624,7 @@ __pyx_t_1 = (__pyx_v_size == Py_None); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":199 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":199 * * if size is None: * return func(state, a, b) # <<<<<<<<<<<<<< @@ -1651,7 +1641,7 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":201 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":201 * return func(state, a, b) * else: * array = np.empty(size, np.float64) # <<<<<<<<<<<<<< @@ -1685,7 +1675,7 @@ arrayObject = ((PyArrayObject *)__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":202 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":202 * else: * array = np.empty(size, np.float64) * length = PyArray_SIZE(array) # <<<<<<<<<<<<<< @@ -1694,7 +1684,7 @@ */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":203 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":203 * array = np.empty(size, np.float64) * length = PyArray_SIZE(array) * array_data = array.data # <<<<<<<<<<<<<< @@ -1703,7 +1693,7 @@ */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":204 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":204 * length = PyArray_SIZE(array) * array_data = array.data * for i from 0 <= i < length: # <<<<<<<<<<<<<< @@ -1713,7 +1703,7 @@ __pyx_t_5 = __pyx_v_length; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":205 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":205 * array_data = array.data * for i from 0 <= i < length: * array_data[i] = func(state, a, b) # <<<<<<<<<<<<<< @@ -1723,7 +1713,7 @@ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, __pyx_v_a, __pyx_v_b); } - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":206 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":206 * for i from 0 <= i < length: * array_data[i] = func(state, a, b) * return array # <<<<<<<<<<<<<< @@ -1753,7 +1743,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":209 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":209 * * * cdef object cont2_array(rk_state *state, rk_cont2 func, object size, # <<<<<<<<<<<<<< @@ -1781,7 +1771,7 @@ arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":219 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":219 * cdef broadcast multi * * if size is None: # <<<<<<<<<<<<<< @@ -1791,7 +1781,7 @@ __pyx_t_1 = (__pyx_v_size == Py_None); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":220 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":220 * * if size is None: * multi = PyArray_MultiIterNew(2, oa, ob) # <<<<<<<<<<<<<< @@ -1805,7 +1795,7 @@ __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":221 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":221 * if size is None: * multi = PyArray_MultiIterNew(2, oa, ob) * array = PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_DOUBLE) # <<<<<<<<<<<<<< @@ -1819,7 +1809,7 @@ arrayObject = ((PyArrayObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":222 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":222 * multi = PyArray_MultiIterNew(2, oa, ob) * array = PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_DOUBLE) * array_data = array.data # <<<<<<<<<<<<<< @@ -1828,7 +1818,7 @@ */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":223 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":223 * array = PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_DOUBLE) * array_data = array.data * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<< @@ -1838,7 +1828,7 @@ __pyx_t_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":224 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":224 * array_data = array.data * for i from 0 <= i < multi.size: * oa_data = PyArray_MultiIter_DATA(multi, 0) # <<<<<<<<<<<<<< @@ -1847,7 +1837,7 @@ */ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 0)); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":225 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":225 * for i from 0 <= i < multi.size: * oa_data = PyArray_MultiIter_DATA(multi, 0) * ob_data = PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<< @@ -1856,7 +1846,7 @@ */ __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 1)); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":226 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":226 * oa_data = PyArray_MultiIter_DATA(multi, 0) * ob_data = PyArray_MultiIter_DATA(multi, 1) * array_data[i] = func(state, oa_data[0], ob_data[0]) # <<<<<<<<<<<<<< @@ -1865,7 +1855,7 @@ */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_oa_data[0]), (__pyx_v_ob_data[0])); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":227 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":227 * ob_data = PyArray_MultiIter_DATA(multi, 1) * array_data[i] = func(state, oa_data[0], ob_data[0]) * PyArray_MultiIter_NEXT(multi) # <<<<<<<<<<<<<< @@ -1878,7 +1868,7 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":229 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":229 * PyArray_MultiIter_NEXT(multi) * else: * array = np.empty(size, np.float64) # <<<<<<<<<<<<<< @@ -1912,7 +1902,7 @@ arrayObject = ((PyArrayObject *)__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":230 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":230 * else: * array = np.empty(size, np.float64) * array_data = array.data # <<<<<<<<<<<<<< @@ -1921,7 +1911,7 @@ */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":231 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":231 * array = np.empty(size, np.float64) * array_data = array.data * multi = PyArray_MultiIterNew(3, array, oa, ob) # <<<<<<<<<<<<<< @@ -1935,7 +1925,7 @@ __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":232 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":232 * array_data = array.data * multi = PyArray_MultiIterNew(3, array, oa, ob) * if (multi.size != PyArray_SIZE(array)): # <<<<<<<<<<<<<< @@ -1945,7 +1935,7 @@ __pyx_t_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":233 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":233 * multi = PyArray_MultiIterNew(3, array, oa, ob) * if (multi.size != PyArray_SIZE(array)): * raise ValueError("size is not compatible with inputs") # <<<<<<<<<<<<<< @@ -1967,7 +1957,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":234 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":234 * if (multi.size != PyArray_SIZE(array)): * raise ValueError("size is not compatible with inputs") * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<< @@ -1977,7 +1967,7 @@ __pyx_t_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":235 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":235 * raise ValueError("size is not compatible with inputs") * for i from 0 <= i < multi.size: * oa_data = PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<< @@ -1986,7 +1976,7 @@ */ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 1)); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":236 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":236 * for i from 0 <= i < multi.size: * oa_data = PyArray_MultiIter_DATA(multi, 1) * ob_data = PyArray_MultiIter_DATA(multi, 2) # <<<<<<<<<<<<<< @@ -1995,7 +1985,7 @@ */ __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 2)); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":237 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":237 * oa_data = PyArray_MultiIter_DATA(multi, 1) * ob_data = PyArray_MultiIter_DATA(multi, 2) * array_data[i] = func(state, oa_data[0], ob_data[0]) # <<<<<<<<<<<<<< @@ -2004,7 +1994,7 @@ */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_oa_data[0]), (__pyx_v_ob_data[0])); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":238 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":238 * ob_data = PyArray_MultiIter_DATA(multi, 2) * array_data[i] = func(state, oa_data[0], ob_data[0]) * PyArray_MultiIter_NEXTi(multi, 1) # <<<<<<<<<<<<<< @@ -2013,7 +2003,7 @@ */ PyArray_MultiIter_NEXTi(__pyx_v_multi, 1); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":239 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":239 * array_data[i] = func(state, oa_data[0], ob_data[0]) * PyArray_MultiIter_NEXTi(multi, 1) * PyArray_MultiIter_NEXTi(multi, 2) # <<<<<<<<<<<<<< @@ -2025,7 +2015,7 @@ } __pyx_L3:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":240 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":240 * PyArray_MultiIter_NEXTi(multi, 1) * PyArray_MultiIter_NEXTi(multi, 2) * return array # <<<<<<<<<<<<<< @@ -2056,7 +2046,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":242 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":242 * return array * * cdef object cont3_array_sc(rk_state *state, rk_cont3 func, object size, double a, # <<<<<<<<<<<<<< @@ -2079,7 +2069,7 @@ __Pyx_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":250 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":250 * cdef long i * * if size is None: # <<<<<<<<<<<<<< @@ -2089,7 +2079,7 @@ __pyx_t_1 = (__pyx_v_size == Py_None); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":251 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":251 * * if size is None: * return func(state, a, b, c) # <<<<<<<<<<<<<< @@ -2106,7 +2096,7 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":253 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":253 * return func(state, a, b, c) * else: * array = np.empty(size, np.float64) # <<<<<<<<<<<<<< @@ -2140,7 +2130,7 @@ arrayObject = ((PyArrayObject *)__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":254 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":254 * else: * array = np.empty(size, np.float64) * length = PyArray_SIZE(array) # <<<<<<<<<<<<<< @@ -2149,7 +2139,7 @@ */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":255 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":255 * array = np.empty(size, np.float64) * length = PyArray_SIZE(array) * array_data = array.data # <<<<<<<<<<<<<< @@ -2158,7 +2148,7 @@ */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":256 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":256 * length = PyArray_SIZE(array) * array_data = array.data * for i from 0 <= i < length: # <<<<<<<<<<<<<< @@ -2168,7 +2158,7 @@ __pyx_t_5 = __pyx_v_length; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":257 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":257 * array_data = array.data * for i from 0 <= i < length: * array_data[i] = func(state, a, b, c) # <<<<<<<<<<<<<< @@ -2178,7 +2168,7 @@ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, __pyx_v_a, __pyx_v_b, __pyx_v_c); } - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":258 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":258 * for i from 0 <= i < length: * array_data[i] = func(state, a, b, c) * return array # <<<<<<<<<<<<<< @@ -2208,7 +2198,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":260 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":260 * return array * * cdef object cont3_array(rk_state *state, rk_cont3 func, object size, ndarray oa, # <<<<<<<<<<<<<< @@ -2238,7 +2228,7 @@ arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":272 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":272 * cdef broadcast multi * * if size is None: # <<<<<<<<<<<<<< @@ -2248,7 +2238,7 @@ __pyx_t_1 = (__pyx_v_size == Py_None); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":273 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":273 * * if size is None: * multi = PyArray_MultiIterNew(3, oa, ob, oc) # <<<<<<<<<<<<<< @@ -2262,7 +2252,7 @@ __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":274 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":274 * if size is None: * multi = PyArray_MultiIterNew(3, oa, ob, oc) * array = PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_DOUBLE) # <<<<<<<<<<<<<< @@ -2276,7 +2266,7 @@ arrayObject = ((PyArrayObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":275 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":275 * multi = PyArray_MultiIterNew(3, oa, ob, oc) * array = PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_DOUBLE) * array_data = array.data # <<<<<<<<<<<<<< @@ -2285,7 +2275,7 @@ */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":276 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":276 * array = PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_DOUBLE) * array_data = array.data * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<< @@ -2295,7 +2285,7 @@ __pyx_t_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":277 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":277 * array_data = array.data * for i from 0 <= i < multi.size: * oa_data = PyArray_MultiIter_DATA(multi, 0) # <<<<<<<<<<<<<< @@ -2304,7 +2294,7 @@ */ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 0)); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":278 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":278 * for i from 0 <= i < multi.size: * oa_data = PyArray_MultiIter_DATA(multi, 0) * ob_data = PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<< @@ -2313,7 +2303,7 @@ */ __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 1)); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":279 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":279 * oa_data = PyArray_MultiIter_DATA(multi, 0) * ob_data = PyArray_MultiIter_DATA(multi, 1) * oc_data = PyArray_MultiIter_DATA(multi, 2) # <<<<<<<<<<<<<< @@ -2322,7 +2312,7 @@ */ __pyx_v_oc_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 2)); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":280 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":280 * ob_data = PyArray_MultiIter_DATA(multi, 1) * oc_data = PyArray_MultiIter_DATA(multi, 2) * array_data[i] = func(state, oa_data[0], ob_data[0], oc_data[0]) # <<<<<<<<<<<<<< @@ -2331,7 +2321,7 @@ */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_oa_data[0]), (__pyx_v_ob_data[0]), (__pyx_v_oc_data[0])); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":281 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":281 * oc_data = PyArray_MultiIter_DATA(multi, 2) * array_data[i] = func(state, oa_data[0], ob_data[0], oc_data[0]) * PyArray_MultiIter_NEXT(multi) # <<<<<<<<<<<<<< @@ -2344,7 +2334,7 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":283 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":283 * PyArray_MultiIter_NEXT(multi) * else: * array = np.empty(size, np.float64) # <<<<<<<<<<<<<< @@ -2378,7 +2368,7 @@ arrayObject = ((PyArrayObject *)__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":284 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":284 * else: * array = np.empty(size, np.float64) * array_data = array.data # <<<<<<<<<<<<<< @@ -2387,7 +2377,7 @@ */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":286 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":286 * array_data = array.data * multi = PyArray_MultiIterNew(4, array, oa, * ob, oc) # <<<<<<<<<<<<<< @@ -2401,7 +2391,7 @@ __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":287 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":287 * multi = PyArray_MultiIterNew(4, array, oa, * ob, oc) * if (multi.size != PyArray_SIZE(array)): # <<<<<<<<<<<<<< @@ -2411,7 +2401,7 @@ __pyx_t_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":288 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":288 * ob, oc) * if (multi.size != PyArray_SIZE(array)): * raise ValueError("size is not compatible with inputs") # <<<<<<<<<<<<<< @@ -2433,7 +2423,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":289 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":289 * if (multi.size != PyArray_SIZE(array)): * raise ValueError("size is not compatible with inputs") * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<< @@ -2443,7 +2433,7 @@ __pyx_t_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":290 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":290 * raise ValueError("size is not compatible with inputs") * for i from 0 <= i < multi.size: * oa_data = PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<< @@ -2452,7 +2442,7 @@ */ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 1)); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":291 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":291 * for i from 0 <= i < multi.size: * oa_data = PyArray_MultiIter_DATA(multi, 1) * ob_data = PyArray_MultiIter_DATA(multi, 2) # <<<<<<<<<<<<<< @@ -2461,7 +2451,7 @@ */ __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 2)); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":292 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":292 * oa_data = PyArray_MultiIter_DATA(multi, 1) * ob_data = PyArray_MultiIter_DATA(multi, 2) * oc_data = PyArray_MultiIter_DATA(multi, 3) # <<<<<<<<<<<<<< @@ -2470,7 +2460,7 @@ */ __pyx_v_oc_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 3)); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":293 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":293 * ob_data = PyArray_MultiIter_DATA(multi, 2) * oc_data = PyArray_MultiIter_DATA(multi, 3) * array_data[i] = func(state, oa_data[0], ob_data[0], oc_data[0]) # <<<<<<<<<<<<<< @@ -2479,7 +2469,7 @@ */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_oa_data[0]), (__pyx_v_ob_data[0]), (__pyx_v_oc_data[0])); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":294 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":294 * oc_data = PyArray_MultiIter_DATA(multi, 3) * array_data[i] = func(state, oa_data[0], ob_data[0], oc_data[0]) * PyArray_MultiIter_NEXT(multi) # <<<<<<<<<<<<<< @@ -2491,7 +2481,7 @@ } __pyx_L3:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":295 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":295 * array_data[i] = func(state, oa_data[0], ob_data[0], oc_data[0]) * PyArray_MultiIter_NEXT(multi) * return array # <<<<<<<<<<<<<< @@ -2523,7 +2513,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":297 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":297 * return array * * cdef object disc0_array(rk_state *state, rk_disc0 func, object size): # <<<<<<<<<<<<<< @@ -2546,7 +2536,7 @@ __Pyx_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":303 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":303 * cdef long i * * if size is None: # <<<<<<<<<<<<<< @@ -2556,7 +2546,7 @@ __pyx_t_1 = (__pyx_v_size == Py_None); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":304 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":304 * * if size is None: * return func(state) # <<<<<<<<<<<<<< @@ -2573,7 +2563,7 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":306 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":306 * return func(state) * else: * array = np.empty(size, int) # <<<<<<<<<<<<<< @@ -2602,7 +2592,7 @@ arrayObject = ((PyArrayObject *)__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":307 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":307 * else: * array = np.empty(size, int) * length = PyArray_SIZE(array) # <<<<<<<<<<<<<< @@ -2611,7 +2601,7 @@ */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":308 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":308 * array = np.empty(size, int) * length = PyArray_SIZE(array) * array_data = array.data # <<<<<<<<<<<<<< @@ -2620,7 +2610,7 @@ */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":309 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":309 * length = PyArray_SIZE(array) * array_data = array.data * for i from 0 <= i < length: # <<<<<<<<<<<<<< @@ -2630,7 +2620,7 @@ __pyx_t_5 = __pyx_v_length; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":310 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":310 * array_data = array.data * for i from 0 <= i < length: * array_data[i] = func(state) # <<<<<<<<<<<<<< @@ -2640,7 +2630,7 @@ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state); } - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":311 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":311 * for i from 0 <= i < length: * array_data[i] = func(state) * return array # <<<<<<<<<<<<<< @@ -2670,7 +2660,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":313 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":313 * return array * * cdef object discnp_array_sc(rk_state *state, rk_discnp func, object size, long n, double p): # <<<<<<<<<<<<<< @@ -2693,7 +2683,7 @@ __Pyx_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":319 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":319 * cdef long i * * if size is None: # <<<<<<<<<<<<<< @@ -2703,7 +2693,7 @@ __pyx_t_1 = (__pyx_v_size == Py_None); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":320 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":320 * * if size is None: * return func(state, n, p) # <<<<<<<<<<<<<< @@ -2720,7 +2710,7 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":322 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":322 * return func(state, n, p) * else: * array = np.empty(size, int) # <<<<<<<<<<<<<< @@ -2749,7 +2739,7 @@ arrayObject = ((PyArrayObject *)__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":323 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":323 * else: * array = np.empty(size, int) * length = PyArray_SIZE(array) # <<<<<<<<<<<<<< @@ -2758,7 +2748,7 @@ */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":324 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":324 * array = np.empty(size, int) * length = PyArray_SIZE(array) * array_data = array.data # <<<<<<<<<<<<<< @@ -2767,7 +2757,7 @@ */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":325 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":325 * length = PyArray_SIZE(array) * array_data = array.data * for i from 0 <= i < length: # <<<<<<<<<<<<<< @@ -2777,7 +2767,7 @@ __pyx_t_5 = __pyx_v_length; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":326 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":326 * array_data = array.data * for i from 0 <= i < length: * array_data[i] = func(state, n, p) # <<<<<<<<<<<<<< @@ -2787,7 +2777,7 @@ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, __pyx_v_n, __pyx_v_p); } - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":327 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":327 * for i from 0 <= i < length: * array_data[i] = func(state, n, p) * return array # <<<<<<<<<<<<<< @@ -2817,7 +2807,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":329 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":329 * return array * * cdef object discnp_array(rk_state *state, rk_discnp func, object size, ndarray on, ndarray op): # <<<<<<<<<<<<<< @@ -2845,7 +2835,7 @@ arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":338 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":338 * cdef broadcast multi * * if size is None: # <<<<<<<<<<<<<< @@ -2855,7 +2845,7 @@ __pyx_t_1 = (__pyx_v_size == Py_None); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":339 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":339 * * if size is None: * multi = PyArray_MultiIterNew(2, on, op) # <<<<<<<<<<<<<< @@ -2869,7 +2859,7 @@ __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":340 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":340 * if size is None: * multi = PyArray_MultiIterNew(2, on, op) * array = PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG) # <<<<<<<<<<<<<< @@ -2883,7 +2873,7 @@ arrayObject = ((PyArrayObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":341 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":341 * multi = PyArray_MultiIterNew(2, on, op) * array = PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG) * array_data = array.data # <<<<<<<<<<<<<< @@ -2892,7 +2882,7 @@ */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":342 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":342 * array = PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG) * array_data = array.data * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<< @@ -2902,7 +2892,7 @@ __pyx_t_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":343 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":343 * array_data = array.data * for i from 0 <= i < multi.size: * on_data = PyArray_MultiIter_DATA(multi, 0) # <<<<<<<<<<<<<< @@ -2911,7 +2901,7 @@ */ __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi, 0)); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":344 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":344 * for i from 0 <= i < multi.size: * on_data = PyArray_MultiIter_DATA(multi, 0) * op_data = PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<< @@ -2920,7 +2910,7 @@ */ __pyx_v_op_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 1)); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":345 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":345 * on_data = PyArray_MultiIter_DATA(multi, 0) * op_data = PyArray_MultiIter_DATA(multi, 1) * array_data[i] = func(state, on_data[0], op_data[0]) # <<<<<<<<<<<<<< @@ -2929,7 +2919,7 @@ */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_on_data[0]), (__pyx_v_op_data[0])); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":346 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":346 * op_data = PyArray_MultiIter_DATA(multi, 1) * array_data[i] = func(state, on_data[0], op_data[0]) * PyArray_MultiIter_NEXT(multi) # <<<<<<<<<<<<<< @@ -2942,7 +2932,7 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":348 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":348 * PyArray_MultiIter_NEXT(multi) * else: * array = np.empty(size, int) # <<<<<<<<<<<<<< @@ -2971,7 +2961,7 @@ arrayObject = ((PyArrayObject *)__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":349 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":349 * else: * array = np.empty(size, int) * array_data = array.data # <<<<<<<<<<<<<< @@ -2980,7 +2970,7 @@ */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":350 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":350 * array = np.empty(size, int) * array_data = array.data * multi = PyArray_MultiIterNew(3, array, on, op) # <<<<<<<<<<<<<< @@ -2994,7 +2984,7 @@ __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":351 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":351 * array_data = array.data * multi = PyArray_MultiIterNew(3, array, on, op) * if (multi.size != PyArray_SIZE(array)): # <<<<<<<<<<<<<< @@ -3004,7 +2994,7 @@ __pyx_t_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":352 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":352 * multi = PyArray_MultiIterNew(3, array, on, op) * if (multi.size != PyArray_SIZE(array)): * raise ValueError("size is not compatible with inputs") # <<<<<<<<<<<<<< @@ -3026,7 +3016,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":353 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":353 * if (multi.size != PyArray_SIZE(array)): * raise ValueError("size is not compatible with inputs") * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<< @@ -3036,7 +3026,7 @@ __pyx_t_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":354 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":354 * raise ValueError("size is not compatible with inputs") * for i from 0 <= i < multi.size: * on_data = PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<< @@ -3045,7 +3035,7 @@ */ __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi, 1)); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":355 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":355 * for i from 0 <= i < multi.size: * on_data = PyArray_MultiIter_DATA(multi, 1) * op_data = PyArray_MultiIter_DATA(multi, 2) # <<<<<<<<<<<<<< @@ -3054,7 +3044,7 @@ */ __pyx_v_op_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 2)); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":356 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":356 * on_data = PyArray_MultiIter_DATA(multi, 1) * op_data = PyArray_MultiIter_DATA(multi, 2) * array_data[i] = func(state, on_data[0], op_data[0]) # <<<<<<<<<<<<<< @@ -3063,7 +3053,7 @@ */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_on_data[0]), (__pyx_v_op_data[0])); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":357 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":357 * op_data = PyArray_MultiIter_DATA(multi, 2) * array_data[i] = func(state, on_data[0], op_data[0]) * PyArray_MultiIter_NEXTi(multi, 1) # <<<<<<<<<<<<<< @@ -3072,7 +3062,7 @@ */ PyArray_MultiIter_NEXTi(__pyx_v_multi, 1); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":358 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":358 * array_data[i] = func(state, on_data[0], op_data[0]) * PyArray_MultiIter_NEXTi(multi, 1) * PyArray_MultiIter_NEXTi(multi, 2) # <<<<<<<<<<<<<< @@ -3084,7 +3074,7 @@ } __pyx_L3:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":360 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":360 * PyArray_MultiIter_NEXTi(multi, 2) * * return array # <<<<<<<<<<<<<< @@ -3115,7 +3105,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":362 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":362 * return array * * cdef object discdd_array_sc(rk_state *state, rk_discdd func, object size, double n, double p): # <<<<<<<<<<<<<< @@ -3138,7 +3128,7 @@ __Pyx_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":368 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":368 * cdef long i * * if size is None: # <<<<<<<<<<<<<< @@ -3148,7 +3138,7 @@ __pyx_t_1 = (__pyx_v_size == Py_None); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":369 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":369 * * if size is None: * return func(state, n, p) # <<<<<<<<<<<<<< @@ -3165,7 +3155,7 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":371 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":371 * return func(state, n, p) * else: * array = np.empty(size, int) # <<<<<<<<<<<<<< @@ -3194,7 +3184,7 @@ arrayObject = ((PyArrayObject *)__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":372 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":372 * else: * array = np.empty(size, int) * length = PyArray_SIZE(array) # <<<<<<<<<<<<<< @@ -3203,7 +3193,7 @@ */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":373 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":373 * array = np.empty(size, int) * length = PyArray_SIZE(array) * array_data = array.data # <<<<<<<<<<<<<< @@ -3212,7 +3202,7 @@ */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":374 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":374 * length = PyArray_SIZE(array) * array_data = array.data * for i from 0 <= i < length: # <<<<<<<<<<<<<< @@ -3222,7 +3212,7 @@ __pyx_t_5 = __pyx_v_length; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":375 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":375 * array_data = array.data * for i from 0 <= i < length: * array_data[i] = func(state, n, p) # <<<<<<<<<<<<<< @@ -3232,7 +3222,7 @@ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, __pyx_v_n, __pyx_v_p); } - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":376 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":376 * for i from 0 <= i < length: * array_data[i] = func(state, n, p) * return array # <<<<<<<<<<<<<< @@ -3262,7 +3252,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":378 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":378 * return array * * cdef object discdd_array(rk_state *state, rk_discdd func, object size, ndarray on, ndarray op): # <<<<<<<<<<<<<< @@ -3290,7 +3280,7 @@ arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":387 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":387 * cdef broadcast multi * * if size is None: # <<<<<<<<<<<<<< @@ -3300,7 +3290,7 @@ __pyx_t_1 = (__pyx_v_size == Py_None); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":388 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":388 * * if size is None: * multi = PyArray_MultiIterNew(2, on, op) # <<<<<<<<<<<<<< @@ -3314,7 +3304,7 @@ __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":389 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":389 * if size is None: * multi = PyArray_MultiIterNew(2, on, op) * array = PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG) # <<<<<<<<<<<<<< @@ -3328,7 +3318,7 @@ arrayObject = ((PyArrayObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":390 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":390 * multi = PyArray_MultiIterNew(2, on, op) * array = PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG) * array_data = array.data # <<<<<<<<<<<<<< @@ -3337,7 +3327,7 @@ */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":391 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":391 * array = PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG) * array_data = array.data * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<< @@ -3347,7 +3337,7 @@ __pyx_t_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":392 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":392 * array_data = array.data * for i from 0 <= i < multi.size: * on_data = PyArray_MultiIter_DATA(multi, 0) # <<<<<<<<<<<<<< @@ -3356,7 +3346,7 @@ */ __pyx_v_on_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 0)); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":393 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":393 * for i from 0 <= i < multi.size: * on_data = PyArray_MultiIter_DATA(multi, 0) * op_data = PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<< @@ -3365,7 +3355,7 @@ */ __pyx_v_op_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 1)); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":394 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":394 * on_data = PyArray_MultiIter_DATA(multi, 0) * op_data = PyArray_MultiIter_DATA(multi, 1) * array_data[i] = func(state, on_data[0], op_data[0]) # <<<<<<<<<<<<<< @@ -3374,7 +3364,7 @@ */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_on_data[0]), (__pyx_v_op_data[0])); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":395 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":395 * op_data = PyArray_MultiIter_DATA(multi, 1) * array_data[i] = func(state, on_data[0], op_data[0]) * PyArray_MultiIter_NEXT(multi) # <<<<<<<<<<<<<< @@ -3387,7 +3377,7 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":397 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":397 * PyArray_MultiIter_NEXT(multi) * else: * array = np.empty(size, int) # <<<<<<<<<<<<<< @@ -3416,7 +3406,7 @@ arrayObject = ((PyArrayObject *)__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":398 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":398 * else: * array = np.empty(size, int) * array_data = array.data # <<<<<<<<<<<<<< @@ -3425,7 +3415,7 @@ */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":399 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":399 * array = np.empty(size, int) * array_data = array.data * multi = PyArray_MultiIterNew(3, array, on, op) # <<<<<<<<<<<<<< @@ -3439,7 +3429,7 @@ __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":400 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":400 * array_data = array.data * multi = PyArray_MultiIterNew(3, array, on, op) * if (multi.size != PyArray_SIZE(array)): # <<<<<<<<<<<<<< @@ -3449,7 +3439,7 @@ __pyx_t_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":401 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":401 * multi = PyArray_MultiIterNew(3, array, on, op) * if (multi.size != PyArray_SIZE(array)): * raise ValueError("size is not compatible with inputs") # <<<<<<<<<<<<<< @@ -3471,7 +3461,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":402 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":402 * if (multi.size != PyArray_SIZE(array)): * raise ValueError("size is not compatible with inputs") * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<< @@ -3481,7 +3471,7 @@ __pyx_t_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":403 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":403 * raise ValueError("size is not compatible with inputs") * for i from 0 <= i < multi.size: * on_data = PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<< @@ -3490,7 +3480,7 @@ */ __pyx_v_on_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 1)); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":404 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":404 * for i from 0 <= i < multi.size: * on_data = PyArray_MultiIter_DATA(multi, 1) * op_data = PyArray_MultiIter_DATA(multi, 2) # <<<<<<<<<<<<<< @@ -3499,7 +3489,7 @@ */ __pyx_v_op_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 2)); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":405 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":405 * on_data = PyArray_MultiIter_DATA(multi, 1) * op_data = PyArray_MultiIter_DATA(multi, 2) * array_data[i] = func(state, on_data[0], op_data[0]) # <<<<<<<<<<<<<< @@ -3508,7 +3498,7 @@ */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_on_data[0]), (__pyx_v_op_data[0])); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":406 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":406 * op_data = PyArray_MultiIter_DATA(multi, 2) * array_data[i] = func(state, on_data[0], op_data[0]) * PyArray_MultiIter_NEXTi(multi, 1) # <<<<<<<<<<<<<< @@ -3517,7 +3507,7 @@ */ PyArray_MultiIter_NEXTi(__pyx_v_multi, 1); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":407 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":407 * array_data[i] = func(state, on_data[0], op_data[0]) * PyArray_MultiIter_NEXTi(multi, 1) * PyArray_MultiIter_NEXTi(multi, 2) # <<<<<<<<<<<<<< @@ -3529,7 +3519,7 @@ } __pyx_L3:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":409 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":409 * PyArray_MultiIter_NEXTi(multi, 2) * * return array # <<<<<<<<<<<<<< @@ -3560,7 +3550,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":411 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":411 * return array * * cdef object discnmN_array_sc(rk_state *state, rk_discnmN func, object size, # <<<<<<<<<<<<<< @@ -3583,7 +3573,7 @@ __Pyx_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":418 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":418 * cdef long i * * if size is None: # <<<<<<<<<<<<<< @@ -3593,7 +3583,7 @@ __pyx_t_1 = (__pyx_v_size == Py_None); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":419 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":419 * * if size is None: * return func(state, n, m, N) # <<<<<<<<<<<<<< @@ -3610,7 +3600,7 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":421 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":421 * return func(state, n, m, N) * else: * array = np.empty(size, int) # <<<<<<<<<<<<<< @@ -3639,7 +3629,7 @@ arrayObject = ((PyArrayObject *)__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":422 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":422 * else: * array = np.empty(size, int) * length = PyArray_SIZE(array) # <<<<<<<<<<<<<< @@ -3648,7 +3638,7 @@ */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":423 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":423 * array = np.empty(size, int) * length = PyArray_SIZE(array) * array_data = array.data # <<<<<<<<<<<<<< @@ -3657,7 +3647,7 @@ */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":424 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":424 * length = PyArray_SIZE(array) * array_data = array.data * for i from 0 <= i < length: # <<<<<<<<<<<<<< @@ -3667,7 +3657,7 @@ __pyx_t_5 = __pyx_v_length; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":425 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":425 * array_data = array.data * for i from 0 <= i < length: * array_data[i] = func(state, n, m, N) # <<<<<<<<<<<<<< @@ -3677,7 +3667,7 @@ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, __pyx_v_n, __pyx_v_m, __pyx_v_N); } - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":426 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":426 * for i from 0 <= i < length: * array_data[i] = func(state, n, m, N) * return array # <<<<<<<<<<<<<< @@ -3707,7 +3697,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":428 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":428 * return array * * cdef object discnmN_array(rk_state *state, rk_discnmN func, object size, # <<<<<<<<<<<<<< @@ -3737,7 +3727,7 @@ arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":439 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":439 * cdef broadcast multi * * if size is None: # <<<<<<<<<<<<<< @@ -3747,7 +3737,7 @@ __pyx_t_1 = (__pyx_v_size == Py_None); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":440 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":440 * * if size is None: * multi = PyArray_MultiIterNew(3, on, om, oN) # <<<<<<<<<<<<<< @@ -3761,7 +3751,7 @@ __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":441 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":441 * if size is None: * multi = PyArray_MultiIterNew(3, on, om, oN) * array = PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG) # <<<<<<<<<<<<<< @@ -3775,7 +3765,7 @@ arrayObject = ((PyArrayObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":442 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":442 * multi = PyArray_MultiIterNew(3, on, om, oN) * array = PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG) * array_data = array.data # <<<<<<<<<<<<<< @@ -3784,7 +3774,7 @@ */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":443 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":443 * array = PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG) * array_data = array.data * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<< @@ -3794,7 +3784,7 @@ __pyx_t_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":444 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":444 * array_data = array.data * for i from 0 <= i < multi.size: * on_data = PyArray_MultiIter_DATA(multi, 0) # <<<<<<<<<<<<<< @@ -3803,7 +3793,7 @@ */ __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi, 0)); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":445 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":445 * for i from 0 <= i < multi.size: * on_data = PyArray_MultiIter_DATA(multi, 0) * om_data = PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<< @@ -3812,7 +3802,7 @@ */ __pyx_v_om_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi, 1)); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":446 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":446 * on_data = PyArray_MultiIter_DATA(multi, 0) * om_data = PyArray_MultiIter_DATA(multi, 1) * oN_data = PyArray_MultiIter_DATA(multi, 2) # <<<<<<<<<<<<<< @@ -3821,7 +3811,7 @@ */ __pyx_v_oN_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi, 2)); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":447 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":447 * om_data = PyArray_MultiIter_DATA(multi, 1) * oN_data = PyArray_MultiIter_DATA(multi, 2) * array_data[i] = func(state, on_data[0], om_data[0], oN_data[0]) # <<<<<<<<<<<<<< @@ -3830,7 +3820,7 @@ */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_on_data[0]), (__pyx_v_om_data[0]), (__pyx_v_oN_data[0])); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":448 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":448 * oN_data = PyArray_MultiIter_DATA(multi, 2) * array_data[i] = func(state, on_data[0], om_data[0], oN_data[0]) * PyArray_MultiIter_NEXT(multi) # <<<<<<<<<<<<<< @@ -3843,7 +3833,7 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":450 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":450 * PyArray_MultiIter_NEXT(multi) * else: * array = np.empty(size, int) # <<<<<<<<<<<<<< @@ -3872,7 +3862,7 @@ arrayObject = ((PyArrayObject *)__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":451 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":451 * else: * array = np.empty(size, int) * array_data = array.data # <<<<<<<<<<<<<< @@ -3881,7 +3871,7 @@ */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":453 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":453 * array_data = array.data * multi = PyArray_MultiIterNew(4, array, on, om, * oN) # <<<<<<<<<<<<<< @@ -3895,7 +3885,7 @@ __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":454 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":454 * multi = PyArray_MultiIterNew(4, array, on, om, * oN) * if (multi.size != PyArray_SIZE(array)): # <<<<<<<<<<<<<< @@ -3905,7 +3895,7 @@ __pyx_t_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":455 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":455 * oN) * if (multi.size != PyArray_SIZE(array)): * raise ValueError("size is not compatible with inputs") # <<<<<<<<<<<<<< @@ -3927,7 +3917,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":456 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":456 * if (multi.size != PyArray_SIZE(array)): * raise ValueError("size is not compatible with inputs") * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<< @@ -3937,7 +3927,7 @@ __pyx_t_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":457 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":457 * raise ValueError("size is not compatible with inputs") * for i from 0 <= i < multi.size: * on_data = PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<< @@ -3946,7 +3936,7 @@ */ __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi, 1)); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":458 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":458 * for i from 0 <= i < multi.size: * on_data = PyArray_MultiIter_DATA(multi, 1) * om_data = PyArray_MultiIter_DATA(multi, 2) # <<<<<<<<<<<<<< @@ -3955,7 +3945,7 @@ */ __pyx_v_om_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi, 2)); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":459 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":459 * on_data = PyArray_MultiIter_DATA(multi, 1) * om_data = PyArray_MultiIter_DATA(multi, 2) * oN_data = PyArray_MultiIter_DATA(multi, 3) # <<<<<<<<<<<<<< @@ -3964,7 +3954,7 @@ */ __pyx_v_oN_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi, 3)); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":460 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":460 * om_data = PyArray_MultiIter_DATA(multi, 2) * oN_data = PyArray_MultiIter_DATA(multi, 3) * array_data[i] = func(state, on_data[0], om_data[0], oN_data[0]) # <<<<<<<<<<<<<< @@ -3973,7 +3963,7 @@ */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_on_data[0]), (__pyx_v_om_data[0]), (__pyx_v_oN_data[0])); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":461 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":461 * oN_data = PyArray_MultiIter_DATA(multi, 3) * array_data[i] = func(state, on_data[0], om_data[0], oN_data[0]) * PyArray_MultiIter_NEXT(multi) # <<<<<<<<<<<<<< @@ -3985,7 +3975,7 @@ } __pyx_L3:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":463 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":463 * PyArray_MultiIter_NEXT(multi) * * return array # <<<<<<<<<<<<<< @@ -4017,7 +4007,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":465 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":465 * return array * * cdef object discd_array_sc(rk_state *state, rk_discd func, object size, double a): # <<<<<<<<<<<<<< @@ -4040,7 +4030,7 @@ __Pyx_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":471 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":471 * cdef long i * * if size is None: # <<<<<<<<<<<<<< @@ -4050,7 +4040,7 @@ __pyx_t_1 = (__pyx_v_size == Py_None); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":472 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":472 * * if size is None: * return func(state, a) # <<<<<<<<<<<<<< @@ -4067,7 +4057,7 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":474 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":474 * return func(state, a) * else: * array = np.empty(size, int) # <<<<<<<<<<<<<< @@ -4096,7 +4086,7 @@ arrayObject = ((PyArrayObject *)__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":475 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":475 * else: * array = np.empty(size, int) * length = PyArray_SIZE(array) # <<<<<<<<<<<<<< @@ -4105,7 +4095,7 @@ */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":476 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":476 * array = np.empty(size, int) * length = PyArray_SIZE(array) * array_data = array.data # <<<<<<<<<<<<<< @@ -4114,7 +4104,7 @@ */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":477 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":477 * length = PyArray_SIZE(array) * array_data = array.data * for i from 0 <= i < length: # <<<<<<<<<<<<<< @@ -4124,7 +4114,7 @@ __pyx_t_5 = __pyx_v_length; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":478 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":478 * array_data = array.data * for i from 0 <= i < length: * array_data[i] = func(state, a) # <<<<<<<<<<<<<< @@ -4134,7 +4124,7 @@ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, __pyx_v_a); } - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":479 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":479 * for i from 0 <= i < length: * array_data[i] = func(state, a) * return array # <<<<<<<<<<<<<< @@ -4164,7 +4154,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":481 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":481 * return array * * cdef object discd_array(rk_state *state, rk_discd func, object size, ndarray oa): # <<<<<<<<<<<<<< @@ -4193,7 +4183,7 @@ __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_itera = ((PyArrayIterObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":490 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":490 * cdef flatiter itera * * if size is None: # <<<<<<<<<<<<<< @@ -4203,7 +4193,7 @@ __pyx_t_1 = (__pyx_v_size == Py_None); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":491 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":491 * * if size is None: * array = PyArray_SimpleNew(oa.nd, oa.dimensions, NPY_LONG) # <<<<<<<<<<<<<< @@ -4217,7 +4207,7 @@ arrayObject = ((PyArrayObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":492 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":492 * if size is None: * array = PyArray_SimpleNew(oa.nd, oa.dimensions, NPY_LONG) * length = PyArray_SIZE(array) # <<<<<<<<<<<<<< @@ -4226,7 +4216,7 @@ */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":493 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":493 * array = PyArray_SimpleNew(oa.nd, oa.dimensions, NPY_LONG) * length = PyArray_SIZE(array) * array_data = array.data # <<<<<<<<<<<<<< @@ -4235,7 +4225,7 @@ */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":494 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":494 * length = PyArray_SIZE(array) * array_data = array.data * itera = PyArray_IterNew(oa) # <<<<<<<<<<<<<< @@ -4249,7 +4239,7 @@ __pyx_v_itera = ((PyArrayIterObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":495 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":495 * array_data = array.data * itera = PyArray_IterNew(oa) * for i from 0 <= i < length: # <<<<<<<<<<<<<< @@ -4259,7 +4249,7 @@ __pyx_t_3 = __pyx_v_length; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":496 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":496 * itera = PyArray_IterNew(oa) * for i from 0 <= i < length: * array_data[i] = func(state, ((itera.dataptr))[0]) # <<<<<<<<<<<<<< @@ -4268,7 +4258,7 @@ */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (((double *)__pyx_v_itera->dataptr)[0])); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":497 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":497 * for i from 0 <= i < length: * array_data[i] = func(state, ((itera.dataptr))[0]) * PyArray_ITER_NEXT(itera) # <<<<<<<<<<<<<< @@ -4281,7 +4271,7 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":499 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":499 * PyArray_ITER_NEXT(itera) * else: * array = np.empty(size, int) # <<<<<<<<<<<<<< @@ -4310,7 +4300,7 @@ arrayObject = ((PyArrayObject *)__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":500 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":500 * else: * array = np.empty(size, int) * array_data = array.data # <<<<<<<<<<<<<< @@ -4319,7 +4309,7 @@ */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":501 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":501 * array = np.empty(size, int) * array_data = array.data * multi = PyArray_MultiIterNew(2, array, oa) # <<<<<<<<<<<<<< @@ -4333,7 +4323,7 @@ __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":502 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":502 * array_data = array.data * multi = PyArray_MultiIterNew(2, array, oa) * if (multi.size != PyArray_SIZE(array)): # <<<<<<<<<<<<<< @@ -4343,7 +4333,7 @@ __pyx_t_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":503 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":503 * multi = PyArray_MultiIterNew(2, array, oa) * if (multi.size != PyArray_SIZE(array)): * raise ValueError("size is not compatible with inputs") # <<<<<<<<<<<<<< @@ -4365,7 +4355,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":504 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":504 * if (multi.size != PyArray_SIZE(array)): * raise ValueError("size is not compatible with inputs") * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<< @@ -4375,7 +4365,7 @@ __pyx_t_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":505 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":505 * raise ValueError("size is not compatible with inputs") * for i from 0 <= i < multi.size: * oa_data = PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<< @@ -4384,7 +4374,7 @@ */ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 1)); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":506 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":506 * for i from 0 <= i < multi.size: * oa_data = PyArray_MultiIter_DATA(multi, 1) * array_data[i] = func(state, oa_data[0]) # <<<<<<<<<<<<<< @@ -4393,7 +4383,7 @@ */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_oa_data[0])); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":507 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":507 * oa_data = PyArray_MultiIter_DATA(multi, 1) * array_data[i] = func(state, oa_data[0]) * PyArray_MultiIter_NEXTi(multi, 1) # <<<<<<<<<<<<<< @@ -4405,7 +4395,7 @@ } __pyx_L3:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":508 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":508 * array_data[i] = func(state, oa_data[0]) * PyArray_MultiIter_NEXTi(multi, 1) * return array # <<<<<<<<<<<<<< @@ -4436,7 +4426,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":510 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":510 * return array * * cdef double kahan_sum(double *darr, long n): # <<<<<<<<<<<<<< @@ -4454,7 +4444,7 @@ long __pyx_t_1; __Pyx_RefNannySetupContext("kahan_sum"); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":513 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":513 * cdef double c, y, t, sum * cdef long i * sum = darr[0] # <<<<<<<<<<<<<< @@ -4463,7 +4453,7 @@ */ __pyx_v_sum = (__pyx_v_darr[0]); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":514 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":514 * cdef long i * sum = darr[0] * c = 0.0 # <<<<<<<<<<<<<< @@ -4472,7 +4462,7 @@ */ __pyx_v_c = 0.0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":515 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":515 * sum = darr[0] * c = 0.0 * for i from 1 <= i < n: # <<<<<<<<<<<<<< @@ -4482,7 +4472,7 @@ __pyx_t_1 = __pyx_v_n; for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":516 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":516 * c = 0.0 * for i from 1 <= i < n: * y = darr[i] - c # <<<<<<<<<<<<<< @@ -4491,7 +4481,7 @@ */ __pyx_v_y = ((__pyx_v_darr[__pyx_v_i]) - __pyx_v_c); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":517 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":517 * for i from 1 <= i < n: * y = darr[i] - c * t = sum + y # <<<<<<<<<<<<<< @@ -4500,7 +4490,7 @@ */ __pyx_v_t = (__pyx_v_sum + __pyx_v_y); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":518 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":518 * y = darr[i] - c * t = sum + y * c = (t-sum) - y # <<<<<<<<<<<<<< @@ -4509,7 +4499,7 @@ */ __pyx_v_c = ((__pyx_v_t - __pyx_v_sum) - __pyx_v_y); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":519 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":519 * t = sum + y * c = (t-sum) - y * sum = t # <<<<<<<<<<<<<< @@ -4519,7 +4509,7 @@ __pyx_v_sum = __pyx_v_t; } - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":520 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":520 * c = (t-sum) - y * sum = t * return sum # <<<<<<<<<<<<<< @@ -4535,7 +4525,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":557 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":557 * cdef rk_state *internal_state * * def __init__(self, seed=None): # <<<<<<<<<<<<<< @@ -4588,7 +4578,7 @@ return -1; __pyx_L4_argument_unpacking_done:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":558 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":558 * * def __init__(self, seed=None): * self.internal_state = PyMem_Malloc(sizeof(rk_state)) # <<<<<<<<<<<<<< @@ -4597,7 +4587,7 @@ */ ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = ((rk_state *)PyMem_Malloc((sizeof(rk_state)))); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":560 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":560 * self.internal_state = PyMem_Malloc(sizeof(rk_state)) * * self.seed(seed) # <<<<<<<<<<<<<< @@ -4630,7 +4620,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":562 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":562 * self.seed(seed) * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -4644,7 +4634,7 @@ __Pyx_RefNannySetupContext("__dealloc__"); __Pyx_INCREF((PyObject *)__pyx_v_self); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":563 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":563 * * def __dealloc__(self): * if self.internal_state != NULL: # <<<<<<<<<<<<<< @@ -4654,7 +4644,7 @@ __pyx_t_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != NULL); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":564 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":564 * def __dealloc__(self): * if self.internal_state != NULL: * PyMem_Free(self.internal_state) # <<<<<<<<<<<<<< @@ -4663,7 +4653,7 @@ */ PyMem_Free(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":565 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":565 * if self.internal_state != NULL: * PyMem_Free(self.internal_state) * self.internal_state = NULL # <<<<<<<<<<<<<< @@ -4679,7 +4669,7 @@ __Pyx_RefNannyFinishContext(); } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":567 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":567 * self.internal_state = NULL * * def seed(self, seed=None): # <<<<<<<<<<<<<< @@ -4696,8 +4686,8 @@ PyObject *__pyx_v_iseed; PyObject *__pyx_r = NULL; int __pyx_t_1; - unsigned long __pyx_t_2; - PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_2 = NULL; + unsigned long __pyx_t_3; PyObject *__pyx_t_4 = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__seed,0}; __Pyx_RefNannySetupContext("seed"); @@ -4741,7 +4731,7 @@ arrayObject_obj = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_iseed = Py_None; __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":588 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":588 * cdef rk_error errcode * cdef ndarray obj "arrayObject_obj" * if seed is None: # <<<<<<<<<<<<<< @@ -4751,7 +4741,7 @@ __pyx_t_1 = (__pyx_v_seed == Py_None); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":589 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":589 * cdef ndarray obj "arrayObject_obj" * if seed is None: * errcode = rk_randomseed(self.internal_state) # <<<<<<<<<<<<<< @@ -4762,45 +4752,48 @@ goto __pyx_L6; } - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":590 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":590 * if seed is None: * errcode = rk_randomseed(self.internal_state) * elif type(seed) is int: # <<<<<<<<<<<<<< * rk_seed(seed, self.internal_state) * elif isinstance(seed, np.integer): */ - __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_seed)) == ((PyObject *)((PyObject*)&PyInt_Type))); + __pyx_t_2 = ((PyObject *)__Pyx_Type(__pyx_v_seed)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __pyx_t_1 = (__pyx_t_2 == ((PyObject*)&PyInt_Type)); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":591 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":591 * errcode = rk_randomseed(self.internal_state) * elif type(seed) is int: * rk_seed(seed, self.internal_state) # <<<<<<<<<<<<<< * elif isinstance(seed, np.integer): * iseed = int(seed) */ - __pyx_t_2 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_seed); if (unlikely((__pyx_t_2 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - rk_seed(__pyx_t_2, ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); + __pyx_t_3 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_seed); if (unlikely((__pyx_t_3 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + rk_seed(__pyx_t_3, ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); goto __pyx_L6; } - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":592 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":592 * elif type(seed) is int: * rk_seed(seed, self.internal_state) * elif isinstance(seed, np.integer): # <<<<<<<<<<<<<< * iseed = int(seed) * rk_seed(iseed, self.internal_state) */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__integer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__integer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = PyObject_IsInstance(__pyx_v_seed, __pyx_t_4); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":593 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":593 * rk_seed(seed, self.internal_state) * elif isinstance(seed, np.integer): * iseed = int(seed) # <<<<<<<<<<<<<< @@ -4812,41 +4805,41 @@ __Pyx_INCREF(__pyx_v_seed); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_seed); __Pyx_GIVEREF(__pyx_v_seed); - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_iseed); - __pyx_v_iseed = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_iseed = __pyx_t_2; + __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":594 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":594 * elif isinstance(seed, np.integer): * iseed = int(seed) * rk_seed(iseed, self.internal_state) # <<<<<<<<<<<<<< * else: * obj = PyArray_ContiguousFromObject(seed, NPY_LONG, 1, 1) */ - __pyx_t_2 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_iseed); if (unlikely((__pyx_t_2 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - rk_seed(__pyx_t_2, ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); + __pyx_t_3 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_iseed); if (unlikely((__pyx_t_3 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + rk_seed(__pyx_t_3, ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); goto __pyx_L6; } /*else*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":596 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":596 * rk_seed(iseed, self.internal_state) * else: * obj = PyArray_ContiguousFromObject(seed, NPY_LONG, 1, 1) # <<<<<<<<<<<<<< * init_by_array(self.internal_state, (obj.data), * obj.dimensions[0]) */ - __pyx_t_3 = PyArray_ContiguousFromObject(__pyx_v_seed, NPY_LONG, 1, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_3))); + __pyx_t_2 = PyArray_ContiguousFromObject(__pyx_v_seed, NPY_LONG, 1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_t_2))); __Pyx_DECREF(((PyObject *)arrayObject_obj)); - arrayObject_obj = ((PyArrayObject *)__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + arrayObject_obj = ((PyArrayObject *)__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":598 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":598 * obj = PyArray_ContiguousFromObject(seed, NPY_LONG, 1, 1) * init_by_array(self.internal_state, (obj.data), * obj.dimensions[0]) # <<<<<<<<<<<<<< @@ -4860,7 +4853,7 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("mtrand.RandomState.seed"); __pyx_r = NULL; @@ -4874,7 +4867,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":600 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":600 * obj.dimensions[0]) * * def get_state(self): # <<<<<<<<<<<<<< @@ -4894,7 +4887,7 @@ __Pyx_RefNannySetupContext("get_state"); arrayObject_state = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":631 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":631 * """ * cdef ndarray state "arrayObject_state" * state = np.empty(624, np.uint) # <<<<<<<<<<<<<< @@ -4928,7 +4921,7 @@ arrayObject_state = ((PyArrayObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":632 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":632 * cdef ndarray state "arrayObject_state" * state = np.empty(624, np.uint) * memcpy((state.data), (self.internal_state.key), 624*sizeof(long)) # <<<<<<<<<<<<<< @@ -4937,7 +4930,7 @@ */ memcpy(((void *)arrayObject_state->data), ((void *)((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key), (624 * (sizeof(long)))); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":633 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":633 * state = np.empty(624, np.uint) * memcpy((state.data), (self.internal_state.key), 624*sizeof(long)) * state = np.asarray(state, np.uint32) # <<<<<<<<<<<<<< @@ -4971,7 +4964,7 @@ arrayObject_state = ((PyArrayObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":634 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":634 * memcpy((state.data), (self.internal_state.key), 624*sizeof(long)) * state = np.asarray(state, np.uint32) * return ('MT19937', state, self.internal_state.pos, # <<<<<<<<<<<<<< @@ -4982,7 +4975,7 @@ __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":635 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":635 * state = np.asarray(state, np.uint32) * return ('MT19937', state, self.internal_state.pos, * self.internal_state.has_gauss, self.internal_state.gauss) # <<<<<<<<<<<<<< @@ -5030,7 +5023,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":637 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":637 * self.internal_state.has_gauss, self.internal_state.gauss) * * def set_state(self, state): # <<<<<<<<<<<<<< @@ -5065,7 +5058,7 @@ __pyx_v_has_gauss = Py_None; __Pyx_INCREF(Py_None); __pyx_v_cached_gaussian = Py_None; __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":686 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":686 * cdef ndarray obj "arrayObject_obj" * cdef int pos * algorithm_name = state[0] # <<<<<<<<<<<<<< @@ -5078,7 +5071,7 @@ __pyx_v_algorithm_name = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":687 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":687 * cdef int pos * algorithm_name = state[0] * if algorithm_name != 'MT19937': # <<<<<<<<<<<<<< @@ -5091,7 +5084,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":688 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":688 * algorithm_name = state[0] * if algorithm_name != 'MT19937': * raise ValueError("algorithm must be 'MT19937'") # <<<<<<<<<<<<<< @@ -5113,7 +5106,7 @@ } __pyx_L5:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":689 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":689 * if algorithm_name != 'MT19937': * raise ValueError("algorithm must be 'MT19937'") * key, pos = state[1:3] # <<<<<<<<<<<<<< @@ -5151,7 +5144,7 @@ __pyx_v_pos = __pyx_t_5; } - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":690 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":690 * raise ValueError("algorithm must be 'MT19937'") * key, pos = state[1:3] * if len(state) == 3: # <<<<<<<<<<<<<< @@ -5162,7 +5155,7 @@ __pyx_t_2 = (__pyx_t_7 == 3); if (__pyx_t_2) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":691 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":691 * key, pos = state[1:3] * if len(state) == 3: * has_gauss = 0 # <<<<<<<<<<<<<< @@ -5173,7 +5166,7 @@ __Pyx_DECREF(__pyx_v_has_gauss); __pyx_v_has_gauss = __pyx_int_0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":692 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":692 * if len(state) == 3: * has_gauss = 0 * cached_gaussian = 0.0 # <<<<<<<<<<<<<< @@ -5189,7 +5182,7 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":694 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":694 * cached_gaussian = 0.0 * else: * has_gauss, cached_gaussian = state[3:5] # <<<<<<<<<<<<<< @@ -5229,7 +5222,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":695 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":695 * else: * has_gauss, cached_gaussian = state[3:5] * try: # <<<<<<<<<<<<<< @@ -5244,7 +5237,7 @@ __Pyx_XGOTREF(__pyx_save_exc_tb); /*try:*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":696 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":696 * has_gauss, cached_gaussian = state[3:5] * try: * obj = PyArray_ContiguousFromObject(key, NPY_ULONG, 1, 1) # <<<<<<<<<<<<<< @@ -5268,7 +5261,7 @@ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":697 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":697 * try: * obj = PyArray_ContiguousFromObject(key, NPY_ULONG, 1, 1) * except TypeError: # <<<<<<<<<<<<<< @@ -5283,7 +5276,7 @@ __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_4); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":699 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":699 * except TypeError: * # compatibility -- could be an older pickle * obj = PyArray_ContiguousFromObject(key, NPY_LONG, 1, 1) # <<<<<<<<<<<<<< @@ -5315,7 +5308,7 @@ __pyx_L14_try_end:; } - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":700 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":700 * # compatibility -- could be an older pickle * obj = PyArray_ContiguousFromObject(key, NPY_LONG, 1, 1) * if obj.dimensions[0] != 624: # <<<<<<<<<<<<<< @@ -5325,7 +5318,7 @@ __pyx_t_2 = ((arrayObject_obj->dimensions[0]) != 624); if (__pyx_t_2) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":701 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":701 * obj = PyArray_ContiguousFromObject(key, NPY_LONG, 1, 1) * if obj.dimensions[0] != 624: * raise ValueError("state must be 624 longs") # <<<<<<<<<<<<<< @@ -5347,7 +5340,7 @@ } __pyx_L17:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":702 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":702 * if obj.dimensions[0] != 624: * raise ValueError("state must be 624 longs") * memcpy((self.internal_state.key), (obj.data), 624*sizeof(long)) # <<<<<<<<<<<<<< @@ -5356,7 +5349,7 @@ */ memcpy(((void *)((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key), ((void *)arrayObject_obj->data), (624 * (sizeof(long)))); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":703 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":703 * raise ValueError("state must be 624 longs") * memcpy((self.internal_state.key), (obj.data), 624*sizeof(long)) * self.internal_state.pos = pos # <<<<<<<<<<<<<< @@ -5365,7 +5358,7 @@ */ ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos = __pyx_v_pos; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":704 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":704 * memcpy((self.internal_state.key), (obj.data), 624*sizeof(long)) * self.internal_state.pos = pos * self.internal_state.has_gauss = has_gauss # <<<<<<<<<<<<<< @@ -5375,14 +5368,14 @@ __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_has_gauss); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->has_gauss = __pyx_t_5; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":705 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":705 * self.internal_state.pos = pos * self.internal_state.has_gauss = has_gauss * self.internal_state.gauss = cached_gaussian # <<<<<<<<<<<<<< * * # Pickling support: */ - __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_cached_gaussian); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_cached_gaussian); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->gauss = __pyx_t_8; __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -5407,7 +5400,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":708 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":708 * * # Pickling support: * def __getstate__(self): # <<<<<<<<<<<<<< @@ -5422,7 +5415,7 @@ PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__getstate__"); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":709 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":709 * # Pickling support: * def __getstate__(self): * return self.get_state() # <<<<<<<<<<<<<< @@ -5452,7 +5445,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":711 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":711 * return self.get_state() * * def __setstate__(self, state): # <<<<<<<<<<<<<< @@ -5468,7 +5461,7 @@ PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__setstate__"); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":712 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":712 * * def __setstate__(self, state): * self.set_state(state) # <<<<<<<<<<<<<< @@ -5502,7 +5495,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":714 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":714 * self.set_state(state) * * def __reduce__(self): # <<<<<<<<<<<<<< @@ -5518,7 +5511,7 @@ PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__reduce__"); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":715 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":715 * * def __reduce__(self): * return (np.random.__RandomState_ctor, (), self.get_state()) # <<<<<<<<<<<<<< @@ -5568,7 +5561,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":718 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":718 * * # Basic distributions: * def random_sample(self, size=None): # <<<<<<<<<<<<<< @@ -5620,7 +5613,7 @@ return NULL; __pyx_L4_argument_unpacking_done:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":759 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":759 * * """ * return cont0_array(self.internal_state, rk_double, size) # <<<<<<<<<<<<<< @@ -5646,7 +5639,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":761 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":761 * return cont0_array(self.internal_state, rk_double, size) * * def tomaxint(self, size=None): # <<<<<<<<<<<<<< @@ -5698,7 +5691,7 @@ return NULL; __pyx_L4_argument_unpacking_done:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":787 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":787 * * """ * return disc0_array(self.internal_state, rk_long, size) # <<<<<<<<<<<<<< @@ -5724,7 +5717,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":789 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":789 * return disc0_array(self.internal_state, rk_long, size) * * def randint(self, low, high=None, size=None): # <<<<<<<<<<<<<< @@ -5811,7 +5804,7 @@ __Pyx_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":845 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":845 * cdef long i * * if high is None: # <<<<<<<<<<<<<< @@ -5821,7 +5814,7 @@ __pyx_t_1 = (__pyx_v_high == Py_None); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":846 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":846 * * if high is None: * lo = 0 # <<<<<<<<<<<<<< @@ -5830,7 +5823,7 @@ */ __pyx_v_lo = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":847 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":847 * if high is None: * lo = 0 * hi = low # <<<<<<<<<<<<<< @@ -5843,7 +5836,7 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":849 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":849 * hi = low * else: * lo = low # <<<<<<<<<<<<<< @@ -5853,7 +5846,7 @@ __pyx_t_2 = __Pyx_PyInt_AsLong(__pyx_v_low); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_lo = __pyx_t_2; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":850 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":850 * else: * lo = low * hi = high # <<<<<<<<<<<<<< @@ -5865,7 +5858,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":852 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":852 * hi = high * * diff = hi - lo - 1 # <<<<<<<<<<<<<< @@ -5874,7 +5867,7 @@ */ __pyx_v_diff = ((__pyx_v_hi - __pyx_v_lo) - 1); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":853 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":853 * * diff = hi - lo - 1 * if diff < 0: # <<<<<<<<<<<<<< @@ -5884,7 +5877,7 @@ __pyx_t_1 = (__pyx_v_diff < 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":854 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":854 * diff = hi - lo - 1 * if diff < 0: * raise ValueError("low >= high") # <<<<<<<<<<<<<< @@ -5906,7 +5899,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":856 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":856 * raise ValueError("low >= high") * * if size is None: # <<<<<<<<<<<<<< @@ -5916,7 +5909,7 @@ __pyx_t_1 = (__pyx_v_size == Py_None); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":857 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":857 * * if size is None: * return rk_interval(diff, self.internal_state) + lo # <<<<<<<<<<<<<< @@ -5933,7 +5926,7 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":859 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":859 * return rk_interval(diff, self.internal_state) + lo * else: * array = np.empty(size, int) # <<<<<<<<<<<<<< @@ -5962,7 +5955,7 @@ arrayObject = ((PyArrayObject *)__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":860 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":860 * else: * array = np.empty(size, int) * length = PyArray_SIZE(array) # <<<<<<<<<<<<<< @@ -5971,7 +5964,7 @@ */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":861 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":861 * array = np.empty(size, int) * length = PyArray_SIZE(array) * array_data = array.data # <<<<<<<<<<<<<< @@ -5980,7 +5973,7 @@ */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":862 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":862 * length = PyArray_SIZE(array) * array_data = array.data * for i from 0 <= i < length: # <<<<<<<<<<<<<< @@ -5990,7 +5983,7 @@ __pyx_t_2 = __pyx_v_length; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":863 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":863 * array_data = array.data * for i from 0 <= i < length: * array_data[i] = lo + rk_interval(diff, self.internal_state) # <<<<<<<<<<<<<< @@ -6000,7 +5993,7 @@ (__pyx_v_array_data[__pyx_v_i]) = (__pyx_v_lo + ((long)rk_interval(__pyx_v_diff, ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state))); } - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":864 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":864 * for i from 0 <= i < length: * array_data[i] = lo + rk_interval(diff, self.internal_state) * return array # <<<<<<<<<<<<<< @@ -6033,7 +6026,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":866 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":866 * return array * * def bytes(self, unsigned int length): # <<<<<<<<<<<<<< @@ -6060,7 +6053,7 @@ __pyx_L4_argument_unpacking_done:; __pyx_v_bytestring = Py_None; __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":889 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":889 * """ * cdef void *bytes * bytestring = empty_py_bytes(length, &bytes) # <<<<<<<<<<<<<< @@ -6073,7 +6066,7 @@ __pyx_v_bytestring = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":890 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":890 * cdef void *bytes * bytestring = empty_py_bytes(length, &bytes) * rk_fill(bytes, length, self.internal_state) # <<<<<<<<<<<<<< @@ -6082,7 +6075,7 @@ */ rk_fill(__pyx_v_bytes, __pyx_v_length, ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":891 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":891 * bytestring = empty_py_bytes(length, &bytes) * rk_fill(bytes, length, self.internal_state) * return bytestring # <<<<<<<<<<<<<< @@ -6107,7 +6100,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":893 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":893 * return bytestring * * def uniform(self, low=0.0, high=1.0, size=None): # <<<<<<<<<<<<<< @@ -6198,7 +6191,7 @@ __pyx_v_odiff = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_temp = Py_None; __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":968 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":968 * cdef object temp * * flow = PyFloat_AsDouble(low) # <<<<<<<<<<<<<< @@ -6207,7 +6200,7 @@ */ __pyx_v_flow = PyFloat_AsDouble(__pyx_v_low); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":969 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":969 * * flow = PyFloat_AsDouble(low) * fhigh = PyFloat_AsDouble(high) # <<<<<<<<<<<<<< @@ -6216,7 +6209,7 @@ */ __pyx_v_fhigh = PyFloat_AsDouble(__pyx_v_high); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":970 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":970 * flow = PyFloat_AsDouble(low) * fhigh = PyFloat_AsDouble(high) * if not PyErr_Occurred(): # <<<<<<<<<<<<<< @@ -6226,7 +6219,7 @@ __pyx_t_1 = (!PyErr_Occurred()); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":971 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":971 * fhigh = PyFloat_AsDouble(high) * if not PyErr_Occurred(): * return cont2_array_sc(self.internal_state, rk_uniform, size, flow, fhigh-flow) # <<<<<<<<<<<<<< @@ -6243,7 +6236,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":972 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":972 * if not PyErr_Occurred(): * return cont2_array_sc(self.internal_state, rk_uniform, size, flow, fhigh-flow) * PyErr_Clear() # <<<<<<<<<<<<<< @@ -6252,7 +6245,7 @@ */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":973 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":973 * return cont2_array_sc(self.internal_state, rk_uniform, size, flow, fhigh-flow) * PyErr_Clear() * olow = PyArray_FROM_OTF(low, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -6266,7 +6259,7 @@ __pyx_v_olow = ((PyArrayObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":974 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":974 * PyErr_Clear() * olow = PyArray_FROM_OTF(low, NPY_DOUBLE, NPY_ALIGNED) * ohigh = PyArray_FROM_OTF(high, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -6280,7 +6273,7 @@ __pyx_v_ohigh = ((PyArrayObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":975 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":975 * olow = PyArray_FROM_OTF(low, NPY_DOUBLE, NPY_ALIGNED) * ohigh = PyArray_FROM_OTF(high, NPY_DOUBLE, NPY_ALIGNED) * temp = np.subtract(ohigh, olow) # <<<<<<<<<<<<<< @@ -6308,7 +6301,7 @@ __pyx_v_temp = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":976 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":976 * ohigh = PyArray_FROM_OTF(high, NPY_DOUBLE, NPY_ALIGNED) * temp = np.subtract(ohigh, olow) * Py_INCREF(temp) # needed to get around Pyrex's automatic reference-counting # <<<<<<<<<<<<<< @@ -6317,7 +6310,7 @@ */ Py_INCREF(__pyx_v_temp); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":978 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":978 * Py_INCREF(temp) # needed to get around Pyrex's automatic reference-counting * # rules because EnsureArray steals a reference * odiff = PyArray_EnsureArray(temp) # <<<<<<<<<<<<<< @@ -6331,7 +6324,7 @@ __pyx_v_odiff = ((PyArrayObject *)__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":979 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":979 * # rules because EnsureArray steals a reference * odiff = PyArray_EnsureArray(temp) * return cont2_array(self.internal_state, rk_uniform, size, olow, odiff) # <<<<<<<<<<<<<< @@ -6367,7 +6360,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":981 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":981 * return cont2_array(self.internal_state, rk_uniform, size, olow, odiff) * * def rand(self, *args): # <<<<<<<<<<<<<< @@ -6391,7 +6384,7 @@ __pyx_v_args = __pyx_args; __Pyx_INCREF((PyObject *)__pyx_v_self); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1019 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1019 * * """ * if len(args) == 0: # <<<<<<<<<<<<<< @@ -6402,7 +6395,7 @@ __pyx_t_2 = (__pyx_t_1 == 0); if (__pyx_t_2) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1020 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1020 * """ * if len(args) == 0: * return self.random_sample() # <<<<<<<<<<<<<< @@ -6422,7 +6415,7 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1022 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1022 * return self.random_sample() * else: * return self.random_sample(size=args) # <<<<<<<<<<<<<< @@ -6461,7 +6454,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1024 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1024 * return self.random_sample(size=args) * * def randn(self, *args): # <<<<<<<<<<<<<< @@ -6485,7 +6478,7 @@ __pyx_v_args = __pyx_args; __Pyx_INCREF((PyObject *)__pyx_v_self); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1075 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1075 * * """ * if len(args) == 0: # <<<<<<<<<<<<<< @@ -6496,7 +6489,7 @@ __pyx_t_2 = (__pyx_t_1 == 0); if (__pyx_t_2) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1076 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1076 * """ * if len(args) == 0: * return self.standard_normal() # <<<<<<<<<<<<<< @@ -6516,7 +6509,7 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1078 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1078 * return self.standard_normal() * else: * return self.standard_normal(args) # <<<<<<<<<<<<<< @@ -6557,7 +6550,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1080 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1080 * return self.standard_normal(args) * * def random_integers(self, low, high=None, size=None): # <<<<<<<<<<<<<< @@ -6635,7 +6628,7 @@ __Pyx_INCREF(__pyx_v_high); __Pyx_INCREF(__pyx_v_size); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1152 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1152 * * """ * if high is None: # <<<<<<<<<<<<<< @@ -6645,7 +6638,7 @@ __pyx_t_1 = (__pyx_v_high == Py_None); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1153 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1153 * """ * if high is None: * high = low # <<<<<<<<<<<<<< @@ -6656,7 +6649,7 @@ __Pyx_DECREF(__pyx_v_high); __pyx_v_high = __pyx_v_low; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1154 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1154 * if high is None: * high = low * low = 1 # <<<<<<<<<<<<<< @@ -6670,7 +6663,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1155 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1155 * high = low * low = 1 * return self.randint(low, high+1, size) # <<<<<<<<<<<<<< @@ -6719,7 +6712,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1158 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1158 * * # Complicated, continuous distributions: * def standard_normal(self, size=None): # <<<<<<<<<<<<<< @@ -6771,7 +6764,7 @@ return NULL; __pyx_L4_argument_unpacking_done:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1188 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1188 * * """ * return cont0_array(self.internal_state, rk_gauss, size) # <<<<<<<<<<<<<< @@ -6797,7 +6790,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1190 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1190 * return cont0_array(self.internal_state, rk_gauss, size) * * def normal(self, loc=0.0, scale=1.0, size=None): # <<<<<<<<<<<<<< @@ -6885,7 +6878,7 @@ __pyx_v_oloc = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1275 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1275 * cdef double floc, fscale * * floc = PyFloat_AsDouble(loc) # <<<<<<<<<<<<<< @@ -6894,7 +6887,7 @@ */ __pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1276 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1276 * * floc = PyFloat_AsDouble(loc) * fscale = PyFloat_AsDouble(scale) # <<<<<<<<<<<<<< @@ -6903,7 +6896,7 @@ */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1277 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1277 * floc = PyFloat_AsDouble(loc) * fscale = PyFloat_AsDouble(scale) * if not PyErr_Occurred(): # <<<<<<<<<<<<<< @@ -6913,7 +6906,7 @@ __pyx_t_1 = (!PyErr_Occurred()); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1278 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1278 * fscale = PyFloat_AsDouble(scale) * if not PyErr_Occurred(): * if fscale <= 0: # <<<<<<<<<<<<<< @@ -6923,7 +6916,7 @@ __pyx_t_1 = (__pyx_v_fscale <= 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1279 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1279 * if not PyErr_Occurred(): * if fscale <= 0: * raise ValueError("scale <= 0") # <<<<<<<<<<<<<< @@ -6945,7 +6938,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1280 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1280 * if fscale <= 0: * raise ValueError("scale <= 0") * return cont2_array_sc(self.internal_state, rk_normal, size, floc, fscale) # <<<<<<<<<<<<<< @@ -6962,7 +6955,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1282 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1282 * return cont2_array_sc(self.internal_state, rk_normal, size, floc, fscale) * * PyErr_Clear() # <<<<<<<<<<<<<< @@ -6971,7 +6964,7 @@ */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1284 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1284 * PyErr_Clear() * * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -6985,7 +6978,7 @@ __pyx_v_oloc = ((PyArrayObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1285 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1285 * * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED) * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -6999,7 +6992,7 @@ __pyx_v_oscale = ((PyArrayObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1286 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1286 * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED) * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oscale, 0)): # <<<<<<<<<<<<<< @@ -7041,7 +7034,7 @@ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1287 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1287 * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oscale, 0)): * raise ValueError("scale <= 0") # <<<<<<<<<<<<<< @@ -7063,7 +7056,7 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1288 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1288 * if np.any(np.less_equal(oscale, 0)): * raise ValueError("scale <= 0") * return cont2_array(self.internal_state, rk_normal, size, oloc, oscale) # <<<<<<<<<<<<<< @@ -7098,7 +7091,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1290 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1290 * return cont2_array(self.internal_state, rk_normal, size, oloc, oscale) * * def beta(self, a, b, size=None): # <<<<<<<<<<<<<< @@ -7184,7 +7177,7 @@ __pyx_v_oa = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_ob = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1330 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1330 * cdef double fa, fb * * fa = PyFloat_AsDouble(a) # <<<<<<<<<<<<<< @@ -7193,7 +7186,7 @@ */ __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1331 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1331 * * fa = PyFloat_AsDouble(a) * fb = PyFloat_AsDouble(b) # <<<<<<<<<<<<<< @@ -7202,7 +7195,7 @@ */ __pyx_v_fb = PyFloat_AsDouble(__pyx_v_b); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1332 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1332 * fa = PyFloat_AsDouble(a) * fb = PyFloat_AsDouble(b) * if not PyErr_Occurred(): # <<<<<<<<<<<<<< @@ -7212,7 +7205,7 @@ __pyx_t_1 = (!PyErr_Occurred()); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1333 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1333 * fb = PyFloat_AsDouble(b) * if not PyErr_Occurred(): * if fa <= 0: # <<<<<<<<<<<<<< @@ -7222,7 +7215,7 @@ __pyx_t_1 = (__pyx_v_fa <= 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1334 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1334 * if not PyErr_Occurred(): * if fa <= 0: * raise ValueError("a <= 0") # <<<<<<<<<<<<<< @@ -7244,7 +7237,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1335 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1335 * if fa <= 0: * raise ValueError("a <= 0") * if fb <= 0: # <<<<<<<<<<<<<< @@ -7254,7 +7247,7 @@ __pyx_t_1 = (__pyx_v_fb <= 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1336 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1336 * raise ValueError("a <= 0") * if fb <= 0: * raise ValueError("b <= 0") # <<<<<<<<<<<<<< @@ -7276,7 +7269,7 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1337 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1337 * if fb <= 0: * raise ValueError("b <= 0") * return cont2_array_sc(self.internal_state, rk_beta, size, fa, fb) # <<<<<<<<<<<<<< @@ -7293,7 +7286,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1339 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1339 * return cont2_array_sc(self.internal_state, rk_beta, size, fa, fb) * * PyErr_Clear() # <<<<<<<<<<<<<< @@ -7302,7 +7295,7 @@ */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1341 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1341 * PyErr_Clear() * * oa = PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -7316,7 +7309,7 @@ __pyx_v_oa = ((PyArrayObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1342 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1342 * * oa = PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED) * ob = PyArray_FROM_OTF(b, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -7330,7 +7323,7 @@ __pyx_v_ob = ((PyArrayObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1343 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1343 * oa = PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED) * ob = PyArray_FROM_OTF(b, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oa, 0)): # <<<<<<<<<<<<<< @@ -7372,7 +7365,7 @@ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1344 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1344 * ob = PyArray_FROM_OTF(b, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oa, 0)): * raise ValueError("a <= 0") # <<<<<<<<<<<<<< @@ -7394,7 +7387,7 @@ } __pyx_L9:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1345 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1345 * if np.any(np.less_equal(oa, 0)): * raise ValueError("a <= 0") * if np.any(np.less_equal(ob, 0)): # <<<<<<<<<<<<<< @@ -7436,7 +7429,7 @@ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1346 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1346 * raise ValueError("a <= 0") * if np.any(np.less_equal(ob, 0)): * raise ValueError("b <= 0") # <<<<<<<<<<<<<< @@ -7458,7 +7451,7 @@ } __pyx_L10:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1347 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1347 * if np.any(np.less_equal(ob, 0)): * raise ValueError("b <= 0") * return cont2_array(self.internal_state, rk_beta, size, oa, ob) # <<<<<<<<<<<<<< @@ -7493,7 +7486,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1349 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1349 * return cont2_array(self.internal_state, rk_beta, size, oa, ob) * * def exponential(self, scale=1.0, size=None): # <<<<<<<<<<<<<< @@ -7566,7 +7559,7 @@ __Pyx_INCREF(__pyx_v_size); __pyx_v_oscale = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1390 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1390 * cdef double fscale * * fscale = PyFloat_AsDouble(scale) # <<<<<<<<<<<<<< @@ -7575,7 +7568,7 @@ */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1391 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1391 * * fscale = PyFloat_AsDouble(scale) * if not PyErr_Occurred(): # <<<<<<<<<<<<<< @@ -7585,7 +7578,7 @@ __pyx_t_1 = (!PyErr_Occurred()); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1392 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1392 * fscale = PyFloat_AsDouble(scale) * if not PyErr_Occurred(): * if fscale <= 0: # <<<<<<<<<<<<<< @@ -7595,7 +7588,7 @@ __pyx_t_1 = (__pyx_v_fscale <= 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1393 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1393 * if not PyErr_Occurred(): * if fscale <= 0: * raise ValueError("scale <= 0") # <<<<<<<<<<<<<< @@ -7617,7 +7610,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1394 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1394 * if fscale <= 0: * raise ValueError("scale <= 0") * return cont1_array_sc(self.internal_state, rk_exponential, size, fscale) # <<<<<<<<<<<<<< @@ -7634,7 +7627,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1396 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1396 * return cont1_array_sc(self.internal_state, rk_exponential, size, fscale) * * PyErr_Clear() # <<<<<<<<<<<<<< @@ -7643,7 +7636,7 @@ */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1398 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1398 * PyErr_Clear() * * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -7657,7 +7650,7 @@ __pyx_v_oscale = ((PyArrayObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1399 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1399 * * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oscale, 0.0)): # <<<<<<<<<<<<<< @@ -7701,7 +7694,7 @@ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1400 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1400 * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oscale, 0.0)): * raise ValueError("scale <= 0") # <<<<<<<<<<<<<< @@ -7723,7 +7716,7 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1401 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1401 * if np.any(np.less_equal(oscale, 0.0)): * raise ValueError("scale <= 0") * return cont1_array(self.internal_state, rk_exponential, size, oscale) # <<<<<<<<<<<<<< @@ -7756,7 +7749,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1403 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1403 * return cont1_array(self.internal_state, rk_exponential, size, oscale) * * def standard_exponential(self, size=None): # <<<<<<<<<<<<<< @@ -7808,7 +7801,7 @@ return NULL; __pyx_L4_argument_unpacking_done:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1429 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1429 * * """ * return cont0_array(self.internal_state, rk_standard_exponential, size) # <<<<<<<<<<<<<< @@ -7834,7 +7827,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1431 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1431 * return cont0_array(self.internal_state, rk_standard_exponential, size) * * def standard_gamma(self, shape, size=None): # <<<<<<<<<<<<<< @@ -7904,7 +7897,7 @@ __Pyx_INCREF(__pyx_v_size); __pyx_v_oshape = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1501 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1501 * cdef double fshape * * fshape = PyFloat_AsDouble(shape) # <<<<<<<<<<<<<< @@ -7913,7 +7906,7 @@ */ __pyx_v_fshape = PyFloat_AsDouble(__pyx_v_shape); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1502 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1502 * * fshape = PyFloat_AsDouble(shape) * if not PyErr_Occurred(): # <<<<<<<<<<<<<< @@ -7923,7 +7916,7 @@ __pyx_t_1 = (!PyErr_Occurred()); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1503 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1503 * fshape = PyFloat_AsDouble(shape) * if not PyErr_Occurred(): * if fshape <= 0: # <<<<<<<<<<<<<< @@ -7933,7 +7926,7 @@ __pyx_t_1 = (__pyx_v_fshape <= 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1504 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1504 * if not PyErr_Occurred(): * if fshape <= 0: * raise ValueError("shape <= 0") # <<<<<<<<<<<<<< @@ -7955,7 +7948,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1505 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1505 * if fshape <= 0: * raise ValueError("shape <= 0") * return cont1_array_sc(self.internal_state, rk_standard_gamma, size, fshape) # <<<<<<<<<<<<<< @@ -7972,7 +7965,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1507 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1507 * return cont1_array_sc(self.internal_state, rk_standard_gamma, size, fshape) * * PyErr_Clear() # <<<<<<<<<<<<<< @@ -7981,7 +7974,7 @@ */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1508 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1508 * * PyErr_Clear() * oshape = PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -7995,7 +7988,7 @@ __pyx_v_oshape = ((PyArrayObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1509 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1509 * PyErr_Clear() * oshape = PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oshape, 0.0)): # <<<<<<<<<<<<<< @@ -8039,7 +8032,7 @@ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1510 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1510 * oshape = PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oshape, 0.0)): * raise ValueError("shape <= 0") # <<<<<<<<<<<<<< @@ -8061,7 +8054,7 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1511 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1511 * if np.any(np.less_equal(oshape, 0.0)): * raise ValueError("shape <= 0") * return cont1_array(self.internal_state, rk_standard_gamma, size, oshape) # <<<<<<<<<<<<<< @@ -8094,7 +8087,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1513 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1513 * return cont1_array(self.internal_state, rk_standard_gamma, size, oshape) * * def gamma(self, shape, scale=1.0, size=None): # <<<<<<<<<<<<<< @@ -8179,7 +8172,7 @@ __pyx_v_oshape = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1586 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1586 * cdef double fshape, fscale * * fshape = PyFloat_AsDouble(shape) # <<<<<<<<<<<<<< @@ -8188,7 +8181,7 @@ */ __pyx_v_fshape = PyFloat_AsDouble(__pyx_v_shape); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1587 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1587 * * fshape = PyFloat_AsDouble(shape) * fscale = PyFloat_AsDouble(scale) # <<<<<<<<<<<<<< @@ -8197,7 +8190,7 @@ */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1588 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1588 * fshape = PyFloat_AsDouble(shape) * fscale = PyFloat_AsDouble(scale) * if not PyErr_Occurred(): # <<<<<<<<<<<<<< @@ -8207,7 +8200,7 @@ __pyx_t_1 = (!PyErr_Occurred()); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1589 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1589 * fscale = PyFloat_AsDouble(scale) * if not PyErr_Occurred(): * if fshape <= 0: # <<<<<<<<<<<<<< @@ -8217,7 +8210,7 @@ __pyx_t_1 = (__pyx_v_fshape <= 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1590 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1590 * if not PyErr_Occurred(): * if fshape <= 0: * raise ValueError("shape <= 0") # <<<<<<<<<<<<<< @@ -8239,7 +8232,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1591 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1591 * if fshape <= 0: * raise ValueError("shape <= 0") * if fscale <= 0: # <<<<<<<<<<<<<< @@ -8249,7 +8242,7 @@ __pyx_t_1 = (__pyx_v_fscale <= 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1592 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1592 * raise ValueError("shape <= 0") * if fscale <= 0: * raise ValueError("scale <= 0") # <<<<<<<<<<<<<< @@ -8271,7 +8264,7 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1593 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1593 * if fscale <= 0: * raise ValueError("scale <= 0") * return cont2_array_sc(self.internal_state, rk_gamma, size, fshape, fscale) # <<<<<<<<<<<<<< @@ -8288,7 +8281,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1595 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1595 * return cont2_array_sc(self.internal_state, rk_gamma, size, fshape, fscale) * * PyErr_Clear() # <<<<<<<<<<<<<< @@ -8297,7 +8290,7 @@ */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1596 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1596 * * PyErr_Clear() * oshape = PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -8311,7 +8304,7 @@ __pyx_v_oshape = ((PyArrayObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1597 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1597 * PyErr_Clear() * oshape = PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ALIGNED) * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -8325,7 +8318,7 @@ __pyx_v_oscale = ((PyArrayObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1598 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1598 * oshape = PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ALIGNED) * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oshape, 0.0)): # <<<<<<<<<<<<<< @@ -8369,7 +8362,7 @@ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1599 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1599 * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oshape, 0.0)): * raise ValueError("shape <= 0") # <<<<<<<<<<<<<< @@ -8391,7 +8384,7 @@ } __pyx_L9:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1600 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1600 * if np.any(np.less_equal(oshape, 0.0)): * raise ValueError("shape <= 0") * if np.any(np.less_equal(oscale, 0.0)): # <<<<<<<<<<<<<< @@ -8435,7 +8428,7 @@ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1601 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1601 * raise ValueError("shape <= 0") * if np.any(np.less_equal(oscale, 0.0)): * raise ValueError("scale <= 0") # <<<<<<<<<<<<<< @@ -8457,7 +8450,7 @@ } __pyx_L10:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1602 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1602 * if np.any(np.less_equal(oscale, 0.0)): * raise ValueError("scale <= 0") * return cont2_array(self.internal_state, rk_gamma, size, oshape, oscale) # <<<<<<<<<<<<<< @@ -8492,7 +8485,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1604 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1604 * return cont2_array(self.internal_state, rk_gamma, size, oshape, oscale) * * def f(self, dfnum, dfden, size=None): # <<<<<<<<<<<<<< @@ -8578,7 +8571,7 @@ __pyx_v_odfnum = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_odfden = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1688 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1688 * cdef double fdfnum, fdfden * * fdfnum = PyFloat_AsDouble(dfnum) # <<<<<<<<<<<<<< @@ -8587,7 +8580,7 @@ */ __pyx_v_fdfnum = PyFloat_AsDouble(__pyx_v_dfnum); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1689 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1689 * * fdfnum = PyFloat_AsDouble(dfnum) * fdfden = PyFloat_AsDouble(dfden) # <<<<<<<<<<<<<< @@ -8596,7 +8589,7 @@ */ __pyx_v_fdfden = PyFloat_AsDouble(__pyx_v_dfden); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1690 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1690 * fdfnum = PyFloat_AsDouble(dfnum) * fdfden = PyFloat_AsDouble(dfden) * if not PyErr_Occurred(): # <<<<<<<<<<<<<< @@ -8606,7 +8599,7 @@ __pyx_t_1 = (!PyErr_Occurred()); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1691 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1691 * fdfden = PyFloat_AsDouble(dfden) * if not PyErr_Occurred(): * if fdfnum <= 0: # <<<<<<<<<<<<<< @@ -8616,7 +8609,7 @@ __pyx_t_1 = (__pyx_v_fdfnum <= 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1692 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1692 * if not PyErr_Occurred(): * if fdfnum <= 0: * raise ValueError("shape <= 0") # <<<<<<<<<<<<<< @@ -8638,7 +8631,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1693 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1693 * if fdfnum <= 0: * raise ValueError("shape <= 0") * if fdfden <= 0: # <<<<<<<<<<<<<< @@ -8648,7 +8641,7 @@ __pyx_t_1 = (__pyx_v_fdfden <= 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1694 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1694 * raise ValueError("shape <= 0") * if fdfden <= 0: * raise ValueError("scale <= 0") # <<<<<<<<<<<<<< @@ -8670,7 +8663,7 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1695 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1695 * if fdfden <= 0: * raise ValueError("scale <= 0") * return cont2_array_sc(self.internal_state, rk_f, size, fdfnum, fdfden) # <<<<<<<<<<<<<< @@ -8687,7 +8680,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1697 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1697 * return cont2_array_sc(self.internal_state, rk_f, size, fdfnum, fdfden) * * PyErr_Clear() # <<<<<<<<<<<<<< @@ -8696,7 +8689,7 @@ */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1699 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1699 * PyErr_Clear() * * odfnum = PyArray_FROM_OTF(dfnum, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -8710,7 +8703,7 @@ __pyx_v_odfnum = ((PyArrayObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1700 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1700 * * odfnum = PyArray_FROM_OTF(dfnum, NPY_DOUBLE, NPY_ALIGNED) * odfden = PyArray_FROM_OTF(dfden, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -8724,7 +8717,7 @@ __pyx_v_odfden = ((PyArrayObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1701 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1701 * odfnum = PyArray_FROM_OTF(dfnum, NPY_DOUBLE, NPY_ALIGNED) * odfden = PyArray_FROM_OTF(dfden, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(odfnum, 0.0)): # <<<<<<<<<<<<<< @@ -8768,7 +8761,7 @@ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1702 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1702 * odfden = PyArray_FROM_OTF(dfden, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(odfnum, 0.0)): * raise ValueError("dfnum <= 0") # <<<<<<<<<<<<<< @@ -8790,7 +8783,7 @@ } __pyx_L9:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1703 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1703 * if np.any(np.less_equal(odfnum, 0.0)): * raise ValueError("dfnum <= 0") * if np.any(np.less_equal(odfden, 0.0)): # <<<<<<<<<<<<<< @@ -8834,7 +8827,7 @@ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1704 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1704 * raise ValueError("dfnum <= 0") * if np.any(np.less_equal(odfden, 0.0)): * raise ValueError("dfden <= 0") # <<<<<<<<<<<<<< @@ -8856,7 +8849,7 @@ } __pyx_L10:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1705 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1705 * if np.any(np.less_equal(odfden, 0.0)): * raise ValueError("dfden <= 0") * return cont2_array(self.internal_state, rk_f, size, odfnum, odfden) # <<<<<<<<<<<<<< @@ -8891,7 +8884,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1707 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1707 * return cont2_array(self.internal_state, rk_f, size, odfnum, odfden) * * def noncentral_f(self, dfnum, dfden, nonc, size=None): # <<<<<<<<<<<<<< @@ -8991,7 +8984,7 @@ __pyx_v_odfden = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_ononc = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1774 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1774 * cdef double fdfnum, fdfden, fnonc * * fdfnum = PyFloat_AsDouble(dfnum) # <<<<<<<<<<<<<< @@ -9000,7 +8993,7 @@ */ __pyx_v_fdfnum = PyFloat_AsDouble(__pyx_v_dfnum); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1775 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1775 * * fdfnum = PyFloat_AsDouble(dfnum) * fdfden = PyFloat_AsDouble(dfden) # <<<<<<<<<<<<<< @@ -9009,7 +9002,7 @@ */ __pyx_v_fdfden = PyFloat_AsDouble(__pyx_v_dfden); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1776 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1776 * fdfnum = PyFloat_AsDouble(dfnum) * fdfden = PyFloat_AsDouble(dfden) * fnonc = PyFloat_AsDouble(nonc) # <<<<<<<<<<<<<< @@ -9018,7 +9011,7 @@ */ __pyx_v_fnonc = PyFloat_AsDouble(__pyx_v_nonc); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1777 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1777 * fdfden = PyFloat_AsDouble(dfden) * fnonc = PyFloat_AsDouble(nonc) * if not PyErr_Occurred(): # <<<<<<<<<<<<<< @@ -9028,7 +9021,7 @@ __pyx_t_1 = (!PyErr_Occurred()); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1778 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1778 * fnonc = PyFloat_AsDouble(nonc) * if not PyErr_Occurred(): * if fdfnum <= 1: # <<<<<<<<<<<<<< @@ -9038,7 +9031,7 @@ __pyx_t_1 = (__pyx_v_fdfnum <= 1); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1779 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1779 * if not PyErr_Occurred(): * if fdfnum <= 1: * raise ValueError("dfnum <= 1") # <<<<<<<<<<<<<< @@ -9060,7 +9053,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1780 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1780 * if fdfnum <= 1: * raise ValueError("dfnum <= 1") * if fdfden <= 0: # <<<<<<<<<<<<<< @@ -9070,7 +9063,7 @@ __pyx_t_1 = (__pyx_v_fdfden <= 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1781 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1781 * raise ValueError("dfnum <= 1") * if fdfden <= 0: * raise ValueError("dfden <= 0") # <<<<<<<<<<<<<< @@ -9092,7 +9085,7 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1782 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1782 * if fdfden <= 0: * raise ValueError("dfden <= 0") * if fnonc < 0: # <<<<<<<<<<<<<< @@ -9102,7 +9095,7 @@ __pyx_t_1 = (__pyx_v_fnonc < 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1783 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1783 * raise ValueError("dfden <= 0") * if fnonc < 0: * raise ValueError("nonc < 0") # <<<<<<<<<<<<<< @@ -9124,7 +9117,7 @@ } __pyx_L9:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1784 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1784 * if fnonc < 0: * raise ValueError("nonc < 0") * return cont3_array_sc(self.internal_state, rk_noncentral_f, size, # <<<<<<<<<<<<<< @@ -9133,7 +9126,7 @@ */ __Pyx_XDECREF(__pyx_r); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1785 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1785 * raise ValueError("nonc < 0") * return cont3_array_sc(self.internal_state, rk_noncentral_f, size, * fdfnum, fdfden, fnonc) # <<<<<<<<<<<<<< @@ -9149,7 +9142,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1787 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1787 * fdfnum, fdfden, fnonc) * * PyErr_Clear() # <<<<<<<<<<<<<< @@ -9158,7 +9151,7 @@ */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1789 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1789 * PyErr_Clear() * * odfnum = PyArray_FROM_OTF(dfnum, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -9172,7 +9165,7 @@ __pyx_v_odfnum = ((PyArrayObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1790 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1790 * * odfnum = PyArray_FROM_OTF(dfnum, NPY_DOUBLE, NPY_ALIGNED) * odfden = PyArray_FROM_OTF(dfden, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -9186,7 +9179,7 @@ __pyx_v_odfden = ((PyArrayObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1791 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1791 * odfnum = PyArray_FROM_OTF(dfnum, NPY_DOUBLE, NPY_ALIGNED) * odfden = PyArray_FROM_OTF(dfden, NPY_DOUBLE, NPY_ALIGNED) * ononc = PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -9200,7 +9193,7 @@ __pyx_v_ononc = ((PyArrayObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1793 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1793 * ononc = PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ALIGNED) * * if np.any(np.less_equal(odfnum, 1.0)): # <<<<<<<<<<<<<< @@ -9244,7 +9237,7 @@ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1794 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1794 * * if np.any(np.less_equal(odfnum, 1.0)): * raise ValueError("dfnum <= 1") # <<<<<<<<<<<<<< @@ -9266,7 +9259,7 @@ } __pyx_L10:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1795 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1795 * if np.any(np.less_equal(odfnum, 1.0)): * raise ValueError("dfnum <= 1") * if np.any(np.less_equal(odfden, 0.0)): # <<<<<<<<<<<<<< @@ -9310,7 +9303,7 @@ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1796 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1796 * raise ValueError("dfnum <= 1") * if np.any(np.less_equal(odfden, 0.0)): * raise ValueError("dfden <= 0") # <<<<<<<<<<<<<< @@ -9332,7 +9325,7 @@ } __pyx_L11:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1797 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1797 * if np.any(np.less_equal(odfden, 0.0)): * raise ValueError("dfden <= 0") * if np.any(np.less(ononc, 0.0)): # <<<<<<<<<<<<<< @@ -9376,7 +9369,7 @@ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1798 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1798 * raise ValueError("dfden <= 0") * if np.any(np.less(ononc, 0.0)): * raise ValueError("nonc < 0") # <<<<<<<<<<<<<< @@ -9398,7 +9391,7 @@ } __pyx_L12:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1799 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1799 * if np.any(np.less(ononc, 0.0)): * raise ValueError("nonc < 0") * return cont3_array(self.internal_state, rk_noncentral_f, size, odfnum, # <<<<<<<<<<<<<< @@ -9407,7 +9400,7 @@ */ __Pyx_XDECREF(__pyx_r); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1800 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1800 * raise ValueError("nonc < 0") * return cont3_array(self.internal_state, rk_noncentral_f, size, odfnum, * odfden, ononc) # <<<<<<<<<<<<<< @@ -9443,7 +9436,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1802 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1802 * odfden, ononc) * * def chisquare(self, df, size=None): # <<<<<<<<<<<<<< @@ -9513,7 +9506,7 @@ __Pyx_INCREF(__pyx_v_size); __pyx_v_odf = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1869 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1869 * cdef double fdf * * fdf = PyFloat_AsDouble(df) # <<<<<<<<<<<<<< @@ -9522,7 +9515,7 @@ */ __pyx_v_fdf = PyFloat_AsDouble(__pyx_v_df); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1870 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1870 * * fdf = PyFloat_AsDouble(df) * if not PyErr_Occurred(): # <<<<<<<<<<<<<< @@ -9532,7 +9525,7 @@ __pyx_t_1 = (!PyErr_Occurred()); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1871 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1871 * fdf = PyFloat_AsDouble(df) * if not PyErr_Occurred(): * if fdf <= 0: # <<<<<<<<<<<<<< @@ -9542,7 +9535,7 @@ __pyx_t_1 = (__pyx_v_fdf <= 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1872 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1872 * if not PyErr_Occurred(): * if fdf <= 0: * raise ValueError("df <= 0") # <<<<<<<<<<<<<< @@ -9564,7 +9557,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1873 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1873 * if fdf <= 0: * raise ValueError("df <= 0") * return cont1_array_sc(self.internal_state, rk_chisquare, size, fdf) # <<<<<<<<<<<<<< @@ -9581,7 +9574,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1875 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1875 * return cont1_array_sc(self.internal_state, rk_chisquare, size, fdf) * * PyErr_Clear() # <<<<<<<<<<<<<< @@ -9590,7 +9583,7 @@ */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1877 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1877 * PyErr_Clear() * * odf = PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -9604,7 +9597,7 @@ __pyx_v_odf = ((PyArrayObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1878 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1878 * * odf = PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(odf, 0.0)): # <<<<<<<<<<<<<< @@ -9648,7 +9641,7 @@ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1879 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1879 * odf = PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(odf, 0.0)): * raise ValueError("df <= 0") # <<<<<<<<<<<<<< @@ -9670,7 +9663,7 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1880 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1880 * if np.any(np.less_equal(odf, 0.0)): * raise ValueError("df <= 0") * return cont1_array(self.internal_state, rk_chisquare, size, odf) # <<<<<<<<<<<<<< @@ -9703,7 +9696,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1882 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1882 * return cont1_array(self.internal_state, rk_chisquare, size, odf) * * def noncentral_chisquare(self, df, nonc, size=None): # <<<<<<<<<<<<<< @@ -9789,7 +9782,7 @@ __pyx_v_odf = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_ononc = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1953 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1953 * cdef ndarray odf, ononc * cdef double fdf, fnonc * fdf = PyFloat_AsDouble(df) # <<<<<<<<<<<<<< @@ -9798,7 +9791,7 @@ */ __pyx_v_fdf = PyFloat_AsDouble(__pyx_v_df); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1954 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1954 * cdef double fdf, fnonc * fdf = PyFloat_AsDouble(df) * fnonc = PyFloat_AsDouble(nonc) # <<<<<<<<<<<<<< @@ -9807,7 +9800,7 @@ */ __pyx_v_fnonc = PyFloat_AsDouble(__pyx_v_nonc); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1955 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1955 * fdf = PyFloat_AsDouble(df) * fnonc = PyFloat_AsDouble(nonc) * if not PyErr_Occurred(): # <<<<<<<<<<<<<< @@ -9817,7 +9810,7 @@ __pyx_t_1 = (!PyErr_Occurred()); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1956 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1956 * fnonc = PyFloat_AsDouble(nonc) * if not PyErr_Occurred(): * if fdf <= 1: # <<<<<<<<<<<<<< @@ -9827,7 +9820,7 @@ __pyx_t_1 = (__pyx_v_fdf <= 1); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1957 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1957 * if not PyErr_Occurred(): * if fdf <= 1: * raise ValueError("df <= 0") # <<<<<<<<<<<<<< @@ -9849,7 +9842,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1958 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1958 * if fdf <= 1: * raise ValueError("df <= 0") * if fnonc <= 0: # <<<<<<<<<<<<<< @@ -9859,7 +9852,7 @@ __pyx_t_1 = (__pyx_v_fnonc <= 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1959 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1959 * raise ValueError("df <= 0") * if fnonc <= 0: * raise ValueError("nonc <= 0") # <<<<<<<<<<<<<< @@ -9881,7 +9874,7 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1960 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1960 * if fnonc <= 0: * raise ValueError("nonc <= 0") * return cont2_array_sc(self.internal_state, rk_noncentral_chisquare, # <<<<<<<<<<<<<< @@ -9890,7 +9883,7 @@ */ __Pyx_XDECREF(__pyx_r); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1961 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1961 * raise ValueError("nonc <= 0") * return cont2_array_sc(self.internal_state, rk_noncentral_chisquare, * size, fdf, fnonc) # <<<<<<<<<<<<<< @@ -9906,7 +9899,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1963 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1963 * size, fdf, fnonc) * * PyErr_Clear() # <<<<<<<<<<<<<< @@ -9915,7 +9908,7 @@ */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1965 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1965 * PyErr_Clear() * * odf = PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -9929,7 +9922,7 @@ __pyx_v_odf = ((PyArrayObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1966 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1966 * * odf = PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ALIGNED) * ononc = PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -9943,7 +9936,7 @@ __pyx_v_ononc = ((PyArrayObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1967 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1967 * odf = PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ALIGNED) * ononc = PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(odf, 0.0)): # <<<<<<<<<<<<<< @@ -9987,7 +9980,7 @@ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1968 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1968 * ononc = PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(odf, 0.0)): * raise ValueError("df <= 1") # <<<<<<<<<<<<<< @@ -10009,7 +10002,7 @@ } __pyx_L9:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1969 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1969 * if np.any(np.less_equal(odf, 0.0)): * raise ValueError("df <= 1") * if np.any(np.less_equal(ononc, 0.0)): # <<<<<<<<<<<<<< @@ -10053,7 +10046,7 @@ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1970 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1970 * raise ValueError("df <= 1") * if np.any(np.less_equal(ononc, 0.0)): * raise ValueError("nonc < 0") # <<<<<<<<<<<<<< @@ -10075,7 +10068,7 @@ } __pyx_L10:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1971 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1971 * if np.any(np.less_equal(ononc, 0.0)): * raise ValueError("nonc < 0") * return cont2_array(self.internal_state, rk_noncentral_chisquare, size, # <<<<<<<<<<<<<< @@ -10084,7 +10077,7 @@ */ __Pyx_XDECREF(__pyx_r); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1972 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1972 * raise ValueError("nonc < 0") * return cont2_array(self.internal_state, rk_noncentral_chisquare, size, * odf, ononc) # <<<<<<<<<<<<<< @@ -10118,7 +10111,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1974 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1974 * odf, ononc) * * def standard_cauchy(self, size=None): # <<<<<<<<<<<<<< @@ -10170,7 +10163,7 @@ return NULL; __pyx_L4_argument_unpacking_done:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2033 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2033 * * """ * return cont0_array(self.internal_state, rk_standard_cauchy, size) # <<<<<<<<<<<<<< @@ -10196,7 +10189,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2035 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2035 * return cont0_array(self.internal_state, rk_standard_cauchy, size) * * def standard_t(self, df, size=None): # <<<<<<<<<<<<<< @@ -10266,7 +10259,7 @@ __Pyx_INCREF(__pyx_v_size); __pyx_v_odf = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2123 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2123 * cdef double fdf * * fdf = PyFloat_AsDouble(df) # <<<<<<<<<<<<<< @@ -10275,7 +10268,7 @@ */ __pyx_v_fdf = PyFloat_AsDouble(__pyx_v_df); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2124 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2124 * * fdf = PyFloat_AsDouble(df) * if not PyErr_Occurred(): # <<<<<<<<<<<<<< @@ -10285,7 +10278,7 @@ __pyx_t_1 = (!PyErr_Occurred()); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2125 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2125 * fdf = PyFloat_AsDouble(df) * if not PyErr_Occurred(): * if fdf <= 0: # <<<<<<<<<<<<<< @@ -10295,7 +10288,7 @@ __pyx_t_1 = (__pyx_v_fdf <= 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2126 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2126 * if not PyErr_Occurred(): * if fdf <= 0: * raise ValueError("df <= 0") # <<<<<<<<<<<<<< @@ -10317,7 +10310,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2127 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2127 * if fdf <= 0: * raise ValueError("df <= 0") * return cont1_array_sc(self.internal_state, rk_standard_t, size, fdf) # <<<<<<<<<<<<<< @@ -10334,7 +10327,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2129 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2129 * return cont1_array_sc(self.internal_state, rk_standard_t, size, fdf) * * PyErr_Clear() # <<<<<<<<<<<<<< @@ -10343,7 +10336,7 @@ */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2131 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2131 * PyErr_Clear() * * odf = PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -10357,7 +10350,7 @@ __pyx_v_odf = ((PyArrayObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2132 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2132 * * odf = PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(odf, 0.0)): # <<<<<<<<<<<<<< @@ -10401,7 +10394,7 @@ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2133 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2133 * odf = PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(odf, 0.0)): * raise ValueError("df <= 0") # <<<<<<<<<<<<<< @@ -10423,7 +10416,7 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2134 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2134 * if np.any(np.less_equal(odf, 0.0)): * raise ValueError("df <= 0") * return cont1_array(self.internal_state, rk_standard_t, size, odf) # <<<<<<<<<<<<<< @@ -10456,7 +10449,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2136 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2136 * return cont1_array(self.internal_state, rk_standard_t, size, odf) * * def vonmises(self, mu, kappa, size=None): # <<<<<<<<<<<<<< @@ -10542,7 +10535,7 @@ __pyx_v_omu = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_okappa = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2216 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2216 * cdef double fmu, fkappa * * fmu = PyFloat_AsDouble(mu) # <<<<<<<<<<<<<< @@ -10551,7 +10544,7 @@ */ __pyx_v_fmu = PyFloat_AsDouble(__pyx_v_mu); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2217 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2217 * * fmu = PyFloat_AsDouble(mu) * fkappa = PyFloat_AsDouble(kappa) # <<<<<<<<<<<<<< @@ -10560,7 +10553,7 @@ */ __pyx_v_fkappa = PyFloat_AsDouble(__pyx_v_kappa); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2218 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2218 * fmu = PyFloat_AsDouble(mu) * fkappa = PyFloat_AsDouble(kappa) * if not PyErr_Occurred(): # <<<<<<<<<<<<<< @@ -10570,7 +10563,7 @@ __pyx_t_1 = (!PyErr_Occurred()); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2219 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2219 * fkappa = PyFloat_AsDouble(kappa) * if not PyErr_Occurred(): * if fkappa < 0: # <<<<<<<<<<<<<< @@ -10580,7 +10573,7 @@ __pyx_t_1 = (__pyx_v_fkappa < 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2220 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2220 * if not PyErr_Occurred(): * if fkappa < 0: * raise ValueError("kappa < 0") # <<<<<<<<<<<<<< @@ -10602,7 +10595,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2221 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2221 * if fkappa < 0: * raise ValueError("kappa < 0") * return cont2_array_sc(self.internal_state, rk_vonmises, size, fmu, fkappa) # <<<<<<<<<<<<<< @@ -10619,7 +10612,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2223 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2223 * return cont2_array_sc(self.internal_state, rk_vonmises, size, fmu, fkappa) * * PyErr_Clear() # <<<<<<<<<<<<<< @@ -10628,7 +10621,7 @@ */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2225 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2225 * PyErr_Clear() * * omu = PyArray_FROM_OTF(mu, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -10642,7 +10635,7 @@ __pyx_v_omu = ((PyArrayObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2226 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2226 * * omu = PyArray_FROM_OTF(mu, NPY_DOUBLE, NPY_ALIGNED) * okappa = PyArray_FROM_OTF(kappa, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -10656,7 +10649,7 @@ __pyx_v_okappa = ((PyArrayObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2227 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2227 * omu = PyArray_FROM_OTF(mu, NPY_DOUBLE, NPY_ALIGNED) * okappa = PyArray_FROM_OTF(kappa, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less(okappa, 0.0)): # <<<<<<<<<<<<<< @@ -10700,7 +10693,7 @@ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2228 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2228 * okappa = PyArray_FROM_OTF(kappa, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less(okappa, 0.0)): * raise ValueError("kappa < 0") # <<<<<<<<<<<<<< @@ -10722,7 +10715,7 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2229 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2229 * if np.any(np.less(okappa, 0.0)): * raise ValueError("kappa < 0") * return cont2_array(self.internal_state, rk_vonmises, size, omu, okappa) # <<<<<<<<<<<<<< @@ -10757,7 +10750,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2231 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2231 * return cont2_array(self.internal_state, rk_vonmises, size, omu, okappa) * * def pareto(self, a, size=None): # <<<<<<<<<<<<<< @@ -10827,7 +10820,7 @@ __Pyx_INCREF(__pyx_v_size); __pyx_v_oa = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2307 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2307 * cdef double fa * * fa = PyFloat_AsDouble(a) # <<<<<<<<<<<<<< @@ -10836,7 +10829,7 @@ */ __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2308 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2308 * * fa = PyFloat_AsDouble(a) * if not PyErr_Occurred(): # <<<<<<<<<<<<<< @@ -10846,7 +10839,7 @@ __pyx_t_1 = (!PyErr_Occurred()); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2309 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2309 * fa = PyFloat_AsDouble(a) * if not PyErr_Occurred(): * if fa <= 0: # <<<<<<<<<<<<<< @@ -10856,7 +10849,7 @@ __pyx_t_1 = (__pyx_v_fa <= 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2310 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2310 * if not PyErr_Occurred(): * if fa <= 0: * raise ValueError("a <= 0") # <<<<<<<<<<<<<< @@ -10878,7 +10871,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2311 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2311 * if fa <= 0: * raise ValueError("a <= 0") * return cont1_array_sc(self.internal_state, rk_pareto, size, fa) # <<<<<<<<<<<<<< @@ -10895,7 +10888,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2313 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2313 * return cont1_array_sc(self.internal_state, rk_pareto, size, fa) * * PyErr_Clear() # <<<<<<<<<<<<<< @@ -10904,7 +10897,7 @@ */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2315 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2315 * PyErr_Clear() * * oa = PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -10918,7 +10911,7 @@ __pyx_v_oa = ((PyArrayObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2316 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2316 * * oa = PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oa, 0.0)): # <<<<<<<<<<<<<< @@ -10962,7 +10955,7 @@ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2317 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2317 * oa = PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oa, 0.0)): * raise ValueError("a <= 0") # <<<<<<<<<<<<<< @@ -10984,7 +10977,7 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2318 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2318 * if np.any(np.less_equal(oa, 0.0)): * raise ValueError("a <= 0") * return cont1_array(self.internal_state, rk_pareto, size, oa) # <<<<<<<<<<<<<< @@ -11017,7 +11010,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2320 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2320 * return cont1_array(self.internal_state, rk_pareto, size, oa) * * def weibull(self, a, size=None): # <<<<<<<<<<<<<< @@ -11087,7 +11080,7 @@ __Pyx_INCREF(__pyx_v_size); __pyx_v_oa = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2407 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2407 * cdef double fa * * fa = PyFloat_AsDouble(a) # <<<<<<<<<<<<<< @@ -11096,7 +11089,7 @@ */ __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2408 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2408 * * fa = PyFloat_AsDouble(a) * if not PyErr_Occurred(): # <<<<<<<<<<<<<< @@ -11106,7 +11099,7 @@ __pyx_t_1 = (!PyErr_Occurred()); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2409 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2409 * fa = PyFloat_AsDouble(a) * if not PyErr_Occurred(): * if fa <= 0: # <<<<<<<<<<<<<< @@ -11116,7 +11109,7 @@ __pyx_t_1 = (__pyx_v_fa <= 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2410 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2410 * if not PyErr_Occurred(): * if fa <= 0: * raise ValueError("a <= 0") # <<<<<<<<<<<<<< @@ -11138,7 +11131,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2411 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2411 * if fa <= 0: * raise ValueError("a <= 0") * return cont1_array_sc(self.internal_state, rk_weibull, size, fa) # <<<<<<<<<<<<<< @@ -11155,7 +11148,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2413 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2413 * return cont1_array_sc(self.internal_state, rk_weibull, size, fa) * * PyErr_Clear() # <<<<<<<<<<<<<< @@ -11164,7 +11157,7 @@ */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2415 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2415 * PyErr_Clear() * * oa = PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -11178,7 +11171,7 @@ __pyx_v_oa = ((PyArrayObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2416 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2416 * * oa = PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oa, 0.0)): # <<<<<<<<<<<<<< @@ -11222,7 +11215,7 @@ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2417 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2417 * oa = PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oa, 0.0)): * raise ValueError("a <= 0") # <<<<<<<<<<<<<< @@ -11244,7 +11237,7 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2418 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2418 * if np.any(np.less_equal(oa, 0.0)): * raise ValueError("a <= 0") * return cont1_array(self.internal_state, rk_weibull, size, oa) # <<<<<<<<<<<<<< @@ -11277,7 +11270,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2420 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2420 * return cont1_array(self.internal_state, rk_weibull, size, oa) * * def power(self, a, size=None): # <<<<<<<<<<<<<< @@ -11347,7 +11340,7 @@ __Pyx_INCREF(__pyx_v_size); __pyx_v_oa = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2516 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2516 * cdef double fa * * fa = PyFloat_AsDouble(a) # <<<<<<<<<<<<<< @@ -11356,7 +11349,7 @@ */ __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2517 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2517 * * fa = PyFloat_AsDouble(a) * if not PyErr_Occurred(): # <<<<<<<<<<<<<< @@ -11366,7 +11359,7 @@ __pyx_t_1 = (!PyErr_Occurred()); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2518 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2518 * fa = PyFloat_AsDouble(a) * if not PyErr_Occurred(): * if fa <= 0: # <<<<<<<<<<<<<< @@ -11376,7 +11369,7 @@ __pyx_t_1 = (__pyx_v_fa <= 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2519 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2519 * if not PyErr_Occurred(): * if fa <= 0: * raise ValueError("a <= 0") # <<<<<<<<<<<<<< @@ -11398,7 +11391,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2520 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2520 * if fa <= 0: * raise ValueError("a <= 0") * return cont1_array_sc(self.internal_state, rk_power, size, fa) # <<<<<<<<<<<<<< @@ -11415,7 +11408,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2522 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2522 * return cont1_array_sc(self.internal_state, rk_power, size, fa) * * PyErr_Clear() # <<<<<<<<<<<<<< @@ -11424,7 +11417,7 @@ */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2524 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2524 * PyErr_Clear() * * oa = PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -11438,7 +11431,7 @@ __pyx_v_oa = ((PyArrayObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2525 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2525 * * oa = PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oa, 0.0)): # <<<<<<<<<<<<<< @@ -11482,7 +11475,7 @@ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2526 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2526 * oa = PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oa, 0.0)): * raise ValueError("a <= 0") # <<<<<<<<<<<<<< @@ -11504,7 +11497,7 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2527 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2527 * if np.any(np.less_equal(oa, 0.0)): * raise ValueError("a <= 0") * return cont1_array(self.internal_state, rk_power, size, oa) # <<<<<<<<<<<<<< @@ -11537,7 +11530,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2529 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2529 * return cont1_array(self.internal_state, rk_power, size, oa) * * def laplace(self, loc=0.0, scale=1.0, size=None): # <<<<<<<<<<<<<< @@ -11625,7 +11618,7 @@ __pyx_v_oloc = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2605 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2605 * cdef double floc, fscale * * floc = PyFloat_AsDouble(loc) # <<<<<<<<<<<<<< @@ -11634,7 +11627,7 @@ */ __pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2606 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2606 * * floc = PyFloat_AsDouble(loc) * fscale = PyFloat_AsDouble(scale) # <<<<<<<<<<<<<< @@ -11643,7 +11636,7 @@ */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2607 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2607 * floc = PyFloat_AsDouble(loc) * fscale = PyFloat_AsDouble(scale) * if not PyErr_Occurred(): # <<<<<<<<<<<<<< @@ -11653,7 +11646,7 @@ __pyx_t_1 = (!PyErr_Occurred()); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2608 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2608 * fscale = PyFloat_AsDouble(scale) * if not PyErr_Occurred(): * if fscale <= 0: # <<<<<<<<<<<<<< @@ -11663,7 +11656,7 @@ __pyx_t_1 = (__pyx_v_fscale <= 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2609 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2609 * if not PyErr_Occurred(): * if fscale <= 0: * raise ValueError("scale <= 0") # <<<<<<<<<<<<<< @@ -11685,7 +11678,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2610 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2610 * if fscale <= 0: * raise ValueError("scale <= 0") * return cont2_array_sc(self.internal_state, rk_laplace, size, floc, fscale) # <<<<<<<<<<<<<< @@ -11702,7 +11695,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2612 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2612 * return cont2_array_sc(self.internal_state, rk_laplace, size, floc, fscale) * * PyErr_Clear() # <<<<<<<<<<<<<< @@ -11711,7 +11704,7 @@ */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2613 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2613 * * PyErr_Clear() * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -11725,7 +11718,7 @@ __pyx_v_oloc = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2614 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2614 * PyErr_Clear() * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED) * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -11739,7 +11732,7 @@ __pyx_v_oscale = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2615 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2615 * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED) * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oscale, 0.0)): # <<<<<<<<<<<<<< @@ -11783,7 +11776,7 @@ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2616 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2616 * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oscale, 0.0)): * raise ValueError("scale <= 0") # <<<<<<<<<<<<<< @@ -11805,7 +11798,7 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2617 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2617 * if np.any(np.less_equal(oscale, 0.0)): * raise ValueError("scale <= 0") * return cont2_array(self.internal_state, rk_laplace, size, oloc, oscale) # <<<<<<<<<<<<<< @@ -11840,7 +11833,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2619 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2619 * return cont2_array(self.internal_state, rk_laplace, size, oloc, oscale) * * def gumbel(self, loc=0.0, scale=1.0, size=None): # <<<<<<<<<<<<<< @@ -11928,7 +11921,7 @@ __pyx_v_oloc = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2729 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2729 * cdef double floc, fscale * * floc = PyFloat_AsDouble(loc) # <<<<<<<<<<<<<< @@ -11937,7 +11930,7 @@ */ __pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2730 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2730 * * floc = PyFloat_AsDouble(loc) * fscale = PyFloat_AsDouble(scale) # <<<<<<<<<<<<<< @@ -11946,7 +11939,7 @@ */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2731 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2731 * floc = PyFloat_AsDouble(loc) * fscale = PyFloat_AsDouble(scale) * if not PyErr_Occurred(): # <<<<<<<<<<<<<< @@ -11956,7 +11949,7 @@ __pyx_t_1 = (!PyErr_Occurred()); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2732 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2732 * fscale = PyFloat_AsDouble(scale) * if not PyErr_Occurred(): * if fscale <= 0: # <<<<<<<<<<<<<< @@ -11966,7 +11959,7 @@ __pyx_t_1 = (__pyx_v_fscale <= 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2733 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2733 * if not PyErr_Occurred(): * if fscale <= 0: * raise ValueError("scale <= 0") # <<<<<<<<<<<<<< @@ -11988,7 +11981,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2734 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2734 * if fscale <= 0: * raise ValueError("scale <= 0") * return cont2_array_sc(self.internal_state, rk_gumbel, size, floc, fscale) # <<<<<<<<<<<<<< @@ -12005,7 +11998,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2736 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2736 * return cont2_array_sc(self.internal_state, rk_gumbel, size, floc, fscale) * * PyErr_Clear() # <<<<<<<<<<<<<< @@ -12014,7 +12007,7 @@ */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2737 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2737 * * PyErr_Clear() * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -12028,7 +12021,7 @@ __pyx_v_oloc = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2738 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2738 * PyErr_Clear() * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED) * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -12042,7 +12035,7 @@ __pyx_v_oscale = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2739 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2739 * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED) * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oscale, 0.0)): # <<<<<<<<<<<<<< @@ -12086,7 +12079,7 @@ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2740 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2740 * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oscale, 0.0)): * raise ValueError("scale <= 0") # <<<<<<<<<<<<<< @@ -12108,7 +12101,7 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2741 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2741 * if np.any(np.less_equal(oscale, 0.0)): * raise ValueError("scale <= 0") * return cont2_array(self.internal_state, rk_gumbel, size, oloc, oscale) # <<<<<<<<<<<<<< @@ -12143,7 +12136,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2743 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2743 * return cont2_array(self.internal_state, rk_gumbel, size, oloc, oscale) * * def logistic(self, loc=0.0, scale=1.0, size=None): # <<<<<<<<<<<<<< @@ -12231,7 +12224,7 @@ __pyx_v_oloc = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2817 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2817 * cdef double floc, fscale * * floc = PyFloat_AsDouble(loc) # <<<<<<<<<<<<<< @@ -12240,7 +12233,7 @@ */ __pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2818 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2818 * * floc = PyFloat_AsDouble(loc) * fscale = PyFloat_AsDouble(scale) # <<<<<<<<<<<<<< @@ -12249,7 +12242,7 @@ */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2819 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2819 * floc = PyFloat_AsDouble(loc) * fscale = PyFloat_AsDouble(scale) * if not PyErr_Occurred(): # <<<<<<<<<<<<<< @@ -12259,7 +12252,7 @@ __pyx_t_1 = (!PyErr_Occurred()); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2820 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2820 * fscale = PyFloat_AsDouble(scale) * if not PyErr_Occurred(): * if fscale <= 0: # <<<<<<<<<<<<<< @@ -12269,7 +12262,7 @@ __pyx_t_1 = (__pyx_v_fscale <= 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2821 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2821 * if not PyErr_Occurred(): * if fscale <= 0: * raise ValueError("scale <= 0") # <<<<<<<<<<<<<< @@ -12291,7 +12284,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2822 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2822 * if fscale <= 0: * raise ValueError("scale <= 0") * return cont2_array_sc(self.internal_state, rk_logistic, size, floc, fscale) # <<<<<<<<<<<<<< @@ -12308,7 +12301,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2824 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2824 * return cont2_array_sc(self.internal_state, rk_logistic, size, floc, fscale) * * PyErr_Clear() # <<<<<<<<<<<<<< @@ -12317,7 +12310,7 @@ */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2825 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2825 * * PyErr_Clear() * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -12331,7 +12324,7 @@ __pyx_v_oloc = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2826 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2826 * PyErr_Clear() * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED) * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -12345,7 +12338,7 @@ __pyx_v_oscale = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2827 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2827 * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ALIGNED) * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oscale, 0.0)): # <<<<<<<<<<<<<< @@ -12389,7 +12382,7 @@ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2828 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2828 * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oscale, 0.0)): * raise ValueError("scale <= 0") # <<<<<<<<<<<<<< @@ -12411,7 +12404,7 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2829 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2829 * if np.any(np.less_equal(oscale, 0.0)): * raise ValueError("scale <= 0") * return cont2_array(self.internal_state, rk_logistic, size, oloc, oscale) # <<<<<<<<<<<<<< @@ -12446,7 +12439,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2831 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2831 * return cont2_array(self.internal_state, rk_logistic, size, oloc, oscale) * * def lognormal(self, mean=0.0, sigma=1.0, size=None): # <<<<<<<<<<<<<< @@ -12534,7 +12527,7 @@ __pyx_v_omean = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_osigma = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2946 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2946 * cdef double fmean, fsigma * * fmean = PyFloat_AsDouble(mean) # <<<<<<<<<<<<<< @@ -12543,7 +12536,7 @@ */ __pyx_v_fmean = PyFloat_AsDouble(__pyx_v_mean); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2947 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2947 * * fmean = PyFloat_AsDouble(mean) * fsigma = PyFloat_AsDouble(sigma) # <<<<<<<<<<<<<< @@ -12552,7 +12545,7 @@ */ __pyx_v_fsigma = PyFloat_AsDouble(__pyx_v_sigma); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2949 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2949 * fsigma = PyFloat_AsDouble(sigma) * * if not PyErr_Occurred(): # <<<<<<<<<<<<<< @@ -12562,7 +12555,7 @@ __pyx_t_1 = (!PyErr_Occurred()); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2950 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2950 * * if not PyErr_Occurred(): * if fsigma <= 0: # <<<<<<<<<<<<<< @@ -12572,7 +12565,7 @@ __pyx_t_1 = (__pyx_v_fsigma <= 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2951 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2951 * if not PyErr_Occurred(): * if fsigma <= 0: * raise ValueError("sigma <= 0") # <<<<<<<<<<<<<< @@ -12594,7 +12587,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2952 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2952 * if fsigma <= 0: * raise ValueError("sigma <= 0") * return cont2_array_sc(self.internal_state, rk_lognormal, size, fmean, fsigma) # <<<<<<<<<<<<<< @@ -12611,7 +12604,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2954 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2954 * return cont2_array_sc(self.internal_state, rk_lognormal, size, fmean, fsigma) * * PyErr_Clear() # <<<<<<<<<<<<<< @@ -12620,7 +12613,7 @@ */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2956 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2956 * PyErr_Clear() * * omean = PyArray_FROM_OTF(mean, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -12634,7 +12627,7 @@ __pyx_v_omean = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2957 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2957 * * omean = PyArray_FROM_OTF(mean, NPY_DOUBLE, NPY_ALIGNED) * osigma = PyArray_FROM_OTF(sigma, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -12648,7 +12641,7 @@ __pyx_v_osigma = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2958 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2958 * omean = PyArray_FROM_OTF(mean, NPY_DOUBLE, NPY_ALIGNED) * osigma = PyArray_FROM_OTF(sigma, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(osigma, 0.0)): # <<<<<<<<<<<<<< @@ -12692,7 +12685,7 @@ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2959 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2959 * osigma = PyArray_FROM_OTF(sigma, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(osigma, 0.0)): * raise ValueError("sigma <= 0.0") # <<<<<<<<<<<<<< @@ -12714,7 +12707,7 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2960 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2960 * if np.any(np.less_equal(osigma, 0.0)): * raise ValueError("sigma <= 0.0") * return cont2_array(self.internal_state, rk_lognormal, size, omean, osigma) # <<<<<<<<<<<<<< @@ -12749,7 +12742,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2962 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2962 * return cont2_array(self.internal_state, rk_lognormal, size, omean, osigma) * * def rayleigh(self, scale=1.0, size=None): # <<<<<<<<<<<<<< @@ -12822,7 +12815,7 @@ __Pyx_INCREF(__pyx_v_size); __pyx_v_oscale = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3020 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3020 * cdef double fscale * * fscale = PyFloat_AsDouble(scale) # <<<<<<<<<<<<<< @@ -12831,7 +12824,7 @@ */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3022 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3022 * fscale = PyFloat_AsDouble(scale) * * if not PyErr_Occurred(): # <<<<<<<<<<<<<< @@ -12841,7 +12834,7 @@ __pyx_t_1 = (!PyErr_Occurred()); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3023 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3023 * * if not PyErr_Occurred(): * if fscale <= 0: # <<<<<<<<<<<<<< @@ -12851,7 +12844,7 @@ __pyx_t_1 = (__pyx_v_fscale <= 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3024 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3024 * if not PyErr_Occurred(): * if fscale <= 0: * raise ValueError("scale <= 0") # <<<<<<<<<<<<<< @@ -12873,7 +12866,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3025 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3025 * if fscale <= 0: * raise ValueError("scale <= 0") * return cont1_array_sc(self.internal_state, rk_rayleigh, size, fscale) # <<<<<<<<<<<<<< @@ -12890,7 +12883,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3027 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3027 * return cont1_array_sc(self.internal_state, rk_rayleigh, size, fscale) * * PyErr_Clear() # <<<<<<<<<<<<<< @@ -12899,7 +12892,7 @@ */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3029 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3029 * PyErr_Clear() * * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -12913,7 +12906,7 @@ __pyx_v_oscale = ((PyArrayObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3030 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3030 * * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oscale, 0.0)): # <<<<<<<<<<<<<< @@ -12957,7 +12950,7 @@ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3031 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3031 * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oscale, 0.0)): * raise ValueError("scale <= 0.0") # <<<<<<<<<<<<<< @@ -12979,7 +12972,7 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3032 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3032 * if np.any(np.less_equal(oscale, 0.0)): * raise ValueError("scale <= 0.0") * return cont1_array(self.internal_state, rk_rayleigh, size, oscale) # <<<<<<<<<<<<<< @@ -13012,7 +13005,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3034 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3034 * return cont1_array(self.internal_state, rk_rayleigh, size, oscale) * * def wald(self, mean, scale, size=None): # <<<<<<<<<<<<<< @@ -13098,7 +13091,7 @@ __pyx_v_omean = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3100 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3100 * cdef double fmean, fscale * * fmean = PyFloat_AsDouble(mean) # <<<<<<<<<<<<<< @@ -13107,7 +13100,7 @@ */ __pyx_v_fmean = PyFloat_AsDouble(__pyx_v_mean); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3101 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3101 * * fmean = PyFloat_AsDouble(mean) * fscale = PyFloat_AsDouble(scale) # <<<<<<<<<<<<<< @@ -13116,7 +13109,7 @@ */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3102 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3102 * fmean = PyFloat_AsDouble(mean) * fscale = PyFloat_AsDouble(scale) * if not PyErr_Occurred(): # <<<<<<<<<<<<<< @@ -13126,7 +13119,7 @@ __pyx_t_1 = (!PyErr_Occurred()); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3103 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3103 * fscale = PyFloat_AsDouble(scale) * if not PyErr_Occurred(): * if fmean <= 0: # <<<<<<<<<<<<<< @@ -13136,7 +13129,7 @@ __pyx_t_1 = (__pyx_v_fmean <= 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3104 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3104 * if not PyErr_Occurred(): * if fmean <= 0: * raise ValueError("mean <= 0") # <<<<<<<<<<<<<< @@ -13158,7 +13151,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3105 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3105 * if fmean <= 0: * raise ValueError("mean <= 0") * if fscale <= 0: # <<<<<<<<<<<<<< @@ -13168,7 +13161,7 @@ __pyx_t_1 = (__pyx_v_fscale <= 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3106 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3106 * raise ValueError("mean <= 0") * if fscale <= 0: * raise ValueError("scale <= 0") # <<<<<<<<<<<<<< @@ -13190,7 +13183,7 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3107 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3107 * if fscale <= 0: * raise ValueError("scale <= 0") * return cont2_array_sc(self.internal_state, rk_wald, size, fmean, fscale) # <<<<<<<<<<<<<< @@ -13207,7 +13200,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3109 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3109 * return cont2_array_sc(self.internal_state, rk_wald, size, fmean, fscale) * * PyErr_Clear() # <<<<<<<<<<<<<< @@ -13216,7 +13209,7 @@ */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3110 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3110 * * PyErr_Clear() * omean = PyArray_FROM_OTF(mean, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -13230,7 +13223,7 @@ __pyx_v_omean = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3111 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3111 * PyErr_Clear() * omean = PyArray_FROM_OTF(mean, NPY_DOUBLE, NPY_ALIGNED) * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -13244,7 +13237,7 @@ __pyx_v_oscale = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3112 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3112 * omean = PyArray_FROM_OTF(mean, NPY_DOUBLE, NPY_ALIGNED) * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(omean,0.0)): # <<<<<<<<<<<<<< @@ -13288,7 +13281,7 @@ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3113 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3113 * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(omean,0.0)): * raise ValueError("mean <= 0.0") # <<<<<<<<<<<<<< @@ -13309,7 +13302,7 @@ goto __pyx_L9; } - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3114 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3114 * if np.any(np.less_equal(omean,0.0)): * raise ValueError("mean <= 0.0") * elif np.any(np.less_equal(oscale,0.0)): # <<<<<<<<<<<<<< @@ -13353,7 +13346,7 @@ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3115 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3115 * raise ValueError("mean <= 0.0") * elif np.any(np.less_equal(oscale,0.0)): * raise ValueError("scale <= 0.0") # <<<<<<<<<<<<<< @@ -13375,7 +13368,7 @@ } __pyx_L9:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3116 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3116 * elif np.any(np.less_equal(oscale,0.0)): * raise ValueError("scale <= 0.0") * return cont2_array(self.internal_state, rk_wald, size, omean, oscale) # <<<<<<<<<<<<<< @@ -13410,7 +13403,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3120 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3120 * * * def triangular(self, left, mode, right, size=None): # <<<<<<<<<<<<<< @@ -13510,7 +13503,7 @@ __pyx_v_omode = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_oright = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3180 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3180 * cdef double fleft, fmode, fright * * fleft = PyFloat_AsDouble(left) # <<<<<<<<<<<<<< @@ -13519,7 +13512,7 @@ */ __pyx_v_fleft = PyFloat_AsDouble(__pyx_v_left); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3181 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3181 * * fleft = PyFloat_AsDouble(left) * fright = PyFloat_AsDouble(right) # <<<<<<<<<<<<<< @@ -13528,7 +13521,7 @@ */ __pyx_v_fright = PyFloat_AsDouble(__pyx_v_right); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3182 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3182 * fleft = PyFloat_AsDouble(left) * fright = PyFloat_AsDouble(right) * fmode = PyFloat_AsDouble(mode) # <<<<<<<<<<<<<< @@ -13537,7 +13530,7 @@ */ __pyx_v_fmode = PyFloat_AsDouble(__pyx_v_mode); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3183 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3183 * fright = PyFloat_AsDouble(right) * fmode = PyFloat_AsDouble(mode) * if not PyErr_Occurred(): # <<<<<<<<<<<<<< @@ -13547,7 +13540,7 @@ __pyx_t_1 = (!PyErr_Occurred()); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3184 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3184 * fmode = PyFloat_AsDouble(mode) * if not PyErr_Occurred(): * if fleft > fmode: # <<<<<<<<<<<<<< @@ -13557,7 +13550,7 @@ __pyx_t_1 = (__pyx_v_fleft > __pyx_v_fmode); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3185 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3185 * if not PyErr_Occurred(): * if fleft > fmode: * raise ValueError("left > mode") # <<<<<<<<<<<<<< @@ -13579,7 +13572,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3186 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3186 * if fleft > fmode: * raise ValueError("left > mode") * if fmode > fright: # <<<<<<<<<<<<<< @@ -13589,7 +13582,7 @@ __pyx_t_1 = (__pyx_v_fmode > __pyx_v_fright); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3187 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3187 * raise ValueError("left > mode") * if fmode > fright: * raise ValueError("mode > right") # <<<<<<<<<<<<<< @@ -13611,7 +13604,7 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3188 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3188 * if fmode > fright: * raise ValueError("mode > right") * if fleft == fright: # <<<<<<<<<<<<<< @@ -13621,7 +13614,7 @@ __pyx_t_1 = (__pyx_v_fleft == __pyx_v_fright); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3189 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3189 * raise ValueError("mode > right") * if fleft == fright: * raise ValueError("left == right") # <<<<<<<<<<<<<< @@ -13643,7 +13636,7 @@ } __pyx_L9:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3190 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3190 * if fleft == fright: * raise ValueError("left == right") * return cont3_array_sc(self.internal_state, rk_triangular, size, fleft, # <<<<<<<<<<<<<< @@ -13652,7 +13645,7 @@ */ __Pyx_XDECREF(__pyx_r); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3191 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3191 * raise ValueError("left == right") * return cont3_array_sc(self.internal_state, rk_triangular, size, fleft, * fmode, fright) # <<<<<<<<<<<<<< @@ -13668,7 +13661,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3193 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3193 * fmode, fright) * * PyErr_Clear() # <<<<<<<<<<<<<< @@ -13677,7 +13670,7 @@ */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3194 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3194 * * PyErr_Clear() * oleft = PyArray_FROM_OTF(left, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -13691,7 +13684,7 @@ __pyx_v_oleft = ((PyArrayObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3195 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3195 * PyErr_Clear() * oleft = PyArray_FROM_OTF(left, NPY_DOUBLE, NPY_ALIGNED) * omode = PyArray_FROM_OTF(mode, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -13705,7 +13698,7 @@ __pyx_v_omode = ((PyArrayObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3196 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3196 * oleft = PyArray_FROM_OTF(left, NPY_DOUBLE, NPY_ALIGNED) * omode = PyArray_FROM_OTF(mode, NPY_DOUBLE, NPY_ALIGNED) * oright = PyArray_FROM_OTF(right, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -13719,7 +13712,7 @@ __pyx_v_oright = ((PyArrayObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3198 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3198 * oright = PyArray_FROM_OTF(right, NPY_DOUBLE, NPY_ALIGNED) * * if np.any(np.greater(oleft, omode)): # <<<<<<<<<<<<<< @@ -13761,7 +13754,7 @@ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3199 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3199 * * if np.any(np.greater(oleft, omode)): * raise ValueError("left > mode") # <<<<<<<<<<<<<< @@ -13783,7 +13776,7 @@ } __pyx_L10:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3200 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3200 * if np.any(np.greater(oleft, omode)): * raise ValueError("left > mode") * if np.any(np.greater(omode, oright)): # <<<<<<<<<<<<<< @@ -13825,7 +13818,7 @@ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3201 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3201 * raise ValueError("left > mode") * if np.any(np.greater(omode, oright)): * raise ValueError("mode > right") # <<<<<<<<<<<<<< @@ -13847,7 +13840,7 @@ } __pyx_L11:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3202 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3202 * if np.any(np.greater(omode, oright)): * raise ValueError("mode > right") * if np.any(np.equal(oleft, oright)): # <<<<<<<<<<<<<< @@ -13889,7 +13882,7 @@ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3203 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3203 * raise ValueError("mode > right") * if np.any(np.equal(oleft, oright)): * raise ValueError("left == right") # <<<<<<<<<<<<<< @@ -13911,7 +13904,7 @@ } __pyx_L12:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3204 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3204 * if np.any(np.equal(oleft, oright)): * raise ValueError("left == right") * return cont3_array(self.internal_state, rk_triangular, size, oleft, # <<<<<<<<<<<<<< @@ -13920,7 +13913,7 @@ */ __Pyx_XDECREF(__pyx_r); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3205 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3205 * raise ValueError("left == right") * return cont3_array(self.internal_state, rk_triangular, size, oleft, * omode, oright) # <<<<<<<<<<<<<< @@ -13956,7 +13949,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3208 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3208 * * # Complicated, discrete distributions: * def binomial(self, n, p, size=None): # <<<<<<<<<<<<<< @@ -14042,7 +14035,7 @@ __pyx_v_on = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_op = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3293 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3293 * cdef double fp * * fp = PyFloat_AsDouble(p) # <<<<<<<<<<<<<< @@ -14051,7 +14044,7 @@ */ __pyx_v_fp = PyFloat_AsDouble(__pyx_v_p); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3294 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3294 * * fp = PyFloat_AsDouble(p) * ln = PyInt_AsLong(n) # <<<<<<<<<<<<<< @@ -14060,7 +14053,7 @@ */ __pyx_v_ln = PyInt_AsLong(__pyx_v_n); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3295 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3295 * fp = PyFloat_AsDouble(p) * ln = PyInt_AsLong(n) * if not PyErr_Occurred(): # <<<<<<<<<<<<<< @@ -14070,7 +14063,7 @@ __pyx_t_1 = (!PyErr_Occurred()); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3296 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3296 * ln = PyInt_AsLong(n) * if not PyErr_Occurred(): * if ln <= 0: # <<<<<<<<<<<<<< @@ -14080,7 +14073,7 @@ __pyx_t_1 = (__pyx_v_ln <= 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3297 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3297 * if not PyErr_Occurred(): * if ln <= 0: * raise ValueError("n <= 0") # <<<<<<<<<<<<<< @@ -14102,7 +14095,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3298 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3298 * if ln <= 0: * raise ValueError("n <= 0") * if fp < 0: # <<<<<<<<<<<<<< @@ -14112,7 +14105,7 @@ __pyx_t_1 = (__pyx_v_fp < 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3299 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3299 * raise ValueError("n <= 0") * if fp < 0: * raise ValueError("p < 0") # <<<<<<<<<<<<<< @@ -14133,7 +14126,7 @@ goto __pyx_L8; } - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3300 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3300 * if fp < 0: * raise ValueError("p < 0") * elif fp > 1: # <<<<<<<<<<<<<< @@ -14143,7 +14136,7 @@ __pyx_t_1 = (__pyx_v_fp > 1); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3301 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3301 * raise ValueError("p < 0") * elif fp > 1: * raise ValueError("p > 1") # <<<<<<<<<<<<<< @@ -14165,7 +14158,7 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3302 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3302 * elif fp > 1: * raise ValueError("p > 1") * return discnp_array_sc(self.internal_state, rk_binomial, size, ln, fp) # <<<<<<<<<<<<<< @@ -14182,7 +14175,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3304 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3304 * return discnp_array_sc(self.internal_state, rk_binomial, size, ln, fp) * * PyErr_Clear() # <<<<<<<<<<<<<< @@ -14191,7 +14184,7 @@ */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3306 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3306 * PyErr_Clear() * * on = PyArray_FROM_OTF(n, NPY_LONG, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -14205,7 +14198,7 @@ __pyx_v_on = ((PyArrayObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3307 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3307 * * on = PyArray_FROM_OTF(n, NPY_LONG, NPY_ALIGNED) * op = PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -14219,7 +14212,7 @@ __pyx_v_op = ((PyArrayObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3308 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3308 * on = PyArray_FROM_OTF(n, NPY_LONG, NPY_ALIGNED) * op = PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(n, 0)): # <<<<<<<<<<<<<< @@ -14261,7 +14254,7 @@ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3309 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3309 * op = PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(n, 0)): * raise ValueError("n <= 0") # <<<<<<<<<<<<<< @@ -14283,7 +14276,7 @@ } __pyx_L9:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3310 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3310 * if np.any(np.less_equal(n, 0)): * raise ValueError("n <= 0") * if np.any(np.less(p, 0)): # <<<<<<<<<<<<<< @@ -14325,7 +14318,7 @@ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3311 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3311 * raise ValueError("n <= 0") * if np.any(np.less(p, 0)): * raise ValueError("p < 0") # <<<<<<<<<<<<<< @@ -14347,7 +14340,7 @@ } __pyx_L10:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3312 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3312 * if np.any(np.less(p, 0)): * raise ValueError("p < 0") * if np.any(np.greater(p, 1)): # <<<<<<<<<<<<<< @@ -14389,7 +14382,7 @@ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3313 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3313 * raise ValueError("p < 0") * if np.any(np.greater(p, 1)): * raise ValueError("p > 1") # <<<<<<<<<<<<<< @@ -14411,7 +14404,7 @@ } __pyx_L11:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3314 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3314 * if np.any(np.greater(p, 1)): * raise ValueError("p > 1") * return discnp_array(self.internal_state, rk_binomial, size, on, op) # <<<<<<<<<<<<<< @@ -14446,7 +14439,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3316 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3316 * return discnp_array(self.internal_state, rk_binomial, size, on, op) * * def negative_binomial(self, n, p, size=None): # <<<<<<<<<<<<<< @@ -14532,7 +14525,7 @@ __pyx_v_on = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_op = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3386 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3386 * cdef double fp * * fp = PyFloat_AsDouble(p) # <<<<<<<<<<<<<< @@ -14541,7 +14534,7 @@ */ __pyx_v_fp = PyFloat_AsDouble(__pyx_v_p); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3387 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3387 * * fp = PyFloat_AsDouble(p) * fn = PyFloat_AsDouble(n) # <<<<<<<<<<<<<< @@ -14550,7 +14543,7 @@ */ __pyx_v_fn = PyFloat_AsDouble(__pyx_v_n); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3388 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3388 * fp = PyFloat_AsDouble(p) * fn = PyFloat_AsDouble(n) * if not PyErr_Occurred(): # <<<<<<<<<<<<<< @@ -14560,7 +14553,7 @@ __pyx_t_1 = (!PyErr_Occurred()); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3389 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3389 * fn = PyFloat_AsDouble(n) * if not PyErr_Occurred(): * if fn <= 0: # <<<<<<<<<<<<<< @@ -14570,7 +14563,7 @@ __pyx_t_1 = (__pyx_v_fn <= 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3390 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3390 * if not PyErr_Occurred(): * if fn <= 0: * raise ValueError("n <= 0") # <<<<<<<<<<<<<< @@ -14592,7 +14585,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3391 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3391 * if fn <= 0: * raise ValueError("n <= 0") * if fp < 0: # <<<<<<<<<<<<<< @@ -14602,7 +14595,7 @@ __pyx_t_1 = (__pyx_v_fp < 0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3392 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3392 * raise ValueError("n <= 0") * if fp < 0: * raise ValueError("p < 0") # <<<<<<<<<<<<<< @@ -14623,7 +14616,7 @@ goto __pyx_L8; } - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3393 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3393 * if fp < 0: * raise ValueError("p < 0") * elif fp > 1: # <<<<<<<<<<<<<< @@ -14633,7 +14626,7 @@ __pyx_t_1 = (__pyx_v_fp > 1); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3394 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3394 * raise ValueError("p < 0") * elif fp > 1: * raise ValueError("p > 1") # <<<<<<<<<<<<<< @@ -14655,7 +14648,7 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3395 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3395 * elif fp > 1: * raise ValueError("p > 1") * return discdd_array_sc(self.internal_state, rk_negative_binomial, # <<<<<<<<<<<<<< @@ -14664,7 +14657,7 @@ */ __Pyx_XDECREF(__pyx_r); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3396 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3396 * raise ValueError("p > 1") * return discdd_array_sc(self.internal_state, rk_negative_binomial, * size, fn, fp) # <<<<<<<<<<<<<< @@ -14680,7 +14673,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3398 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3398 * size, fn, fp) * * PyErr_Clear() # <<<<<<<<<<<<<< @@ -14689,7 +14682,7 @@ */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3400 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3400 * PyErr_Clear() * * on = PyArray_FROM_OTF(n, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -14703,7 +14696,7 @@ __pyx_v_on = ((PyArrayObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3401 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3401 * * on = PyArray_FROM_OTF(n, NPY_DOUBLE, NPY_ALIGNED) * op = PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -14717,7 +14710,7 @@ __pyx_v_op = ((PyArrayObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3402 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3402 * on = PyArray_FROM_OTF(n, NPY_DOUBLE, NPY_ALIGNED) * op = PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(n, 0)): # <<<<<<<<<<<<<< @@ -14759,7 +14752,7 @@ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3403 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3403 * op = PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(n, 0)): * raise ValueError("n <= 0") # <<<<<<<<<<<<<< @@ -14781,7 +14774,7 @@ } __pyx_L9:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3404 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3404 * if np.any(np.less_equal(n, 0)): * raise ValueError("n <= 0") * if np.any(np.less(p, 0)): # <<<<<<<<<<<<<< @@ -14823,7 +14816,7 @@ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3405 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3405 * raise ValueError("n <= 0") * if np.any(np.less(p, 0)): * raise ValueError("p < 0") # <<<<<<<<<<<<<< @@ -14845,7 +14838,7 @@ } __pyx_L10:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3406 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3406 * if np.any(np.less(p, 0)): * raise ValueError("p < 0") * if np.any(np.greater(p, 1)): # <<<<<<<<<<<<<< @@ -14887,7 +14880,7 @@ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3407 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3407 * raise ValueError("p < 0") * if np.any(np.greater(p, 1)): * raise ValueError("p > 1") # <<<<<<<<<<<<<< @@ -14909,7 +14902,7 @@ } __pyx_L11:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3408 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3408 * if np.any(np.greater(p, 1)): * raise ValueError("p > 1") * return discdd_array(self.internal_state, rk_negative_binomial, size, # <<<<<<<<<<<<<< @@ -14918,7 +14911,7 @@ */ __Pyx_XDECREF(__pyx_r); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3409 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3409 * raise ValueError("p > 1") * return discdd_array(self.internal_state, rk_negative_binomial, size, * on, op) # <<<<<<<<<<<<<< @@ -14952,7 +14945,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3411 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3411 * on, op) * * def poisson(self, lam=1.0, size=None): # <<<<<<<<<<<<<< @@ -15025,7 +15018,7 @@ __Pyx_INCREF(__pyx_v_size); __pyx_v_olam = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3461 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3461 * cdef ndarray olam * cdef double flam * flam = PyFloat_AsDouble(lam) # <<<<<<<<<<<<<< @@ -15034,7 +15027,7 @@ */ __pyx_v_flam = PyFloat_AsDouble(__pyx_v_lam); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3462 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3462 * cdef double flam * flam = PyFloat_AsDouble(lam) * if not PyErr_Occurred(): # <<<<<<<<<<<<<< @@ -15044,7 +15037,7 @@ __pyx_t_1 = (!PyErr_Occurred()); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3463 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3463 * flam = PyFloat_AsDouble(lam) * if not PyErr_Occurred(): * if lam < 0: # <<<<<<<<<<<<<< @@ -15057,7 +15050,7 @@ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3464 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3464 * if not PyErr_Occurred(): * if lam < 0: * raise ValueError("lam < 0") # <<<<<<<<<<<<<< @@ -15079,7 +15072,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3465 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3465 * if lam < 0: * raise ValueError("lam < 0") * return discd_array_sc(self.internal_state, rk_poisson, size, flam) # <<<<<<<<<<<<<< @@ -15096,7 +15089,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3467 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3467 * return discd_array_sc(self.internal_state, rk_poisson, size, flam) * * PyErr_Clear() # <<<<<<<<<<<<<< @@ -15105,7 +15098,7 @@ */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3469 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3469 * PyErr_Clear() * * olam = PyArray_FROM_OTF(lam, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -15119,7 +15112,7 @@ __pyx_v_olam = ((PyArrayObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3470 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3470 * * olam = PyArray_FROM_OTF(lam, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less(olam, 0)): # <<<<<<<<<<<<<< @@ -15161,7 +15154,7 @@ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3471 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3471 * olam = PyArray_FROM_OTF(lam, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less(olam, 0)): * raise ValueError("lam < 0") # <<<<<<<<<<<<<< @@ -15183,7 +15176,7 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3472 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3472 * if np.any(np.less(olam, 0)): * raise ValueError("lam < 0") * return discd_array(self.internal_state, rk_poisson, size, olam) # <<<<<<<<<<<<<< @@ -15216,7 +15209,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3474 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3474 * return discd_array(self.internal_state, rk_poisson, size, olam) * * def zipf(self, a, size=None): # <<<<<<<<<<<<<< @@ -15286,7 +15279,7 @@ __Pyx_INCREF(__pyx_v_size); __pyx_v_oa = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3553 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3553 * cdef double fa * * fa = PyFloat_AsDouble(a) # <<<<<<<<<<<<<< @@ -15295,7 +15288,7 @@ */ __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3554 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3554 * * fa = PyFloat_AsDouble(a) * if not PyErr_Occurred(): # <<<<<<<<<<<<<< @@ -15305,7 +15298,7 @@ __pyx_t_1 = (!PyErr_Occurred()); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3555 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3555 * fa = PyFloat_AsDouble(a) * if not PyErr_Occurred(): * if fa <= 1.0: # <<<<<<<<<<<<<< @@ -15315,7 +15308,7 @@ __pyx_t_1 = (__pyx_v_fa <= 1.0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3556 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3556 * if not PyErr_Occurred(): * if fa <= 1.0: * raise ValueError("a <= 1.0") # <<<<<<<<<<<<<< @@ -15337,7 +15330,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3557 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3557 * if fa <= 1.0: * raise ValueError("a <= 1.0") * return discd_array_sc(self.internal_state, rk_zipf, size, fa) # <<<<<<<<<<<<<< @@ -15354,7 +15347,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3559 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3559 * return discd_array_sc(self.internal_state, rk_zipf, size, fa) * * PyErr_Clear() # <<<<<<<<<<<<<< @@ -15363,7 +15356,7 @@ */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3561 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3561 * PyErr_Clear() * * oa = PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -15377,7 +15370,7 @@ __pyx_v_oa = ((PyArrayObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3562 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3562 * * oa = PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oa, 1.0)): # <<<<<<<<<<<<<< @@ -15421,7 +15414,7 @@ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3563 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3563 * oa = PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(oa, 1.0)): * raise ValueError("a <= 1.0") # <<<<<<<<<<<<<< @@ -15443,7 +15436,7 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3564 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3564 * if np.any(np.less_equal(oa, 1.0)): * raise ValueError("a <= 1.0") * return discd_array(self.internal_state, rk_zipf, size, oa) # <<<<<<<<<<<<<< @@ -15476,7 +15469,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3566 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3566 * return discd_array(self.internal_state, rk_zipf, size, oa) * * def geometric(self, p, size=None): # <<<<<<<<<<<<<< @@ -15546,7 +15539,7 @@ __Pyx_INCREF(__pyx_v_size); __pyx_v_op = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3614 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3614 * cdef double fp * * fp = PyFloat_AsDouble(p) # <<<<<<<<<<<<<< @@ -15555,7 +15548,7 @@ */ __pyx_v_fp = PyFloat_AsDouble(__pyx_v_p); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3615 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3615 * * fp = PyFloat_AsDouble(p) * if not PyErr_Occurred(): # <<<<<<<<<<<<<< @@ -15565,7 +15558,7 @@ __pyx_t_1 = (!PyErr_Occurred()); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3616 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3616 * fp = PyFloat_AsDouble(p) * if not PyErr_Occurred(): * if fp < 0.0: # <<<<<<<<<<<<<< @@ -15575,7 +15568,7 @@ __pyx_t_1 = (__pyx_v_fp < 0.0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3617 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3617 * if not PyErr_Occurred(): * if fp < 0.0: * raise ValueError("p < 0.0") # <<<<<<<<<<<<<< @@ -15597,7 +15590,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3618 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3618 * if fp < 0.0: * raise ValueError("p < 0.0") * if fp > 1.0: # <<<<<<<<<<<<<< @@ -15607,7 +15600,7 @@ __pyx_t_1 = (__pyx_v_fp > 1.0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3619 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3619 * raise ValueError("p < 0.0") * if fp > 1.0: * raise ValueError("p > 1.0") # <<<<<<<<<<<<<< @@ -15629,7 +15622,7 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3620 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3620 * if fp > 1.0: * raise ValueError("p > 1.0") * return discd_array_sc(self.internal_state, rk_geometric, size, fp) # <<<<<<<<<<<<<< @@ -15646,7 +15639,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3622 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3622 * return discd_array_sc(self.internal_state, rk_geometric, size, fp) * * PyErr_Clear() # <<<<<<<<<<<<<< @@ -15655,7 +15648,7 @@ */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3625 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3625 * * * op = PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -15669,7 +15662,7 @@ __pyx_v_op = ((PyArrayObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3626 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3626 * * op = PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less(op, 0.0)): # <<<<<<<<<<<<<< @@ -15713,7 +15706,7 @@ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3627 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3627 * op = PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less(op, 0.0)): * raise ValueError("p < 0.0") # <<<<<<<<<<<<<< @@ -15735,7 +15728,7 @@ } __pyx_L9:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3628 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3628 * if np.any(np.less(op, 0.0)): * raise ValueError("p < 0.0") * if np.any(np.greater(op, 1.0)): # <<<<<<<<<<<<<< @@ -15779,7 +15772,7 @@ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3629 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3629 * raise ValueError("p < 0.0") * if np.any(np.greater(op, 1.0)): * raise ValueError("p > 1.0") # <<<<<<<<<<<<<< @@ -15801,7 +15794,7 @@ } __pyx_L10:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3630 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3630 * if np.any(np.greater(op, 1.0)): * raise ValueError("p > 1.0") * return discd_array(self.internal_state, rk_geometric, size, op) # <<<<<<<<<<<<<< @@ -15834,7 +15827,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3632 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3632 * return discd_array(self.internal_state, rk_geometric, size, op) * * def hypergeometric(self, ngood, nbad, nsample, size=None): # <<<<<<<<<<<<<< @@ -15935,7 +15928,7 @@ __pyx_v_onbad = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_onsample = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3719 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3719 * cdef long lngood, lnbad, lnsample * * lngood = PyInt_AsLong(ngood) # <<<<<<<<<<<<<< @@ -15944,7 +15937,7 @@ */ __pyx_v_lngood = PyInt_AsLong(__pyx_v_ngood); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3720 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3720 * * lngood = PyInt_AsLong(ngood) * lnbad = PyInt_AsLong(nbad) # <<<<<<<<<<<<<< @@ -15953,7 +15946,7 @@ */ __pyx_v_lnbad = PyInt_AsLong(__pyx_v_nbad); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3721 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3721 * lngood = PyInt_AsLong(ngood) * lnbad = PyInt_AsLong(nbad) * lnsample = PyInt_AsLong(nsample) # <<<<<<<<<<<<<< @@ -15962,7 +15955,7 @@ */ __pyx_v_lnsample = PyInt_AsLong(__pyx_v_nsample); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3722 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3722 * lnbad = PyInt_AsLong(nbad) * lnsample = PyInt_AsLong(nsample) * if not PyErr_Occurred(): # <<<<<<<<<<<<<< @@ -15972,7 +15965,7 @@ __pyx_t_1 = (!PyErr_Occurred()); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3723 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3723 * lnsample = PyInt_AsLong(nsample) * if not PyErr_Occurred(): * if ngood < 1: # <<<<<<<<<<<<<< @@ -15985,7 +15978,7 @@ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3724 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3724 * if not PyErr_Occurred(): * if ngood < 1: * raise ValueError("ngood < 1") # <<<<<<<<<<<<<< @@ -16007,7 +16000,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3725 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3725 * if ngood < 1: * raise ValueError("ngood < 1") * if nbad < 1: # <<<<<<<<<<<<<< @@ -16020,7 +16013,7 @@ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3726 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3726 * raise ValueError("ngood < 1") * if nbad < 1: * raise ValueError("nbad < 1") # <<<<<<<<<<<<<< @@ -16042,7 +16035,7 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3727 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3727 * if nbad < 1: * raise ValueError("nbad < 1") * if nsample < 1: # <<<<<<<<<<<<<< @@ -16055,7 +16048,7 @@ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3728 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3728 * raise ValueError("nbad < 1") * if nsample < 1: * raise ValueError("nsample < 1") # <<<<<<<<<<<<<< @@ -16077,7 +16070,7 @@ } __pyx_L9:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3729 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3729 * if nsample < 1: * raise ValueError("nsample < 1") * if ngood + nbad < nsample: # <<<<<<<<<<<<<< @@ -16093,7 +16086,7 @@ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3730 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3730 * raise ValueError("nsample < 1") * if ngood + nbad < nsample: * raise ValueError("ngood + nbad < nsample") # <<<<<<<<<<<<<< @@ -16115,7 +16108,7 @@ } __pyx_L10:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3731 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3731 * if ngood + nbad < nsample: * raise ValueError("ngood + nbad < nsample") * return discnmN_array_sc(self.internal_state, rk_hypergeometric, size, # <<<<<<<<<<<<<< @@ -16124,7 +16117,7 @@ */ __Pyx_XDECREF(__pyx_r); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3732 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3732 * raise ValueError("ngood + nbad < nsample") * return discnmN_array_sc(self.internal_state, rk_hypergeometric, size, * lngood, lnbad, lnsample) # <<<<<<<<<<<<<< @@ -16140,7 +16133,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3735 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3735 * * * PyErr_Clear() # <<<<<<<<<<<<<< @@ -16149,7 +16142,7 @@ */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3737 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3737 * PyErr_Clear() * * ongood = PyArray_FROM_OTF(ngood, NPY_LONG, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -16163,7 +16156,7 @@ __pyx_v_ongood = ((PyArrayObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3738 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3738 * * ongood = PyArray_FROM_OTF(ngood, NPY_LONG, NPY_ALIGNED) * onbad = PyArray_FROM_OTF(nbad, NPY_LONG, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -16177,7 +16170,7 @@ __pyx_v_onbad = ((PyArrayObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3739 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3739 * ongood = PyArray_FROM_OTF(ngood, NPY_LONG, NPY_ALIGNED) * onbad = PyArray_FROM_OTF(nbad, NPY_LONG, NPY_ALIGNED) * onsample = PyArray_FROM_OTF(nsample, NPY_LONG, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -16191,7 +16184,7 @@ __pyx_v_onsample = ((PyArrayObject *)__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3740 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3740 * onbad = PyArray_FROM_OTF(nbad, NPY_LONG, NPY_ALIGNED) * onsample = PyArray_FROM_OTF(nsample, NPY_LONG, NPY_ALIGNED) * if np.any(np.less(ongood, 1)): # <<<<<<<<<<<<<< @@ -16233,7 +16226,7 @@ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3741 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3741 * onsample = PyArray_FROM_OTF(nsample, NPY_LONG, NPY_ALIGNED) * if np.any(np.less(ongood, 1)): * raise ValueError("ngood < 1") # <<<<<<<<<<<<<< @@ -16255,7 +16248,7 @@ } __pyx_L11:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3742 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3742 * if np.any(np.less(ongood, 1)): * raise ValueError("ngood < 1") * if np.any(np.less(onbad, 1)): # <<<<<<<<<<<<<< @@ -16297,7 +16290,7 @@ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3743 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3743 * raise ValueError("ngood < 1") * if np.any(np.less(onbad, 1)): * raise ValueError("nbad < 1") # <<<<<<<<<<<<<< @@ -16319,7 +16312,7 @@ } __pyx_L12:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3744 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3744 * if np.any(np.less(onbad, 1)): * raise ValueError("nbad < 1") * if np.any(np.less(onsample, 1)): # <<<<<<<<<<<<<< @@ -16361,7 +16354,7 @@ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3745 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3745 * raise ValueError("nbad < 1") * if np.any(np.less(onsample, 1)): * raise ValueError("nsample < 1") # <<<<<<<<<<<<<< @@ -16383,7 +16376,7 @@ } __pyx_L13:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3746 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3746 * if np.any(np.less(onsample, 1)): * raise ValueError("nsample < 1") * if np.any(np.less(np.add(ongood, onbad),onsample)): # <<<<<<<<<<<<<< @@ -16442,7 +16435,7 @@ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3747 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3747 * raise ValueError("nsample < 1") * if np.any(np.less(np.add(ongood, onbad),onsample)): * raise ValueError("ngood + nbad < nsample") # <<<<<<<<<<<<<< @@ -16464,7 +16457,7 @@ } __pyx_L14:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3748 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3748 * if np.any(np.less(np.add(ongood, onbad),onsample)): * raise ValueError("ngood + nbad < nsample") * return discnmN_array(self.internal_state, rk_hypergeometric, size, # <<<<<<<<<<<<<< @@ -16473,7 +16466,7 @@ */ __Pyx_XDECREF(__pyx_r); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3749 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3749 * raise ValueError("ngood + nbad < nsample") * return discnmN_array(self.internal_state, rk_hypergeometric, size, * ongood, onbad, onsample) # <<<<<<<<<<<<<< @@ -16510,7 +16503,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3751 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3751 * ongood, onbad, onsample) * * def logseries(self, p, size=None): # <<<<<<<<<<<<<< @@ -16580,7 +16573,7 @@ __Pyx_INCREF(__pyx_v_size); __pyx_v_op = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3828 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3828 * cdef double fp * * fp = PyFloat_AsDouble(p) # <<<<<<<<<<<<<< @@ -16589,7 +16582,7 @@ */ __pyx_v_fp = PyFloat_AsDouble(__pyx_v_p); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3829 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3829 * * fp = PyFloat_AsDouble(p) * if not PyErr_Occurred(): # <<<<<<<<<<<<<< @@ -16599,7 +16592,7 @@ __pyx_t_1 = (!PyErr_Occurred()); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3830 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3830 * fp = PyFloat_AsDouble(p) * if not PyErr_Occurred(): * if fp <= 0.0: # <<<<<<<<<<<<<< @@ -16609,7 +16602,7 @@ __pyx_t_1 = (__pyx_v_fp <= 0.0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3831 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3831 * if not PyErr_Occurred(): * if fp <= 0.0: * raise ValueError("p <= 0.0") # <<<<<<<<<<<<<< @@ -16631,7 +16624,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3832 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3832 * if fp <= 0.0: * raise ValueError("p <= 0.0") * if fp >= 1.0: # <<<<<<<<<<<<<< @@ -16641,7 +16634,7 @@ __pyx_t_1 = (__pyx_v_fp >= 1.0); if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3833 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3833 * raise ValueError("p <= 0.0") * if fp >= 1.0: * raise ValueError("p >= 1.0") # <<<<<<<<<<<<<< @@ -16663,7 +16656,7 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3834 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3834 * if fp >= 1.0: * raise ValueError("p >= 1.0") * return discd_array_sc(self.internal_state, rk_logseries, size, fp) # <<<<<<<<<<<<<< @@ -16680,7 +16673,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3836 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3836 * return discd_array_sc(self.internal_state, rk_logseries, size, fp) * * PyErr_Clear() # <<<<<<<<<<<<<< @@ -16689,7 +16682,7 @@ */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3838 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3838 * PyErr_Clear() * * op = PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED) # <<<<<<<<<<<<<< @@ -16703,7 +16696,7 @@ __pyx_v_op = ((PyArrayObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3839 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3839 * * op = PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(op, 0.0)): # <<<<<<<<<<<<<< @@ -16747,7 +16740,7 @@ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3840 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3840 * op = PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED) * if np.any(np.less_equal(op, 0.0)): * raise ValueError("p <= 0.0") # <<<<<<<<<<<<<< @@ -16769,7 +16762,7 @@ } __pyx_L9:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3841 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3841 * if np.any(np.less_equal(op, 0.0)): * raise ValueError("p <= 0.0") * if np.any(np.greater_equal(op, 1.0)): # <<<<<<<<<<<<<< @@ -16813,7 +16806,7 @@ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3842 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3842 * raise ValueError("p <= 0.0") * if np.any(np.greater_equal(op, 1.0)): * raise ValueError("p >= 1.0") # <<<<<<<<<<<<<< @@ -16835,7 +16828,7 @@ } __pyx_L10:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3843 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3843 * if np.any(np.greater_equal(op, 1.0)): * raise ValueError("p >= 1.0") * return discd_array(self.internal_state, rk_logseries, size, op) # <<<<<<<<<<<<<< @@ -16868,7 +16861,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3846 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3846 * * # Multivariate distributions: * def multivariate_normal(self, mean, cov, size=None): # <<<<<<<<<<<<<< @@ -16966,7 +16959,7 @@ __pyx_v_s = Py_None; __Pyx_INCREF(Py_None); __pyx_v_v = Py_None; __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3939 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3939 * """ * # Check preconditions on arguments * mean = np.array(mean) # <<<<<<<<<<<<<< @@ -16991,7 +16984,7 @@ __pyx_v_mean = __pyx_t_3; __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3940 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3940 * # Check preconditions on arguments * mean = np.array(mean) * cov = np.array(cov) # <<<<<<<<<<<<<< @@ -17016,7 +17009,7 @@ __pyx_v_cov = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3941 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3941 * mean = np.array(mean) * cov = np.array(cov) * if size is None: # <<<<<<<<<<<<<< @@ -17026,7 +17019,7 @@ __pyx_t_4 = (__pyx_v_size == Py_None); if (__pyx_t_4) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3942 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3942 * cov = np.array(cov) * if size is None: * shape = [] # <<<<<<<<<<<<<< @@ -17042,7 +17035,7 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3944 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3944 * shape = [] * else: * shape = size # <<<<<<<<<<<<<< @@ -17055,7 +17048,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3945 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3945 * else: * shape = size * if len(mean.shape) != 1: # <<<<<<<<<<<<<< @@ -17069,7 +17062,7 @@ __pyx_t_4 = (__pyx_t_5 != 1); if (__pyx_t_4) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3946 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3946 * shape = size * if len(mean.shape) != 1: * raise ValueError("mean must be 1 dimensional") # <<<<<<<<<<<<<< @@ -17091,7 +17084,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3947 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3947 * if len(mean.shape) != 1: * raise ValueError("mean must be 1 dimensional") * if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]): # <<<<<<<<<<<<<< @@ -17126,7 +17119,7 @@ } if (__pyx_t_7) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3948 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3948 * raise ValueError("mean must be 1 dimensional") * if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]): * raise ValueError("cov must be 2 dimensional and square") # <<<<<<<<<<<<<< @@ -17148,7 +17141,7 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3949 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3949 * if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]): * raise ValueError("cov must be 2 dimensional and square") * if mean.shape[0] != cov.shape[0]: # <<<<<<<<<<<<<< @@ -17173,7 +17166,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_7) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3950 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3950 * raise ValueError("cov must be 2 dimensional and square") * if mean.shape[0] != cov.shape[0]: * raise ValueError("mean and cov must have same length") # <<<<<<<<<<<<<< @@ -17195,7 +17188,7 @@ } __pyx_L9:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3952 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3952 * raise ValueError("mean and cov must have same length") * # Compute shape of output * if isinstance(shape, int): # <<<<<<<<<<<<<< @@ -17205,7 +17198,7 @@ __pyx_t_7 = PyObject_TypeCheck(__pyx_v_shape, ((PyTypeObject *)((PyObject*)&PyInt_Type))); if (__pyx_t_7) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3953 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3953 * # Compute shape of output * if isinstance(shape, int): * shape = [shape] # <<<<<<<<<<<<<< @@ -17224,7 +17217,7 @@ } __pyx_L10:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3954 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3954 * if isinstance(shape, int): * shape = [shape] * final_shape = list(shape[:]) # <<<<<<<<<<<<<< @@ -17245,7 +17238,7 @@ __pyx_v_final_shape = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3955 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3955 * shape = [shape] * final_shape = list(shape[:]) * final_shape.append(mean.shape[0]) # <<<<<<<<<<<<<< @@ -17262,7 +17255,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3959 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3959 * # numbers. The matrix has rows with the same length as mean and as * # many rows are necessary to form a matrix of shape final_shape. * x = self.standard_normal(np.multiply.reduce(final_shape)) # <<<<<<<<<<<<<< @@ -17301,7 +17294,7 @@ __pyx_v_x = __pyx_t_8; __pyx_t_8 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3960 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3960 * # many rows are necessary to form a matrix of shape final_shape. * x = self.standard_normal(np.multiply.reduce(final_shape)) * x.shape = (np.multiply.reduce(final_shape[0:len(final_shape)-1]), # <<<<<<<<<<<<<< @@ -17329,7 +17322,7 @@ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3961 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3961 * x = self.standard_normal(np.multiply.reduce(final_shape)) * x.shape = (np.multiply.reduce(final_shape[0:len(final_shape)-1]), * mean.shape[0]) # <<<<<<<<<<<<<< @@ -17350,7 +17343,7 @@ __pyx_t_3 = 0; __pyx_t_8 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3960 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3960 * # many rows are necessary to form a matrix of shape final_shape. * x = self.standard_normal(np.multiply.reduce(final_shape)) * x.shape = (np.multiply.reduce(final_shape[0:len(final_shape)-1]), # <<<<<<<<<<<<<< @@ -17360,7 +17353,7 @@ if (PyObject_SetAttr(__pyx_v_x, __pyx_n_s__shape, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3969 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3969 * # decomposition of cov is such an A. * * from numpy.dual import svd # <<<<<<<<<<<<<< @@ -17383,7 +17376,7 @@ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3971 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3971 * from numpy.dual import svd * # XXX: we really should be doing this by Cholesky decomposition * (u,s,v) = svd(cov) # <<<<<<<<<<<<<< @@ -17436,7 +17429,7 @@ __pyx_t_1 = 0; } - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3972 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3972 * # XXX: we really should be doing this by Cholesky decomposition * (u,s,v) = svd(cov) * x = np.dot(x*np.sqrt(s),v) # <<<<<<<<<<<<<< @@ -17481,7 +17474,7 @@ __pyx_v_x = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3975 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3975 * # The rows of x now have the correct covariance but mean 0. Add * # mean to each row. Then each row will have mean mean. * np.add(mean,x,x) # <<<<<<<<<<<<<< @@ -17510,7 +17503,7 @@ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3976 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3976 * # mean to each row. Then each row will have mean mean. * np.add(mean,x,x) * x.shape = tuple(final_shape) # <<<<<<<<<<<<<< @@ -17528,7 +17521,7 @@ if (PyObject_SetAttr(__pyx_v_x, __pyx_n_s__shape, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3977 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3977 * np.add(mean,x,x) * x.shape = tuple(final_shape) * return x # <<<<<<<<<<<<<< @@ -17567,7 +17560,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3979 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3979 * return x * * def multinomial(self, long n, object pvals, size=None): # <<<<<<<<<<<<<< @@ -17663,7 +17656,7 @@ __pyx_v_shape = Py_None; __Pyx_INCREF(Py_None); __pyx_v_multin = Py_None; __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4038 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4038 * cdef double Sum * * d = len(pvals) # <<<<<<<<<<<<<< @@ -17673,7 +17666,7 @@ __pyx_t_1 = PyObject_Length(__pyx_v_pvals); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4038; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_d = __pyx_t_1; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4039 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4039 * * d = len(pvals) * parr = PyArray_ContiguousFromObject(pvals, NPY_DOUBLE, 1, 1) # <<<<<<<<<<<<<< @@ -17687,7 +17680,7 @@ arrayObject_parr = ((PyArrayObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4040 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4040 * d = len(pvals) * parr = PyArray_ContiguousFromObject(pvals, NPY_DOUBLE, 1, 1) * pix = parr.data # <<<<<<<<<<<<<< @@ -17696,7 +17689,7 @@ */ __pyx_v_pix = ((double *)arrayObject_parr->data); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4042 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4042 * pix = parr.data * * if kahan_sum(pix, d-1) > (1.0 + 1e-12): # <<<<<<<<<<<<<< @@ -17706,7 +17699,7 @@ __pyx_t_3 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix, (__pyx_v_d - 1)) > (1.0 + 9.9999999999999998e-13)); if (__pyx_t_3) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4043 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4043 * * if kahan_sum(pix, d-1) > (1.0 + 1e-12): * raise ValueError("sum(pvals[:-1]) > 1.0") # <<<<<<<<<<<<<< @@ -17728,7 +17721,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4045 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4045 * raise ValueError("sum(pvals[:-1]) > 1.0") * * if size is None: # <<<<<<<<<<<<<< @@ -17738,7 +17731,7 @@ __pyx_t_3 = (__pyx_v_size == Py_None); if (__pyx_t_3) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4046 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4046 * * if size is None: * shape = (d,) # <<<<<<<<<<<<<< @@ -17758,17 +17751,20 @@ goto __pyx_L7; } - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4047 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4047 * if size is None: * shape = (d,) * elif type(size) is int: # <<<<<<<<<<<<<< * shape = (size, d) * else: */ - __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_size)) == ((PyObject *)((PyObject*)&PyInt_Type))); + __pyx_t_2 = ((PyObject *)__Pyx_Type(__pyx_v_size)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4047; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __pyx_t_3 = (__pyx_t_2 == ((PyObject*)&PyInt_Type)); + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; if (__pyx_t_3) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4048 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4048 * shape = (d,) * elif type(size) is int: * shape = (size, d) # <<<<<<<<<<<<<< @@ -17792,7 +17788,7 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4050 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4050 * shape = (size, d) * else: * shape = size + (d,) # <<<<<<<<<<<<<< @@ -17815,7 +17811,7 @@ } __pyx_L7:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4052 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4052 * shape = size + (d,) * * multin = np.zeros(shape, int) # <<<<<<<<<<<<<< @@ -17843,7 +17839,7 @@ __pyx_v_multin = __pyx_t_5; __pyx_t_5 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4053 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4053 * * multin = np.zeros(shape, int) * mnarr = multin # <<<<<<<<<<<<<< @@ -17854,7 +17850,7 @@ __Pyx_DECREF(((PyObject *)arrayObject_mnarr)); arrayObject_mnarr = ((PyArrayObject *)__pyx_v_multin); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4054 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4054 * multin = np.zeros(shape, int) * mnarr = multin * mnix = mnarr.data # <<<<<<<<<<<<<< @@ -17863,7 +17859,7 @@ */ __pyx_v_mnix = ((long *)arrayObject_mnarr->data); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4055 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4055 * mnarr = multin * mnix = mnarr.data * i = 0 # <<<<<<<<<<<<<< @@ -17872,7 +17868,7 @@ */ __pyx_v_i = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4056 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4056 * mnix = mnarr.data * i = 0 * while i < PyArray_SIZE(mnarr): # <<<<<<<<<<<<<< @@ -17883,7 +17879,7 @@ __pyx_t_3 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr)); if (!__pyx_t_3) break; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4057 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4057 * i = 0 * while i < PyArray_SIZE(mnarr): * Sum = 1.0 # <<<<<<<<<<<<<< @@ -17892,7 +17888,7 @@ */ __pyx_v_Sum = 1.0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4058 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4058 * while i < PyArray_SIZE(mnarr): * Sum = 1.0 * dn = n # <<<<<<<<<<<<<< @@ -17901,7 +17897,7 @@ */ __pyx_v_dn = __pyx_v_n; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4059 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4059 * Sum = 1.0 * dn = n * for j from 0 <= j < d-1: # <<<<<<<<<<<<<< @@ -17911,7 +17907,7 @@ __pyx_t_6 = (__pyx_v_d - 1); for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4060 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4060 * dn = n * for j from 0 <= j < d-1: * mnix[i+j] = rk_binomial(self.internal_state, dn, pix[j]/Sum) # <<<<<<<<<<<<<< @@ -17925,7 +17921,7 @@ } (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]) = rk_binomial(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, __pyx_v_dn, (__pyx_t_7 / __pyx_v_Sum)); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4061 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4061 * for j from 0 <= j < d-1: * mnix[i+j] = rk_binomial(self.internal_state, dn, pix[j]/Sum) * dn = dn - mnix[i+j] # <<<<<<<<<<<<<< @@ -17934,7 +17930,7 @@ */ __pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)])); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4062 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4062 * mnix[i+j] = rk_binomial(self.internal_state, dn, pix[j]/Sum) * dn = dn - mnix[i+j] * if dn <= 0: # <<<<<<<<<<<<<< @@ -17944,7 +17940,7 @@ __pyx_t_3 = (__pyx_v_dn <= 0); if (__pyx_t_3) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4063 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4063 * dn = dn - mnix[i+j] * if dn <= 0: * break # <<<<<<<<<<<<<< @@ -17956,7 +17952,7 @@ } __pyx_L12:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4064 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4064 * if dn <= 0: * break * Sum = Sum - pix[j] # <<<<<<<<<<<<<< @@ -17967,7 +17963,7 @@ } __pyx_L11_break:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4065 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4065 * break * Sum = Sum - pix[j] * if dn > 0: # <<<<<<<<<<<<<< @@ -17977,7 +17973,7 @@ __pyx_t_3 = (__pyx_v_dn > 0); if (__pyx_t_3) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4066 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4066 * Sum = Sum - pix[j] * if dn > 0: * mnix[i+d-1] = dn # <<<<<<<<<<<<<< @@ -17989,7 +17985,7 @@ } __pyx_L13:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4068 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4068 * mnix[i+d-1] = dn * * i = i + d # <<<<<<<<<<<<<< @@ -17999,7 +17995,7 @@ __pyx_v_i = (__pyx_v_i + __pyx_v_d); } - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4070 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4070 * i = i + d * * return multin # <<<<<<<<<<<<<< @@ -18032,7 +18028,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4072 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4072 * return multin * * def dirichlet(self, object alpha, size=None): # <<<<<<<<<<<<<< @@ -18116,7 +18112,7 @@ __pyx_v_shape = Py_None; __Pyx_INCREF(Py_None); __pyx_v_diric = Py_None; __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4136 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4136 * cdef double acc, invacc * * k = len(alpha) # <<<<<<<<<<<<<< @@ -18126,7 +18122,7 @@ __pyx_t_1 = PyObject_Length(__pyx_v_alpha); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_k = __pyx_t_1; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4137 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4137 * * k = len(alpha) * alpha_arr = PyArray_ContiguousFromObject(alpha, NPY_DOUBLE, 1, 1) # <<<<<<<<<<<<<< @@ -18140,7 +18136,7 @@ __pyx_v_alpha_arr = ((PyArrayObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4138 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4138 * k = len(alpha) * alpha_arr = PyArray_ContiguousFromObject(alpha, NPY_DOUBLE, 1, 1) * alpha_data = alpha_arr.data # <<<<<<<<<<<<<< @@ -18149,7 +18145,7 @@ */ __pyx_v_alpha_data = ((double *)__pyx_v_alpha_arr->data); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4140 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4140 * alpha_data = alpha_arr.data * * if size is None: # <<<<<<<<<<<<<< @@ -18159,7 +18155,7 @@ __pyx_t_3 = (__pyx_v_size == Py_None); if (__pyx_t_3) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4141 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4141 * * if size is None: * shape = (k,) # <<<<<<<<<<<<<< @@ -18179,17 +18175,20 @@ goto __pyx_L6; } - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4142 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4142 * if size is None: * shape = (k,) * elif type(size) is int: # <<<<<<<<<<<<<< * shape = (size, k) * else: */ - __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v_size)) == ((PyObject *)((PyObject*)&PyInt_Type))); + __pyx_t_4 = ((PyObject *)__Pyx_Type(__pyx_v_size)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __pyx_t_3 = (__pyx_t_4 == ((PyObject*)&PyInt_Type)); + __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; if (__pyx_t_3) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4143 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4143 * shape = (k,) * elif type(size) is int: * shape = (size, k) # <<<<<<<<<<<<<< @@ -18213,7 +18212,7 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4145 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4145 * shape = (size, k) * else: * shape = size + (k,) # <<<<<<<<<<<<<< @@ -18236,7 +18235,7 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4147 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4147 * shape = size + (k,) * * diric = np.zeros(shape, np.float64) # <<<<<<<<<<<<<< @@ -18269,7 +18268,7 @@ __pyx_v_diric = __pyx_t_5; __pyx_t_5 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4148 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4148 * * diric = np.zeros(shape, np.float64) * val_arr = diric # <<<<<<<<<<<<<< @@ -18280,7 +18279,7 @@ __Pyx_DECREF(((PyObject *)__pyx_v_val_arr)); __pyx_v_val_arr = ((PyArrayObject *)__pyx_v_diric); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4149 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4149 * diric = np.zeros(shape, np.float64) * val_arr = diric * val_data= val_arr.data # <<<<<<<<<<<<<< @@ -18289,7 +18288,7 @@ */ __pyx_v_val_data = ((double *)__pyx_v_val_arr->data); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4151 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4151 * val_data= val_arr.data * * i = 0 # <<<<<<<<<<<<<< @@ -18298,7 +18297,7 @@ */ __pyx_v_i = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4152 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4152 * * i = 0 * totsize = PyArray_SIZE(val_arr) # <<<<<<<<<<<<<< @@ -18307,7 +18306,7 @@ */ __pyx_v_totsize = PyArray_SIZE(__pyx_v_val_arr); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4153 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4153 * i = 0 * totsize = PyArray_SIZE(val_arr) * while i < totsize: # <<<<<<<<<<<<<< @@ -18318,7 +18317,7 @@ __pyx_t_3 = (__pyx_v_i < __pyx_v_totsize); if (!__pyx_t_3) break; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4154 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4154 * totsize = PyArray_SIZE(val_arr) * while i < totsize: * acc = 0.0 # <<<<<<<<<<<<<< @@ -18327,7 +18326,7 @@ */ __pyx_v_acc = 0.0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4155 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4155 * while i < totsize: * acc = 0.0 * for j from 0 <= j < k: # <<<<<<<<<<<<<< @@ -18337,7 +18336,7 @@ __pyx_t_6 = __pyx_v_k; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4156 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4156 * acc = 0.0 * for j from 0 <= j < k: * val_data[i+j] = rk_standard_gamma(self.internal_state, alpha_data[j]) # <<<<<<<<<<<<<< @@ -18346,7 +18345,7 @@ */ (__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)]) = rk_standard_gamma(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state, (__pyx_v_alpha_data[__pyx_v_j])); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4157 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4157 * for j from 0 <= j < k: * val_data[i+j] = rk_standard_gamma(self.internal_state, alpha_data[j]) * acc = acc + val_data[i+j] # <<<<<<<<<<<<<< @@ -18356,7 +18355,7 @@ __pyx_v_acc = (__pyx_v_acc + (__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)])); } - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4158 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4158 * val_data[i+j] = rk_standard_gamma(self.internal_state, alpha_data[j]) * acc = acc + val_data[i+j] * invacc = 1/acc # <<<<<<<<<<<<<< @@ -18369,7 +18368,7 @@ } __pyx_v_invacc = (1 / __pyx_v_acc); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4159 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4159 * acc = acc + val_data[i+j] * invacc = 1/acc * for j from 0 <= j < k: # <<<<<<<<<<<<<< @@ -18379,7 +18378,7 @@ __pyx_t_6 = __pyx_v_k; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4160 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4160 * invacc = 1/acc * for j from 0 <= j < k: * val_data[i+j] = val_data[i+j] * invacc # <<<<<<<<<<<<<< @@ -18389,7 +18388,7 @@ (__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)]) = ((__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)]) * __pyx_v_invacc); } - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4161 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4161 * for j from 0 <= j < k: * val_data[i+j] = val_data[i+j] * invacc * i = i + k # <<<<<<<<<<<<<< @@ -18399,7 +18398,7 @@ __pyx_v_i = (__pyx_v_i + __pyx_v_k); } - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4163 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4163 * i = i + k * * return diric # <<<<<<<<<<<<<< @@ -18432,7 +18431,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4166 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4166 * * # Shuffling and permutations: * def shuffle(self, object x): # <<<<<<<<<<<<<< @@ -18457,7 +18456,7 @@ __Pyx_INCREF((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_v_x); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4176 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4176 * cdef int copy * * i = len(x) - 1 # <<<<<<<<<<<<<< @@ -18467,7 +18466,7 @@ __pyx_t_1 = PyObject_Length(__pyx_v_x); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_i = (__pyx_t_1 - 1); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4177 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4177 * * i = len(x) - 1 * try: # <<<<<<<<<<<<<< @@ -18482,7 +18481,7 @@ __Pyx_XGOTREF(__pyx_save_exc_tb); /*try:*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4178 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4178 * i = len(x) - 1 * try: * j = len(x[0]) # <<<<<<<<<<<<<< @@ -18502,7 +18501,7 @@ __pyx_L5_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4179 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4179 * try: * j = len(x[0]) * except: # <<<<<<<<<<<<<< @@ -18516,7 +18515,7 @@ __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_4); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4180 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4180 * j = len(x[0]) * except: * j = 0 # <<<<<<<<<<<<<< @@ -18543,7 +18542,7 @@ __pyx_L12_try_end:; } - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4182 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4182 * j = 0 * * if (j == 0): # <<<<<<<<<<<<<< @@ -18553,7 +18552,7 @@ __pyx_t_5 = (__pyx_v_j == 0); if (__pyx_t_5) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4184 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4184 * if (j == 0): * # adaptation of random.shuffle() * while i > 0: # <<<<<<<<<<<<<< @@ -18564,7 +18563,7 @@ __pyx_t_5 = (__pyx_v_i > 0); if (!__pyx_t_5) break; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4185 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4185 * # adaptation of random.shuffle() * while i > 0: * j = rk_interval(i, self.internal_state) # <<<<<<<<<<<<<< @@ -18573,7 +18572,7 @@ */ __pyx_v_j = rk_interval(__pyx_v_i, ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4186 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4186 * while i > 0: * j = rk_interval(i, self.internal_state) * x[i], x[j] = x[j], x[i] # <<<<<<<<<<<<<< @@ -18589,7 +18588,7 @@ if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_t_3, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4187 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4187 * j = rk_interval(i, self.internal_state) * x[i], x[j] = x[j], x[i] * i = i - 1 # <<<<<<<<<<<<<< @@ -18602,7 +18601,7 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4190 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4190 * else: * # make copies * copy = hasattr(x[0], 'copy') # <<<<<<<<<<<<<< @@ -18615,7 +18614,7 @@ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_copy = __pyx_t_5; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4191 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4191 * # make copies * copy = hasattr(x[0], 'copy') * if copy: # <<<<<<<<<<<<<< @@ -18625,7 +18624,7 @@ __pyx_t_6 = __pyx_v_copy; if (__pyx_t_6) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4192 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4192 * copy = hasattr(x[0], 'copy') * if copy: * while(i > 0): # <<<<<<<<<<<<<< @@ -18636,7 +18635,7 @@ __pyx_t_5 = (__pyx_v_i > 0); if (!__pyx_t_5) break; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4193 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4193 * if copy: * while(i > 0): * j = rk_interval(i, self.internal_state) # <<<<<<<<<<<<<< @@ -18645,7 +18644,7 @@ */ __pyx_v_j = rk_interval(__pyx_v_i, ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4194 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4194 * while(i > 0): * j = rk_interval(i, self.internal_state) * x[i], x[j] = x[j].copy(), x[i].copy() # <<<<<<<<<<<<<< @@ -18673,7 +18672,7 @@ if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_t_4, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4195 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4195 * j = rk_interval(i, self.internal_state) * x[i], x[j] = x[j].copy(), x[i].copy() * i = i - 1 # <<<<<<<<<<<<<< @@ -18686,7 +18685,7 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4197 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4197 * i = i - 1 * else: * while(i > 0): # <<<<<<<<<<<<<< @@ -18697,7 +18696,7 @@ __pyx_t_5 = (__pyx_v_i > 0); if (!__pyx_t_5) break; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4198 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4198 * else: * while(i > 0): * j = rk_interval(i, self.internal_state) # <<<<<<<<<<<<<< @@ -18706,7 +18705,7 @@ */ __pyx_v_j = rk_interval(__pyx_v_i, ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4199 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4199 * while(i > 0): * j = rk_interval(i, self.internal_state) * x[i], x[j] = x[j][:], x[i][:] # <<<<<<<<<<<<<< @@ -18728,7 +18727,7 @@ if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_t_2, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4200 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4200 * j = rk_interval(i, self.internal_state) * x[i], x[j] = x[j][:], x[i][:] * i = i - 1 # <<<<<<<<<<<<<< @@ -18758,7 +18757,7 @@ return __pyx_r; } -/* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4202 +/* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4202 * i = i - 1 * * def permutation(self, object x): # <<<<<<<<<<<<<< @@ -18780,7 +18779,7 @@ __Pyx_INCREF(__pyx_v_x); __pyx_v_arr = Py_None; __Pyx_INCREF(Py_None); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4229 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4229 * * """ * if isinstance(x, (int, np.integer)): # <<<<<<<<<<<<<< @@ -18804,7 +18803,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4230 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4230 * """ * if isinstance(x, (int, np.integer)): * arr = np.arange(x) # <<<<<<<<<<<<<< @@ -18832,7 +18831,7 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4232 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4232 * arr = np.arange(x) * else: * arr = np.array(x) # <<<<<<<<<<<<<< @@ -18859,7 +18858,7 @@ } __pyx_L5:; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4233 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4233 * else: * arr = np.array(x) * self.shuffle(arr) # <<<<<<<<<<<<<< @@ -18879,7 +18878,7 @@ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4234 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4234 * arr = np.array(x) * self.shuffle(arr) * return arr # <<<<<<<<<<<<<< @@ -19438,10 +19437,10 @@ /*--- Global init code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ - __pyx_ptype_6mtrand_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_6mtrand_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6mtrand_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6mtrand_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_6mtrand_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6mtrand_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_6mtrand_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6mtrand_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr)); if (unlikely(!__pyx_ptype_6mtrand_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6mtrand_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject)); if (unlikely(!__pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6mtrand_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject)); if (unlikely(!__pyx_ptype_6mtrand_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_6mtrand_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject)); if (unlikely(!__pyx_ptype_6mtrand_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyType_Ready(&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_SetAttrString(__pyx_m, "RandomState", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState; @@ -19449,7 +19448,7 @@ /*--- Function import code ---*/ /*--- Execution code ---*/ - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":124 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":124 * * # Initialize numpy * import_array() # <<<<<<<<<<<<<< @@ -19458,7 +19457,7 @@ */ import_array(); - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":126 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":126 * import_array() * * import numpy as np # <<<<<<<<<<<<<< @@ -19470,7 +19469,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":893 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":893 * return bytestring * * def uniform(self, low=0.0, high=1.0, size=None): # <<<<<<<<<<<<<< @@ -19488,7 +19487,7 @@ __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1190 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1190 * return cont0_array(self.internal_state, rk_gauss, size) * * def normal(self, loc=0.0, scale=1.0, size=None): # <<<<<<<<<<<<<< @@ -19506,7 +19505,7 @@ __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1349 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1349 * return cont2_array(self.internal_state, rk_beta, size, oa, ob) * * def exponential(self, scale=1.0, size=None): # <<<<<<<<<<<<<< @@ -19519,7 +19518,7 @@ __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1513 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1513 * return cont1_array(self.internal_state, rk_standard_gamma, size, oshape) * * def gamma(self, shape, scale=1.0, size=None): # <<<<<<<<<<<<<< @@ -19532,7 +19531,7 @@ __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2529 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2529 * return cont1_array(self.internal_state, rk_power, size, oa) * * def laplace(self, loc=0.0, scale=1.0, size=None): # <<<<<<<<<<<<<< @@ -19550,7 +19549,7 @@ __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2619 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2619 * return cont2_array(self.internal_state, rk_laplace, size, oloc, oscale) * * def gumbel(self, loc=0.0, scale=1.0, size=None): # <<<<<<<<<<<<<< @@ -19568,7 +19567,7 @@ __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2743 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2743 * return cont2_array(self.internal_state, rk_gumbel, size, oloc, oscale) * * def logistic(self, loc=0.0, scale=1.0, size=None): # <<<<<<<<<<<<<< @@ -19586,7 +19585,7 @@ __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2831 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2831 * return cont2_array(self.internal_state, rk_logistic, size, oloc, oscale) * * def lognormal(self, mean=0.0, sigma=1.0, size=None): # <<<<<<<<<<<<<< @@ -19604,7 +19603,7 @@ __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":2962 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":2962 * return cont2_array(self.internal_state, rk_lognormal, size, omean, osigma) * * def rayleigh(self, scale=1.0, size=None): # <<<<<<<<<<<<<< @@ -19617,7 +19616,7 @@ __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":3411 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":3411 * on, op) * * def poisson(self, lam=1.0, size=None): # <<<<<<<<<<<<<< @@ -19630,7 +19629,7 @@ __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4236 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4236 * return arr * * _rand = RandomState() # <<<<<<<<<<<<<< @@ -19642,7 +19641,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s___rand, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4237 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4237 * * _rand = RandomState() * seed = _rand.seed # <<<<<<<<<<<<<< @@ -19657,7 +19656,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__seed, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4238 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4238 * _rand = RandomState() * seed = _rand.seed * get_state = _rand.get_state # <<<<<<<<<<<<<< @@ -19672,7 +19671,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__get_state, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4239 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4239 * seed = _rand.seed * get_state = _rand.get_state * set_state = _rand.set_state # <<<<<<<<<<<<<< @@ -19687,7 +19686,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__set_state, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4240 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4240 * get_state = _rand.get_state * set_state = _rand.set_state * random_sample = _rand.random_sample # <<<<<<<<<<<<<< @@ -19702,7 +19701,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__random_sample, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4241 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4241 * set_state = _rand.set_state * random_sample = _rand.random_sample * randint = _rand.randint # <<<<<<<<<<<<<< @@ -19717,7 +19716,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__randint, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4242 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4242 * random_sample = _rand.random_sample * randint = _rand.randint * bytes = _rand.bytes # <<<<<<<<<<<<<< @@ -19732,7 +19731,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__bytes, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4243 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4243 * randint = _rand.randint * bytes = _rand.bytes * uniform = _rand.uniform # <<<<<<<<<<<<<< @@ -19747,7 +19746,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__uniform, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4244 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4244 * bytes = _rand.bytes * uniform = _rand.uniform * rand = _rand.rand # <<<<<<<<<<<<<< @@ -19762,7 +19761,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__rand, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4245 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4245 * uniform = _rand.uniform * rand = _rand.rand * randn = _rand.randn # <<<<<<<<<<<<<< @@ -19777,7 +19776,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__randn, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4246 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4246 * rand = _rand.rand * randn = _rand.randn * random_integers = _rand.random_integers # <<<<<<<<<<<<<< @@ -19792,7 +19791,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__random_integers, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4247 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4247 * randn = _rand.randn * random_integers = _rand.random_integers * standard_normal = _rand.standard_normal # <<<<<<<<<<<<<< @@ -19807,7 +19806,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__standard_normal, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4248 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4248 * random_integers = _rand.random_integers * standard_normal = _rand.standard_normal * normal = _rand.normal # <<<<<<<<<<<<<< @@ -19822,7 +19821,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__normal, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4249 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4249 * standard_normal = _rand.standard_normal * normal = _rand.normal * beta = _rand.beta # <<<<<<<<<<<<<< @@ -19837,7 +19836,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__beta, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4250 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4250 * normal = _rand.normal * beta = _rand.beta * exponential = _rand.exponential # <<<<<<<<<<<<<< @@ -19852,7 +19851,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__exponential, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4251 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4251 * beta = _rand.beta * exponential = _rand.exponential * standard_exponential = _rand.standard_exponential # <<<<<<<<<<<<<< @@ -19867,7 +19866,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_59, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4252 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4252 * exponential = _rand.exponential * standard_exponential = _rand.standard_exponential * standard_gamma = _rand.standard_gamma # <<<<<<<<<<<<<< @@ -19882,7 +19881,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__standard_gamma, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4253 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4253 * standard_exponential = _rand.standard_exponential * standard_gamma = _rand.standard_gamma * gamma = _rand.gamma # <<<<<<<<<<<<<< @@ -19897,7 +19896,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__gamma, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4254 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4254 * standard_gamma = _rand.standard_gamma * gamma = _rand.gamma * f = _rand.f # <<<<<<<<<<<<<< @@ -19912,7 +19911,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__f, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4255 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4255 * gamma = _rand.gamma * f = _rand.f * noncentral_f = _rand.noncentral_f # <<<<<<<<<<<<<< @@ -19927,7 +19926,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__noncentral_f, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4256 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4256 * f = _rand.f * noncentral_f = _rand.noncentral_f * chisquare = _rand.chisquare # <<<<<<<<<<<<<< @@ -19942,7 +19941,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__chisquare, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4257 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4257 * noncentral_f = _rand.noncentral_f * chisquare = _rand.chisquare * noncentral_chisquare = _rand.noncentral_chisquare # <<<<<<<<<<<<<< @@ -19957,7 +19956,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_60, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4258 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4258 * chisquare = _rand.chisquare * noncentral_chisquare = _rand.noncentral_chisquare * standard_cauchy = _rand.standard_cauchy # <<<<<<<<<<<<<< @@ -19972,7 +19971,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__standard_cauchy, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4259 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4259 * noncentral_chisquare = _rand.noncentral_chisquare * standard_cauchy = _rand.standard_cauchy * standard_t = _rand.standard_t # <<<<<<<<<<<<<< @@ -19987,7 +19986,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__standard_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4260 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4260 * standard_cauchy = _rand.standard_cauchy * standard_t = _rand.standard_t * vonmises = _rand.vonmises # <<<<<<<<<<<<<< @@ -20002,7 +20001,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__vonmises, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4261 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4261 * standard_t = _rand.standard_t * vonmises = _rand.vonmises * pareto = _rand.pareto # <<<<<<<<<<<<<< @@ -20017,7 +20016,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__pareto, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4262 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4262 * vonmises = _rand.vonmises * pareto = _rand.pareto * weibull = _rand.weibull # <<<<<<<<<<<<<< @@ -20032,7 +20031,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__weibull, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4263 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4263 * pareto = _rand.pareto * weibull = _rand.weibull * power = _rand.power # <<<<<<<<<<<<<< @@ -20047,7 +20046,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__power, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4264 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4264 * weibull = _rand.weibull * power = _rand.power * laplace = _rand.laplace # <<<<<<<<<<<<<< @@ -20062,7 +20061,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__laplace, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4265 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4265 * power = _rand.power * laplace = _rand.laplace * gumbel = _rand.gumbel # <<<<<<<<<<<<<< @@ -20077,7 +20076,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__gumbel, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4266 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4266 * laplace = _rand.laplace * gumbel = _rand.gumbel * logistic = _rand.logistic # <<<<<<<<<<<<<< @@ -20092,7 +20091,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__logistic, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4267 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4267 * gumbel = _rand.gumbel * logistic = _rand.logistic * lognormal = _rand.lognormal # <<<<<<<<<<<<<< @@ -20107,7 +20106,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__lognormal, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4268 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4268 * logistic = _rand.logistic * lognormal = _rand.lognormal * rayleigh = _rand.rayleigh # <<<<<<<<<<<<<< @@ -20122,7 +20121,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__rayleigh, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4269 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4269 * lognormal = _rand.lognormal * rayleigh = _rand.rayleigh * wald = _rand.wald # <<<<<<<<<<<<<< @@ -20137,7 +20136,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__wald, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4270 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4270 * rayleigh = _rand.rayleigh * wald = _rand.wald * triangular = _rand.triangular # <<<<<<<<<<<<<< @@ -20152,7 +20151,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__triangular, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4272 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4272 * triangular = _rand.triangular * * binomial = _rand.binomial # <<<<<<<<<<<<<< @@ -20167,7 +20166,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__binomial, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4273 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4273 * * binomial = _rand.binomial * negative_binomial = _rand.negative_binomial # <<<<<<<<<<<<<< @@ -20182,7 +20181,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__negative_binomial, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4274 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4274 * binomial = _rand.binomial * negative_binomial = _rand.negative_binomial * poisson = _rand.poisson # <<<<<<<<<<<<<< @@ -20197,7 +20196,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__poisson, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4275 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4275 * negative_binomial = _rand.negative_binomial * poisson = _rand.poisson * zipf = _rand.zipf # <<<<<<<<<<<<<< @@ -20212,7 +20211,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__zipf, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4276 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4276 * poisson = _rand.poisson * zipf = _rand.zipf * geometric = _rand.geometric # <<<<<<<<<<<<<< @@ -20227,7 +20226,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__geometric, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4277 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4277 * zipf = _rand.zipf * geometric = _rand.geometric * hypergeometric = _rand.hypergeometric # <<<<<<<<<<<<<< @@ -20242,7 +20241,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__hypergeometric, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4278 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4278 * geometric = _rand.geometric * hypergeometric = _rand.hypergeometric * logseries = _rand.logseries # <<<<<<<<<<<<<< @@ -20257,7 +20256,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__logseries, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4280 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4280 * logseries = _rand.logseries * * multivariate_normal = _rand.multivariate_normal # <<<<<<<<<<<<<< @@ -20272,7 +20271,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__multivariate_normal, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4281 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4281 * * multivariate_normal = _rand.multivariate_normal * multinomial = _rand.multinomial # <<<<<<<<<<<<<< @@ -20287,7 +20286,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__multinomial, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4282 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4282 * multivariate_normal = _rand.multivariate_normal * multinomial = _rand.multinomial * dirichlet = _rand.dirichlet # <<<<<<<<<<<<<< @@ -20302,7 +20301,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__dirichlet, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4284 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4284 * dirichlet = _rand.dirichlet * * shuffle = _rand.shuffle # <<<<<<<<<<<<<< @@ -20316,7 +20315,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__shuffle, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":4285 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":4285 * * shuffle = _rand.shuffle * permutation = _rand.permutation # <<<<<<<<<<<<<< @@ -20329,7 +20328,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__permutation, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/pauli/koodi/proj/scipy/numpy/numpy/random/mtrand/mtrand.pyx":1 + /* "/home/charris/Workspace/numpy.git/numpy/random/mtrand/mtrand.pyx":1 * # mtrand.pyx -- A Pyrex wrapper of Jean-Sebastien Roy's RandomKit # <<<<<<<<<<<<<< * # * # Copyright 2005 Robert Kern (robert.kern at gmail.com) @@ -20962,7 +20961,7 @@ } -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { +static INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, #if PY_VERSION_HEX < 0x02050000 "need more than %d value%s to unpack", (int)index, @@ -20972,7 +20971,7 @@ (index == 1) ? "" : "s"); } -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void) { +static INLINE void __Pyx_RaiseTooManyValuesError(void) { PyErr_SetString(PyExc_ValueError, "too many values to unpack"); } @@ -21045,7 +21044,7 @@ } -static CYTHON_INLINE int __Pyx_CheckKeywordStrings( +static INLINE int __Pyx_CheckKeywordStrings( PyObject *kwdict, const char* function_name, int kw_allowed) @@ -21079,7 +21078,7 @@ return 0; } -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { +static INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_Format(PyExc_SystemError, "Missing type object"); return 0; @@ -21092,7 +21091,7 @@ } -static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +static INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { PyThreadState *tstate = PyThreadState_GET(); *type = tstate->exc_type; *value = tstate->exc_value; @@ -21157,7 +21156,7 @@ return result; } -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); @@ -21172,7 +21171,7 @@ Py_XDECREF(tmp_tb); } -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; @@ -21294,7 +21293,7 @@ } #endif -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { +static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { const unsigned char neg_one = (unsigned char)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(unsigned char) < sizeof(long)) { @@ -21313,7 +21312,7 @@ return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); } -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { +static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { const unsigned short neg_one = (unsigned short)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(unsigned short) < sizeof(long)) { @@ -21332,7 +21331,7 @@ return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); } -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { +static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { const unsigned int neg_one = (unsigned int)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(unsigned int) < sizeof(long)) { @@ -21351,7 +21350,7 @@ return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); } -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) { +static INLINE char __Pyx_PyInt_AsChar(PyObject* x) { const char neg_one = (char)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(char) < sizeof(long)) { @@ -21370,7 +21369,7 @@ return (char)__Pyx_PyInt_AsLong(x); } -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) { +static INLINE short __Pyx_PyInt_AsShort(PyObject* x) { const short neg_one = (short)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(short) < sizeof(long)) { @@ -21389,7 +21388,7 @@ return (short)__Pyx_PyInt_AsLong(x); } -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) { +static INLINE int __Pyx_PyInt_AsInt(PyObject* x) { const int neg_one = (int)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(int) < sizeof(long)) { @@ -21408,7 +21407,7 @@ return (int)__Pyx_PyInt_AsLong(x); } -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { +static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { const signed char neg_one = (signed char)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(signed char) < sizeof(long)) { @@ -21427,7 +21426,7 @@ return (signed char)__Pyx_PyInt_AsSignedLong(x); } -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { +static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { const signed short neg_one = (signed short)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(signed short) < sizeof(long)) { @@ -21446,7 +21445,7 @@ return (signed short)__Pyx_PyInt_AsSignedLong(x); } -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { +static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { const signed int neg_one = (signed int)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(signed int) < sizeof(long)) { @@ -21465,7 +21464,7 @@ return (signed int)__Pyx_PyInt_AsSignedLong(x); } -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { +static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { const unsigned long neg_one = (unsigned long)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 @@ -21500,7 +21499,7 @@ } } -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { +static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 @@ -21535,7 +21534,7 @@ } } -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) { +static INLINE long __Pyx_PyInt_AsLong(PyObject* x) { const long neg_one = (long)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 @@ -21570,7 +21569,7 @@ } } -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { +static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 @@ -21605,7 +21604,7 @@ } } -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { +static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { const signed long neg_one = (signed long)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 @@ -21640,7 +21639,7 @@ } } -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { +static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 @@ -21678,12 +21677,11 @@ #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, - long size, int strict) + long size) { PyObject *py_module = 0; PyObject *result = 0; PyObject *py_name = 0; - char warning[200]; py_module = __Pyx_ImportModule(module_name); if (!py_module) @@ -21708,15 +21706,9 @@ module_name, class_name); goto bad; } - if (!strict && ((PyTypeObject *)result)->tp_basicsize > size) { - PyOS_snprintf(warning, sizeof(warning), - "%s.%s size changed, may indicate binary incompatibility", - module_name, class_name); - PyErr_WarnEx(NULL, warning, 0); - } - else if (((PyTypeObject *)result)->tp_basicsize != size) { + if (((PyTypeObject *)result)->tp_basicsize != size) { PyErr_Format(PyExc_ValueError, - "%s.%s has the wrong size, try recompiling", + "%s.%s does not appear to be the correct type object", module_name, class_name); goto bad; } @@ -21852,13 +21844,13 @@ /* Type Conversion Functions */ -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { +static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { if (x == Py_True) return 1; else if ((x == Py_False) | (x == Py_None)) return 0; else return PyObject_IsTrue(x); } -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { +static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; @@ -21904,7 +21896,7 @@ return res; } -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { +static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject* x = PyNumber_Index(b); if (!x) return -1; @@ -21913,7 +21905,7 @@ return ival; } -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { +static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { #if PY_VERSION_HEX < 0x02050000 if (ival <= LONG_MAX) return PyInt_FromLong((long)ival); @@ -21927,7 +21919,7 @@ #endif } -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { +static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) { return (size_t)-1; From numpy-svn at scipy.org Tue Feb 23 05:01:49 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 23 Feb 2010 04:01:49 -0600 (CST) Subject: [Numpy-svn] r8257 - trunk/numpy/numarray/include/numpy Message-ID: <20100223100149.C818339CB27@scipy.org> Author: charris Date: 2010-02-23 04:01:49 -0600 (Tue, 23 Feb 2010) New Revision: 8257 Modified: trunk/numpy/numarray/include/numpy/libnumarray.h Log: BUG: NPY_PY3K probably isn't defined when libnumarray.h is included. Modified: trunk/numpy/numarray/include/numpy/libnumarray.h =================================================================== --- trunk/numpy/numarray/include/numpy/libnumarray.h 2010-02-23 09:49:38 UTC (rev 8256) +++ trunk/numpy/numarray/include/numpy/libnumarray.h 2010-02-23 10:01:49 UTC (rev 8257) @@ -40,7 +40,7 @@ #endif #endif -#if defined(NPY_PY3K) +#if PY_VERSION_HEX >= 0x03010000 #define _import_libnumarray() \ { \ PyObject *module = PyImport_ImportModule("numpy.numarray._capi"); \ From numpy-svn at scipy.org Tue Feb 23 13:54:10 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 23 Feb 2010 12:54:10 -0600 (CST) Subject: [Numpy-svn] r8258 - trunk/numpy/core/src/private Message-ID: <20100223185410.83F2C39CB47@scipy.org> Author: charris Date: 2010-02-23 12:54:09 -0600 (Tue, 23 Feb 2010) New Revision: 8258 Modified: trunk/numpy/core/src/private/npy_3kcompat.h Log: ENH: Add compatibility functions in npy_3kcompat.h for the PyCObject -> PyCapsule update. The improved error handling of PyCapsules is tossed out. When Python3k becomes the required version and a major refactoring is undertaken, that defect should be fixed. Modified: trunk/numpy/core/src/private/npy_3kcompat.h =================================================================== --- trunk/numpy/core/src/private/npy_3kcompat.h 2010-02-23 10:01:49 UTC (rev 8257) +++ trunk/numpy/core/src/private/npy_3kcompat.h 2010-02-23 18:54:09 UTC (rev 8258) @@ -213,15 +213,89 @@ #endif /* - * A destructor is needed for PyCapsule objects to - * replace _pya_free. + * PyCObject functions adapted to PyCapsules. + * + * The main job here is to get rid of the improved error handling + * of PyCapsules. It's a shame... */ #if defined(NPY_PY3K) + +static NPY_INLINE PyObject * +NpyCapsule_FromVoidPtr(void *ptr, void (*dtor)(PyObject *)) +{ + PyObject *ret = PyCapsule_New(ptr, NULL, dtor); + if (ret == NULL) { + PyErr_Clear(); + } + return ret; +} + +static NPY_INLINE PyObject * +NpyCapsule_FromVoidPtrAndDesc(void *ptr, void* context, void (*dtor)(PyObject *)) +{ + PyObject *ret = NpyCapsule_New(ptr, dtor); + if (ret != NULL && PyCapsule_SetContext(ret, context) != 0) { + PyErr_Clear(); + Py_DECREF(ret); + ret = NULL; + } + return ret; +} + +static NPY_INLINE void * +NpyCapsule_AsVoidPtr(PyObject *obj) +{ + void *ret = PyCapsule_GetPointer(obj, NULL); + if (ret == NULL) { + PyErr_Clear(); + } + return ret; +} + +static NPY_INLINE int +NpyCapsule_Check(PyObject *ptr) +{ + return PyCapsule_CheckExact(ptr); +} + static void simple_capsule_dtor(PyObject *cap) { PyArray_free(PyCapsule_GetPointer(cap, NULL)); } + +#else + +static NPY_INLINE PyObject * +NpyCapsule_FromVoidPtr(void *ptr, void (*dtor)(void *)) +{ + return PyCObject_FromVoidPtr(ptr, dtor); +} + +static NPY_INLINE PyObject * +NpyCapsule_FromVoidPtrAndDesc(void *ptr, void* context, void (*dtor)(void *)) +{ + return PyCObject_FromVoidPtrAndDesc(ptr, context, dtor); +} + +static NPY_INLINE void * +NpyCapsule_AsVoidPtr(PyObject *ptr) +{ + return PyCObject_AsVoidPtr(ptr); +} + +static NPY_INLINE int +NpyCapsule_Check(PyObject *ptr) +{ + return PyCObject_Check(ptr); +} + +static void +simple_capsule_dtor(void *ptr) +{ + PyArray_free(ptr); +} + #endif #endif /* _NPY_3KCOMPAT_H_ */ From numpy-svn at scipy.org Tue Feb 23 20:57:36 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 23 Feb 2010 19:57:36 -0600 (CST) Subject: [Numpy-svn] r8259 - in vendor/binaries: . nosse sse2 sse3 Message-ID: <20100224015736.6C34239CB0D@scipy.org> Author: cdavid Date: 2010-02-23 19:57:35 -0600 (Tue, 23 Feb 2010) New Revision: 8259 Added: vendor/binaries/README.txt vendor/binaries/nosse/ vendor/binaries/nosse/libblas.a vendor/binaries/nosse/liblapack.a vendor/binaries/sse2/ vendor/binaries/sse2/libatlas.a vendor/binaries/sse2/libcblas.a vendor/binaries/sse2/libf77blas.a vendor/binaries/sse2/liblapack.a vendor/binaries/sse2/libtstatlas.a vendor/binaries/sse3/ vendor/binaries/sse3/libatlas.a vendor/binaries/sse3/libcblas.a vendor/binaries/sse3/libf77blas.a vendor/binaries/sse3/liblapack.a Log: Add blas/lapack binaries for win32. Added: vendor/binaries/README.txt =================================================================== --- vendor/binaries/README.txt (rev 0) +++ vendor/binaries/README.txt 2010-02-24 01:57:35 UTC (rev 8259) @@ -0,0 +1,4 @@ +Those binaries are generated as follows: + - MinGW 3.14, gcc 3.4 + g77 + - Atlas 3.8.3 + - Lapack 3.1.1 Added: vendor/binaries/nosse/libblas.a =================================================================== (Binary files differ) Property changes on: vendor/binaries/nosse/libblas.a ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: vendor/binaries/nosse/liblapack.a =================================================================== (Binary files differ) Property changes on: vendor/binaries/nosse/liblapack.a ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: vendor/binaries/sse2/libatlas.a =================================================================== (Binary files differ) Property changes on: vendor/binaries/sse2/libatlas.a ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: vendor/binaries/sse2/libcblas.a =================================================================== (Binary files differ) Property changes on: vendor/binaries/sse2/libcblas.a ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: vendor/binaries/sse2/libf77blas.a =================================================================== (Binary files differ) Property changes on: vendor/binaries/sse2/libf77blas.a ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: vendor/binaries/sse2/liblapack.a =================================================================== (Binary files differ) Property changes on: vendor/binaries/sse2/liblapack.a ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: vendor/binaries/sse2/libtstatlas.a =================================================================== (Binary files differ) Property changes on: vendor/binaries/sse2/libtstatlas.a ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: vendor/binaries/sse3/libatlas.a =================================================================== (Binary files differ) Property changes on: vendor/binaries/sse3/libatlas.a ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: vendor/binaries/sse3/libcblas.a =================================================================== (Binary files differ) Property changes on: vendor/binaries/sse3/libcblas.a ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: vendor/binaries/sse3/libf77blas.a =================================================================== (Binary files differ) Property changes on: vendor/binaries/sse3/libf77blas.a ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: vendor/binaries/sse3/liblapack.a =================================================================== (Binary files differ) Property changes on: vendor/binaries/sse3/liblapack.a ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream From numpy-svn at scipy.org Wed Feb 24 17:05:03 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 24 Feb 2010 16:05:03 -0600 (CST) Subject: [Numpy-svn] r8260 - trunk/numpy/distutils Message-ID: <20100224220503.B06F339CB4C@scipy.org> Author: stefan Date: 2010-02-24 16:05:03 -0600 (Wed, 24 Feb 2010) New Revision: 8260 Modified: trunk/numpy/distutils/ccompiler.py Log: ENH: Support changed distutils API in Python 2.7. Modified: trunk/numpy/distutils/ccompiler.py =================================================================== --- trunk/numpy/distutils/ccompiler.py 2010-02-24 01:57:35 UTC (rev 8259) +++ trunk/numpy/distutils/ccompiler.py 2010-02-24 22:05:03 UTC (rev 8260) @@ -2,15 +2,19 @@ import os import sys import types +from copy import copy from distutils.ccompiler import * from distutils import ccompiler +from distutils.errors import DistutilsExecError, DistutilsModuleError, \ + DistutilsPlatformError from distutils.sysconfig import customize_compiler from distutils.version import LooseVersion from numpy.distutils import log from numpy.distutils.exec_command import exec_command -from numpy.distutils.misc_util import cyg2win32, is_sequence, mingw32, quote_args, msvc_on_amd64 +from numpy.distutils.misc_util import cyg2win32, is_sequence, mingw32, \ + quote_args, msvc_on_amd64 from numpy.distutils.compat import get_exception # hack to set compiler optimizing options. Needs to integrated with something. From numpy-svn at scipy.org Thu Feb 25 00:20:19 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 24 Feb 2010 23:20:19 -0600 (CST) Subject: [Numpy-svn] r8261 - trunk/numpy/numarray Message-ID: <20100225052019.060F639CB3B@scipy.org> Author: charris Date: 2010-02-24 23:20:18 -0600 (Wed, 24 Feb 2010) New Revision: 8261 Modified: trunk/numpy/numarray/_capi.c Log: ENH: Try to fix numarray _capi.c for Python >= 3.1. Needs testing that I am not in a position to do. Modified: trunk/numpy/numarray/_capi.c =================================================================== --- trunk/numpy/numarray/_capi.c 2010-02-24 22:05:03 UTC (rev 8260) +++ trunk/numpy/numarray/_capi.c 2010-02-25 05:20:18 UTC (rev 8261) @@ -3367,22 +3367,49 @@ #if (!defined(METHOD_TABLE_EXISTS)) static PyMethodDef _libnumarrayMethods[] = { - {NULL, NULL, 0, NULL} /* Sentinel */ + {NULL, NULL, 0, NULL} /* Sentinel */ }; #endif /* boiler plate API init */ +#if PY_VERSION_HEX >= 0x03010000 + +#define RETVAL m + +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "_capi", + NULL, + -1, + _libnumarrayMethods, + NULL, + NULL, + NULL, + NULL +}; + +PyObject *PyInit___capi(void) +#else + +#define RETVAL + PyMODINIT_FUNC init_capi(void) +#endif { - PyObject *m = Py_InitModule("_capi", _libnumarrayMethods); + PyObject *m; PyObject *c_api_object; _Error = PyErr_NewException("numpy.numarray._capi.error", NULL, NULL); /* Create a CObject containing the API pointer array's address */ -#if defined(NPY_PY3K) +#if PY_VERSION_HEX >= 0x03010000 + m = PyModule_Create(&moduledef); c_api_object = PyCapsule_New((void *)libnumarray_API, NULL, NULL); + if (c_api_object == NULL) { + PyErr_Clear(); + } #else + m = Py_InitModule("_capi", _libnumarrayMethods); c_api_object = PyCObject_FromVoidPtr((void *)libnumarray_API, NULL); #endif @@ -3393,13 +3420,16 @@ PyDict_SetItemString(d, "_C_API", c_api_object); PyDict_SetItemString(d, "error", _Error); Py_DECREF(c_api_object); - } else { - return; } - if (PyModule_AddObject(m, "__version__", - PyString_FromString("0.9")) < 0) return; - - if (_import_array() < 0) return; + else { + return RETVAL; + } + if (PyModule_AddObject(m, "__version__", PyString_FromString("0.9")) < 0) { + return RETVAL; + } + if (_import_array() < 0) { + return RETVAL; + } deferred_libnumarray_init(); - return; + return RETVAL; } From numpy-svn at scipy.org Thu Feb 25 00:20:26 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 24 Feb 2010 23:20:26 -0600 (CST) Subject: [Numpy-svn] r8262 - trunk/numpy/core/code_generators Message-ID: <20100225052026.BF68D39CB3B@scipy.org> Author: charris Date: 2010-02-24 23:20:26 -0600 (Wed, 24 Feb 2010) New Revision: 8262 Modified: trunk/numpy/core/code_generators/generate_numpy_api.py trunk/numpy/core/code_generators/generate_ufunc_api.py Log: ENH: Cleanup numpy and ufunc apis for Python >= 3.1. Make sure that an error is set for all error returns so that PyErr_Print() works properly in the import_umath* and import_array* macros. Modified: trunk/numpy/core/code_generators/generate_numpy_api.py =================================================================== --- trunk/numpy/core/code_generators/generate_numpy_api.py 2010-02-25 05:20:18 UTC (rev 8261) +++ trunk/numpy/core/code_generators/generate_numpy_api.py 2010-02-25 05:20:26 UTC (rev 8262) @@ -49,40 +49,57 @@ _import_array(void) { int st; - PyObject *numpy = NULL; + PyObject *numpy = PyImport_ImportModule("numpy.core.multiarray"); PyObject *c_api = NULL; + if (numpy == NULL) { + PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import"); + return -1; + } + c_api = PyObject_GetAttrString(numpy, "_ARRAY_API"); + if (c_api == NULL) { + PyErr_SetString(PyExc_AttributeError, "_ARRAY_API not found"); + Py_DECREF(numpy); + return -1; + } + Py_DECREF(numpy); - -numpy = PyImport_ImportModule("numpy.core.multiarray"); -if (numpy == NULL) return -1; -c_api = PyObject_GetAttrString(numpy, "_ARRAY_API"); -if (c_api == NULL) {Py_DECREF(numpy); return -1;} - #if PY_VERSION_HEX >= 0x03010000 - if (PyCapsule_CheckExact(c_api)) { - PyArray_API = (void **)PyCapsule_GetPointer(c_api, NULL); + if (!PyCapsule_CheckExact(c_api)) { + PyErr_SetString(PyExc_RuntimeError, "_ARRAY_API is not PyCapsule object"); + Py_DECREF(c_api); + return -1; } + PyArray_API = (void **)PyCapsule_GetPointer(c_api, NULL); + Py_DECREF(c_api); + if (PyArray_API == NULL) { + return -1; + } #else - if (PyCObject_Check(c_api)) { - PyArray_API = (void **)PyCObject_AsVoidPtr(c_api); + if (!PyCObject_Check(c_api)) { + PyErr_SetString(PyExc_RuntimeError, "_ARRAY_API is not PyCObject object"); + Py_DECREF(c_api); + return -1; } + PyArray_API = (void **)PyCObject_AsVoidPtr(c_api); + Py_DECREF(c_api); + if (PyArray_API == NULL) { + PyErr_SetString(PyExc_RuntimeError, "_ARRAY_API is NULL pointer"); + return -1; + } #endif - Py_DECREF(c_api); - Py_DECREF(numpy); - if (PyArray_API == NULL) return -1; /* Perform runtime check of C API version */ if (NPY_VERSION != PyArray_GetNDArrayCVersion()) { - PyErr_Format(PyExc_RuntimeError, "module compiled against "\ - "ABI version %%x but this version of numpy is %%x", \ - (int) NPY_VERSION, (int) PyArray_GetNDArrayCVersion()); - return -1; + PyErr_Format(PyExc_RuntimeError, "module compiled against "\ + "ABI version %%x but this version of numpy is %%x", \ + (int) NPY_VERSION, (int) PyArray_GetNDArrayCVersion()); + return -1; } if (NPY_FEATURE_VERSION > PyArray_GetNDArrayCFeatureVersion()) { - PyErr_Format(PyExc_RuntimeError, "module compiled against "\ - "API version %%x but this version of numpy is %%x", \ - (int) NPY_FEATURE_VERSION, (int) PyArray_GetNDArrayCFeatureVersion()); - return -1; + PyErr_Format(PyExc_RuntimeError, "module compiled against "\ + "API version %%x but this version of numpy is %%x", \ + (int) NPY_FEATURE_VERSION, (int) PyArray_GetNDArrayCFeatureVersion()); + return -1; } /* @@ -91,20 +108,20 @@ */ st = PyArray_GetEndianness(); if (st == NPY_CPU_UNKNOWN_ENDIAN) { - PyErr_Format(PyExc_RuntimeError, "FATAL: module compiled as unknown endian"); - return -1; + PyErr_Format(PyExc_RuntimeError, "FATAL: module compiled as unknown endian"); + return -1; } -#if NPY_BYTE_ORDER ==NPY_BIG_ENDIAN +#if NPY_BYTE_ORDER == NPY_BIG_ENDIAN if (st != NPY_CPU_BIG) { - PyErr_Format(PyExc_RuntimeError, "FATAL: module compiled as "\ - "big endian, but detected different endianness at runtime"); - return -1; + PyErr_Format(PyExc_RuntimeError, "FATAL: module compiled as "\ + "big endian, but detected different endianness at runtime"); + return -1; } #elif NPY_BYTE_ORDER == NPY_LITTLE_ENDIAN if (st != NPY_CPU_LITTLE) { - PyErr_Format(PyExc_RuntimeError, "FATAL: module compiled as "\ - "little endian, but detected different endianness at runtime"); - return -1; + PyErr_Format(PyExc_RuntimeError, "FATAL: module compiled as "\ + "little endian, but detected different endianness at runtime"); + return -1; } #endif Modified: trunk/numpy/core/code_generators/generate_ufunc_api.py =================================================================== --- trunk/numpy/core/code_generators/generate_ufunc_api.py 2010-02-25 05:20:18 UTC (rev 8261) +++ trunk/numpy/core/code_generators/generate_ufunc_api.py 2010-02-25 05:20:26 UTC (rev 8262) @@ -41,22 +41,43 @@ PyObject *numpy = PyImport_ImportModule("numpy.core.umath"); PyObject *c_api = NULL; - if (numpy == NULL) return -1; + if (numpy == NULL) { + PyErr_SetString(PyExc_ImportError, "numpy.core.umath failed to import"); + return -1; + } c_api = PyObject_GetAttrString(numpy, "_UFUNC_API"); - if (c_api == NULL) {Py_DECREF(numpy); return -1;} + if (c_api == NULL) { + PyErr_SetString(PyExc_AttributeError, "_UFUNC_API not found"); + Py_DECREF(numpy); + return -1; + } + Py_DECREF(numpy); #if PY_VERSION_HEX >= 0x03010000 - if (PyCapsule_CheckExact(c_api)) { - PyUFunc_API = (void **)PyCapsule_GetPointer(c_api, NULL); + if (!PyCapsule_CheckExact(c_api)) { + PyErr_SetString(PyExc_RuntimeError, "_UFUNC_API is not PyCapsule object"); + Py_DECREF(c_api); + return -1; } + PyUFunc_API = (void **)PyCapsule_GetPointer(c_api, NULL); + Py_DECREF(c_api); + if (PyUFunc_API == NULL) { + return -1; + } #else - if (PyCObject_Check(c_api)) { - PyUFunc_API = (void **)PyCObject_AsVoidPtr(c_api); + if (!PyCObject_Check(c_api)) { + PyErr_SetString(PyExc_RuntimeError, "_UFUNC_API is not PyCObject object"); + Py_DECREF(c_api); + return -1; } -#endif + PyUFunc_API = (void **)PyCObject_AsVoidPtr(c_api); Py_DECREF(c_api); Py_DECREF(numpy); - if (PyUFunc_API == NULL) return -1; + if (PyUFunc_API == NULL) { + PyErr_SetString(PyExc_RuntimeError, "_UFUNC_API is NULL pointer"); + return -1; + } +#endif return 0; } From numpy-svn at scipy.org Thu Feb 25 00:20:34 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 24 Feb 2010 23:20:34 -0600 (CST) Subject: [Numpy-svn] r8263 - trunk/numpy/f2py/tests/f90 Message-ID: <20100225052034.B432C39CB3B@scipy.org> Author: charris Date: 2010-02-24 23:20:34 -0600 (Wed, 24 Feb 2010) New Revision: 8263 Modified: trunk/numpy/f2py/tests/f90/return_character.py trunk/numpy/f2py/tests/f90/return_complex.py trunk/numpy/f2py/tests/f90/return_integer.py trunk/numpy/f2py/tests/f90/return_logical.py trunk/numpy/f2py/tests/f90/return_real.py Log: BUG: Shoddy quick fix of some f2py tests so they run. The tests expose errors, but the errors look like artifacts of an unfinished refactoring and partial update to support numpy. Modified: trunk/numpy/f2py/tests/f90/return_character.py =================================================================== --- trunk/numpy/f2py/tests/f90/return_character.py 2010-02-25 05:20:26 UTC (rev 8262) +++ trunk/numpy/f2py/tests/f90/return_character.py 2010-02-25 05:20:34 UTC (rev 8263) @@ -6,14 +6,14 @@ python return_character.py --quiet """ -import f2py2e -from Numeric import array +import numpy.f2py as f2py +from numpy import array def build(f2py_opts): try: import f90_ext_return_character except ImportError: - assert not f2py2e.compile('''\ + assert not f2py.compile('''\ module f90_return_char contains function t0(value) @@ -75,11 +75,18 @@ assert t(23)=='2' r = t('ab');assert r=='a',`r` r = t(array('ab'));assert r=='a',`r` - r = t(array(77,'1'));assert r=='M',`r` + r = t(array(77,'l'));assert r=='M',`r` + try: raise RuntimeError,`t(array([77,87]))` except ValueError: pass + except RuntimeError: print "Failed Error" + except: print "Wrong Error Type 1" + try: raise RuntimeError,`t(array(77))` except ValueError: pass + except RuntimeError: print "Failed Error" + except: print "Wrong Error Type 2" + elif tname in ['ts','ss']: assert t(23)=='23 ',`t(23)` assert t('123456789abcdef')=='123456789a',`t('123456789abcdef')` @@ -92,7 +99,7 @@ if __name__=='__main__': #import libwadpy - repeat,f2py_opts = f2py2e.f2py_testing.cmdline() + repeat,f2py_opts = f2py.f2py_testing.cmdline() test_functions = build(f2py_opts) - f2py2e.f2py_testing.run(runtest,test_functions,repeat) + f2py.f2py_testing.run(runtest,test_functions,repeat) print 'ok' Modified: trunk/numpy/f2py/tests/f90/return_complex.py =================================================================== --- trunk/numpy/f2py/tests/f90/return_complex.py 2010-02-25 05:20:26 UTC (rev 8262) +++ trunk/numpy/f2py/tests/f90/return_complex.py 2010-02-25 05:20:34 UTC (rev 8263) @@ -5,14 +5,14 @@ python return_complex.py --quiet """ -import f2py2e -from Numeric import array +import numpy.f2py as f2py +from numpy import array def build(f2py_opts): try: import f90_ext_return_complex except ImportError: - assert not f2py2e.compile('''\ + assert not f2py.compile('''\ module f90_return_complex contains function t0(value) @@ -87,11 +87,11 @@ assert abs(t(array(23+4j,'F'))-(23+4j))<=err assert abs(t(array([234]))-234.)<=err assert abs(t(array([[234]]))-234.)<=err - assert abs(t(array([234],'1'))+22.)<=err - assert abs(t(array([234],'s'))-234.)<=err + assert abs(t(array([234],'b'))+22.)<=err + assert abs(t(array([234],'h'))-234.)<=err assert abs(t(array([234],'i'))-234.)<=err assert abs(t(array([234],'l'))-234.)<=err - assert abs(t(array([234],'b'))-234.)<=err + assert abs(t(array([234],'q'))-234.)<=err assert abs(t(array([234],'f'))-234.)<=err assert abs(t(array([234],'d'))-234.)<=err assert abs(t(array([234+3j],'F'))-(234+3j))<=err @@ -99,18 +99,33 @@ try: raise RuntimeError,`t(array([234],'c'))` except TypeError: pass + except RuntimeError: print "Failed Error" + except: print "Wrong Error Type 1" + try: raise RuntimeError,`t('abc')` except TypeError: pass + except RuntimeError: print "Failed Error" + except: print "Wrong Error Type 2" try: raise RuntimeError,`t([])` except IndexError: pass + except RuntimeError: print "Failed Error" + except: print "Wrong Error Type 3" + try: raise RuntimeError,`t(())` except IndexError: pass + except RuntimeError: print "Failed Error" + except: print "Wrong Error Type 4" try: raise RuntimeError,`t(t)` except TypeError: pass + except RuntimeError: print "Failed Error" + except: print "Wrong Error Type 5" + try: raise RuntimeError,`t({})` except TypeError: pass + except RuntimeError: print "Failed Error" + except: print "Wrong Error Type 6" try: try: raise RuntimeError,`t(10l**400)` @@ -120,7 +135,7 @@ if __name__=='__main__': #import libwadpy - repeat,f2py_opts = f2py2e.f2py_testing.cmdline() + repeat,f2py_opts = f2py.f2py_testing.cmdline() test_functions = build(f2py_opts) - f2py2e.f2py_testing.run(runtest,test_functions,repeat) + f2py.f2py_testing.run(runtest,test_functions,repeat) print 'ok' Modified: trunk/numpy/f2py/tests/f90/return_integer.py =================================================================== --- trunk/numpy/f2py/tests/f90/return_integer.py 2010-02-25 05:20:26 UTC (rev 8262) +++ trunk/numpy/f2py/tests/f90/return_integer.py 2010-02-25 05:20:34 UTC (rev 8263) @@ -9,14 +9,14 @@ """ import sys -import f2py2e -from Numeric import array +import numpy.f2py as f2py +from numpy import array def build(f2py_opts): try: import f90_ext_return_integer except ImportError: - assert not f2py2e.compile('''\ + assert not f2py.compile('''\ module f90_return_integer contains function t0(value) @@ -96,11 +96,11 @@ assert t(array(123))==123 assert t(array([123]))==123 assert t(array([[123]]))==123 - assert t(array([123],'1'))==123 - assert t(array([123],'s'))==123 + assert t(array([123],'b'))==123 + assert t(array([123],'h'))==123 assert t(array([123],'i'))==123 assert t(array([123],'l'))==123 - assert t(array([123],'b'))==123 + assert t(array([123],'q'))==123 assert t(array([123],'f'))==123 assert t(array([123],'d'))==123 if sys.version[:3]<='2.2': @@ -109,18 +109,33 @@ try: raise RuntimeError,`t(array([123],'c'))` except ValueError: pass + except RuntimeError: print "Failed Error" + except: print "Wrong Error Type 1" + try: raise RuntimeError,`t('abc')` except ValueError: pass + except RuntimeError: print "Failed Error" + except: print "Wrong Error Type 2" try: raise RuntimeError,`t([])` except IndexError: pass + except RuntimeError: print "Failed Error" + except: print "Wrong Error Type 3" + try: raise RuntimeError,`t(())` except IndexError: pass + except RuntimeError: print "Failed Error" + except: print "Wrong Error Type 4" try: raise RuntimeError,`t(t)` except TypeError: pass + except RuntimeError: print "Failed Error" + except: print "Wrong Error Type 5" + try: raise RuntimeError,`t({})` except TypeError: pass + except RuntimeError: print "Failed Error" + except: print "Wrong Error Type 6" if tname in ['t8','s8']: try: raise RuntimeError,`t(100000000000000000000000l)` @@ -138,14 +153,13 @@ #import libwadpy status = 1 try: - repeat,f2py_opts = f2py2e.f2py_testing.cmdline() + repeat,f2py_opts = f2py.f2py_testing.cmdline() test_functions = build(f2py_opts) - f2py2e.f2py_testing.run(runtest,test_functions,repeat) + f2py.f2py_testing.run(runtest,test_functions,repeat) print 'ok' status = 0 finally: if status: print '*'*20 - print 'Running f2py2e.diagnose' - import f2py2e.diagnose - f2py2e.diagnose.run() + print 'Running f2py.diagnose' + f2py.diagnose.run() Modified: trunk/numpy/f2py/tests/f90/return_logical.py =================================================================== --- trunk/numpy/f2py/tests/f90/return_logical.py 2010-02-25 05:20:26 UTC (rev 8262) +++ trunk/numpy/f2py/tests/f90/return_logical.py 2010-02-25 05:20:34 UTC (rev 8263) @@ -5,8 +5,8 @@ python return_logical.py --quiet """ -import f2py2e -from Numeric import array +import numpy.f2py as f2py +from numpy import array try: True except NameError: @@ -17,7 +17,7 @@ try: import f90_ext_return_logical except ImportError: - assert not f2py2e.compile('''\ + assert not f2py.compile('''\ module f90_return_logical contains function t0(value) @@ -112,11 +112,11 @@ assert t(array(234))==1 assert t(array([234]))==1 assert t(array([[234]]))==1 - assert t(array([234],'1'))==1 - assert t(array([234],'s'))==1 + assert t(array([234],'b'))==1 + assert t(array([234],'h'))==1 assert t(array([234],'i'))==1 assert t(array([234],'l'))==1 - assert t(array([234],'b'))==1 + assert t(array([234],'q'))==1 assert t(array([234],'f'))==1 assert t(array([234],'d'))==1 assert t(array([234+3j],'F'))==1 @@ -126,12 +126,13 @@ assert t(array([[0]]))==0 assert t(array([0j]))==0 assert t(array([1]))==1 - assert t(array([0,0]))==0 - assert t(array([0,1]))==1 #XXX: is this expected? + # The call itself raises an error. + #assert t(array([0,0])) == 0 # fails + #assert t(array([1,1])) == 1 # fails if __name__=='__main__': #import libwadpy - repeat,f2py_opts = f2py2e.f2py_testing.cmdline() + repeat,f2py_opts = f2py.f2py_testing.cmdline() test_functions = build(f2py_opts) - f2py2e.f2py_testing.run(runtest,test_functions,repeat) + f2py.f2py_testing.run(runtest,test_functions,repeat) print 'ok' Modified: trunk/numpy/f2py/tests/f90/return_real.py =================================================================== --- trunk/numpy/f2py/tests/f90/return_real.py 2010-02-25 05:20:26 UTC (rev 8262) +++ trunk/numpy/f2py/tests/f90/return_real.py 2010-02-25 05:20:34 UTC (rev 8263) @@ -6,14 +6,14 @@ """ import sys -import f2py2e -from Numeric import array +import numpy.f2py as f2py +from numpy import array def build(f2py_opts): try: import f90_ext_return_real except ImportError: - assert not f2py2e.compile('''\ + assert not f2py.compile('''\ module f90_return_real contains function t0(value) @@ -87,11 +87,11 @@ assert abs(t(array(234))-234.)<=err assert abs(t(array([234]))-234.)<=err assert abs(t(array([[234]]))-234.)<=err - assert abs(t(array([234],'1'))+22)<=err - assert abs(t(array([234],'s'))-234.)<=err + assert abs(t(array([234],'b'))+22)<=err + assert abs(t(array([234],'h'))-234.)<=err assert abs(t(array([234],'i'))-234.)<=err assert abs(t(array([234],'l'))-234.)<=err - assert abs(t(array([234],'b'))-234.)<=err + assert abs(t(array([234],'q'))-234.)<=err assert abs(t(array([234],'f'))-234.)<=err assert abs(t(array([234],'d'))-234.)<=err if sys.version[:3]<='2.2': @@ -102,18 +102,33 @@ try: raise RuntimeError,`t(array([234],'c'))` except ValueError: pass + except RuntimeError: print "Failed Error" + except: print "Wrong Error Type 1" + try: raise RuntimeError,`t('abc')` except ValueError: pass + except RuntimeError: print "Failed Error" + except: print "Wrong Error Type 2" try: raise RuntimeError,`t([])` except IndexError: pass + except RuntimeError: print "Failed Error" + except: print "Wrong Error Type 3" + try: raise RuntimeError,`t(())` except IndexError: pass + except RuntimeError: print "Failed Error" + except: print "Wrong Error Type 4" try: raise RuntimeError,`t(t)` except TypeError: pass + except RuntimeError: print "Failed Error" + except: print "Wrong Error Type 5" + try: raise RuntimeError,`t({})` except TypeError: pass + except RuntimeError: print "Failed Error" + except: print "Wrong Error Type 6" try: try: raise RuntimeError,`t(10l**400)` @@ -123,7 +138,7 @@ if __name__=='__main__': #import libwadpy - repeat,f2py_opts = f2py2e.f2py_testing.cmdline() + repeat,f2py_opts = f2py.f2py_testing.cmdline() test_functions = build(f2py_opts) - f2py2e.f2py_testing.run(runtest,test_functions,repeat) + f2py.f2py_testing.run(runtest,test_functions,repeat) print 'ok' From numpy-svn at scipy.org Thu Feb 25 00:20:39 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 24 Feb 2010 23:20:39 -0600 (CST) Subject: [Numpy-svn] r8264 - trunk/numpy/f2py Message-ID: <20100225052039.B830839CB3B@scipy.org> Author: charris Date: 2010-02-24 23:20:39 -0600 (Wed, 24 Feb 2010) New Revision: 8264 Modified: trunk/numpy/f2py/__init__.py Log: ENH: Add diagnose to f2py package. This makes the tests a bit easier to fix. Modified: trunk/numpy/f2py/__init__.py =================================================================== --- trunk/numpy/f2py/__init__.py 2010-02-25 05:20:34 UTC (rev 8263) +++ trunk/numpy/f2py/__init__.py 2010-02-25 05:20:39 UTC (rev 8264) @@ -6,12 +6,14 @@ import sys import commands +import f2py2e +import f2py_testing +import diagnose + from info import __doc__ -import f2py2e run_main = f2py2e.run_main main = f2py2e.main -import f2py_testing def compile(source, modulename = 'untitled', From numpy-svn at scipy.org Thu Feb 25 00:20:44 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 24 Feb 2010 23:20:44 -0600 (CST) Subject: [Numpy-svn] r8265 - trunk/numpy/f2py Message-ID: <20100225052044.B562F39CB3B@scipy.org> Author: charris Date: 2010-02-24 23:20:44 -0600 (Wed, 24 Feb 2010) New Revision: 8265 Modified: trunk/numpy/f2py/diagnose.py Log: BUG: Fix imports in diagnose and excise old crap. Modified: trunk/numpy/f2py/diagnose.py =================================================================== --- trunk/numpy/f2py/diagnose.py 2010-02-25 05:20:39 UTC (rev 8264) +++ trunk/numpy/f2py/diagnose.py 2010-02-25 05:20:44 UTC (rev 8265) @@ -1,6 +1,8 @@ #!/usr/bin/env python -import os,sys,tempfile +import os +import sys +import tempfile def run_command(cmd): print 'Running %r:' % (cmd) @@ -22,30 +24,21 @@ print '------' print 'sys.path=%r' % (':'.join(sys.path)) print '------' + try: - import Numeric - has_Numeric = 1 - except ImportError: - print 'Failed to import Numeric:',sys.exc_value - has_Numeric = 0 - try: - import numarray - has_numarray = 1 - except ImportError: - print 'Failed to import numarray:',sys.exc_value - has_numarray = 0 - try: import numpy has_newnumpy = 1 except ImportError: print 'Failed to import new numpy:', sys.exc_value has_newnumpy = 0 + try: - import f2py2e + from numpy.f2py import f2py2e has_f2py2e = 1 except ImportError: print 'Failed to import f2py2e:',sys.exc_value has_f2py2e = 0 + try: import numpy.distutils has_numpy_distutils = 2 @@ -56,20 +49,7 @@ except ImportError: print 'Failed to import numpy_distutils:',sys.exc_value has_numpy_distutils = 0 - if has_Numeric: - try: - print 'Found Numeric version %r in %s' % \ - (Numeric.__version__,Numeric.__file__) - except Exception,msg: - print 'error:',msg - print '------' - if has_numarray: - try: - print 'Found numarray version %r in %s' % \ - (numarray.__version__,numarray.__file__) - except Exception,msg: - print 'error:',msg - print '------' + if has_newnumpy: try: print 'Found new numpy version %r in %s' % \ @@ -77,6 +57,7 @@ except Exception,msg: print 'error:', msg print '------' + if has_f2py2e: try: print 'Found f2py2e version %r in %s' % \ @@ -84,9 +65,10 @@ except Exception,msg: print 'error:',msg print '------' + if has_numpy_distutils: try: - if has_numpy_distutils==2: + if has_numpy_distutils == 2: print 'Found numpy.distutils version %r in %r' % (\ numpy.distutils.__version__, numpy.distutils.__file__) @@ -99,7 +81,7 @@ print 'error:',msg print '------' try: - if has_numpy_distutils==1: + if has_numpy_distutils == 1: print 'Importing numpy_distutils.command.build_flib ...', import numpy_distutils.command.build_flib as build_flib print 'ok' @@ -116,7 +98,7 @@ print 'error:',msg,'(ignore it, build_flib is obsolute for numpy.distutils 0.2.2 and up)' print '------' try: - if has_numpy_distutils==2: + if has_numpy_distutils == 2: print 'Importing numpy.distutils.fcompiler ...', import numpy.distutils.fcompiler as fcompiler else: @@ -135,7 +117,7 @@ print 'error:',msg print '------' try: - if has_numpy_distutils==2: + if has_numpy_distutils == 2: print 'Importing numpy.distutils.cpuinfo ...', from numpy.distutils.cpuinfo import cpuinfo print 'ok' From numpy-svn at scipy.org Thu Feb 25 00:20:51 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 24 Feb 2010 23:20:51 -0600 (CST) Subject: [Numpy-svn] r8266 - in trunk/numpy/f2py: . src Message-ID: <20100225052051.6D79E39CB3B@scipy.org> Author: charris Date: 2010-02-24 23:20:51 -0600 (Wed, 24 Feb 2010) New Revision: 8266 Modified: trunk/numpy/f2py/cb_rules.py trunk/numpy/f2py/cfuncs.py trunk/numpy/f2py/rules.py trunk/numpy/f2py/src/fortranobject.c trunk/numpy/f2py/src/fortranobject.h Log: ENH: Add support for PyCapsule. Modified: trunk/numpy/f2py/cb_rules.py =================================================================== --- trunk/numpy/f2py/cb_rules.py 2010-02-25 05:20:44 UTC (rev 8265) +++ trunk/numpy/f2py/cb_rules.py 2010-02-25 05:20:51 UTC (rev 8266) @@ -60,9 +60,9 @@ \t\tPyErr_SetString(#modulename#_error,\"cb: Callback #argname# not defined (as an argument or module #modulename# attribute).\\n\"); \t\tgoto capi_fail; \t} -\tif (PyCObject_Check(#name#_capi)) { +\tif (F2PyCapsule_Check(#name#_capi)) { \t#name#_typedef #name#_cptr; -\t#name#_cptr = PyCObject_AsVoidPtr(#name#_capi); +\t#name#_cptr = F2PyCapsule_AsVoidPtr(#name#_capi); \t#returncptr#(*#name#_cptr)(#optargs_nm##args_nm##strarglens_nm#); \t#return# \t} Modified: trunk/numpy/f2py/cfuncs.py =================================================================== --- trunk/numpy/f2py/cfuncs.py 2010-02-25 05:20:44 UTC (rev 8265) +++ trunk/numpy/f2py/cfuncs.py 2010-02-25 05:20:51 UTC (rev 8266) @@ -999,7 +999,7 @@ \t\t\t\ttot += PyTuple_Size((PyObject *)xa); \t\t\ttmp_fun = fun; \t\t} -\t\telse if (PyCObject_Check(fun)) { +\t\telse if (F2PyCapsule_Check(fun)) { \t\t\ttot = maxnofargs; \t\t\tif (xa != NULL) \t\t\t\text = PyTuple_Size((PyObject *)xa); Modified: trunk/numpy/f2py/rules.py =================================================================== --- trunk/numpy/f2py/rules.py 2010-02-25 05:20:44 UTC (rev 8265) +++ trunk/numpy/f2py/rules.py 2010-02-25 05:20:51 UTC (rev 8266) @@ -392,7 +392,7 @@ { extern #ctype# #F_FUNC#(#name_lower#,#NAME#)(void); PyObject* o = PyDict_GetItemString(d,"#name#"); - PyObject_SetAttrString(o,"_cpointer", PyCObject_FromVoidPtr((void*)#F_FUNC#(#name_lower#,#NAME#),NULL)); + PyObject_SetAttrString(o,"_cpointer", F2PyCapsule_FromVoidPtr((void*)#F_FUNC#(#name_lower#,#NAME#),NULL)); } '''}, 'need':{l_not(l_or(ismoduleroutine,isdummyroutine)):['F_WRAPPEDFUNC','F_FUNC']}, @@ -686,8 +686,8 @@ }, { 'frompyobj':[{l_not(isintent_callback):"""\ -if(PyCObject_Check(#varname#_capi)) { - #varname#_cptr = PyCObject_AsVoidPtr(#varname#_capi); +if(F2PyCapsule_Check(#varname#_capi)) { + #varname#_cptr = F2PyCapsule_AsVoidPtr(#varname#_capi); } else { #varname#_cptr = #cbname#; } Modified: trunk/numpy/f2py/src/fortranobject.c =================================================================== --- trunk/numpy/f2py/src/fortranobject.c 2010-02-25 05:20:44 UTC (rev 8265) +++ trunk/numpy/f2py/src/fortranobject.c 2010-02-25 05:20:51 UTC (rev 8266) @@ -855,6 +855,61 @@ return PyArray_CopyInto(out, (PyArrayObject *)arr); } +/*******************************************/ +/* Compatibility functions for Python 3.1 */ +/*******************************************/ + +#if PY_VERSION_HEX >= 0X03010000 + +PyObject * +F2PyCapsule_FromVoidPtr(void *ptr, void (*dtor)(PyObject *)) +{ + PyObject *ret = PyCapsule_New(ptr, NULL, dtor); + if (ret == NULL) { + PyErr_Clear(); + } + return ret; +} + +void * +F2PyCapsule_AsVoidPtr(PyObject *obj) +{ + void *ret = PyCapsule_GetPointer(obj, NULL); + if (ret == NULL) { + PyErr_Clear(); + } + return ret; +} + +int +F2PyCapsule_Check(PyObject *ptr) +{ + return PyCapsule_CheckExact(ptr); +} + +#else + +PyObject * +F2PyCapsule_FromVoidPtr(void *ptr, void (*dtor)(void *)) +{ + return PyCObject_FromVoidPtr(ptr, dtor); +} + +void * +F2PyCapsule_AsVoidPtr(PyObject *ptr) +{ + return PyCObject_AsVoidPtr(ptr); +} + +int +F2PyCapsule_Check(PyObject *ptr) +{ + return PyCObject_Check(ptr); +} + +#endif + + #ifdef __cplusplus } #endif Modified: trunk/numpy/f2py/src/fortranobject.h =================================================================== --- trunk/numpy/f2py/src/fortranobject.h 2010-02-25 05:20:44 UTC (rev 8265) +++ trunk/numpy/f2py/src/fortranobject.h 2010-02-25 05:20:51 UTC (rev 8266) @@ -84,7 +84,7 @@ typedef struct { PyObject_HEAD int len; /* Number of attributes */ - FortranDataDef *defs; /* An array of FortranDataDef's */ + FortranDataDef *defs; /* An array of FortranDataDef's */ PyObject *dict; /* Fortran object attribute dictionary */ } PyFortranObject; @@ -96,6 +96,20 @@ extern PyObject * PyFortranObject_New(FortranDataDef* defs, f2py_void_func init); extern PyObject * PyFortranObject_NewAsAttr(FortranDataDef* defs); +#if PY_VERSION_HEX >= 0X03010000 + +PyObject * F2PyCapsule_FromVoidPtr(void *ptr, void (*dtor)(PyObject *)); +void * F2PyCapsule_AsVoidPtr(PyObject *obj); +int F2PyCapsule_Check(PyObject *ptr); + +#else + +PyObject * F2PyCapsule_FromVoidPtr(void *ptr, void (*dtor)(void *)); +void * F2PyCapsule_AsVoidPtr(PyObject *ptr); +int F2PyCapsule_Check(PyObject *ptr); + +#endif + #define ISCONTIGUOUS(m) ((m)->flags & NPY_CONTIGUOUS) #define F2PY_INTENT_IN 1 #define F2PY_INTENT_INOUT 2 From numpy-svn at scipy.org Thu Feb 25 12:49:24 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 25 Feb 2010 11:49:24 -0600 (CST) Subject: [Numpy-svn] r8267 - in trunk/numpy/core/src: multiarray umath Message-ID: <20100225174924.4610B39CB66@scipy.org> Author: charris Date: 2010-02-25 11:49:24 -0600 (Thu, 25 Feb 2010) New Revision: 8267 Modified: trunk/numpy/core/src/multiarray/arraytypes.c.src trunk/numpy/core/src/multiarray/ctors.c trunk/numpy/core/src/multiarray/descriptor.c trunk/numpy/core/src/multiarray/getset.c trunk/numpy/core/src/multiarray/multiarraymodule.c trunk/numpy/core/src/multiarray/scalarapi.c trunk/numpy/core/src/multiarray/scalartypes.c.src trunk/numpy/core/src/multiarray/usertypes.c trunk/numpy/core/src/umath/ufunc_object.c trunk/numpy/core/src/umath/umathmodule.c.src Log: BUG: Make sure that the errors set by the PyCapsule functions are cleared. The PyCObject functions don't set errors. Note that the error handling in the current code is spotty and needs to be fixed at some point. Modified: trunk/numpy/core/src/multiarray/arraytypes.c.src =================================================================== --- trunk/numpy/core/src/multiarray/arraytypes.c.src 2010-02-25 05:20:51 UTC (rev 8266) +++ trunk/numpy/core/src/multiarray/arraytypes.c.src 2010-02-25 17:49:24 UTC (rev 8267) @@ -3533,10 +3533,17 @@ dt_data->den = 1; dt_data->events = 1; +/* FIXME + * There is no error check here and no way to indicate an error + * until the metadata turns up NULL. + */ #if defined(NPY_PY3K) cobj = PyCapsule_New((void *)dt_data, NULL, simple_capsule_dtor); + if (cobj == NULL) { + PyErr_Clear(); + } #else - cobj = PyCObject_FromVoidPtr((void *)dt_data, _pya_free); + cobj = PyCObject_FromVoidPtr((void *)dt_data, simple_capsule_dtor); #endif descr->metadata = PyDict_New(); PyDict_SetItemString(descr->metadata, NPY_METADATA_DTSTR, cobj); Modified: trunk/numpy/core/src/multiarray/ctors.c =================================================================== --- trunk/numpy/core/src/multiarray/ctors.c 2010-02-25 05:20:51 UTC (rev 8266) +++ trunk/numpy/core/src/multiarray/ctors.c 2010-02-25 17:49:24 UTC (rev 8267) @@ -1144,6 +1144,9 @@ if (PyCapsule_CheckExact(e)) { PyArrayInterface *inter; inter = (PyArrayInterface *)PyCapsule_GetPointer(e, NULL); + if (inter == NULL) { + PyErr_Clear(); + } #else if (PyCObject_Check(e)) { PyArrayInterface *inter; @@ -1576,6 +1579,9 @@ /* A C-function is stored here */ PyArray_FinalizeFunc *cfunc; cfunc = PyCapsule_GetPointer(func, NULL); + if (cfunc == NULL) { + PyErr_Clear(); + } #else if PyCObject_Check(func) { /* A C-function is stored here */ @@ -2127,6 +2133,9 @@ goto fail; } inter = PyCapsule_GetPointer(attr, NULL); + if (inter == NULL) { + PyErr_Clear(); + } #else if (!PyCObject_Check(attr)) { goto fail; Modified: trunk/numpy/core/src/multiarray/descriptor.c =================================================================== --- trunk/numpy/core/src/multiarray/descriptor.c 2010-02-25 05:20:51 UTC (rev 8266) +++ trunk/numpy/core/src/multiarray/descriptor.c 2010-02-25 17:49:24 UTC (rev 8267) @@ -648,6 +648,9 @@ #if defined(NPY_PY3K) dt_data = PyCapsule_GetPointer(cobj, NULL); + if (dt_data == NULL) { + PyErr_Clear(); + } #else dt_data = PyCObject_AsVoidPtr(cobj); #endif @@ -669,6 +672,7 @@ _convert_datetime_tuple_to_cobj(PyObject *tuple) { PyArray_DatetimeMetaData *dt_data; + PyObject *ret; dt_data = _pya_malloc(sizeof(PyArray_DatetimeMetaData)); dt_data->base = _unit_from_str( @@ -685,11 +689,18 @@ } } +/* FIXME + * There is no error handling here. + */ #if defined(NPY_PY3K) - return PyCapsule_New((void *)dt_data, NULL, simple_capsule_dtor); + ret = PyCapsule_New((void *)dt_data, NULL, simple_capsule_dtor); + if (ret == NULL) { + PyErr_Clear(); + } #else - return PyCObject_FromVoidPtr((void *)dt_data, _pya_free); + ret = PyCObject_FromVoidPtr((void *)dt_data, simple_capsule_dtor); #endif + return ret; } static PyArray_Descr * @@ -1554,6 +1565,9 @@ tmp = PyDict_GetItemString(self->metadata, NPY_METADATA_DTSTR); #if defined(NPY_PY3K) dt_data = PyCapsule_GetPointer(tmp, NULL); + if (dt_data == NULL) { + PyErr_Clear(); + } #else dt_data = PyCObject_AsVoidPtr(tmp); #endif Modified: trunk/numpy/core/src/multiarray/getset.c =================================================================== --- trunk/numpy/core/src/multiarray/getset.c 2010-02-25 05:20:51 UTC (rev 8266) +++ trunk/numpy/core/src/multiarray/getset.c 2010-02-25 17:49:24 UTC (rev 8267) @@ -554,7 +554,14 @@ Py_INCREF(self); #if defined(NPY_PY3K) ret = PyCapsule_New(inter, NULL, gentype_struct_free); - PyCapsule_SetContext(ret, self); + if (ret == NULL) { + PyErr_Clear(); + } + else if (PyCapsule_SetContext(ret, self) != 0) { + PyErr_Clear(); + Py_DECREF(ret); + ret = NULL; + } #else ret = PyCObject_FromVoidPtrAndDesc(inter, self, gentype_struct_free); #endif Modified: trunk/numpy/core/src/multiarray/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarray/multiarraymodule.c 2010-02-25 05:20:51 UTC (rev 8266) +++ trunk/numpy/core/src/multiarray/multiarraymodule.c 2010-02-25 17:49:24 UTC (rev 8267) @@ -1350,9 +1350,18 @@ return 1; } +/* FIXME + * There is no err handling here. + */ #if defined(NPY_PY3K) data1 = PyCapsule_GetPointer(cobj1, NULL); + if (data1 == NULL) { + PyErr_Clear(); + } data2 = PyCapsule_GetPointer(cobj2, NULL); + if (data2 == NULL) { + PyErr_Clear(); + } #else data1 = PyCObject_AsVoidPtr(cobj1); data2 = PyCObject_AsVoidPtr(cobj2); @@ -3050,8 +3059,14 @@ if (PyType_Ready(&PyArrayFlags_Type) < 0) { return RETVAL; } +/* FIXME + * There is no error handling here + */ #if defined(NPY_PY3K) c_api = PyCapsule_New((void *)PyArray_API, NULL, NULL); + if (c_api == NULL) { + PyErr_Clear(); + } #else c_api = PyCObject_FromVoidPtr((void *)PyArray_API, NULL); #endif @@ -3085,8 +3100,14 @@ PyDict_SetItemString(d, "METADATA_DTSTR", s); Py_DECREF(s); +/* FIXME + * There is no error handling here + */ #if defined(NPY_PY3K) s = PyCapsule_New((void *)_datetime_strings, NULL, NULL); + if (s == NULL) { + PyErr_Clear(); + } #else s = PyCObject_FromVoidPtr((void *)_datetime_strings, NULL); #endif Modified: trunk/numpy/core/src/multiarray/scalarapi.c =================================================================== --- trunk/numpy/core/src/multiarray/scalarapi.c 2010-02-25 05:20:51 UTC (rev 8266) +++ trunk/numpy/core/src/multiarray/scalarapi.c 2010-02-25 17:49:24 UTC (rev 8267) @@ -536,8 +536,11 @@ } #if defined(NPY_PY3K) cobj = PyCapsule_New((void *)dt_data, NULL, simple_capsule_dtor); + if (cobj == NULL) { + PyErr_Clear(); + } #else - cobj = PyCObject_FromVoidPtr((void *)dt_data, _pya_free); + cobj = PyCObject_FromVoidPtr((void *)dt_data, simple_capsule_dtor); #endif /* Add correct meta-data to the data-type */ @@ -670,8 +673,15 @@ PyObject *cobj; PyArray_DatetimeMetaData *dt_data; cobj = PyDict_GetItemString(descr->metadata, NPY_METADATA_DTSTR); + +/* FIXME + * There is no error handling here. + */ #if defined(NPY_PY3K) dt_data = PyCapsule_GetPointer(cobj, NULL); + if (dt_data == NULL) { + PyErr_Clear(); + } #else dt_data = PyCObject_AsVoidPtr(cobj); #endif Modified: trunk/numpy/core/src/multiarray/scalartypes.c.src =================================================================== --- trunk/numpy/core/src/multiarray/scalartypes.c.src 2010-02-25 05:20:51 UTC (rev 8266) +++ trunk/numpy/core/src/multiarray/scalartypes.c.src 2010-02-25 17:49:24 UTC (rev 8267) @@ -859,7 +859,13 @@ #if defined(NPY_PY3K) ret = PyCapsule_New(inter, NULL, gentype_struct_free); - PyCapsule_SetContext(ret, arr); + if (ret == NULL) { + PyErr_Clear(); + } + else if (PyCapsule_SetContext(ret, arr) != 0) { + PyErr_Clear(); + ret == NULL; + } #else ret = PyCObject_FromVoidPtrAndDesc(inter, arr, gentype_struct_free); #endif Modified: trunk/numpy/core/src/multiarray/usertypes.c =================================================================== --- trunk/numpy/core/src/multiarray/usertypes.c 2010-02-25 05:20:51 UTC (rev 8266) +++ trunk/numpy/core/src/multiarray/usertypes.c 2010-02-25 17:49:24 UTC (rev 8267) @@ -208,6 +208,9 @@ } #if defined(NPY_PY3K) cobj = PyCapsule_New((void *)castfunc, NULL, NULL); + if (cobj == NULL) { + PyErr_Clear(); + } #else cobj = PyCObject_FromVoidPtr((void *)castfunc, NULL); #endif Modified: trunk/numpy/core/src/umath/ufunc_object.c =================================================================== --- trunk/numpy/core/src/umath/ufunc_object.c 2010-02-25 05:20:51 UTC (rev 8266) +++ trunk/numpy/core/src/umath/ufunc_object.c 2010-02-25 17:49:24 UTC (rev 8267) @@ -374,6 +374,9 @@ #if defined(NPY_PY3K) funcdata = (PyUFunc_Loop1d *)PyCapsule_GetPointer(obj, NULL); + if (funcdata == NULL) { + PyErr_Clear(); + } #else funcdata = (PyUFunc_Loop1d *)PyCObject_AsVoidPtr(obj); #endif @@ -523,6 +526,9 @@ */ #if defined(NPY_PY3K) funcdata = (PyUFunc_Loop1d *)PyCapsule_GetPointer(obj, NULL); + if (funcdata == NULL) { + PyErr_Clear(); + } #else funcdata = (PyUFunc_Loop1d *)PyCObject_AsVoidPtr(obj); #endif @@ -3976,6 +3982,9 @@ if (cobj == NULL) { #if defined(NPY_PY3K) cobj = PyCapsule_New((void *)funcdata, NULL, _loop1d_list_free); + if (cobj == NULL) { + PyErr_Clear(); + } #else cobj = PyCObject_FromVoidPtr((void *)funcdata, _loop1d_list_free); #endif @@ -3998,6 +4007,9 @@ */ #if defined(NPY_PY3K) current = (PyUFunc_Loop1d *)PyCapsule_GetPointer(cobj, NULL); + if (current == NULL) { + PyErr_Clear(); + } #else current = (PyUFunc_Loop1d *)PyCObject_AsVoidPtr(cobj); #endif Modified: trunk/numpy/core/src/umath/umathmodule.c.src =================================================================== --- trunk/numpy/core/src/umath/umathmodule.c.src 2010-02-25 05:20:51 UTC (rev 8266) +++ trunk/numpy/core/src/umath/umathmodule.c.src 2010-02-25 17:49:24 UTC (rev 8267) @@ -307,6 +307,9 @@ #if defined(NPY_PY3K) c_api = PyCapsule_New((void *)PyUFunc_API, NULL, NULL); + if (c_api == NULL) { + PyErr_Clear(); + } #else c_api = PyCObject_FromVoidPtr((void *)PyUFunc_API, NULL); #endif From numpy-svn at scipy.org Sat Feb 27 02:59:34 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 27 Feb 2010 01:59:34 -0600 (CST) Subject: [Numpy-svn] r8268 - in branches/1.4.x/numpy/polynomial: . tests Message-ID: <20100227075934.42BD839CAF9@scipy.org> Author: charris Date: 2010-02-27 01:59:34 -0600 (Sat, 27 Feb 2010) New Revision: 8268 Modified: branches/1.4.x/numpy/polynomial/polytemplate.py branches/1.4.x/numpy/polynomial/tests/test_chebyshev.py branches/1.4.x/numpy/polynomial/tests/test_polynomial.py Log: BUG: Fix lower bound specification for integration in the Chebyshev and Polynomial classes and add some tests. Modified: branches/1.4.x/numpy/polynomial/polytemplate.py =================================================================== --- branches/1.4.x/numpy/polynomial/polytemplate.py 2010-02-25 17:49:24 UTC (rev 8267) +++ branches/1.4.x/numpy/polynomial/polytemplate.py 2010-02-27 07:59:34 UTC (rev 8268) @@ -441,12 +441,12 @@ `${nick}der` : similar function for derivative. """ - off, scl = pu.mapparms($domain, self.domain) + off, scl = self.mapparms() if lbnd is None : lbnd = 0 else : - lbnd = off + scl*x - coef = ${nick}int(self.coef, m, k, lbnd, scl) + lbnd = off + scl*lbnd + coef = ${nick}int(self.coef, m, k, lbnd, 1./scl) return self.__class__(coef, self.domain) def deriv(self, m=1): @@ -472,7 +472,7 @@ `${nick}int` : similar function for integration. """ - off, scl = pu.mapparms(self.domain, $domain) + off, scl = self.mapparms() coef = ${nick}der(self.coef, m, scl) return self.__class__(coef, self.domain) Modified: branches/1.4.x/numpy/polynomial/tests/test_chebyshev.py =================================================================== --- branches/1.4.x/numpy/polynomial/tests/test_chebyshev.py 2010-02-25 17:49:24 UTC (rev 8267) +++ branches/1.4.x/numpy/polynomial/tests/test_chebyshev.py 2010-02-27 07:59:34 UTC (rev 8268) @@ -105,7 +105,7 @@ return x*(x**2 - 1) #check empty input - assert_equal(ch.chebval([], 1).size, 0) + assert_equal(ch.chebval([], [1]).size, 0) #check normal input) for i in range(5) : @@ -420,6 +420,8 @@ def test_integ(self) : p = self.p2.integ() assert_almost_equal(p.coef, ch.chebint([1,2,3], 1, 0, scl=.5)) + p = self.p2.integ(lbnd=0) + assert_almost_equal(p(0), 0) p = self.p2.integ(1, 1) assert_almost_equal(p.coef, ch.chebint([1,2,3], 1, 1, scl=.5)) p = self.p2.integ(2, [1, 2]) Modified: branches/1.4.x/numpy/polynomial/tests/test_polynomial.py =================================================================== --- branches/1.4.x/numpy/polynomial/tests/test_polynomial.py 2010-02-25 17:49:24 UTC (rev 8267) +++ branches/1.4.x/numpy/polynomial/tests/test_polynomial.py 2010-02-27 07:59:34 UTC (rev 8268) @@ -97,7 +97,7 @@ return x*(x**2 - 1) #check empty input - assert_equal(poly.polyval([], 1).size, 0) + assert_equal(poly.polyval([], [1]).size, 0) #check normal input) x = np.linspace(-1,1) @@ -394,6 +394,8 @@ def test_integ(self) : p = self.p2.integ() assert_almost_equal(p.coef, poly.polyint([1,2,3], 1, 0, scl=.5)) + p = self.p2.integ(lbnd=0) + assert_almost_equal(p(0), 0) p = self.p2.integ(1, 1) assert_almost_equal(p.coef, poly.polyint([1,2,3], 1, 1, scl=.5)) p = self.p2.integ(2, [1, 2]) From numpy-svn at scipy.org Sat Feb 27 03:01:35 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 27 Feb 2010 02:01:35 -0600 (CST) Subject: [Numpy-svn] r8269 - in trunk/numpy/polynomial: . tests Message-ID: <20100227080135.5851F39CAFE@scipy.org> Author: charris Date: 2010-02-27 02:01:35 -0600 (Sat, 27 Feb 2010) New Revision: 8269 Modified: trunk/numpy/polynomial/polytemplate.py trunk/numpy/polynomial/tests/test_chebyshev.py trunk/numpy/polynomial/tests/test_polynomial.py Log: BUG: Fix bug in lbnd implementation of the integ method of the Chebyshev and Polynomial classes. Modified: trunk/numpy/polynomial/polytemplate.py =================================================================== --- trunk/numpy/polynomial/polytemplate.py 2010-02-27 07:59:34 UTC (rev 8268) +++ trunk/numpy/polynomial/polytemplate.py 2010-02-27 08:01:35 UTC (rev 8269) @@ -455,12 +455,12 @@ `${nick}der` : similar function for derivative. """ - off, scl = pu.mapparms($domain, self.domain) + off, scl = self.mapparms() if lbnd is None : lbnd = 0 else : - lbnd = off + scl*x - coef = ${nick}int(self.coef, m, k, lbnd, scl) + lbnd = off + scl*lbnd + coef = ${nick}int(self.coef, m, k, lbnd, 1./scl) return self.__class__(coef, self.domain) def deriv(self, m=1): @@ -486,7 +486,7 @@ `${nick}int` : similar function for integration. """ - off, scl = pu.mapparms(self.domain, $domain) + off, scl = self.mapparms() coef = ${nick}der(self.coef, m, scl) return self.__class__(coef, self.domain) Modified: trunk/numpy/polynomial/tests/test_chebyshev.py =================================================================== --- trunk/numpy/polynomial/tests/test_chebyshev.py 2010-02-27 07:59:34 UTC (rev 8268) +++ trunk/numpy/polynomial/tests/test_chebyshev.py 2010-02-27 08:01:35 UTC (rev 8269) @@ -419,6 +419,8 @@ def test_integ(self) : p = self.p2.integ() assert_almost_equal(p.coef, ch.chebint([1,2,3], 1, 0, scl=.5)) + p = self.p2.integ(lbnd=0) + assert_almost_equal(p(0), 0) p = self.p2.integ(1, 1) assert_almost_equal(p.coef, ch.chebint([1,2,3], 1, 1, scl=.5)) p = self.p2.integ(2, [1, 2]) Modified: trunk/numpy/polynomial/tests/test_polynomial.py =================================================================== --- trunk/numpy/polynomial/tests/test_polynomial.py 2010-02-27 07:59:34 UTC (rev 8268) +++ trunk/numpy/polynomial/tests/test_polynomial.py 2010-02-27 08:01:35 UTC (rev 8269) @@ -393,6 +393,8 @@ def test_integ(self) : p = self.p2.integ() assert_almost_equal(p.coef, poly.polyint([1,2,3], 1, 0, scl=.5)) + p = self.p2.integ(lbnd=0) + assert_almost_equal(p(0), 0) p = self.p2.integ(1, 1) assert_almost_equal(p.coef, poly.polyint([1,2,3], 1, 1, scl=.5)) p = self.p2.integ(2, [1, 2]) From numpy-svn at scipy.org Sat Feb 27 10:11:50 2010 From: numpy-svn at scipy.org (Genuine Pfizer c Retailer) Date: Sat, 27 Feb 2010 09:11:50 -0600 (CST) Subject: [Numpy-svn] Visitor numpy-svn's personal 80% OFF Message-ID: <20100227151150.1004939CC14@scipy.org> An HTML attachment was scrubbed... URL: From numpy-svn at scipy.org Sat Feb 27 10:23:42 2010 From: numpy-svn at scipy.org (Tanner) Date: Sat, 27 Feb 2010 09:23:42 -0600 (CST) Subject: [Numpy-svn] Message #899109 Message-ID: <20100227152342.2853839CC0A@scipy.org> An HTML attachment was scrubbed... URL: From numpy-svn at scipy.org Sat Feb 27 22:47:04 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 27 Feb 2010 21:47:04 -0600 (CST) Subject: [Numpy-svn] r8270 - trunk/numpy Message-ID: <20100228034704.A46B739CB12@scipy.org> Author: oliphant Date: 2010-02-27 21:47:04 -0600 (Sat, 27 Feb 2010) New Revision: 8270 Modified: trunk/numpy/ctypeslib.py Log: Add capability to ctypeslib to convert a pointer to memory to an array of a particular shape. Modified: trunk/numpy/ctypeslib.py =================================================================== --- trunk/numpy/ctypeslib.py 2010-02-27 08:01:35 UTC (rev 8269) +++ trunk/numpy/ctypeslib.py 2010-02-28 03:47:04 UTC (rev 8270) @@ -363,15 +363,42 @@ array_type.__array_interface__ = property(__array_interface__) + def prep_pointer(pointer_obj, shape): + """Given a ctypes pointer object, construct and + attach an __array_interface__ property to it if it does not + yet have one. + """ + try: pointer_obj.__array_interface__ + except AttributeError: pass + else: return + + contents = pointer_obj.contents + dtype = _dtype(type(contents)) + + inter = {'version': 3, + 'typestr': dtype.str, + 'data': (ct.addressof(contents), False), + 'shape': shape} + + pointer_obj.__array_interface__ = inter + ################################################################ # public functions - def as_array(obj): - """Create a numpy array from a ctypes array. The numpy array - shares the memory with the ctypes object.""" + def as_array(obj, shape=None): + """Create a numpy array from a ctypes array or a ctypes POINTER. + The numpy array shares the memory with the ctypes object. + + The size parameter must be given if converting from a ctypes POINTER. + The size parameter is ignored if converting from a ctypes array + """ tp = type(obj) try: tp.__array_interface__ - except AttributeError: prep_array(tp) + except AttributeError: + if hasattr(obj, 'contents'): + prep_pointer(obj, shape) + else: + prep_array(tp) return array(obj, copy=False) def as_ctypes(obj):