From ariver at enthought.com Thu Jan 14 02:48:40 2010 From: ariver at enthought.com (Aaron River) Date: Thu, 14 Jan 2010 01:48:40 -0600 Subject: [Numpy-svn] test2 Message-ID: <02F8B93F-F1F5-4ED8-89F0-D6606DED587C@enthought.com> test2 -- Aaron From numpy-svn at scipy.org Thu Jan 14 20:51:02 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 14 Jan 2010 19:51:02 -0600 (CST) Subject: [Numpy-svn] r8053 - trunk Message-ID: <20100115015102.80F0BC7C029@scipy.org> Author: ariver Date: 2010-01-14 19:51:02 -0600 (Thu, 14 Jan 2010) New Revision: 8053 Modified: trunk/TEST_COMMIT Log: _ Modified: trunk/TEST_COMMIT =================================================================== --- trunk/TEST_COMMIT 2010-01-15 01:00:20 UTC (rev 8052) +++ trunk/TEST_COMMIT 2010-01-15 01:51:02 UTC (rev 8053) @@ -14,4 +14,4 @@ sasha: yes tim_hochberg: yes jarrod.millman: yes -ariver: 2010-01-14 19:00:08 +ariver: 2010-01-14 19:50:50 From numpy-svn at scipy.org Thu Jan 14 21:02:31 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 14 Jan 2010 20:02:31 -0600 (CST) Subject: [Numpy-svn] r8055 - trunk Message-ID: <20100115020231.01CBFC7C029@scipy.org> Author: ariver Date: 2010-01-14 20:02:30 -0600 (Thu, 14 Jan 2010) New Revision: 8055 Modified: trunk/TEST_COMMIT Log: _ Modified: trunk/TEST_COMMIT =================================================================== --- trunk/TEST_COMMIT 2010-01-15 01:57:56 UTC (rev 8054) +++ trunk/TEST_COMMIT 2010-01-15 02:02:30 UTC (rev 8055) @@ -14,4 +14,4 @@ sasha: yes tim_hochberg: yes jarrod.millman: yes -ariver: 2010-01-14 19:57:44 +ariver: 2010-01-14 20:02:18 From numpy-svn at scipy.org Fri Jan 15 14:03:10 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Jan 2010 13:03:10 -0600 (CST) Subject: [Numpy-svn] r8056 - trunk/doc/numpy.scipy.org/theme/scipy Message-ID: <20100115190310.DD73A39C674@scipy.org> Author: jarrod.millman Date: 2010-01-15 13:03:10 -0600 (Fri, 15 Jan 2010) New Revision: 8056 Modified: trunk/doc/numpy.scipy.org/theme/scipy/index.html Log: fixed broken links Modified: trunk/doc/numpy.scipy.org/theme/scipy/index.html =================================================================== --- trunk/doc/numpy.scipy.org/theme/scipy/index.html 2010-01-15 02:02:30 UTC (rev 8055) +++ trunk/doc/numpy.scipy.org/theme/scipy/index.html 2010-01-15 19:03:10 UTC (rev 8056) @@ -7,16 +7,16 @@ - + Download - + Getting Started Documentation - + Bug Report From numpy-svn at scipy.org Fri Jan 15 14:11:56 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Jan 2010 13:11:56 -0600 (CST) Subject: [Numpy-svn] r8057 - trunk/doc/numpy.scipy.org/theme/scipy Message-ID: <20100115191156.8DE9539C674@scipy.org> Author: jarrod.millman Date: 2010-01-15 13:11:56 -0600 (Fri, 15 Jan 2010) New Revision: 8057 Modified: trunk/doc/numpy.scipy.org/theme/scipy/index.html Log: missed a few links Modified: trunk/doc/numpy.scipy.org/theme/scipy/index.html =================================================================== --- trunk/doc/numpy.scipy.org/theme/scipy/index.html 2010-01-15 19:03:10 UTC (rev 8056) +++ trunk/doc/numpy.scipy.org/theme/scipy/index.html 2010-01-15 19:11:56 UTC (rev 8057) @@ -24,10 +24,10 @@ - Download - Getting Started + Download + Getting Started Documentation - Report Bugs + Report Bugs Read the Blog From numpy-svn at scipy.org Fri Jan 15 14:15:26 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Jan 2010 13:15:26 -0600 (CST) Subject: [Numpy-svn] r8058 - trunk/numpy/core/tests Message-ID: <20100115191526.4E4D439C4B4@scipy.org> Author: oliphant Date: 2010-01-15 13:15:26 -0600 (Fri, 15 Jan 2010) New Revision: 8058 Modified: trunk/numpy/core/tests/test_multiarray.py Log: Fix test related to bug-fix in array creation from a buffer when offset is provided. Modified: trunk/numpy/core/tests/test_multiarray.py =================================================================== --- trunk/numpy/core/tests/test_multiarray.py 2010-01-15 19:11:56 UTC (rev 8057) +++ trunk/numpy/core/tests/test_multiarray.py 2010-01-15 19:15:26 UTC (rev 8058) @@ -94,9 +94,10 @@ r.strides = strides=strides*x.itemsize 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(ValueError, make_array, 8, 3, 1) + self.failUnlessRaises(RuntimeError, make_array, 8, 3, 1) #self.failUnlessRaises(ValueError, make_array, 8, 3, 0) def test_fill(self): From numpy-svn at scipy.org Fri Jan 15 18:46:54 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Jan 2010 17:46:54 -0600 (CST) Subject: [Numpy-svn] r8059 - trunk/numpy/fft Message-ID: <20100115234654.E74E3C7C069@scipy.org> Author: oliphant Date: 2010-01-15 17:46:54 -0600 (Fri, 15 Jan 2010) New Revision: 8059 Modified: trunk/numpy/fft/fftpack.py Log: Remove un-necessary import. Modified: trunk/numpy/fft/fftpack.py =================================================================== --- trunk/numpy/fft/fftpack.py 2010-01-15 19:15:26 UTC (rev 8058) +++ trunk/numpy/fft/fftpack.py 2010-01-15 23:46:54 UTC (rev 8059) @@ -37,7 +37,6 @@ from numpy.core import asarray, zeros, swapaxes, shape, conjugate, \ take import fftpack_lite as fftpack -from helper import * _fft_cache = {} _real_fft_cache = {} From numpy-svn at scipy.org Fri Jan 15 22:08:03 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Jan 2010 21:08:03 -0600 (CST) Subject: [Numpy-svn] r8060 - trunk/doc/numpy.scipy.org Message-ID: <20100116030803.2A11EC7C07D@scipy.org> Author: jarrod.millman Date: 2010-01-15 21:08:03 -0600 (Fri, 15 Jan 2010) New Revision: 8060 Modified: trunk/doc/numpy.scipy.org/Makefile Log: add make webup Modified: trunk/doc/numpy.scipy.org/Makefile =================================================================== --- trunk/doc/numpy.scipy.org/Makefile 2010-01-15 23:46:54 UTC (rev 8059) +++ trunk/doc/numpy.scipy.org/Makefile 2010-01-16 03:08:03 UTC (rev 8060) @@ -110,3 +110,7 @@ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) build/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in build/doctest/output.txt." + +webup: + @echo "Copying html files to numpy.scipy.org..." + rsync -avH -e ssh _build/html/ jarrod.millman at numpy.scipy.org:/srv/www/numpy From numpy-svn at scipy.org Fri Jan 15 22:11:27 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Jan 2010 21:11:27 -0600 (CST) Subject: [Numpy-svn] r8061 - in trunk/doc/numpy.scipy.org: . source Message-ID: <20100116031127.73190C7C07D@scipy.org> Author: jarrod.millman Date: 2010-01-15 21:11:27 -0600 (Fri, 15 Jan 2010) New Revision: 8061 Added: trunk/doc/numpy.scipy.org/_theme/ Removed: trunk/doc/numpy.scipy.org/theme/ Modified: trunk/doc/numpy.scipy.org/source/conf.py Log: mv theme to _theme Copied: trunk/doc/numpy.scipy.org/_theme (from rev 8060, trunk/doc/numpy.scipy.org/theme) Modified: trunk/doc/numpy.scipy.org/source/conf.py =================================================================== --- trunk/doc/numpy.scipy.org/source/conf.py 2010-01-16 03:08:03 UTC (rev 8060) +++ trunk/doc/numpy.scipy.org/source/conf.py 2010-01-16 03:11:27 UTC (rev 8061) @@ -99,7 +99,7 @@ #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. -html_theme_path = ["../theme"] +html_theme_path = ["../_theme"] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". From numpy-svn at scipy.org Fri Jan 15 22:14:46 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Jan 2010 21:14:46 -0600 (CST) Subject: [Numpy-svn] r8062 - in trunk/doc/numpy.scipy.org: . source Message-ID: <20100116031446.32C22C7C07D@scipy.org> Author: jarrod.millman Date: 2010-01-15 21:14:46 -0600 (Fri, 15 Jan 2010) New Revision: 8062 Added: trunk/doc/numpy.scipy.org/_static/ trunk/doc/numpy.scipy.org/conf.py trunk/doc/numpy.scipy.org/content.rst trunk/doc/numpy.scipy.org/old_array_packages.rst Removed: trunk/doc/numpy.scipy.org/source/_static/ trunk/doc/numpy.scipy.org/source/conf.py trunk/doc/numpy.scipy.org/source/content.rst trunk/doc/numpy.scipy.org/source/old_array_packages.rst Log: moving content up a level from source Copied: trunk/doc/numpy.scipy.org/_static (from rev 8060, trunk/doc/numpy.scipy.org/source/_static) Copied: trunk/doc/numpy.scipy.org/conf.py (from rev 8061, trunk/doc/numpy.scipy.org/source/conf.py) =================================================================== --- trunk/doc/numpy.scipy.org/conf.py (rev 0) +++ trunk/doc/numpy.scipy.org/conf.py 2010-01-16 03:14:46 UTC (rev 8062) @@ -0,0 +1,208 @@ +# -*- coding: utf-8 -*- +# +# Scipy.org documentation build configuration file +# +# This file is execfile()d with the current directory set to its containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys, os + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +#sys.path.append(os.path.abspath('.')) + +# -- General configuration ----------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be extensions +# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +extensions = ['sphinx.ext.intersphinx', 'sphinx.ext.pngmath', + 'sphinx.ext.ifconfig'] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +#source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'content' + +# General information about the project. +project = u'Numpy' +copyright = u'2009 Numpy developers' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '' +# The full version, including alpha/beta/rc tags. +release = '' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +#language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of documents that shouldn't be included in the build. +#unused_docs = [] + +# List of directories, relative to source directory, that shouldn't be searched +# for source files. +exclude_trees = [] + +# The reST default role (used for this markup: `text`) to use for all documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + + +# -- Options for HTML output --------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. Major themes that come with +# Sphinx are currently 'default' and 'sphinxdoc'. +html_theme = 'scipy' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +html_theme_path = ["../_theme"] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +html_title = "Numpy" + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = "" + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +#html_static_path = ['static'] +html_static_path = ['_static'] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} +html_additional_pages = {'index': 'index.html'} + +# If false, no module index is generated. +#html_use_modindex = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +html_show_sourcelink = False + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = '' + +# Output file base name for HTML help builder. +htmlhelp_basename = 'Scipy.org' + + +# -- Options for LaTeX output -------------------------------------------------- + +# The paper size ('letter' or 'a4'). +#latex_paper_size = 'letter' + +# The font size ('10pt', '11pt' or '12pt'). +#latex_font_size = '10pt' + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, documentclass [howto/manual]). +latex_documents = [ + ('index', 'numpy-scipy-org.tex', u'numpy.scipy.org', + u'NumPy collaborators', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# Additional stuff for the LaTeX preamble. +#latex_preamble = '' + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_use_modindex = True + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = { + 'http://docs.python.org/': None, + 'http://docs.scipy.org/doc/numpy/': None, +} Copied: trunk/doc/numpy.scipy.org/content.rst (from rev 8060, trunk/doc/numpy.scipy.org/source/content.rst) =================================================================== --- trunk/doc/numpy.scipy.org/content.rst (rev 0) +++ trunk/doc/numpy.scipy.org/content.rst 2010-01-16 03:14:46 UTC (rev 8062) @@ -0,0 +1,7 @@ +Numerical Python +================= + +.. toctree:: + :maxdepth: 2 + + old_array_packages.rst Copied: trunk/doc/numpy.scipy.org/old_array_packages.rst (from rev 8060, trunk/doc/numpy.scipy.org/source/old_array_packages.rst) =================================================================== --- trunk/doc/numpy.scipy.org/old_array_packages.rst (rev 0) +++ trunk/doc/numpy.scipy.org/old_array_packages.rst 2010-01-16 03:14:46 UTC (rev 8062) @@ -0,0 +1,40 @@ +==================== +Older Array Packages +==================== + +It may take months for the large code base that uses Numeric and/or Numarray +to transition to the new NumPy system. Links to the older packages are +provided here. New users should start out with NumPy. + +Much of the documentation for Numeric and Numarray is applicable to the NumPy package. However, there are `significant feature improvements `_. A complete guide to the new system has been written by the primary developer, Travis Oliphant. It is now in the public domain. Other Documentation is available at `the scipy website `_ and in the docstrings (which can be extracted using pydoc). Free Documentation for Numeric (most of which is still valid) is `here `_ or as a `pdf `_ file. Obviously you should replace references to Numeric in that document with numpy (i.e. instead of "import Numeric", use "import numpy"). + +Upgrading from historical implementations +========================================= + +NumPy derives from the old Numeric code base and can be used as a replacement for Numeric. It also adds the features introduced by Numarray and can also be used to replace Numarray. + +Numeric users should find the transition relatively easy (although not without some effort). There is a module (numpy.oldnumeric.alter_code1) that can makemost of the necessary changes to your Python code that used Numeric to work with NumPy's Numeric compatibility module. + +Users of numarray can also transition their code using a similar module (numpy.numarray.alter_code1) and the numpy.numarray compatibility layer. + +C-code written to either package can be easily ported to NumPy using "numpy/oldnumeric.h" and "numpy/libnumarray.h" for the Numeric C-API and the Numarray C-API respectively. `Sourceforge download site `_ + +For about 6 months at the end of 2005, the new package was called SciPy Core (not to be confused with the full SciPy package which remains a `separate `_ package), and so you will occasionally see references to SciPy Core floating around. It was decided in January 2006 to go with the historical name of NumPy for the new package. Realize that NumPy (module name numpy) is the new name. Because of the name-change, there were a lot of dicussions that took place on scipy-dev at scipy.org and scipy-user at scipy.org. If you have a question about the new system, you may wish to run a search on those mailing lists as well as the main NumPy list (numpy-discussion at lists.sourceforge.net) + +Numeric (version 24.2) +====================== + +Numeric was the first array object built for Python. It has been quite successful and is used in a wide variety of settings and applications. Maintenance has ceased for Numeric, and users should transisition to NumPy as quickly as possible. There is a module called numpy.oldnumeric.alter_code1 in NumPy that can make the transition to NumPy easier (it will automatically perform the search-and-replace style changes that need to be made to python code that uses Numeric to make it work with NumPy). + +Documentation for Numeric is at http://numpy.scipy.org/numpydoc/numdoc.htm> or as a `pdf `_ file `Sourceforge Numeric Download Page `_ + +Numarray +======== + +Numarray is another implementation of an array object for Python written after +Numeric and before NumPy. Sponsors of numarray have indicated they will be +moving to NumPy as soon as is feasible for them so that eventually numarray +will be phased out (probably sometime in 2007). This project shares some of +the resources with the Numeric sourceforge site but maintains its own web page +at http://www.stsci.edu/resources/software_hardware/numarray +`Sourceforge Numarray Download Page `_ \ No newline at end of file Deleted: trunk/doc/numpy.scipy.org/source/conf.py =================================================================== --- trunk/doc/numpy.scipy.org/source/conf.py 2010-01-16 03:11:27 UTC (rev 8061) +++ trunk/doc/numpy.scipy.org/source/conf.py 2010-01-16 03:14:46 UTC (rev 8062) @@ -1,208 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Scipy.org documentation build configuration file -# -# This file is execfile()d with the current directory set to its containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys, os - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -#sys.path.append(os.path.abspath('.')) - -# -- General configuration ----------------------------------------------------- - -# Add any Sphinx extension module names here, as strings. They can be extensions -# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.intersphinx', 'sphinx.ext.pngmath', - 'sphinx.ext.ifconfig'] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# The suffix of source filenames. -source_suffix = '.rst' - -# The encoding of source files. -#source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = 'content' - -# General information about the project. -project = u'Numpy' -copyright = u'2009 Numpy developers' - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The short X.Y version. -version = '' -# The full version, including alpha/beta/rc tags. -release = '' - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -#language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -#today = '' -# Else, today_fmt is used as the format for a strftime call. -#today_fmt = '%B %d, %Y' - -# List of documents that shouldn't be included in the build. -#unused_docs = [] - -# List of directories, relative to source directory, that shouldn't be searched -# for source files. -exclude_trees = [] - -# The reST default role (used for this markup: `text`) to use for all documents. -#default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -#add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -#show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' - -# A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] - - -# -- Options for HTML output --------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. Major themes that come with -# Sphinx are currently 'default' and 'sphinxdoc'. -html_theme = 'scipy' - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -#html_theme_options = {} - -# Add any paths that contain custom themes here, relative to this directory. -html_theme_path = ["../_theme"] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -html_title = "Numpy" - -# A shorter title for the navigation bar. Default is the same as html_title. -#html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -#html_logo = "" - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -#html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -#html_static_path = ['static'] -html_static_path = ['_static'] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -#html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -#html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -#html_additional_pages = {} -html_additional_pages = {'index': 'index.html'} - -# If false, no module index is generated. -#html_use_modindex = True - -# If false, no index is generated. -#html_use_index = True - -# If true, the index is split into individual pages for each letter. -#html_split_index = False - -# If true, links to the reST sources are added to the pages. -html_show_sourcelink = False - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -#html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -#html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -#html_use_opensearch = '' - -# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = '' - -# Output file base name for HTML help builder. -htmlhelp_basename = 'Scipy.org' - - -# -- Options for LaTeX output -------------------------------------------------- - -# The paper size ('letter' or 'a4'). -#latex_paper_size = 'letter' - -# The font size ('10pt', '11pt' or '12pt'). -#latex_font_size = '10pt' - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, documentclass [howto/manual]). -latex_documents = [ - ('index', 'numpy-scipy-org.tex', u'numpy.scipy.org', - u'NumPy collaborators', 'manual'), -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -#latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -#latex_use_parts = False - -# Additional stuff for the LaTeX preamble. -#latex_preamble = '' - -# Documents to append as an appendix to all manuals. -#latex_appendices = [] - -# If false, no module index is generated. -#latex_use_modindex = True - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - 'http://docs.python.org/': None, - 'http://docs.scipy.org/doc/numpy/': None, -} Deleted: trunk/doc/numpy.scipy.org/source/content.rst =================================================================== --- trunk/doc/numpy.scipy.org/source/content.rst 2010-01-16 03:11:27 UTC (rev 8061) +++ trunk/doc/numpy.scipy.org/source/content.rst 2010-01-16 03:14:46 UTC (rev 8062) @@ -1,7 +0,0 @@ -Numerical Python -================= - -.. toctree:: - :maxdepth: 2 - - old_array_packages.rst Deleted: trunk/doc/numpy.scipy.org/source/old_array_packages.rst =================================================================== --- trunk/doc/numpy.scipy.org/source/old_array_packages.rst 2010-01-16 03:11:27 UTC (rev 8061) +++ trunk/doc/numpy.scipy.org/source/old_array_packages.rst 2010-01-16 03:14:46 UTC (rev 8062) @@ -1,40 +0,0 @@ -==================== -Older Array Packages -==================== - -It may take months for the large code base that uses Numeric and/or Numarray -to transition to the new NumPy system. Links to the older packages are -provided here. New users should start out with NumPy. - -Much of the documentation for Numeric and Numarray is applicable to the NumPy package. However, there are `significant feature improvements `_. A complete guide to the new system has been written by the primary developer, Travis Oliphant. It is now in the public domain. Other Documentation is available at `the scipy website `_ and in the docstrings (which can be extracted using pydoc). Free Documentation for Numeric (most of which is still valid) is `here `_ or as a `pdf `_ file. Obviously you should replace references to Numeric in that document with numpy (i.e. instead of "import Numeric", use "import numpy"). - -Upgrading from historical implementations -========================================= - -NumPy derives from the old Numeric code base and can be used as a replacement for Numeric. It also adds the features introduced by Numarray and can also be used to replace Numarray. - -Numeric users should find the transition relatively easy (although not without some effort). There is a module (numpy.oldnumeric.alter_code1) that can makemost of the necessary changes to your Python code that used Numeric to work with NumPy's Numeric compatibility module. - -Users of numarray can also transition their code using a similar module (numpy.numarray.alter_code1) and the numpy.numarray compatibility layer. - -C-code written to either package can be easily ported to NumPy using "numpy/oldnumeric.h" and "numpy/libnumarray.h" for the Numeric C-API and the Numarray C-API respectively. `Sourceforge download site `_ - -For about 6 months at the end of 2005, the new package was called SciPy Core (not to be confused with the full SciPy package which remains a `separate `_ package), and so you will occasionally see references to SciPy Core floating around. It was decided in January 2006 to go with the historical name of NumPy for the new package. Realize that NumPy (module name numpy) is the new name. Because of the name-change, there were a lot of dicussions that took place on scipy-dev at scipy.org and scipy-user at scipy.org. If you have a question about the new system, you may wish to run a search on those mailing lists as well as the main NumPy list (numpy-discussion at lists.sourceforge.net) - -Numeric (version 24.2) -====================== - -Numeric was the first array object built for Python. It has been quite successful and is used in a wide variety of settings and applications. Maintenance has ceased for Numeric, and users should transisition to NumPy as quickly as possible. There is a module called numpy.oldnumeric.alter_code1 in NumPy that can make the transition to NumPy easier (it will automatically perform the search-and-replace style changes that need to be made to python code that uses Numeric to make it work with NumPy). - -Documentation for Numeric is at http://numpy.scipy.org/numpydoc/numdoc.htm> or as a `pdf `_ file `Sourceforge Numeric Download Page `_ - -Numarray -======== - -Numarray is another implementation of an array object for Python written after -Numeric and before NumPy. Sponsors of numarray have indicated they will be -moving to NumPy as soon as is feasible for them so that eventually numarray -will be phased out (probably sometime in 2007). This project shares some of -the resources with the Numeric sourceforge site but maintains its own web page -at http://www.stsci.edu/resources/software_hardware/numarray -`Sourceforge Numarray Download Page `_ \ No newline at end of file From numpy-svn at scipy.org Fri Jan 15 22:17:29 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Jan 2010 21:17:29 -0600 (CST) Subject: [Numpy-svn] r8063 - trunk/doc/numpy.scipy.org Message-ID: <20100116031729.EB0C9C7C07D@scipy.org> Author: jarrod.millman Date: 2010-01-15 21:17:29 -0600 (Fri, 15 Jan 2010) New Revision: 8063 Modified: trunk/doc/numpy.scipy.org/Makefile trunk/doc/numpy.scipy.org/conf.py Log: point everything to top-level dir Modified: trunk/doc/numpy.scipy.org/Makefile =================================================================== --- trunk/doc/numpy.scipy.org/Makefile 2010-01-16 03:14:46 UTC (rev 8062) +++ trunk/doc/numpy.scipy.org/Makefile 2010-01-16 03:17:29 UTC (rev 8063) @@ -9,7 +9,7 @@ # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source +ALLSPHINXOPTS = -d build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest Modified: trunk/doc/numpy.scipy.org/conf.py =================================================================== --- trunk/doc/numpy.scipy.org/conf.py 2010-01-16 03:14:46 UTC (rev 8062) +++ trunk/doc/numpy.scipy.org/conf.py 2010-01-16 03:17:29 UTC (rev 8063) @@ -99,7 +99,7 @@ #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. -html_theme_path = ["../_theme"] +html_theme_path = ["_theme"] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". From numpy-svn at scipy.org Fri Jan 15 22:19:31 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Jan 2010 21:19:31 -0600 (CST) Subject: [Numpy-svn] r8064 - trunk/doc/numpy.scipy.org Message-ID: <20100116031931.C7F9DC7C07D@scipy.org> Author: jarrod.millman Date: 2010-01-15 21:19:31 -0600 (Fri, 15 Jan 2010) New Revision: 8064 Removed: trunk/doc/numpy.scipy.org/source/ Log: removing old dir From numpy-svn at scipy.org Fri Jan 15 22:20:34 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Jan 2010 21:20:34 -0600 (CST) Subject: [Numpy-svn] r8065 - in trunk/doc/numpy.scipy.org: _static _theme/scipy/static Message-ID: <20100116032034.0AAE0C7C07D@scipy.org> Author: jarrod.millman Date: 2010-01-15 21:20:33 -0600 (Fri, 15 Jan 2010) New Revision: 8065 Added: trunk/doc/numpy.scipy.org/_theme/scipy/static/favicon.ico trunk/doc/numpy.scipy.org/_theme/scipy/static/images/ Removed: trunk/doc/numpy.scipy.org/_static/favicon.ico trunk/doc/numpy.scipy.org/_static/images/ Log: consolidating static content in one location Deleted: trunk/doc/numpy.scipy.org/_static/favicon.ico =================================================================== (Binary files differ) Copied: trunk/doc/numpy.scipy.org/_theme/scipy/static/favicon.ico (from rev 8063, trunk/doc/numpy.scipy.org/_static/favicon.ico) =================================================================== (Binary files differ) Copied: trunk/doc/numpy.scipy.org/_theme/scipy/static/images (from rev 8063, trunk/doc/numpy.scipy.org/_static/images) From numpy-svn at scipy.org Fri Jan 15 22:22:25 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Jan 2010 21:22:25 -0600 (CST) Subject: [Numpy-svn] r8066 - trunk/doc/numpy.scipy.org Message-ID: <20100116032225.34B26C7C07D@scipy.org> Author: jarrod.millman Date: 2010-01-15 21:22:25 -0600 (Fri, 15 Jan 2010) New Revision: 8066 Removed: trunk/doc/numpy.scipy.org/_static/ Log: removing old dir From numpy-svn at scipy.org Fri Jan 15 22:28:31 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Jan 2010 21:28:31 -0600 (CST) Subject: [Numpy-svn] r8067 - trunk/doc/numpy.scipy.org Message-ID: <20100116032831.B99F7C7C07D@scipy.org> Author: jarrod.millman Date: 2010-01-15 21:28:31 -0600 (Fri, 15 Jan 2010) New Revision: 8067 Modified: trunk/doc/numpy.scipy.org/conf.py Log: point conf to the default static content Modified: trunk/doc/numpy.scipy.org/conf.py =================================================================== --- trunk/doc/numpy.scipy.org/conf.py 2010-01-16 03:22:25 UTC (rev 8066) +++ trunk/doc/numpy.scipy.org/conf.py 2010-01-16 03:28:31 UTC (rev 8067) @@ -116,12 +116,12 @@ # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None +html_favicon = 'favicon.ico' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". #html_static_path = ['static'] -html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. From numpy-svn at scipy.org Fri Jan 15 22:32:15 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Jan 2010 21:32:15 -0600 (CST) Subject: [Numpy-svn] r8068 - trunk/doc/numpy.scipy.org Message-ID: <20100116033215.F0EFCC7C07D@scipy.org> Author: jarrod.millman Date: 2010-01-15 21:32:15 -0600 (Fri, 15 Jan 2010) New Revision: 8068 Modified: trunk/doc/numpy.scipy.org/Makefile Log: mv build to _build Modified: trunk/doc/numpy.scipy.org/Makefile =================================================================== --- trunk/doc/numpy.scipy.org/Makefile 2010-01-16 03:28:31 UTC (rev 8067) +++ trunk/doc/numpy.scipy.org/Makefile 2010-01-16 03:32:15 UTC (rev 8068) @@ -9,7 +9,7 @@ # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +ALLSPHINXOPTS = -d _build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest @@ -30,86 +30,86 @@ @echo " doctest to run all doctests embedded in the documentation (if enabled)" clean: - -rm -rf build/* + -rm -rf _build/* upload: html - chmod ug=rwX,o=rX -R build/html + chmod ug=rwX,o=rX -R _build/html rsync -r -z --delete-after -p \ - build/html/ \ + _build/html/ \ $(USER)@new.scipy.org:/srv/www/numpy/ html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) build/html + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) _build/html @echo - @echo "Build finished. The HTML pages are in build/html." + @echo "Build finished. The HTML pages are in _build/html." dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) build/dirhtml + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) _build/dirhtml @echo - @echo "Build finished. The HTML pages are in build/dirhtml." + @echo "Build finished. The HTML pages are in _build/dirhtml." pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) build/pickle + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) _build/pickle @echo @echo "Build finished; now you can process the pickle files." json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) build/json + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) _build/json @echo @echo "Build finished; now you can process the JSON files." htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) build/htmlhelp + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) _build/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in build/htmlhelp." + ".hhp project file in _build/htmlhelp." qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) build/qthelp + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) _build/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in build/qthelp, like this:" - @echo "# qcollectiongenerator build/qthelp/Numpy.qhcp" + ".qhcp project file in _build/qthelp, like this:" + @echo "# qcollectiongenerator _build/qthelp/Numpy.qhcp" @echo "To view the help file:" - @echo "# assistant -collectionFile build/qthelp/Numpy.qhc" + @echo "# assistant -collectionFile _build/qthelp/Numpy.qhc" devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) build/devhelp + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) _build/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/Numpy" - @echo "# ln -s build/devhelp $$HOME/.local/share/devhelp/Numpy" + @echo "# ln -s _build/devhelp $$HOME/.local/share/devhelp/Numpy" @echo "# devhelp" latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) build/latex + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) _build/latex @echo - @echo "Build finished; the LaTeX files are in build/latex." + @echo "Build finished; the LaTeX files are in _build/latex." @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ "run these through (pdf)latex." latexpdf: latex - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) build/latex + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) _build/latex @echo "Running LaTeX files through pdflatex..." - make -C build/latex all-pdf - @echo "pdflatex finished; the PDF files are in build/latex." + make -C _build/latex all-pdf + @echo "pdflatex finished; the PDF files are in _build/latex." changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) build/changes + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) _build/changes @echo - @echo "The overview file is in build/changes." + @echo "The overview file is in _build/changes." linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) build/linkcheck + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) _build/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ - "or in build/linkcheck/output.txt." + "or in _build/linkcheck/output.txt." doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) build/doctest + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) _build/doctest @echo "Testing of doctests in the sources finished, look at the " \ - "results in build/doctest/output.txt." + "results in _build/doctest/output.txt." webup: @echo "Copying html files to numpy.scipy.org..." From numpy-svn at scipy.org Fri Jan 15 22:32:55 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Jan 2010 21:32:55 -0600 (CST) Subject: [Numpy-svn] r8069 - trunk/doc/numpy.scipy.org Message-ID: <20100116033255.C50A3C7C07D@scipy.org> Author: jarrod.millman Date: 2010-01-15 21:32:55 -0600 (Fri, 15 Jan 2010) New Revision: 8069 Modified: trunk/doc/numpy.scipy.org/Makefile Log: remove webup, use upload Modified: trunk/doc/numpy.scipy.org/Makefile =================================================================== --- trunk/doc/numpy.scipy.org/Makefile 2010-01-16 03:32:15 UTC (rev 8068) +++ trunk/doc/numpy.scipy.org/Makefile 2010-01-16 03:32:55 UTC (rev 8069) @@ -110,7 +110,3 @@ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) _build/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in _build/doctest/output.txt." - -webup: - @echo "Copying html files to numpy.scipy.org..." - rsync -avH -e ssh _build/html/ jarrod.millman at numpy.scipy.org:/srv/www/numpy From numpy-svn at scipy.org Fri Jan 15 23:33:05 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Jan 2010 22:33:05 -0600 (CST) Subject: [Numpy-svn] r8070 - trunk/numpy/core/src/multiarray Message-ID: <20100116043305.445CDC7C07D@scipy.org> Author: charris Date: 2010-01-15 22:33:05 -0600 (Fri, 15 Jan 2010) New Revision: 8070 Modified: trunk/numpy/core/src/multiarray/arraytypes.c.src Log: Fix bus error resulting from inlined gcc memcpy alignment assumptions. Fixes ticket #1336. Modified: trunk/numpy/core/src/multiarray/arraytypes.c.src =================================================================== --- trunk/numpy/core/src/multiarray/arraytypes.c.src 2010-01-16 03:32:55 UTC (rev 8069) +++ trunk/numpy/core/src/multiarray/arraytypes.c.src 2010-01-16 04:33:05 UTC (rev 8070) @@ -2124,16 +2124,20 @@ #type=Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, datetime, timedelta# */ static Bool - at fname@_nonzero (@type@ *ip, PyArrayObject *ap) + at fname@_nonzero (char *ip, PyArrayObject *ap) { - @type@ t1; - if (ap==NULL || PyArray_ISBEHAVED_RO(ap)) - return (Bool) (*ip != 0); + if (ap == NULL || PyArray_ISBEHAVED_RO(ap)) { + @type@ *ptmp = (@type@ *)ip; + return (Bool) (*ptmp != 0); + } else { - /* don't worry about swap, since we are just testing - whether or not equal to 0 */ - memcpy(&t1, ip, sizeof(@type@)); - return (Bool) (t1 != 0); + /* + * don't worry about swap, since we are just testing + * whether or not equal to 0 + */ + @type@ tmp; + memcpy(&tmp, ip, sizeof(@type@)); + return (Bool) (tmp != 0); } } /**end repeat**/ @@ -2143,16 +2147,20 @@ #type=cfloat, cdouble, clongdouble# */ static Bool - at fname@_nonzero (@type@ *ip, PyArrayObject *ap) + at fname@_nonzero (char *ip, PyArrayObject *ap) { - @type@ t1; - if (ap==NULL || PyArray_ISBEHAVED_RO(ap)) - return (Bool) ((ip->real != 0) || (ip->imag != 0)); + if (ap == NULL || PyArray_ISBEHAVED_RO(ap)) { + @type@ *ptmp = (@type@ *)ip; + return (Bool) ((ptmp->real != 0) || (ptmp->imag != 0)); + } else { - /* don't worry about swap, since we are just testing - whether or not equal to 0 */ - memcpy(&t1, ip, sizeof(@type@)); - return (Bool) ((t1.real != 0) || (t1.imag != 0)); + /* + * don't worry about swap, since we are just testing + * whether or not equal to 0 + */ + @type@ tmp; + memcpy(&tmp, ip, sizeof(@type@)); + return (Bool) ((tmp.real != 0) || (tmp.imag != 0)); } } /**end repeat**/ From numpy-svn at scipy.org Sat Jan 16 00:01:21 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Jan 2010 23:01:21 -0600 (CST) Subject: [Numpy-svn] r8071 - branches/1.4.x/numpy/core/src/multiarray Message-ID: <20100116050121.721F1C7C080@scipy.org> Author: charris Date: 2010-01-15 23:01:21 -0600 (Fri, 15 Jan 2010) New Revision: 8071 Modified: branches/1.4.x/numpy/core/src/multiarray/arraytypes.c.src Log: Backport fix for #1336. Modified: branches/1.4.x/numpy/core/src/multiarray/arraytypes.c.src =================================================================== --- branches/1.4.x/numpy/core/src/multiarray/arraytypes.c.src 2010-01-16 04:33:05 UTC (rev 8070) +++ branches/1.4.x/numpy/core/src/multiarray/arraytypes.c.src 2010-01-16 05:01:21 UTC (rev 8071) @@ -2094,16 +2094,20 @@ #type=Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble, datetime, timedelta# */ static Bool - at fname@_nonzero (@type@ *ip, PyArrayObject *ap) + at fname@_nonzero (char *ip, PyArrayObject *ap) { - @type@ t1; - if (ap==NULL || PyArray_ISBEHAVED_RO(ap)) - return (Bool) (*ip != 0); + if (ap == NULL || PyArray_ISBEHAVED_RO(ap)) { + @type@ *ptmp = (@type@ *)ip; + return (Bool) (*ptmp != 0); + } else { - /* don't worry about swap, since we are just testing - whether or not equal to 0 */ - memcpy(&t1, ip, sizeof(@type@)); - return (Bool) (t1 != 0); + /* + * don't worry about swap, since we are just testing + * whether or not equal to 0 + */ + @type@ tmp; + memcpy(&tmp, ip, sizeof(@type@)); + return (Bool) (tmp != 0); } } /**end repeat**/ @@ -2113,16 +2117,20 @@ #type=cfloat, cdouble, clongdouble# */ static Bool - at fname@_nonzero (@type@ *ip, PyArrayObject *ap) + at fname@_nonzero (char *ip, PyArrayObject *ap) { - @type@ t1; - if (ap==NULL || PyArray_ISBEHAVED_RO(ap)) - return (Bool) ((ip->real != 0) || (ip->imag != 0)); + if (ap == NULL || PyArray_ISBEHAVED_RO(ap)) { + @type@ *ptmp = (@type@ *)ip; + return (Bool) ((ptmp->real != 0) || (ptmp->imag != 0)); + } else { - /* don't worry about swap, since we are just testing - whether or not equal to 0 */ - memcpy(&t1, ip, sizeof(@type@)); - return (Bool) ((t1.real != 0) || (t1.imag != 0)); + /* + * don't worry about swap, since we are just testing + * whether or not equal to 0 + */ + @type@ tmp; + memcpy(&tmp, ip, sizeof(@type@)); + return (Bool) ((tmp.real != 0) || (tmp.imag != 0)); } } /**end repeat**/ From numpy-svn at scipy.org Sun Jan 17 15:09:51 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 17 Jan 2010 14:09:51 -0600 (CST) Subject: [Numpy-svn] r8072 - trunk/numpy/core/src/multiarray Message-ID: <20100117200951.9B99CC7C028@scipy.org> Author: charris Date: 2010-01-17 14:09:51 -0600 (Sun, 17 Jan 2010) New Revision: 8072 Modified: trunk/numpy/core/src/multiarray/arraytypes.c.src Log: STY: First pass cleanup of arraytypes.c.src. Coding style cleanups. Break long lines. Modified: trunk/numpy/core/src/multiarray/arraytypes.c.src =================================================================== --- trunk/numpy/core/src/multiarray/arraytypes.c.src 2010-01-16 05:01:21 UTC (rev 8071) +++ trunk/numpy/core/src/multiarray/arraytypes.c.src 2010-01-17 20:09:51 UTC (rev 8072) @@ -1060,6 +1060,7 @@ } } + static PyObject * TIMEDELTA_getitem(char *ip, PyArrayObject *ap) { timedelta t1; @@ -1430,7 +1431,7 @@ * #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# -*/ + */ static void @from at _to_@to@(@fromtyp@ *ip, @totyp@ *op, intp n, PyArrayObject *aip, PyArrayObject *aop) @@ -1439,6 +1440,7 @@ PyObject *temp = NULL; int skip = aip->descr->elsize; int oskip = @oskip@; + for (i = 0; i < n; i++, ip+=skip, op+=oskip) { temp = @from at _getitem((char *)ip, aip); if (temp == NULL) { @@ -1469,15 +1471,19 @@ Py_DECREF(temp); } } - /**end repeat**/ + /**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# + * #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# */ static void @from at _to_@to@(@fromtyp@ *ip, @totyp@ *op, intp n, PyArrayObject *aip, @@ -1504,8 +1510,13 @@ /**end repeat**/ -/****************** scan *************************************/ +/* + ***************************************************************************** + ** SCAN ** + ***************************************************************************** + */ + /* * The first ignore argument is for backwards compatibility. * Should be removed when the API version is bumped up. @@ -1575,8 +1586,14 @@ #define @fname at _scan NULL /**end repeat**/ -/****************** fromstr *************************************/ +/* + ***************************************************************************** + ** FROMSTR ** + ***************************************************************************** + */ + + /**begin repeat * #fname = BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, * ULONGLONG, DATETIME, TIMEDELTA# @@ -1621,8 +1638,13 @@ /**end repeat**/ -/****************** copyswapn *************************************/ +/* + ***************************************************************************** + ** COPYSWAPN ** + ***************************************************************************** + */ + /**begin repeat * * #fname = SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG, FLOAT, @@ -1764,13 +1786,13 @@ int swap, void *NPY_UNUSED(arr)) { - if (src != NULL) { /* copy first if needed */ + if (src != NULL) { + /* copy first if needed */ if (sstride == sizeof(@type@) && dstride == sizeof(@type@)) { memcpy(dst, src, n*sizeof(@type@)); } else { - _unaligned_strided_byte_copy(dst, dstride, src, - sstride, n, + _unaligned_strided_byte_copy(dst, dstride, src, sstride, n, sizeof(@type@)); } } @@ -1864,16 +1886,21 @@ #else { int i, nn; - b = a + (SIZEOF_ at fsize@-1); + + b = a + (SIZEOF_ at fsize@ - 1); nn = SIZEOF_ at fsize@ / 2; - for (i=0; idescr->elsize; + if (dstride == itemsize && sstride == itemsize) { memcpy(dst, src, itemsize * n); } else { - _unaligned_strided_byte_copy(dst, dstride, src, sstride, n, itemsize); + _unaligned_strided_byte_copy(dst, dstride, src, sstride, n, + itemsize); } } return; @@ -1963,19 +1994,24 @@ VOID_copyswapn (char *dst, intp dstride, char *src, intp sstride, intp n, int swap, PyArrayObject *arr) { - if (arr == NULL) return; + if (arr == NULL) { + return; + } if (PyArray_HASFIELDS(arr)) { - PyObject *key, *value, *title=NULL; + PyObject *key, *value, *title = NULL; PyArray_Descr *new, *descr; int offset; - Py_ssize_t pos=0; + Py_ssize_t pos = 0; + descr = arr->descr; while (PyDict_Next(descr->fields, &pos, &key, &value)) { - if NPY_TITLE_KEY(key, value) continue; - if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, - &title)) { - arr->descr=descr;return; + if NPY_TITLE_KEY(key, value) { + continue; } + if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) { + arr->descr = descr; + return; + } arr->descr = new; new->f->copyswapn(dst+offset, dstride, (src != NULL ? src+offset : NULL), @@ -1990,6 +2026,7 @@ npy_intp i; int subitemsize; char *dstptr, *srcptr; + descr = arr->descr; new = descr->subarray->base; arr->descr = new; @@ -1997,11 +2034,13 @@ srcptr = src; subitemsize = new->elsize; num = descr->elsize / subitemsize; - for (i=0; if->copyswapn(dstptr, subitemsize, srcptr, subitemsize, num, swap, arr); dstptr += dstride; - if (srcptr) srcptr += sstride; + if (srcptr) { + srcptr += sstride; + } } arr->descr = descr; return; @@ -2015,19 +2054,24 @@ static void VOID_copyswap (char *dst, char *src, int swap, PyArrayObject *arr) { - if (arr==NULL) return; + if (arr == NULL) { + return; + } if (PyArray_HASFIELDS(arr)) { - PyObject *key, *value, *title=NULL; + PyObject *key, *value, *title = NULL; PyArray_Descr *new, *descr; int offset; - Py_ssize_t pos=0; - descr = arr->descr; /* Save it */ + Py_ssize_t pos = 0; + + descr = arr->descr; while (PyDict_Next(descr->fields, &pos, &key, &value)) { - if NPY_TITLE_KEY(key, value) continue; - if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, - &title)) { - arr->descr=descr;return; + if NPY_TITLE_KEY(key, value) { + continue; } + if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) { + arr->descr = descr; + return; + } arr->descr = new; new->f->copyswap(dst+offset, (src != NULL ? src+offset : NULL), @@ -2040,6 +2084,7 @@ PyArray_Descr *descr, *new; npy_intp num; int itemsize; + descr = arr->descr; new = descr->subarray->base; arr->descr = new; @@ -2062,24 +2107,35 @@ intp n, int swap, PyArrayObject *arr) { int itemsize; - if (arr==NULL) return; + + if (arr == NULL) { + return; + } itemsize = arr->descr->elsize; if (src != NULL) { - if (dstride == itemsize && sstride == itemsize) + if (dstride == itemsize && sstride == itemsize) { memcpy(dst, src, n * itemsize); - else + } + else { _unaligned_strided_byte_copy(dst, dstride, src, sstride, n, itemsize); + } } n *= itemsize; if (swap) { char *a, *b, c; - n >>= 2; /* n is the number of unicode characters to swap */ - for (a = (char *)dst; n>0; n--) { + + /* n is the number of unicode characters to swap */ + n >>= 2; + for (a = (char *)dst; n > 0; n--) { b = a + 3; - c=*a; *a++ = *b; *b-- = c; - c=*a; *a++ = *b; *b-- = c; + c = *a; + *a++ = *b; + *b-- = c; + c = *a; + *a++ = *b; + *b-- = c; a += 2; } } @@ -2098,7 +2154,10 @@ UNICODE_copyswap (char *dst, char *src, int swap, PyArrayObject *arr) { int itemsize; - if (arr == NULL) return; + + if (arr == NULL) { + return; + } itemsize = arr->descr->elsize; if (src != NULL) { memcpy(dst, src, itemsize); @@ -2109,23 +2168,37 @@ itemsize >>= 2; for (a = (char *)dst; itemsize>0; itemsize--) { b = a + 3; - c=*a; *a++ = *b; *b-- = c; - c=*a; *a++ = *b; *b-- = c; + c = *a; + *a++ = *b; + *b-- = c; + c = *a; + *a++ = *b; + *b-- = c; a += 2; } } } -/****************** nonzero **********************************/ +/* + ***************************************************************************** + ** 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, + * DATETIME, TIMEDELTA# + * #type = Bool, byte, ubyte, short, ushort, int, uint, long, ulong, + * longlong, ulonglong, float, double, longdouble, + * datetime, timedelta# */ static Bool - at fname@_nonzero (char *ip, PyArrayObject *ap) + at fname@_nonzero (@type@ *ip, PyArrayObject *ap) { + @type@ t1; if (ap == NULL || PyArray_ISBEHAVED_RO(ap)) { @type@ *ptmp = (@type@ *)ip; return (Bool) (*ptmp != 0); @@ -2143,9 +2216,10 @@ /**end repeat**/ /**begin repeat -#fname=CFLOAT,CDOUBLE,CLONGDOUBLE# -#type=cfloat, cdouble, clongdouble# -*/ + * + * #fname=CFLOAT,CDOUBLE,CLONGDOUBLE# + * #type=cfloat, cdouble, clongdouble# + */ static Bool @fname at _nonzero (char *ip, PyArrayObject *ap) { @@ -2174,10 +2248,11 @@ { char white[] = WHITESPACE; int j; - Bool space=FALSE; - for (j=0; jdescr->elsize >> 2; int i; Bool nonz = FALSE; - char *buffer=NULL; + char *buffer = NULL; - if ((!PyArray_ISNOTSWAPPED(ap)) || \ - (!PyArray_ISALIGNED(ap))) { + if ((!PyArray_ISNOTSWAPPED(ap)) || (!PyArray_ISALIGNED(ap))) { buffer = _pya_malloc(ap->descr->elsize); if (buffer == NULL) { return nonz; @@ -2228,7 +2302,7 @@ ip = (PyArray_UCS4 *)buffer; } - for (i=0; idescr; savedflags = ap->flags; while (PyDict_Next(descr->fields, &pos, &key, &value)) { - if NPY_TITLE_KEY(key, value) continue; + if NPY_TITLE_KEY(key, value) { + continue; + } if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, - &title)) {PyErr_Clear(); continue;} + &title)) { + PyErr_Clear(); + continue; + } ap->descr = new; ap->flags = savedflags; - if ((new->alignment > 1) && !__ALIGNED(ip+offset, new->alignment)) + if ((new->alignment > 1) && !__ALIGNED(ip+offset, new->alignment)) { ap->flags &= ~ALIGNED; - else + } + else { ap->flags |= ALIGNED; + } if (new->f->nonzero(ip+offset, ap)) { - nonz=TRUE; + nonz = TRUE; break; } } @@ -2291,7 +2378,7 @@ return nonz; } len = ap->descr->elsize; - for (i=0; i 0) { + while (itemsize-- > 0) { PyArray_UCS4 c1 = *ip1++; PyArray_UCS4 c2 = *ip2++; if (c1 != c2) { @@ -2540,8 +2631,7 @@ for (i = 0; i < PyTuple_GET_SIZE(names); i++) { key = PyTuple_GET_ITEM(names, i); tup = PyDict_GetItem(descr->fields, key); - if (!PyArg_ParseTuple(tup, "Oi|O", &new, &offset, - &title)) { + if (!PyArg_ParseTuple(tup, "Oi|O", &new, &offset, &title)) { goto finish; } ap->descr = new; @@ -2587,22 +2677,32 @@ return res; } -/****************** argfunc **********************************/ -/**begin repeat +/* + ***************************************************************************** + ** ARGFUNC ** + ***************************************************************************** + */ -#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# -*/ +/**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# + */ static int @fname at _argmax(@type@ *ip, intp n, intp *max_ind, PyArrayObject *NPY_UNUSED(aip)) { intp i; - @type@ mp=*ip; - *max_ind=0; - for (i=1; i mp) { mp = *ip; @@ -2618,13 +2718,15 @@ OBJECT_argmax(PyObject **ip, intp n, intp *max_ind, PyArrayObject *NPY_UNUSED(aip)) { intp i; - PyObject *mp=ip[0]; *max_ind=0; + PyObject *mp = ip[0]; + + *max_ind = 0; i = 1; - while(i 0) { #endif mp = *ip; - *max_ind=i; + *max_ind = i; } } return 0; } /**begin repeat - -#fname= STRING, UNICODE# -#type= char, PyArray_UCS4# - -*/ + * + * #fname = STRING, UNICODE# + * #type = char, PyArray_UCS4# + */ static int @fname at _argmax(@type@ *ip, intp n, intp *max_ind, PyArrayObject *aip) { @@ -2669,13 +2770,25 @@ #define VOID_argmax NULL + +/* + ***************************************************************************** + ** DOT ** + ***************************************************************************** + */ + +/* + * dot means inner product + */ + static void BOOL_dot(char *ip1, intp is1, char *ip2, intp is2, char *op, intp n, void *NPY_UNUSED(ignore)) { - Bool tmp=FALSE; + Bool tmp = FALSE; intp i; - for(i=0;ireal = start.real + i*delta.real; buffer->imag = start.imag + i*delta.imag; } @@ -2838,16 +2988,17 @@ { intp i; PyObject *val = *value; - for (i=0; i max_val) { out[i] = max_val; } } - return; } - - for (i = 0; i < ni; i++) { - if (in[i] < min_val) { - out[i] = min_val; - } else if (in[i] > max_val) { - out[i] = max_val; + else { + for (i = 0; i < ni; i++) { + if (in[i] < min_val) { + out[i] = min_val; + } + else if (in[i] > max_val) { + out[i] = max_val; + } } } - - return; } /**end repeat**/ /**begin repeat -#name=CFLOAT, CDOUBLE, CLONGDOUBLE# -#type= cfloat, cdouble, clongdouble# -*/ + * + * #name = CFLOAT, CDOUBLE, CLONGDOUBLE# + * #type = cfloat, cdouble, clongdouble# + */ static void @name at _fastclip(@type@ *in, intp ni, @type@ *min, @type@ *max, @type@ *out) { @@ -2934,51 +3096,58 @@ min_val = *min; max_val = *max; - - if (max != NULL) + if (max != NULL) { max_val = *max; - if (min != NULL) + } + if (min != NULL) { min_val = *min; - + } if (max == NULL) { for (i = 0; i < ni; i++) { if (PyArray_CLT(in[i],min_val)) { out[i] = min_val; } } - return; } - - if (min == NULL) { + else if (min == NULL) { for (i = 0; i < ni; i++) { if (PyArray_CGT(in[i], max_val)) { out[i] = max_val; } } - return; } - - for (i = 0; i < ni; i++) { - if (PyArray_CLT(in[i], min_val)) { - out[i] = min_val; - } else if (PyArray_CGT(in[i], max_val)) { - out[i] = max_val; + else { + for (i = 0; i < ni; i++) { + if (PyArray_CLT(in[i], min_val)) { + out[i] = min_val; + } + else if (PyArray_CGT(in[i], max_val)) { + out[i] = max_val; + } } } - return; } /**end repeat**/ #define OBJECT_fastclip NULL -/************************ - * Fast putmask functions - *************************/ +/* + ***************************************************************************** + ** FASTPUTMASK ** + ***************************************************************************** + */ + + /**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, DATETIME, TIMEDELTA# + * #type = Bool, byte, ubyte, short, ushort, int, uint, long, ulong, + * longlong, ulonglong, float, double, longdouble, + * cfloat, cdouble, clongdouble, datetime, timedelta# */ static void @name at _fastputmask(@type@ *in, Bool *mask, intp ni, @type@ *vals, intp nv) @@ -3008,14 +3177,21 @@ #define OBJECT_fastputmask NULL +/* + ***************************************************************************** + ** FASTTAKE ** + ***************************************************************************** + */ -/************************ - * Fast take functions - *************************/ /**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, DATETIME, TIMEDELTA# + * #type = Bool, byte, ubyte, short, ushort, int, uint, long, ulong, + * longlong, ulonglong, float, double, longdouble, + * cfloat, cdouble, clongdouble, datetime, timedelta# */ static int @name at _fasttake(@type@ *dest, @type@ *src, intp *indarray, @@ -3027,20 +3203,23 @@ switch(clipmode) { case NPY_RAISE: - for(i=0; i= nindarray)) { PyErr_SetString(PyExc_IndexError, - "index out of range "\ - "for array"); + "index out of range for array"); return 1; } - if (nelem == 1) *dest++ = *(src+tmp); + if (nelem == 1) { + *dest++ = *(src+tmp); + } else { - for(k=0; k= nindarray) - while (tmp >= nindarray) + if (tmp < 0) { + while (tmp < 0) { + tmp += nindarray; + } + } + else if (tmp >= nindarray) { + while (tmp >= nindarray) { tmp -= nindarray; - if (nelem == 1) *dest++ = *(src+tmp); + } + } + if (nelem == 1) { + *dest++ = *(src+tmp); + } else { - for(k=0; k= nindarray) - tmp = nindarray-1; - if (nelem == 1) *dest++ = *(src+tmp); + } + else if (tmp >= nindarray) { + tmp = nindarray - 1; + } + if (nelem == 1) { + *dest++ = *(src+tmp); + } else { - for(k=0; k Author: charris Date: 2010-01-17 14:44:28 -0600 (Sun, 17 Jan 2010) New Revision: 8073 Modified: trunk/numpy/core/src/multiarray/arraytypes.c.src Log: STY: Remove unused variable that was added in last commit. Modified: trunk/numpy/core/src/multiarray/arraytypes.c.src =================================================================== --- trunk/numpy/core/src/multiarray/arraytypes.c.src 2010-01-17 20:09:51 UTC (rev 8072) +++ trunk/numpy/core/src/multiarray/arraytypes.c.src 2010-01-17 20:44:28 UTC (rev 8073) @@ -2198,7 +2198,6 @@ static Bool @fname at _nonzero (@type@ *ip, PyArrayObject *ap) { - @type@ t1; if (ap == NULL || PyArray_ISBEHAVED_RO(ap)) { @type@ *ptmp = (@type@ *)ip; return (Bool) (*ptmp != 0); From numpy-svn at scipy.org Tue Jan 19 13:58:19 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 19 Jan 2010 12:58:19 -0600 (CST) Subject: [Numpy-svn] r8074 - in trunk/numpy/core: src/multiarray tests Message-ID: <20100119185819.5CC86C7C043@scipy.org> Author: oliphant Date: 2010-01-19 12:58:18 -0600 (Tue, 19 Jan 2010) New Revision: 8074 Modified: trunk/numpy/core/src/multiarray/arraytypes.c.src trunk/numpy/core/tests/test_multiarray.py Log: Fix VOID_compare to handle the case of byteswapped data. Fixes Ticket #1366. Modified: trunk/numpy/core/src/multiarray/arraytypes.c.src =================================================================== --- trunk/numpy/core/src/multiarray/arraytypes.c.src 2010-01-17 20:44:28 UTC (rev 8073) +++ trunk/numpy/core/src/multiarray/arraytypes.c.src 2010-01-19 18:58:18 UTC (rev 8074) @@ -2608,6 +2608,7 @@ * in not_equal. * * Must align data passed on to sub-comparisons. + * Also must swap data based on to sub-comparisons. */ static int VOID_compare(char *ip1, char *ip2, PyArrayObject *ap) @@ -2616,7 +2617,7 @@ PyObject *names, *key; PyObject *tup, *title; char *nip1, *nip2; - int i, offset, res = 0; + int i, offset, res = 0, swap=0; if (!PyArray_HASFIELDS(ap)) { return STRING_compare(ip1, ip2, ap); @@ -2634,18 +2635,21 @@ goto finish; } ap->descr = new; + swap = PyArray_ISBYTESWAPPED(ap); nip1 = ip1+offset; nip2 = ip2+offset; - if (new->alignment > 1) { - if (((intp)(nip1) % new->alignment) != 0) { + if ((swap) || (new->alignment > 1)) { + if ((swap) || (((intp)(nip1) % new->alignment) != 0)) { /* create buffer and copy */ nip1 = _pya_malloc(new->elsize); if (nip1 == NULL) { goto finish; } memcpy(nip1, ip1+offset, new->elsize); + if (swap) + new->f->copyswap(nip1, NULL, swap, ap); } - if (((intp)(nip2) % new->alignment) != 0) { + if ((swap) || (((intp)(nip2) % new->alignment) != 0)) { /* copy data to a buffer */ nip2 = _pya_malloc(new->elsize); if (nip2 == NULL) { @@ -2655,10 +2659,12 @@ goto finish; } memcpy(nip2, ip2+offset, new->elsize); + if (swap) + new->f->copyswap(nip2, NULL, swap, ap); } } res = new->f->compare(nip1, nip2, ap); - if (new->alignment > 1) { + if ((swap) || (new->alignment > 1)) { if (nip1 != ip1+offset) { _pya_free(nip1); } Modified: trunk/numpy/core/tests/test_multiarray.py =================================================================== --- trunk/numpy/core/tests/test_multiarray.py 2010-01-17 20:44:28 UTC (rev 8073) +++ trunk/numpy/core/tests/test_multiarray.py 2010-01-19 18:58:18 UTC (rev 8074) @@ -410,6 +410,16 @@ assert_equal(r.word, array(['my','first','name'])) assert_equal(r.number, array([3.1,4.5,6.2])) + if sys.byteorder == 'little': + strtype = '>i2' + else: + strtype = ' Author: oliphant Date: 2010-01-19 16:24:33 -0600 (Tue, 19 Jan 2010) New Revision: 8075 Modified: trunk/numpy/core/tests/test_multiarray.py Log: Fix test for sorting with other-endian field. Modified: trunk/numpy/core/tests/test_multiarray.py =================================================================== --- trunk/numpy/core/tests/test_multiarray.py 2010-01-19 18:58:18 UTC (rev 8074) +++ trunk/numpy/core/tests/test_multiarray.py 2010-01-19 22:24:33 UTC (rev 8075) @@ -414,11 +414,13 @@ strtype = '>i2' else: strtype = ' Author: pierregm Date: 2010-01-20 02:10:11 -0600 (Wed, 20 Jan 2010) New Revision: 8076 Modified: trunk/numpy/lib/io.py Log: np.genfromtxt: make sure we're using the actual names when double-checking for missing values Modified: trunk/numpy/lib/io.py =================================================================== --- trunk/numpy/lib/io.py 2010-01-19 22:24:33 UTC (rev 8075) +++ trunk/numpy/lib/io.py 2010-01-20 08:10:11 UTC (rev 8076) @@ -1428,7 +1428,8 @@ mdtype = np.bool outputmask = np.array(masks, dtype=mdtype) # Try to take care of the missing data we missed - if usemask and output.dtype.names: + 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 _ != ''] for mval in missing_values: From numpy-svn at scipy.org Wed Jan 20 11:24:50 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 20 Jan 2010 10:24:50 -0600 (CST) Subject: [Numpy-svn] r8077 - trunk/numpy/core/src/multiarray Message-ID: <20100120162450.4B597C7C06E@scipy.org> Author: charris Date: 2010-01-20 10:24:49 -0600 (Wed, 20 Jan 2010) New Revision: 8077 Modified: trunk/numpy/core/src/multiarray/arraytypes.c.src Log: BUG: Fix ticket #1336 again. Merge for r8072 introduced a regression. Modified: trunk/numpy/core/src/multiarray/arraytypes.c.src =================================================================== --- trunk/numpy/core/src/multiarray/arraytypes.c.src 2010-01-20 08:10:11 UTC (rev 8076) +++ trunk/numpy/core/src/multiarray/arraytypes.c.src 2010-01-20 16:24:49 UTC (rev 8077) @@ -2194,9 +2194,9 @@ * #type = Bool, byte, ubyte, short, ushort, int, uint, long, ulong, * longlong, ulonglong, float, double, longdouble, * datetime, timedelta# -*/ + */ static Bool - at fname@_nonzero (@type@ *ip, PyArrayObject *ap) + at fname@_nonzero (char *ip, PyArrayObject *ap) { if (ap == NULL || PyArray_ISBEHAVED_RO(ap)) { @type@ *ptmp = (@type@ *)ip; From numpy-svn at scipy.org Thu Jan 21 16:10:02 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 21 Jan 2010 15:10:02 -0600 (CST) Subject: [Numpy-svn] r8078 - trunk/numpy/ma Message-ID: <20100121211002.A5A5639CAE7@scipy.org> Author: pierregm Date: 2010-01-21 15:10:02 -0600 (Thu, 21 Jan 2010) New Revision: 8078 Modified: trunk/numpy/ma/core.py Log: * fixed the docstring of MaskedArray.sort Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2010-01-20 16:24:49 UTC (rev 8077) +++ trunk/numpy/ma/core.py 2010-01-21 21:10:02 UTC (rev 8078) @@ -4887,13 +4887,13 @@ def sort(self, axis= -1, kind='quicksort', order=None, endwith=True, fill_value=None): """ - Return a sorted copy of an array. + Sort the array, in-place Parameters ---------- a : array_like Array to be sorted. - axis : int or None, optional + axis : int, optional Axis along which to sort. If None, the array is flattened before sorting. The default is -1, which sorts along the last axis. kind : {'quicksort', 'mergesort', 'heapsort'}, optional @@ -4905,9 +4905,9 @@ endwith : {True, False}, optional Whether missing values (if any) should be forced in the upper indices (at the end of the array) (True) or lower indices (at the beginning). - fill_value : {var} - Value used to fill in the masked values. If None, use - the the output of minimum_fill_value(). + fill_value : {var}, optional + Value used internally for the masked values. + If ``fill_value`` is not None, it supersedes ``endwith``. Returns ------- @@ -4923,56 +4923,28 @@ Notes ----- - The various sorting algorithms are characterized by their average speed, - worst case performance, work space size, and whether they are stable. A - stable sort keeps items with the same key in the same relative - order. The three available algorithms have the following - properties: + See ``sort`` for notes on the different sorting algorithms. - =========== ======= ============= ============ ======= - kind speed worst case work space stable - =========== ======= ============= ============ ======= - 'quicksort' 1 O(n^2) 0 no - 'mergesort' 2 O(n*log(n)) ~n/2 yes - 'heapsort' 3 O(n*log(n)) 0 no - =========== ======= ============= ============ ======= - - All the sort algorithms make temporary copies of the data when - sorting along any but the last axis. Consequently, sorting along - the last axis is faster and uses less space than sorting along - any other axis. - Examples -------- - >>> a = np.array([[1,4],[3,1]]) - >>> np.sort(a) # sort along the last axis - array([[1, 4], - [1, 3]]) - >>> np.sort(a, axis=None) # sort the flattened array - array([1, 1, 3, 4]) - >>> np.sort(a, axis=0) # sort along the first axis - array([[1, 1], - [3, 4]]) + >>> a = ma.array([1, 2, 5, 4, 3],mask=[0, 1, 0, 1, 0]) + >>> # Default + >>> a.sort() + >>> print a + [1 3 5 -- --] - Use the `order` keyword to specify a field to use when sorting a - structured array: + >>> a = ma.array([1, 2, 5, 4, 3],mask=[0, 1, 0, 1, 0]) + >>> # Put missing values in the front + >>> a.sort(endwith=False) + >>> print a + [-- -- 1 3 5] - >>> dtype = [('name', 'S10'), ('height', float), ('age', int)] - >>> values = [('Arthur', 1.8, 41), ('Lancelot', 1.9, 38), - ... ('Galahad', 1.7, 38)] - >>> a = np.array(values, dtype=dtype) # create a structured array - >>> np.sort(a, order='height') # doctest: +SKIP - array([('Galahad', 1.7, 38), ('Arthur', 1.8, 41), - ('Lancelot', 1.8999999999999999, 38)], - dtype=[('name', '|S10'), ('height', '>> np.sort(a, order=['age', 'height']) # doctest: +SKIP - array([('Galahad', 1.7, 38), ('Lancelot', 1.8999999999999999, 38), - ('Arthur', 1.8, 41)], - dtype=[('name', '|S10'), ('height', '>> a = ma.array([1, 2, 5, 4, 3],mask=[0, 1, 0, 1, 0]) + >>> # fill_value takes over endwith + >>> a.sort(endwith=False, fill_value=3) + >>> print a + [1 -- -- 3 5] + """ if self._mask is nomask: ndarray.sort(self, axis=axis, kind=kind, order=order) From numpy-svn at scipy.org Sun Jan 24 18:11:57 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 24 Jan 2010 17:11:57 -0600 (CST) Subject: [Numpy-svn] r8079 - trunk/numpy/distutils/fcompiler Message-ID: <20100124231157.43E8239C4B4@scipy.org> Author: oliphant Date: 2010-01-24 17:11:57 -0600 (Sun, 24 Jan 2010) New Revision: 8079 Modified: trunk/numpy/distutils/fcompiler/__init__.py trunk/numpy/distutils/fcompiler/intel.py Log: Apply ifort.patch from ticket #1372 to allow Intel Fortran Compiler 11.1 to be called by numpy.distutils. Modified: trunk/numpy/distutils/fcompiler/__init__.py =================================================================== --- trunk/numpy/distutils/fcompiler/__init__.py 2010-01-21 21:10:02 UTC (rev 8078) +++ trunk/numpy/distutils/fcompiler/__init__.py 2010-01-24 23:11:57 UTC (rev 8079) @@ -688,7 +688,8 @@ _default_compilers = ( # sys.platform mappings - ('win32', ('gnu','intelv','absoft','compaqv','intelev','gnu95','g95')), + ('win32', ('gnu','intelv','absoft','compaqv','intelev','gnu95','g95', + 'intelvem', 'intelem')), ('cygwin.*', ('gnu','intelv','absoft','compaqv','intelev','gnu95','g95')), ('linux.*', ('gnu','intel','lahey','pg','absoft','nag','vast','compaq', 'intele','intelem','gnu95','g95')), Modified: trunk/numpy/distutils/fcompiler/intel.py =================================================================== --- trunk/numpy/distutils/fcompiler/intel.py 2010-01-21 21:10:02 UTC (rev 8078) +++ trunk/numpy/distutils/fcompiler/intel.py 2010-01-24 23:11:57 UTC (rev 8079) @@ -8,7 +8,7 @@ compilers = ['IntelFCompiler', 'IntelVisualFCompiler', 'IntelItaniumFCompiler', 'IntelItaniumVisualFCompiler', - 'IntelEM64TFCompiler'] + 'IntelEM64VisualFCompiler', 'IntelEM64TFCompiler'] def intel_version_match(type): # Match against the important stuff in the version string @@ -165,9 +165,14 @@ compiler_type = 'intelv' description = 'Intel Visual Fortran Compiler for 32-bit apps' version_match = intel_version_match('32-bit|IA-32') + + def update_executables(self): + f = dummy_fortran_file() + self.executables['version_cmd'] = ['', '/FI', '/c', + f + '.f', '/o', f + '.o'] ar_exe = 'lib.exe' - possible_executables = ['ifl'] + possible_executables = ['ifort', 'ifl'] executables = { 'version_cmd' : None, @@ -196,7 +201,7 @@ return ['/4Yb','/d2'] def get_flags_opt(self): - return ['/O3','/Qip','/Qipo','/Qipo_obj'] + return ['/O3','/Qip'] def get_flags_arch(self): opt = [] @@ -231,6 +236,13 @@ 'ranlib' : None } +class IntelEM64VisualFCompiler(IntelVisualFCompiler): + compiler_type = 'intelvem' + description = 'Intel Visual Fortran Compiler for 64-bit apps' + + version_match = simple_version_match(start='Intel\(R\).*?64,') + + if __name__ == '__main__': from distutils import log log.set_verbosity(2) From numpy-svn at scipy.org Fri Jan 29 17:18:04 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 29 Jan 2010 16:18:04 -0600 (CST) Subject: [Numpy-svn] r8080 - trunk/numpy/distutils Message-ID: <20100129221804.4578039C674@scipy.org> Author: rkern Date: 2010-01-29 16:18:04 -0600 (Fri, 29 Jan 2010) New Revision: 8080 Modified: trunk/numpy/distutils/misc_util.py Log: BUG: guard against having an uninitialized list of scripts. Modified: trunk/numpy/distutils/misc_util.py =================================================================== --- trunk/numpy/distutils/misc_util.py 2010-01-24 23:11:57 UTC (rev 8079) +++ trunk/numpy/distutils/misc_util.py 2010-01-29 22:18:04 UTC (rev 8080) @@ -1677,6 +1677,8 @@ scripts = self.paths(files) dist = self.get_distribution() if dist is not None: + if dist.scripts is None: + dist.scripts = [] dist.scripts.extend(scripts) else: self.scripts.extend(scripts) From numpy-svn at scipy.org Fri Jan 29 17:50:54 2010 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 29 Jan 2010 16:50:54 -0600 (CST) Subject: [Numpy-svn] r8081 - trunk/numpy/distutils Message-ID: <20100129225054.51BA939C674@scipy.org> Author: rkern Date: 2010-01-29 16:50:54 -0600 (Fri, 29 Jan 2010) New Revision: 8081 Modified: trunk/numpy/distutils/misc_util.py Log: BUG: Add more protection against uninitialized lists on the Distribution object. Modified: trunk/numpy/distutils/misc_util.py =================================================================== --- trunk/numpy/distutils/misc_util.py 2010-01-29 22:18:04 UTC (rev 8080) +++ trunk/numpy/distutils/misc_util.py 2010-01-29 22:50:54 UTC (rev 8081) @@ -1275,6 +1275,8 @@ include_dirs = self.paths(paths) dist = self.get_distribution() if dist is not None: + if dist.include_dirs is None: + dist.include_dirs = [] dist.include_dirs.extend(include_dirs) else: self.include_dirs.extend(include_dirs) @@ -1311,6 +1313,8 @@ [headers.append((path[0],p)) for p in self.paths(path[1])] dist = self.get_distribution() if dist is not None: + if dist.headers is None: + dist.headers = [] dist.headers.extend(headers) else: self.headers.extend(headers) @@ -1655,6 +1659,8 @@ pre_hook, post_hook, full_source_files, package_path) if dist is not None: + if dist.scons_data is None: + dist.scons_data = [] dist.scons_data.append(scons_info) self.warn('distutils distribution has been initialized,'\ ' it may be too late to add a subpackage '+ subpackage_name)