summaryrefslogtreecommitdiff
path: root/numpy/numarray
Commit message (Collapse)AuthorAgeFilesLines
* DEP: Remove deprecated modules numarray and oldnumeric.Charles Harris2013-09-2326-7010/+0
| | | | | | They were deprecated in 1.8 and scheduled for removal in 1.9. Closes #3637.
* FIX: remove unused variables and add castsLars Buitinck2013-08-271-1/+1
| | | | Makes the build complete with fewer warnings.
* STY: Giant comma spacing fixup.Charles Harris2013-08-186-66/+66
| | | | | | | Run the 2to3 ws_comma fixer on *.py files. Some lines are now too long and will need to be broken at some point. OTOH, some lines were already too long and need to be broken at some point. Now seems as good a time as any to do this with open PRs at a minimum.
* STY: Giant whitespace cleanup.Charles Harris2013-08-182-2/+0
| | | | Now is as good a time as any with open PR's at a low.
* MAINT: Remove outdated version checks.Charles Harris2013-07-111-4/+0
| | | | | | | | | | Because Numpy 1.8.0 will no longer supports Python versions < 2.6 we no longer need to check for that and can also remove the code that is specific to those earlier versions. To make this a bit safer, the toplevel setup.py file now contains a check of the Python version number and raises an error when run by an unsupported version.
* DEP: Deprecate the oldnumeric and numarray modules.Charles Harris2013-06-101-0/+6
| | | | | | | | | The numarray and oldnumeric modules are deprecated. This is a bit tricky as raising a DeprecationWarning on import causes an error when tests are run. To deal with that, a ModuleDeprecationWarning class is added to numpy and NoseTester is modified to ignore that warning during testing. Closes #2905
* MAINT: Apply 2to3 idioms fixer.Charles Harris2013-05-023-4/+4
| | | | | | | | | | | | | | | | | | | The idioms fixer makes the following replacements. 1) int <- bool 2) comparison or identity of types <- isinstance 3) a.sort() <- sorted(a) There were two problems that needed to be dealt with after the application of the fixer. First, the replacement of comparison or identity of types by isinstance was not always correct. The isinstance function returns true for subtypes whereas many of the places where the fixer made a substitution needed to check for exact type equality. Second, the sorted function was applied to arrays, but because it treats them as iterators and constructs a sorted list from the result, that is the wrong thing to do. Closes #3062.
* 2to3: Apply the `numliterals` fixer and skip the `long` fixer.Charles Harris2013-04-132-3/+4
| | | | | | | | | | | | | | | | | | | The numliterals fixer replaces the old style octal number like '01' by '0o1' removes the 'L' suffix. Octal values were previously mistakenly specified in some dates, those uses have been corrected by removing the leading zeros. Simply Removing the 'L' suffix should not be a problem, but in some testing code it looks neccesary, so in those places the Python long constructor is used instead. The 'long' type is no longer defined in Python 3. Because we need to have it defined for Python 2 it is added to numpy/compat/np3k.py where it is defined as 'int' for Python 3 and 'long' for Python 2. The `long` fixer then needs to be skipped so that it doesn't undo the good work. Closes #3074, #3067.
* 2to3: apply `dict` fixer.Charles Harris2013-04-061-3/+3
| | | | | | | | | | | | | | | In Python3 `dict.items()`, `dict.keys()`, and `dict.values()` are iterators. This causes problems when a list is needed so the 2to3 fixer explicitly constructs a list when is finds on of those functions. However, that is usually not necessary, so a lot of the work here has been cleaning up those places where the fix is not needed. The big exception to that is the `numpy/f2py/crackfortran.py` file. The code there makes extensive use of loops that modify the contents of the dictionary being looped through, which raises an error. That together with the obscurity of the code in that file made it safest to let the `dict` fixer do its worst. Closes #3050.
* 2to3: Apply `print` fixer.Charles Harris2013-04-0619-43/+43
| | | | | | | Add `print_function` to all `from __future__ import ...` statements and use the python3 print function syntax everywhere. Closes #3078.
* 2to3: Apply `imports` fixer.Charles Harris2013-04-021-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The `imports` fixer deals with the standard packages that have been renamed, removed, or methods that have moved. cPickle -- removed, use pickle commands -- removed, getoutput, getstatusoutput moved to subprocess urlparse -- removed, urlparse moved to urllib.parse cStringIO -- removed, use StringIO or io.StringIO copy_reg -- renamed copyreg _winreg -- renamed winreg ConfigParser -- renamed configparser __builtin__ -- renamed builtins In the case of `cPickle`, it is imported as `pickle` when python < 3 and performance may be a consideration, but otherwise plain old `pickle` is used. Dealing with `StringIO` is a bit tricky. There is an `io.StringIO` function in the `io` module, available since Python 2.6, but it expects unicode whereas `StringIO.StringIO` expects ascii. The Python 3 equivalent is then `io.BytesIO`. What I have done here is used BytesIO for anything that is emulating a file for testing purposes. That is more explicit than using a redefined StringIO as was done before we dropped support for Python 2.4 and 2.5. Closes #3180.
* 2to3: Use absolute imports.Charles Harris2013-03-2818-31/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new import `absolute_import` is added the `from __future__ import` statement and The 2to3 `import` fixer is run to make the imports compatible. There are several things that need to be dealt with to make this work. 1) Files meant to be run as scripts run in a different environment than files imported as part of a package, and so changes to those files need to be skipped. The affected script files are: * all setup.py files * numpy/core/code_generators/generate_umath.py * numpy/core/code_generators/generate_numpy_api.py * numpy/core/code_generators/generate_ufunc_api.py 2) Some imported modules are not available as they are created during the build process and consequently 2to3 is unable to handle them correctly. Files that import those modules need a bit of extra work. The affected files are: * core/__init__.py, * core/numeric.py, * core/_internal.py, * core/arrayprint.py, * core/fromnumeric.py, * numpy/__init__.py, * lib/npyio.py, * lib/function_base.py, * fft/fftpack.py, * random/__init__.py Closes #3172
* Merge pull request #3122 from charris/2to3-apply-xrange-fixerCharles Harris2013-03-281-3/+3
|\ | | | | 2to3: Replace xrange by range and use list(range(...)) where needed
| * 2to3: Replace xrange by range and use list(range(...)) where neededCharles Harris2013-03-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In python3 range is an iterator and `xrange` has been removed. This has two consequence for code: 1) Where a list is needed `list(range(...))` must be used. 2) `xrange` must be replaced by `range` Both of these changes also work in python2 and this patch makes both. There are three places fixed that do not need it, but I left them in so that the result would be `xrange` clean. Closes #3092
* | fix undefined function and add integer divisionsJulian Taylor2013-03-261-5/+18
|/
* 2to3: Put `from __future__ import division in every python file.Charles Harris2013-03-0119-15/+30
| | | | | | | | This should be harmless, as we already are division clean. However, placement of this import takes some care. In the future a script can be used to append new features without worry, at least until such time as it exceeds a single line. Having that ability will make it easier to deal with absolute imports and printing updates.
* 2to3: apply exec fixer results.Charles Harris2013-02-281-1/+1
| | | | This changes the `exec` command to the `exec` function.
* DEP: Remove scons related files and code.Charles Harris2013-01-133-23/+0
| | | | | | | | | This removes files and code supporting scons builds. After this change numpy will only support builds using distutils or bento. The removal of scons has been discussed on the list several times and a decision has been made that scons support is no longer needed. This was originally discussed for numpy 1.7 and because the distutils and bento methods are still available we are skipping the usual deprecation period.
* Use PyMODINIT_FUNC and update docs accordingly.cgohlke2012-09-021-1/+1
| | | | See https://github.com/scipy/scipy/pull/279
* Rename PyArray_RequireWriteable to PyArray_FailUnlessWriteableNathaniel J. Smith2012-05-221-3/+3
| | | | | | Also clean up its API slightly so that the caller passes in a name describing the array being checked which is used to generate an error message, rather than writing an error message from scratch.
* Funnel all assignments to PyArrayObject->base through a single pointNathaniel J. Smith2012-05-151-3/+1
| | | | | | | | | | | | | | | | | | | | | | | This patch removes all direct assignments of non-NULL values to the 'base' field on PyArrayObjects. A new utility function was created to set up UPDATEIFCOPY arrays, and all assignments to 'base' were adjusted to use either PyArray_SetBaseObject or the new PyArray_SetUpdateIfCopyBase. One advantage of this is that it produces more consistent error handling. This error handling revealed a bug in the nditer code, which this patch does *not* yet fix. The bug is that npyiter_new_temp_array sometimes (when dealing with reversed axes) creates an array and then returns a view onto it. But, npyiter_allocate_arrays assumes that the array returned by npyiter_new_temp_array can have UPDATEIFCOPY set, which requires reassigning its 'base' field. Previously, this meant that the temporary array leaked. Now, it produces a ValueError. This code path doesn't seem to actually be hit very often; only one of the nditer tests fails because of the change. See numpy/core/tests/test_nditer.py:test_iter_array_cast_buggy
* Consolidate all array writeability checking in new PyArray_RequireWriteableNathaniel J. Smith2012-05-151-10/+8
| | | | | | | | | This is mostly a code cleanup, but it does have a user-visible effect in that attempting to write to a unwriteable array now consistently raises ValueError. (It used to randomly raise either ValueError or RuntimeError.) Passes numpy.test("full").
* DEP: Update all the '#define NPY_NO_DEPRECATED_API' instances to beMark Wiebe2012-04-061-1/+1
| | | | versioned
* UPDATE: Replace macros in old_defines.h by new.Charles Harris2012-02-042-18/+18
| | | | | With the exception of the numarray fixups these were all instances that were results of code generation.
* STY: Remove trailing whitespaceMark Wiebe2011-07-264-17/+17
|
* ENH: core: Rename PyArray_SetBase to PyArray_SetBaseObject to be more clearMark Wiebe2011-07-221-1/+1
|
* ENH: core: More cleanups removing direct PyArrayObject field accessMark Wiebe2011-07-192-141/+141
|
* ENH: core: Progress getting NumPy building without direct field accessMark Wiebe2011-07-191-13/+19
|
* STY: Replace remaining old style classes with classes subclassing object.Charles Harris2011-04-051-2/+2
|
* 3K: numarray: Python3 fixes in _capi.cPauli Virtanen2010-07-171-20/+24
| | | | Thanks to Christoph Gohlke.
* BUG: core: use PyCapsule objects only on Python >= 3.0, stay with PyCObjects ↵Pauli Virtanen2010-07-172-2/+2
| | | | on Python 2.x
* BUG: Fix problem with numarray _capi.c and python 2.7.Charles Harris2010-05-241-2/+6
|
* ENH, BUG: PyCObject will be deprecated in python 2.7. So use the NpyCapsuleCharles Harris2010-05-032-2/+2
| | | | | | | compatibility functions in npy_3kcompat.h to replace the current calls. This gets rid of a number of version checks and is easier to maintain. Fix bug that was present in the ufunc _loop1d_list_free destructor in the python3k case.
* ENH: get rid of #warning directives, either by fixing the issue or changing ↵Pauli Virtanen2010-04-041-3/+3
| | | | them to comments
* ENH: Try to fix numarray _capi.c for Python >= 3.1. Needs testing that I am notCharles Harris2010-02-251-10/+40
| | | | in a position to do.
* BUG: NPY_PY3K probably isn't defined when libnumarray.h is included.Charles Harris2010-02-231-1/+1
|
* BUG: Replace deprecated PyCObject by PyCapsule for Python >= 3.1.Charles Harris2010-02-232-21/+44
|
* Fix bad usage of namespace alias changechanley2010-02-221-5/+5
|
* STY: Use import numpy as np. This seems to fix an import error introduced byCharles Harris2010-02-211-5/+13
| | | | | 2to3, but that may have been an artifact from a previous build. In anycase, no harm done.
* BUG: fix numarray._capi compilationPauli Virtanen2010-02-211-1/+1
|
* 3K: ENH: make numpy.numarray to importPauli Virtanen2010-02-211-0/+3
|
* 3K: ENH: move numarray includes under numarray/include so that the 'numpy' ↵Pauli Virtanen2010-02-219-3/+3
| | | | directory does not confuse 2to3's relative import conversion
* BUG: fix numscons build.David Cournapeau2009-12-101-2/+1
|
* 3K: numarray: replace buffer APIs by dummy+error. Some ob_types.Pauli Virtanen2009-12-061-4/+31
|
* ENH: Fix some more uninitialized vars.David Cournapeau2009-09-161-18/+52
|
* Fix installation of numarray headers on Windows.Stefan van der Walt2009-06-091-1/+1
|
* Reindent and cleanup whitespace.Charles Harris2009-06-031-2316/+2314
|
* More signed/unsigned comp fixes.David Cournapeau2009-03-091-6/+6
|
* Fix wrong typedef for UInt64.David Cournapeau2009-03-031-1/+1
|
* ran reindentJarrod Millman2008-12-311-1/+1
|