[Numpy-svn] r5762 - in branches/clean_math_config: . doc doc/neps doc/numpybook doc/numpybook/comparison doc/numpybook/comparison/ctypes doc/numpybook/comparison/pyrex doc/numpybook/comparison/weave numpy numpy/core numpy/core/code_generators numpy/core/src numpy/core/tests numpy/distutils/command numpy/doc numpy/lib numpy/lib/tests numpy/ma numpy/testing tools/osxbuild tools/win32build
numpy-svn at scipy.org
numpy-svn at scipy.org
Thu Sep 4 10:56:14 EDT 2008
Author: cdavid
Date: 2008-09-04 09:55:01 -0500 (Thu, 04 Sep 2008)
New Revision: 5762
Added:
branches/clean_math_config/doc/TESTS.txt
branches/clean_math_config/doc/neps/math_config_clean.txt
branches/clean_math_config/doc/neps/warnfix.txt
Modified:
branches/clean_math_config/
branches/clean_math_config/doc/DISTUTILS.txt
branches/clean_math_config/doc/numpybook/comparison/ctypes/filter.py
branches/clean_math_config/doc/numpybook/comparison/ctypes/interface.py
branches/clean_math_config/doc/numpybook/comparison/pyrex/setup.py
branches/clean_math_config/doc/numpybook/comparison/timing.py
branches/clean_math_config/doc/numpybook/comparison/weave/filter.py
branches/clean_math_config/doc/numpybook/comparison/weave/inline.py
branches/clean_math_config/doc/numpybook/runcode.py
branches/clean_math_config/numpy/core/code_generators/generate_umath.py
branches/clean_math_config/numpy/core/memmap.py
branches/clean_math_config/numpy/core/src/scalartypes.inc.src
branches/clean_math_config/numpy/core/tests/test_regression.py
branches/clean_math_config/numpy/distutils/command/scons.py
branches/clean_math_config/numpy/doc/subclassing.py
branches/clean_math_config/numpy/lib/_datasource.py
branches/clean_math_config/numpy/lib/scimath.py
branches/clean_math_config/numpy/lib/tests/test_format.py
branches/clean_math_config/numpy/lib/ufunclike.py
branches/clean_math_config/numpy/ma/core.py
branches/clean_math_config/numpy/testing/nosetester.py
branches/clean_math_config/numpy/testing/parametric.py
branches/clean_math_config/numpy/version.py
branches/clean_math_config/tools/osxbuild/build.py
branches/clean_math_config/tools/osxbuild/install_and_test.py
branches/clean_math_config/tools/win32build/build.py
branches/clean_math_config/tools/win32build/prepare_bootstrap.py
Log:
Merged revisions 5738-5761 via svnmerge from
http://svn.scipy.org/svn/numpy/trunk
........
r5739 | cdavid | 2008-09-01 21:50:46 +0900 (Mon, 01 Sep 2008) | 1 line
Disable memmap test which crashes nose tests on cygwin.
........
r5740 | cdavid | 2008-09-01 22:07:30 +0900 (Mon, 01 Sep 2008) | 2 lines
Fix unused variable warning in object_arrtype_new.
........
r5741 | cdavid | 2008-09-02 15:59:43 +0900 (Tue, 02 Sep 2008) | 5 lines
Fix regression test #771 on 64 bits architecture.
The test assumed an item was 4 bytes. Use itemsize instead of harcoding 4 bytes
per item.
........
r5742 | jarrod.millman | 2008-09-03 05:13:17 +0900 (Wed, 03 Sep 2008) | 2 lines
pulling out testing docs from distutils docs
........
r5743 | jarrod.millman | 2008-09-03 05:32:38 +0900 (Wed, 03 Sep 2008) | 2 lines
reindenting prior to release
........
r5745 | jarrod.millman | 2008-09-03 08:52:37 +0900 (Wed, 03 Sep 2008) | 2 lines
trunk is open for 1.3 development
........
r5748 | alan.mcintyre | 2008-09-03 14:10:39 +0900 (Wed, 03 Sep 2008) | 3 lines
Fix __init__.py boilerplate example in DISTUTILS.txt, and moved content from
SciPy wiki entry on testing guidelines to TESTS.txt.
........
r5749 | alan.mcintyre | 2008-09-03 15:11:28 +0900 (Wed, 03 Sep 2008) | 3 lines
Updated TESTS.txt to actually be ReST.
Capitalization nitpickery in DISTUTILS.txt: 'Scipy' -> 'SciPy'
........
r5750 | alan.mcintyre | 2008-09-03 16:49:59 +0900 (Wed, 03 Sep 2008) | 2 lines
Added section discussing using subclassing to create similar tests.
........
r5751 | pierregm | 2008-09-04 01:48:52 +0900 (Thu, 04 Sep 2008) | 1 line
docstring update
........
r5752 | cdavid | 2008-09-04 01:54:37 +0900 (Thu, 04 Sep 2008) | 1 line
Start a nep for warn-free numpy build.
........
r5753 | cdavid | 2008-09-04 22:31:24 +0900 (Thu, 04 Sep 2008) | 1 line
Update the warnfix nep.
........
r5754 | cdavid | 2008-09-04 22:36:53 +0900 (Thu, 04 Sep 2008) | 1 line
Start a nep for cleaning the math configuration.
........
r5755 | cdavid | 2008-09-04 22:49:01 +0900 (Thu, 04 Sep 2008) | 1 line
Update clean math config nep.
........
Property changes on: branches/clean_math_config
___________________________________________________________________
Name: svnmerge-integrated
- /branches/aligned_alloca:1-5127 /branches/build_with_scons:1-4676 /branches/cdavid:1-5257 /branches/cleanconfig_rtm:1-4677 /branches/distutils-revamp:1-2752 /branches/distutils_scons_command:1-4619 /branches/multicore:1-3687 /branches/numpy.scons:1-4484 /branches/vs_longstring:1-5656 /cleaned_math_config:1-5731 /trunk:1-5737
+ /branches/aligned_alloca:1-5127 /branches/build_with_scons:1-4676 /branches/cdavid:1-5257 /branches/cleanconfig_rtm:1-4677 /branches/distutils-revamp:1-2752 /branches/distutils_scons_command:1-4619 /branches/multicore:1-3687 /branches/numpy.scons:1-4484 /branches/vs_longstring:1-5656 /cleaned_math_config:1-5731 /trunk:1-5761
Modified: branches/clean_math_config/doc/DISTUTILS.txt
===================================================================
--- branches/clean_math_config/doc/DISTUTILS.txt 2008-09-04 14:45:33 UTC (rev 5761)
+++ branches/clean_math_config/doc/DISTUTILS.txt 2008-09-04 14:55:01 UTC (rev 5762)
@@ -58,7 +58,7 @@
SciPy pure Python package example
---------------------------------
-Below is an example of a minimal ``setup.py`` file for a pure Scipy package::
+Below is an example of a minimal ``setup.py`` file for a pure SciPy package::
#!/usr/bin/env python
def configuration(parent_package='',top_path=None):
@@ -399,7 +399,7 @@
The ``info.py`` file
''''''''''''''''''''
-Scipy package import hooks assume that each package contains a
+SciPy package import hooks assume that each package contains a
``info.py`` file. This file contains overall documentation about the package
and variables defining the order of package imports, dependency
relations between packages, etc.
@@ -436,8 +436,8 @@
To speed up the import time and minimize memory usage, numpy
uses ``ppimport`` hooks to transparently postpone importing large modules,
-which might not be used during the Scipy session. In order to
-have access to the documentation of all Scipy packages, including
+which might not be used during the SciPy session. In order to
+have access to the documentation of all SciPy packages, including
postponed packages, the docstring from ``info.py`` is imported
into ``__init__.py``.
@@ -450,61 +450,10 @@
from info import __doc__
...
- from numpy.testing import NumpyTest
- test = NumpyTest().test
+ from numpy.testing import Tester
+ test = Tester().test
+ bench = Tester().bench
-The ``tests/`` directory
-''''''''''''''''''''''''
-
-Ideally, every Python code, extension module, or subpackage in Scipy
-package directory should have the corresponding ``test_<name>.py``
-file in ``tests/`` directory. This file should define classes
-derived from the ``numpy.testing.TestCase`` class (or from
-``unittest.TestCase``) and have names starting with ``test``. The methods
-of these classes whose names contain ``test`` or start with ``bench`` are
-automatically picked up by the test machinery.
-
-A minimal example of a ``test_yyy.py`` file that implements tests for
-a NumPy package module ``numpy.xxx.yyy`` containing a function
-``zzz()``, is shown below::
-
- import sys
- from numpy.testing import *
-
- # import xxx symbols
- from numpy.xxx.yyy import zzz
-
-
- class test_zzz(TestCase):
- def test_simple(self, level=1):
- assert zzz()=='Hello from zzz'
- #...
-
- if __name__ == "__main__":
- run_module_tests(file)
-
-Note that all classes that are inherited from ``TestCase`` class, are
-automatically picked up by the test runner.
-
-``numpy.testing`` module provides also the following convenience
-functions::
-
- assert_equal(actual,desired,err_msg='',verbose=1)
- assert_almost_equal(actual,desired,decimal=7,err_msg='',verbose=1)
- assert_approx_equal(actual,desired,significant=7,err_msg='',verbose=1)
- assert_array_equal(x,y,err_msg='')
- assert_array_almost_equal(x,y,decimal=6,err_msg='')
- rand(*shape) # returns random array with a given shape
-
-To run all test scripts of the module ``xxx``, execute in Python:
-
- >>> import numpy
- >>> numpy.xxx.test()
-
-To run only tests for ``xxx.yyy`` module, execute:
-
- >>> NumpyTest('xxx.yyy').test(level=1,verbosity=1)
-
Extra features in NumPy Distutils
'''''''''''''''''''''''''''''''''
Copied: branches/clean_math_config/doc/TESTS.txt (from rev 5755, trunk/doc/TESTS.txt)
Copied: branches/clean_math_config/doc/neps/math_config_clean.txt (from rev 5755, trunk/doc/neps/math_config_clean.txt)
Copied: branches/clean_math_config/doc/neps/warnfix.txt (from rev 5755, trunk/doc/neps/warnfix.txt)
Modified: branches/clean_math_config/doc/numpybook/comparison/ctypes/filter.py
===================================================================
--- branches/clean_math_config/doc/numpybook/comparison/ctypes/filter.py 2008-09-04 14:45:33 UTC (rev 5761)
+++ branches/clean_math_config/doc/numpybook/comparison/ctypes/filter.py 2008-09-04 14:55:01 UTC (rev 5762)
@@ -21,6 +21,3 @@
b = N.zeros_like(a)
lib.dfilter2d(a, b, a.ctypes.strides, a.ctypes.shape)
return b
-
-
-
Modified: branches/clean_math_config/doc/numpybook/comparison/ctypes/interface.py
===================================================================
--- branches/clean_math_config/doc/numpybook/comparison/ctypes/interface.py 2008-09-04 14:45:33 UTC (rev 5761)
+++ branches/clean_math_config/doc/numpybook/comparison/ctypes/interface.py 2008-09-04 14:55:01 UTC (rev 5762)
@@ -27,7 +27,7 @@
flags='aligned, contiguous,'\
'writeable'),
ctypes.POINTER(N.ctypeslib.c_intp),
- ctypes.POINTER(N.ctypeslib.c_intp)]
+ ctypes.POINTER(N.ctypeslib.c_intp)]
def select(dtype):
if dtype.char in ['?bBhHf']:
@@ -49,12 +49,9 @@
c = N.empty_like(a)
func(a,b,c,a.size)
return c
-
+
def filter2d(a):
a = N.require(a, float, ['ALIGNED'])
b = N.zeros_like(a)
lib.dfilter2d(a, b, a.ctypes.strides, a.ctypes.shape)
return b
-
-
-
Modified: branches/clean_math_config/doc/numpybook/comparison/pyrex/setup.py
===================================================================
--- branches/clean_math_config/doc/numpybook/comparison/pyrex/setup.py 2008-09-04 14:45:33 UTC (rev 5761)
+++ branches/clean_math_config/doc/numpybook/comparison/pyrex/setup.py 2008-09-04 14:55:01 UTC (rev 5762)
@@ -16,8 +16,8 @@
include_dirs = [numpy.get_include()])
pyx_ext2 = Extension('blur',
- ['blur.pyx'],
- include_dirs = [numpy.get_include()])
+ ['blur.pyx'],
+ include_dirs = [numpy.get_include()])
# Call the routine which does the real work
Modified: branches/clean_math_config/doc/numpybook/comparison/timing.py
===================================================================
--- branches/clean_math_config/doc/numpybook/comparison/timing.py 2008-09-04 14:45:33 UTC (rev 5761)
+++ branches/clean_math_config/doc/numpybook/comparison/timing.py 2008-09-04 14:55:01 UTC (rev 5762)
@@ -51,13 +51,11 @@
path = sys.path
for kind in ['f2py']:#['ctypes', 'pyrex', 'weave', 'f2py']:
- res[kind] = []
- sys.path = ['/Users/oliphant/numpybook/%s' % (kind,)] + path
- print sys.path
- for n in N:
- print "%s - %d" % (kind, n)
- t = timeit.Timer(eval('%s_run'%kind), eval('%s_pre %% (%d,%d)'%(kind,n,n)))
- mytime = min(t.repeat(3,100))
- res[kind].append(mytime)
-
-
+ res[kind] = []
+ sys.path = ['/Users/oliphant/numpybook/%s' % (kind,)] + path
+ print sys.path
+ for n in N:
+ print "%s - %d" % (kind, n)
+ t = timeit.Timer(eval('%s_run'%kind), eval('%s_pre %% (%d,%d)'%(kind,n,n)))
+ mytime = min(t.repeat(3,100))
+ res[kind].append(mytime)
Modified: branches/clean_math_config/doc/numpybook/comparison/weave/filter.py
===================================================================
--- branches/clean_math_config/doc/numpybook/comparison/weave/filter.py 2008-09-04 14:45:33 UTC (rev 5761)
+++ branches/clean_math_config/doc/numpybook/comparison/weave/filter.py 2008-09-04 14:55:01 UTC (rev 5762)
@@ -8,11 +8,11 @@
for(i=1;i<Na[0]-1;i++) {
for(j=1;j<Na[1]-1;j++) {
B2(i,j) = A2(i,j) + (A2(i-1,j) +
- A2(i+1,j) + A2(i,j-1)
- + A2(i,j+1))*0.5
- + (A2(i-1,j-1)
- + A2(i-1,j+1)
- + A2(i+1,j-1)
+ A2(i+1,j) + A2(i,j-1)
+ + A2(i,j+1))*0.5
+ + (A2(i-1,j-1)
+ + A2(i-1,j+1)
+ + A2(i+1,j-1)
+ A2(i+1,j+1))*0.25;
}
}
@@ -20,4 +20,3 @@
b = zeros_like(a)
weave.inline(code,['a','b'])
return b
-
Modified: branches/clean_math_config/doc/numpybook/comparison/weave/inline.py
===================================================================
--- branches/clean_math_config/doc/numpybook/comparison/weave/inline.py 2008-09-04 14:45:33 UTC (rev 5761)
+++ branches/clean_math_config/doc/numpybook/comparison/weave/inline.py 2008-09-04 14:55:01 UTC (rev 5762)
@@ -24,11 +24,11 @@
for(i=1;i<Na[0]-1;i++) {
for(j=1;j<Na[1]-1;j++) {
B2(i,j) = A2(i,j) + A2(i-1,j)*0.5 +
- A2(i+1,j)*0.5 + A2(i,j-1)*0.5
- + A2(i,j+1)*0.5
- + A2(i-1,j-1)*0.25
- + A2(i-1,j+1)*0.25
- + A2(i+1,j-1)*0.25
+ A2(i+1,j)*0.5 + A2(i,j-1)*0.5
+ + A2(i,j+1)*0.5
+ + A2(i-1,j-1)*0.25
+ + A2(i-1,j+1)*0.25
+ + A2(i+1,j-1)*0.25
+ A2(i+1,j+1)*0.25;
}
}
Modified: branches/clean_math_config/doc/numpybook/runcode.py
===================================================================
--- branches/clean_math_config/doc/numpybook/runcode.py 2008-09-04 14:45:33 UTC (rev 5761)
+++ branches/clean_math_config/doc/numpybook/runcode.py 2008-09-04 14:55:01 UTC (rev 5762)
@@ -11,7 +11,7 @@
#
# Options:
# -n name of code section (default MyCode)
-#
+#
import sys
import optparse
@@ -23,13 +23,13 @@
def getoutput(tstr, dic):
print "\n\nRunning..."
- print tstr,
+ print tstr,
tempstr = cStringIO.StringIO()
sys.stdout = tempstr
code = compile(tstr, '<input>', 'exec')
try:
res = eval(tstr, dic)
- sys.stdout = sys.__stdout__
+ sys.stdout = sys.__stdout__
except SyntaxError:
try:
res = None
@@ -42,7 +42,7 @@
res = tempstr.getvalue() + '\n' + repr(res)
if res != '':
print "\nOutput is"
- print res,
+ print res,
return res
# now find the code in the code segment
@@ -75,8 +75,8 @@
if line != 'dummy':
outlines.append(line)
return "\n\\newline \n".join(outlines), end
-
+
def runpycode(lyxstr, name='MyCode'):
schobj = re.compile(r"\\layout %s\s+>>> " % name)
outstr = cStringIO.StringIO()
@@ -85,7 +85,7 @@
for it in schobj.finditer(lyxstr):
indx.extend([it.start(), it.end()])
num += 1
-
+
if num == 0:
print "Nothing found for %s" % name
return lyxstr
@@ -103,14 +103,14 @@
for k in range(num):
# first write everything up to the start of the code segment
substr = lyxstr[start:indx[2*k]]
- outstr.write(substr)
+ outstr.write(substr)
if start > 0:
mat = newre.search(substr)
# if PYNEW found, then start a new namespace
if mat:
edic = {}
exec 'from numpy import *' in edic
- exec 'set_printoptions(linewidth=65)' in edic
+ exec 'set_printoptions(linewidth=65)' in edic
# now find the code in the code segment
# endoutput will contain the index just past any output
# already present in the lyx string.
Modified: branches/clean_math_config/numpy/core/code_generators/generate_umath.py
===================================================================
--- branches/clean_math_config/numpy/core/code_generators/generate_umath.py 2008-09-04 14:45:33 UTC (rev 5761)
+++ branches/clean_math_config/numpy/core/code_generators/generate_umath.py 2008-09-04 14:55:01 UTC (rev 5762)
@@ -673,10 +673,10 @@
mlist = []
docstring = textwrap.dedent(uf.docstring).strip()
docstring = docstring.encode('string-escape').replace(r'"', r'\"')
- # Split the docstring because some compilers (like MS) do not like big
- # string literal in C code. We split at endlines because textwrap.wrap
- # do not play well with \n
- docstring = '\\n\"\"'.join(docstring.split(r"\n"))
+ # Split the docstring because some compilers (like MS) do not like big
+ # string literal in C code. We split at endlines because textwrap.wrap
+ # do not play well with \n
+ docstring = '\\n\"\"'.join(docstring.split(r"\n"))
mlist.append(\
r"""f = PyUFunc_FromFuncAndData(%s_functions, %s_data, %s_signatures, %d,
%d, %d, %s, "%s",
Modified: branches/clean_math_config/numpy/core/memmap.py
===================================================================
--- branches/clean_math_config/numpy/core/memmap.py 2008-09-04 14:45:33 UTC (rev 5761)
+++ branches/clean_math_config/numpy/core/memmap.py 2008-09-04 14:55:01 UTC (rev 5762)
@@ -74,7 +74,7 @@
Given a memmap ``fp``, ``isinstance(fp, numpy.ndarray)`` returns
``True``.
- Notes
+ Notes
-----
Memory-mapped arrays use the the Python memory-map object which
Modified: branches/clean_math_config/numpy/core/src/scalartypes.inc.src
===================================================================
--- branches/clean_math_config/numpy/core/src/scalartypes.inc.src 2008-09-04 14:45:33 UTC (rev 5761)
+++ branches/clean_math_config/numpy/core/src/scalartypes.inc.src 2008-09-04 14:55:01 UTC (rev 5762)
@@ -1899,8 +1899,10 @@
PyObject *robj;
PyObject *arr;
PyArray_Descr *typecode = NULL;
+#if !(@default@ == 2)
int itemsize;
void *dest, *src;
+#endif
/* allow base-class (if any) to do conversion */
/* If successful, this will jump to finish: */
Modified: branches/clean_math_config/numpy/core/tests/test_regression.py
===================================================================
--- branches/clean_math_config/numpy/core/tests/test_regression.py 2008-09-04 14:45:33 UTC (rev 5761)
+++ branches/clean_math_config/numpy/core/tests/test_regression.py 2008-09-04 14:55:01 UTC (rev 5762)
@@ -847,7 +847,7 @@
"""Ticket #771: strides are not set correctly when reshaping 0-sized
arrays"""
b = np.indices((0,3,4)).T.reshape(-1,3)
- assert_equal(b.strides, (12, 4))
+ assert_equal(b.strides, (3 * b.itemsize, b.itemsize))
def test_object_array_refcounting(self, level=rlevel):
"""Ticket #633"""
Modified: branches/clean_math_config/numpy/distutils/command/scons.py
===================================================================
--- branches/clean_math_config/numpy/distutils/command/scons.py 2008-09-04 14:45:33 UTC (rev 5761)
+++ branches/clean_math_config/numpy/distutils/command/scons.py 2008-09-04 14:55:01 UTC (rev 5762)
@@ -287,11 +287,11 @@
self.post_hooks = []
self.pkg_names = []
- # To avoid trouble, just don't do anything if no sconscripts are used.
- # This is useful when for example f2py uses numpy.distutils, because
- # f2py does not pass compiler information to scons command, and the
- # compilation setup below can crash in some situation.
- if len(self.sconscripts) > 0:
+ # To avoid trouble, just don't do anything if no sconscripts are used.
+ # This is useful when for example f2py uses numpy.distutils, because
+ # f2py does not pass compiler information to scons command, and the
+ # compilation setup below can crash in some situation.
+ if len(self.sconscripts) > 0:
# Try to get the same compiler than the ones used by distutils: this is
# non trivial because distutils and scons have totally different
# conventions on this one (distutils uses PATH from user's environment,
Modified: branches/clean_math_config/numpy/doc/subclassing.py
===================================================================
--- branches/clean_math_config/numpy/doc/subclassing.py 2008-09-04 14:45:33 UTC (rev 5761)
+++ branches/clean_math_config/numpy/doc/subclassing.py 2008-09-04 14:55:01 UTC (rev 5762)
@@ -7,7 +7,7 @@
-------
This page is based with thanks on the wiki page on subclassing by Pierre
-Gerard-Marchant - http://www.scipy.org/Subclasses.
+Gerard-Marchant - http://www.scipy.org/Subclasses.
Introduction
------------
@@ -40,21 +40,21 @@
To allow subclassing, and views of subclasses, ndarray uses the
ndarray ``__new__`` method for the main work of object initialization,
-rather then the more usual ``__init__`` method.
+rather then the more usual ``__init__`` method.
``__new__`` and ``__init__``
============================
``__new__`` is a standard python method, and, if present, is called
before ``__init__`` when we create a class instance. Consider the
-following::
+following::
class C(object):
def __new__(cls, *args):
- print 'Args in __new__:', args
- return object.__new__(cls, *args)
+ print 'Args in __new__:', args
+ return object.__new__(cls, *args)
def __init__(self, *args):
- print 'Args in __init__:', args
+ print 'Args in __init__:', args
C('hello')
@@ -75,7 +75,7 @@
As you can see, the object can be initialized in the ``__new__``
method or the ``__init__`` method, or both, and in fact ndarray does
not have an ``__init__`` method, because all the initialization is
-done in the ``__new__`` method.
+done in the ``__new__`` method.
Why use ``__new__`` rather than just the usual ``__init__``? Because
in some cases, as for ndarray, we want to be able to return an object
@@ -83,21 +83,21 @@
class C(object):
def __new__(cls, *args):
- print 'cls is:', cls
- print 'Args in __new__:', args
- return object.__new__(cls, *args)
+ print 'cls is:', cls
+ print 'Args in __new__:', args
+ return object.__new__(cls, *args)
def __init__(self, *args):
- print 'self is :', self
- print 'Args in __init__:', args
+ print 'self is :', self
+ print 'Args in __init__:', args
class D(C):
def __new__(cls, *args):
- print 'D cls is:', cls
- print 'D args in __new__:', args
- return C.__new__(C, *args)
+ print 'D cls is:', cls
+ print 'D args in __new__:', args
+ return C.__new__(C, *args)
def __init__(self, *args):
- print 'D self is :', self
- print 'D args in __init__:', args
+ print 'D self is :', self
+ print 'D args in __init__:', args
D('hello')
@@ -131,7 +131,7 @@
``__new__`` method knows nothing of what we have done in our own
``__new__`` method in order to set attributes, and so on. (Aside -
why not call ``obj = subdtype.__new__(...`` then? Because we may not
-have a ``__new__`` method with the same call signature).
+have a ``__new__`` method with the same call signature).
So, when creating a new view object of our subclass, we need to be
able to set any extra attributes from the original object of our
@@ -153,21 +153,21 @@
class InfoArray(np.ndarray):
def __new__(subtype, shape, dtype=float, buffer=None, offset=0,
- strides=None, order=None, info=None):
- # Create the ndarray instance of our type, given the usual
- # input arguments. This will call the standard ndarray
- # constructor, but return an object of our type
- obj = np.ndarray.__new__(subtype, shape, dtype, buffer, offset, strides,
- order)
- # add the new attribute to the created instance
- obj.info = info
- # Finally, we must return the newly created object:
- return obj
+ strides=None, order=None, info=None):
+ # Create the ndarray instance of our type, given the usual
+ # input arguments. This will call the standard ndarray
+ # constructor, but return an object of our type
+ obj = np.ndarray.__new__(subtype, shape, dtype, buffer, offset, strides,
+ order)
+ # add the new attribute to the created instance
+ obj.info = info
+ # Finally, we must return the newly created object:
+ return obj
def __array_finalize__(self,obj):
- # reset the attribute from passed original object
- self.info = getattr(obj, 'info', None)
- # We do not need to return anything
+ # reset the attribute from passed original object
+ self.info = getattr(obj, 'info', None)
+ # We do not need to return anything
obj = InfoArray(shape=(3,), info='information')
print type(obj)
@@ -200,18 +200,18 @@
class RealisticInfoArray(np.ndarray):
def __new__(cls, input_array, info=None):
- # Input array is an already formed ndarray instance
- # We first cast to be our class type
- obj = np.asarray(input_array).view(cls)
- # add the new attribute to the created instance
- obj.info = info
- # Finally, we must return the newly created object:
- return obj
+ # Input array is an already formed ndarray instance
+ # We first cast to be our class type
+ obj = np.asarray(input_array).view(cls)
+ # add the new attribute to the created instance
+ obj.info = info
+ # Finally, we must return the newly created object:
+ return obj
def __array_finalize__(self,obj):
- # reset the attribute from passed original object
- self.info = getattr(obj, 'info', None)
- # We do not need to return anything
+ # reset the attribute from passed original object
+ self.info = getattr(obj, 'info', None)
+ # We do not need to return anything
arr = np.arange(5)
obj = RealisticInfoArray(arr, info='information')
Modified: branches/clean_math_config/numpy/lib/_datasource.py
===================================================================
--- branches/clean_math_config/numpy/lib/_datasource.py 2008-09-04 14:45:33 UTC (rev 5761)
+++ branches/clean_math_config/numpy/lib/_datasource.py 2008-09-04 14:55:01 UTC (rev 5762)
@@ -38,7 +38,7 @@
from shutil import rmtree
# Using a class instead of a module-level dictionary
-# to reduce the inital 'import numpy' overhead by
+# to reduce the inital 'import numpy' overhead by
# deferring the import of bz2 and gzip until needed
# TODO: .zip support, .tar support?
@@ -197,7 +197,7 @@
def _isurl(self, path):
"""Test if path is a net location. Tests the scheme and netloc."""
-
+
# We do this here to reduce the 'import numpy' initial import time.
from urlparse import urlparse
Modified: branches/clean_math_config/numpy/lib/scimath.py
===================================================================
--- branches/clean_math_config/numpy/lib/scimath.py 2008-09-04 14:45:33 UTC (rev 5761)
+++ branches/clean_math_config/numpy/lib/scimath.py 2008-09-04 14:55:01 UTC (rev 5762)
@@ -198,15 +198,15 @@
As the numpy.sqrt, this returns the principal square root of x, which is
what most people mean when they use square root; the principal square root
- of x is not any number z such as z^2 = x.
+ of x is not any number z such as z^2 = x.
For positive numbers, the principal square root is defined as the positive
- number z such as z^2 = x.
+ number z such as z^2 = x.
The principal square root of -1 is i, the principal square root of any
negative number -x is defined a i * sqrt(x). For any non zero complex
number, it is defined by using the following branch cut: x = r e^(i t) with
- r > 0 and -pi < t <= pi. The principal square root is then
+ r > 0 and -pi < t <= pi. The principal square root is then
sqrt(r) e^(i t/2).
"""
x = _fix_real_lt_zero(x)
Modified: branches/clean_math_config/numpy/lib/tests/test_format.py
===================================================================
--- branches/clean_math_config/numpy/lib/tests/test_format.py 2008-09-04 14:45:33 UTC (rev 5761)
+++ branches/clean_math_config/numpy/lib/tests/test_format.py 2008-09-04 14:55:01 UTC (rev 5762)
@@ -421,7 +421,7 @@
def test_memmap_roundtrip():
# XXX: test crashes nose on windows. Fix this
- if not sys.platform == 'win32':
+ if not (sys.platform == 'win32' or sys.platform == 'cygwin'):
for arr in basic_arrays + record_arrays:
if arr.dtype.hasobject:
# Skip these since they can't be mmap'ed.
@@ -434,13 +434,13 @@
format.write_array(fp, arr)
finally:
fp.close()
-
+
fortran_order = (arr.flags.f_contiguous and not arr.flags.c_contiguous)
ma = format.open_memmap(mfn, mode='w+', dtype=arr.dtype,
shape=arr.shape, fortran_order=fortran_order)
ma[...] = arr
del ma
-
+
# Check that both of these files' contents are the same.
fp = open(nfn, 'rb')
normal_bytes = fp.read()
@@ -449,7 +449,7 @@
memmap_bytes = fp.read()
fp.close()
yield assert_equal, normal_bytes, memmap_bytes
-
+
# Check that reading the file using memmap works.
ma = format.open_memmap(nfn, mode='r')
#yield assert_array_equal, ma, arr
Modified: branches/clean_math_config/numpy/lib/ufunclike.py
===================================================================
--- branches/clean_math_config/numpy/lib/ufunclike.py 2008-09-04 14:45:33 UTC (rev 5761)
+++ branches/clean_math_config/numpy/lib/ufunclike.py 2008-09-04 14:55:01 UTC (rev 5762)
@@ -10,12 +10,12 @@
""" Round x to nearest integer towards zero.
"""
x = nx.asanyarray(x)
- if y is None:
+ if y is None:
y = nx.zeros_like(x)
y1 = nx.floor(x)
y2 = nx.ceil(x)
y[...] = nx.where(x >= 0, y1, y2)
- return y
+ return y
def isposinf(x, y=None):
"""
Modified: branches/clean_math_config/numpy/ma/core.py
===================================================================
--- branches/clean_math_config/numpy/ma/core.py 2008-09-04 14:45:33 UTC (rev 5761)
+++ branches/clean_math_config/numpy/ma/core.py 2008-09-04 14:55:01 UTC (rev 5762)
@@ -86,7 +86,7 @@
return
newdoc = """
%s
-
+
Notes
-----
%s
@@ -896,7 +896,7 @@
"""
cond = make_mask(condition)
a = np.array(a, copy=copy, subok=True)
-
+
(cshape, ashape) = (cond.shape, a.shape)
if cshape and cshape != ashape:
raise IndexError("Inconsistant shape between the condition and the input"\
@@ -1817,18 +1817,33 @@
def compress(self, condition, axis=None, out=None):
- """Return a where condition is True.
- If condition is a MaskedArray, missing values are considered as False.
+ """
+ Return `a` where condition is ``True``.
+ If condition is a `MaskedArray`, missing values are considered as ``False``.
- Returns
- -------
- A MaskedArray object.
+ Parameters
+ ----------
+ condition : var
+ Boolean 1-d array selecting which entries to return. If len(condition)
+ is less than the size of a along the axis, then output is truncated
+ to length of condition array.
+ axis : {None, int}, optional
+ Axis along which the operation must be performed.
+ out : {None, ndarray}, optional
+ Alternative output array in which to place the result. It must have
+ the same shape as the expected output but the type will be cast if
+ necessary.
- Notes
- -----
- Please note the difference with compressed() !
- The output of compress has a mask, the output of compressed does not.
+ Returns
+ -------
+ result : MaskedArray
+ A :class:`MaskedArray` object.
+ Warnings
+ --------
+ Please note the difference with :meth:`compressed` !
+ The output of :meth:`compress` has a mask, the output of :meth:`compressed` does not.
+
"""
# Get the basic components
(_data, _mask) = (self._data, self._mask)
@@ -2038,9 +2053,10 @@
Returns
-------
- A masked array where the mask is True where all data are
- masked. If axis is None, returns either a scalar ot the
- masked singleton if all values are masked.
+ result : MaskedArray
+ A masked array where the mask is True where all data are
+ masked. If axis is None, returns either a scalar ot the
+ masked singleton if all values are masked.
"""
m = self._mask
@@ -2182,7 +2198,7 @@
Check if all of the elements of `a` are true.
- Performs a logical_and over the given axis and returns the result.
+ Performs a :func:`logical_and` over the given axis and returns the result.
Masked values are considered as True during computation.
For convenience, the output array is masked where ALL the values along the
current axis are masked: if the output would have been a scalar and that
@@ -2344,10 +2360,8 @@
def cumsum(self, axis=None, dtype=None, out=None):
- """a.cumsum(axis=None, dtype=None, out=None)
-
+ """
Return the cumulative sum of the elements along the given axis.
-
The cumulative sum is calculated over the flattened array by
default, otherwise over the specified axis.
@@ -2358,20 +2372,24 @@
Parameters
----------
axis : {None, -1, int}, optional
- Axis along which the sum is computed. The default
- (`axis` = None) is to compute over the flattened array.
+ Axis along which the sum is computed. The default (`axis` = None) is to
+ compute over the flattened array. `axis` may be negative, in which case
+ it counts from the last to the first axis.
dtype : {None, dtype}, optional
- Determines the type of the returned array and of the accumulator
- where the elements are summed. If dtype has the value None and
- the type of a is an integer type of precision less than the default
- platform integer, then the default platform integer precision is
- used. Otherwise, the dtype is the same as that of a.
+ Type of the returned array and of the accumulator in which the
+ elements are summed. If `dtype` is not specified, it defaults
+ to the dtype of `a`, unless `a` has an integer dtype with a
+ precision less than that of the default platform integer. In
+ that case, the default platform integer is used.
out : ndarray, optional
Alternative output array in which to place the result. It must
have the same shape and buffer length as the expected output
but the type will be cast if necessary.
- WARNING : The mask is lost if out is not a valid MaskedArray !
+ Warning
+ -------
+ The mask is lost if out is not a valid :class:`MaskedArray` !
+
Returns
-------
cumsum : ndarray.
@@ -2380,7 +2398,8 @@
Example
-------
- >>> print np.ma.array(np.arange(10), mask=[0,0,0,1,1,1,0,0,0,0]).cumsum()
+ >>> marr = np.ma.array(np.arange(10), mask=[0,0,0,1,1,1,0,0,0,0])
+ >>> print marr.cumsum()
[0 1 3 -- -- -- 9 16 24 33]
@@ -2401,8 +2420,7 @@
def prod(self, axis=None, dtype=None, out=None):
- """a.prod(axis=None, dtype=None, out=None)
-
+ """
Return the product of the array elements over the given axis.
Masked elements are set to 1 internally for computation.
@@ -2413,8 +2431,8 @@
product is over all the array elements.
dtype : {None, dtype}, optional
Determines the type of the returned array and of the accumulator
- where the elements are multiplied. If dtype has the value None and
- the type of a is an integer type of precision less than the default
+ where the elements are multiplied. If ``dtype`` has the value ``None``
+ and the type of a is an integer type of precision less than the default
platform integer, then the default platform integer precision is
used. Otherwise, the dtype is the same as that of a.
out : {None, array}, optional
@@ -2473,10 +2491,7 @@
def cumprod(self, axis=None, dtype=None, out=None):
"""
- a.cumprod(axis=None, dtype=None, out=None)
-
Return the cumulative product of the elements along the given axis.
-
The cumulative product is taken over the flattened array by
default, otherwise over the specified axis.
@@ -2491,21 +2506,24 @@
(`axis` = None) is to compute over the flattened array.
dtype : {None, dtype}, optional
Determines the type of the returned array and of the accumulator
- where the elements are multiplied. If dtype has the value None and
- the type of a is an integer type of precision less than the default
+ where the elements are multiplied. If ``dtype`` has the value ``None`` and
+ the type of ``a`` is an integer type of precision less than the default
platform integer, then the default platform integer precision is
- used. Otherwise, the dtype is the same as that of a.
+ used. Otherwise, the dtype is the same as that of ``a``.
out : ndarray, optional
Alternative output array in which to place the result. It must
have the same shape and buffer length as the expected output
but the type will be cast if necessary.
- WARNING : The mask is lost if out is not a valid MaskedArray !
+ Warning
+ -------
+ The mask is lost if out is not a valid MaskedArray !
+
Returns
-------
- cumprod : ndarray.
- A new array holding the result is returned unless out is
- specified, in which case a reference to out is returned.
+ cumprod : ndarray
+ A new array holding the result is returned unless out is specified,
+ in which case a reference to out is returned.
Notes
-----
@@ -2524,43 +2542,7 @@
def mean(self, axis=None, dtype=None, out=None):
- """a.mean(axis=None, dtype=None, out=None) -> mean
-
- Returns the average of the array elements. The average is taken over the
- flattened array by default, otherwise over the specified axis.
-
- Parameters
- ----------
- axis : integer
- Axis along which the means are computed. The default is
- to compute the mean of the flattened array.
- dtype : type
- Type to use in computing the means. For arrays of
- integer type the default is float32, for arrays of float types it
- is the same as the array type.
- out : ndarray
- Alternative output array in which to place the result. It must have
- the same shape as the expected output but the type will be cast if
- necessary.
-
- Returns
- -------
- mean : The return type varies, see above.
- A new array holding the result is returned unless out is specified,
- in which case a reference to out is returned.
-
- See Also
- --------
- var : variance
- std : standard deviation
-
- Notes
- -----
- The mean is the sum of the elements along the axis divided by the
- number of elements.
-
-
- """
+ ""
if self._mask is nomask:
result = super(MaskedArray, self).mean(axis=axis, dtype=dtype)
else:
@@ -2576,21 +2558,22 @@
outmask.flat = getattr(result, '_mask', nomask)
return out
return result
+ mean.__doc__ = ndarray.mean.__doc__
def anom(self, axis=None, dtype=None):
- """Return the anomalies (deviations from the average) along
- the given axis.
+ """
+ Return the anomalies (deviations from the average) along the given axis.
- Parameters
- ----------
- axis : int, optional
- Axis along which to perform the operation.
- If None, applies to a flattened version of the array.
- dtype : {dtype}, optional
- Datatype for the intermediary computation. If not
- given, the current dtype is used instead.
+ Parameters
+ ----------
+ axis : int, optional
+ Axis along which to perform the operation.
+ If None, applies to a flattened version of the array.
+ dtype : {dtype}, optional
+ Datatype for the intermediary computation.
+ If not given, the current dtype is used instead.
- """
+ """
m = self.mean(axis, dtype)
if not axis:
return (self - m)
@@ -2598,50 +2581,7 @@
return (self - expand_dims(m,axis))
def var(self, axis=None, dtype=None, out=None, ddof=0):
- """a.var(axis=None, dtype=None, out=None, ddof=0) -> variance
-
- Returns the variance of the array elements, a measure of the spread of a
- distribution. The variance is computed for the flattened array by default,
- otherwise over the specified axis.
-
- Parameters
- ----------
- axis : integer
- Axis along which the variance is computed. The default is to
- compute the variance of the flattened array.
- dtype : data-type
- Type to use in computing the variance. For arrays of integer type
- the default is float32, for arrays of float types it is the same as
- the array type.
- out : ndarray
- Alternative output array in which to place the result. It must have
- the same shape as the expected output but the type will be cast if
- necessary.
- ddof : {0, integer},
- Means Delta Degrees of Freedom. The divisor used in calculation is
- N - ddof.
-
- Returns
- -------
- variance : The return type varies, see above.
- A new array holding the result is returned unless out is specified,
- in which case a reference to out is returned.
-
- See Also
- --------
- std : standard deviation
- mean: average
-
- Notes
- -----
- The variance is the average of the squared deviations from the mean,
- i.e. var = mean(abs(x - x.mean())**2). The mean is computed by
- dividing by N-ddof, where N is the number of elements. The argument
- ddof defaults to zero; for an unbiased estimate supply ddof=1. Note
- that for complex numbers the absolute value is taken before squaring,
- so that the result is always real and nonnegative.
-
- """
+ ""
# Easy case: nomask, business as usual
if self._mask is nomask:
return self._data.var(axis=axis, dtype=dtype, out=out, ddof=ddof)
@@ -2675,52 +2615,11 @@
out.__setmask__(dvar.mask)
return out
return dvar
+ var.__doc__ = np.var.__doc__
- def std(self, axis=None, dtype=None, out=None, ddof=0):
- """a.std(axis=None, dtype=None, out=None, ddof=0)
- Returns the standard deviation of the array elements, a measure of the
- spread of a distribution. The standard deviation is computed for the
- flattened array by default, otherwise over the specified axis.
-
- Parameters
- ----------
- axis : integer
- Axis along which the standard deviation is computed. The default is
- to compute the standard deviation of the flattened array.
- dtype : type
- Type to use in computing the standard deviation. For arrays of
- integer type the default is float32, for arrays of float types it
- is the same as the array type.
- out : ndarray
- Alternative output array in which to place the result. It must have
- the same shape as the expected output but the type will be cast if
- necessary.
- ddof : {0, integer}
- Means Delta Degrees of Freedom. The divisor used in calculations
- is N-ddof.
-
- Returns
- -------
- standard deviation : The return type varies, see above.
- A new array holding the result is returned unless out is specified,
- in which case a reference to out is returned.
-
- See Also
- --------
- var : variance
- mean : average
-
- Notes
- -----
- The standard deviation is the square root of the average of the squared
- deviations from the mean, i.e. var = sqrt(mean(abs(x - x.mean())**2)). The
- computed standard deviation is computed by dividing by the number of
- elements, N-ddof. The option ddof defaults to zero, that is, a biased
- estimate. Note that for complex numbers std takes the absolute value before
- squaring, so that the result is always real and nonnegative.
-
- """
+ def std(self, axis=None, dtype=None, out=None, ddof=0):
+ ""
dvar = self.var(axis=axis,dtype=dtype,out=out, ddof=ddof)
if dvar is not masked:
dvar = sqrt(dvar)
@@ -2728,6 +2627,7 @@
out **= 0.5
return out
return dvar
+ std.__doc__ = np.std.__doc__
#............................................
def round(self, decimals=0, out=None):
@@ -2928,8 +2828,7 @@
#............................................
def min(self, axis=None, out=None, fill_value=None):
- """a.min(axis=None, out=None, fill_value=None)
-
+ """
Return the minimum along a given axis.
Parameters
@@ -2938,11 +2837,11 @@
Axis along which to operate. By default, ``axis`` is None and the
flattened input is used.
out : array_like, optional
- Alternative output array in which to place the result. Must
- be of the same shape and buffer length as the expected output.
+ Alternative output array in which to place the result. Must be of
+ the same shape and buffer length as the expected output.
fill_value : {var}, optional
Value used to fill in the masked values.
- If None, use the output of minimum_fill_value().
+ If None, use the output of `minimum_fill_value`.
Returns
-------
@@ -2950,6 +2849,11 @@
New array holding the result.
If ``out`` was specified, ``out`` is returned.
+ See Also
+ --------
+ minimum_fill_value
+ Returns the minimum filling value for a given datatype.
+
"""
_mask = ndarray.__getattribute__(self, '_mask')
newmask = _mask.all(axis=axis)
@@ -3008,6 +2912,11 @@
New array holding the result.
If ``out`` was specified, ``out`` is returned.
+ See Also
+ --------
+ maximum_fill_value
+ Returns the maximum filling value for a given datatype.
+
"""
_mask = ndarray.__getattribute__(self, '_mask')
newmask = _mask.all(axis=axis)
@@ -3649,7 +3558,8 @@
return
def transpose(a, axes=None):
- """Return a view of the array with dimensions permuted according to axes,
+ """
+ Return a view of the array with dimensions permuted according to axes,
as a masked array.
If ``axes`` is None (default), the output view has reversed
@@ -3865,7 +3775,7 @@
if len(fb.shape) == 0:
fb.shape = (1,)
return np.inner(fa, fb).view(MaskedArray)
-inner.__doc__ = doc_note(np.inner.__doc__,
+inner.__doc__ = doc_note(np.inner.__doc__,
"Masked values are replaced by 0.")
innerproduct = inner
@@ -3953,7 +3863,8 @@
#---- --- Pickling ---
#####--------------------------------------------------------------------------
def dump(a,F):
- """Pickle the MaskedArray `a` to the file `F`. `F` can either be
+ """
+ Pickle the MaskedArray `a` to the file `F`. `F` can either be
the handle of an exiting file, or a string representing a file
name.
@@ -3963,15 +3874,16 @@
return cPickle.dump(a,F)
def dumps(a):
- """Return a string corresponding to the pickling of the
- MaskedArray.
+ """
+ Return a string corresponding to the pickling of the MaskedArray.
"""
return cPickle.dumps(a)
def load(F):
- """Wrapper around ``cPickle.load`` which accepts either a
- file-like object or a filename.
+ """
+ Wrapper around ``cPickle.load`` which accepts either a file-like object
+ or a filename.
"""
if not hasattr(F, 'readline'):
Modified: branches/clean_math_config/numpy/testing/nosetester.py
===================================================================
--- branches/clean_math_config/numpy/testing/nosetester.py 2008-09-04 14:45:33 UTC (rev 5761)
+++ branches/clean_math_config/numpy/testing/nosetester.py 2008-09-04 14:55:01 UTC (rev 5762)
@@ -164,8 +164,8 @@
pyversion = sys.version.replace('\n','')
print "Python version %s" % pyversion
print "nose version %d.%d.%d" % nose.__versioninfo__
-
+
def test(self, label='fast', verbose=1, extra_argv=None, doctests=False,
coverage=False, **kwargs):
''' Run tests for module using nose
Modified: branches/clean_math_config/numpy/testing/parametric.py
===================================================================
--- branches/clean_math_config/numpy/testing/parametric.py 2008-09-04 14:45:33 UTC (rev 5761)
+++ branches/clean_math_config/numpy/testing/parametric.py 2008-09-04 14:55:01 UTC (rev 5762)
@@ -61,9 +61,9 @@
_shareParTestPrefix = 'testsp'
def __init__(self, methodName = 'runTest'):
- warnings.warn("ParametricTestCase will be removed in the next NumPy "
+ warnings.warn("ParametricTestCase will be removed in the next NumPy "
"release", DeprecationWarning)
- unittest.TestCase.__init__(self, methodName)
+ unittest.TestCase.__init__(self, methodName)
def exec_test(self,test,args,result):
"""Execute a single test. Returns a success boolean"""
Modified: branches/clean_math_config/numpy/version.py
===================================================================
--- branches/clean_math_config/numpy/version.py 2008-09-04 14:45:33 UTC (rev 5761)
+++ branches/clean_math_config/numpy/version.py 2008-09-04 14:55:01 UTC (rev 5762)
@@ -1,4 +1,4 @@
-version='1.2.0'
+version='1.3.0'
release=False
if not release:
Modified: branches/clean_math_config/tools/osxbuild/build.py
===================================================================
--- branches/clean_math_config/tools/osxbuild/build.py 2008-09-04 14:45:33 UTC (rev 5761)
+++ branches/clean_math_config/tools/osxbuild/build.py 2008-09-04 14:55:01 UTC (rev 5762)
@@ -36,7 +36,7 @@
cmd = 'sudo chown -R %s %s' % (getuser(), DIST_DIR)
shellcmd(cmd)
shutil.rmtree(DIST_DIR)
-
+
def build_dist():
print 'Building distribution... (using sudo)'
cmd = 'sudo python setupegg.py bdist_mpkg'
@@ -67,7 +67,7 @@
print 'Reverting README.txt...'
cmd = 'svn revert %s' % DEV_README
shellcmd(cmd)
-
+
def shellcmd(cmd, verbose=True):
"""Call a shell command."""
if verbose:
@@ -80,7 +80,7 @@
%s
""" % str(err)
raise Exception(msg)
-
+
def build():
# update end-user documentation
copy_readme()
@@ -99,6 +99,6 @@
os.chdir(cwd)
# restore developer documentation
revert_readme()
-
+
if __name__ == '__main__':
build()
Modified: branches/clean_math_config/tools/osxbuild/install_and_test.py
===================================================================
--- branches/clean_math_config/tools/osxbuild/install_and_test.py 2008-09-04 14:45:33 UTC (rev 5761)
+++ branches/clean_math_config/tools/osxbuild/install_and_test.py 2008-09-04 14:55:01 UTC (rev 5762)
@@ -14,7 +14,7 @@
"""Add color to this print output."""
clrmsg = clrgreen + msg + clrnull
print clrmsg
-
+
distdir = os.path.join(SRC_DIR, DIST_DIR)
# Find the package and build abspath to it
Modified: branches/clean_math_config/tools/win32build/build.py
===================================================================
--- branches/clean_math_config/tools/win32build/build.py 2008-09-04 14:45:33 UTC (rev 5761)
+++ branches/clean_math_config/tools/win32build/build.py 2008-09-04 14:55:01 UTC (rev 5762)
@@ -80,7 +80,7 @@
if not os.path.exists("binaries"):
os.makedirs("binaries")
- shutil.move(os.path.join('dist', get_windist_exec(pyver)),
+ shutil.move(os.path.join('dist', get_windist_exec(pyver)),
os.path.join("binaries", get_binary_name(arch)))
def get_numpy_version():
@@ -110,7 +110,7 @@
if __name__ == '__main__':
from optparse import OptionParser
parser = OptionParser()
- parser.add_option("-a", "--arch", dest="arch",
+ parser.add_option("-a", "--arch", dest="arch",
help = "Architecture to build (sse2, sse3, nosse, etc...)")
parser.add_option("-p", "--pyver", dest="pyver",
help = "Python version (2.4, 2.5, etc...)")
Modified: branches/clean_math_config/tools/win32build/prepare_bootstrap.py
===================================================================
--- branches/clean_math_config/tools/win32build/prepare_bootstrap.py 2008-09-04 14:45:33 UTC (rev 5761)
+++ branches/clean_math_config/tools/win32build/prepare_bootstrap.py 2008-09-04 14:55:01 UTC (rev 5762)
@@ -79,7 +79,7 @@
version = subprocess.Popen(['python', '-c', 'import __builtin__; __builtin__.__NUMPY_SETUP__ = True; from numpy.version import version;print version'], stdout = subprocess.PIPE).communicate()[0]
version = version.strip()
if 'dev' in version:
- out = subprocess.Popen(['svn', 'info'], stdout = subprocess.PIPE).communicate()[0]
+ out = subprocess.Popen(['svn', 'info'], stdout = subprocess.PIPE).communicate()[0]
r = re.compile('Revision: ([0-9]+)')
svnver = None
for line in out.split('\n'):
More information about the Numpy-svn
mailing list