summaryrefslogtreecommitdiff
path: root/numpy/oldnumeric
Commit message (Collapse)AuthorAgeFilesLines
* DEP: Remove deprecated modules numarray and oldnumeric.Charles Harris2013-09-2324-4568/+0
| | | | | | They were deprecated in 1.8 and scheduled for removal in 1.9. Closes #3637.
* STY: Giant comma spacing fixup.Charles Harris2013-08-1815-132/+132
| | | | | | | 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-181-1/+0
| | | | Now is as good a time as any with open PR's at a low.
* 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-3/+3
| | | | | | | | | | | | | | | | | | | 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 types fixer.Charles Harris2013-04-141-13/+14
| | | | | | | | | | | | | | | | | | | | Python 3 removes the builtin types from the types module. The types fixer replaces such references with the builtin types where possible and also takes care of some special cases: types.TypeNone <- type(None) types.NotImplementedType <- type(NotImplemented) types.EllipsisType <- type(Ellipsis) The only two tricky substitutions are types.StringType <- bytes types.LongType <- int These are fixed up to support both Python 3 and Python 2 code by importing the long and bytes types from numpy.compat. Closes #3240.
* Merge pull request #3241 from charris/2to3-apply-nonzero-fixerCharles Harris2013-04-141-0/+15
|\ | | | | 2to3: Apply nonzero fixer.
| * 2to3: Apply nonzero fixer.Charles Harris2013-04-131-0/+15
| | | | | | | | | | | | | | | | | | | | | | In Python 3 the `__nonzero__` class method is replaced by `__bool__`. This only affects the MaskedArray class in numpy/oldnumeric/ma.py file and the simplest solution is to provide both methods. I have my doubts that the fixed up Python 3 version was correct or even tested, but I think the current solution should work for as long as oldnumeric stays in numpy. Closes #3073.
* | 2to3: Apply renames fixer.Charles Harris2013-04-131-8/+16
|/ | | | | | | | | | | Rename sys.maxint to sys.maxsize when the Python version is >= 3. This change was made in Python 3 because all integers are 'long' integers and their maximum value bears no relationship to the C type that int used to represent. The new sys.maxsize value is the maximum value of Py_ssize_t. This change has not led to any reported problems since the numpy 1.5 release. Closes #3082
* 2to3: Apply `map` fixer.Charles Harris2013-04-101-1/+1
| | | | | | | | | | | | | | | | | | | In Python 3 `map` is an iterator while in Python 2 it returns a list. The simple fix applied by the fixer is to inclose all instances of map with `list(...)`. This is not needed in all cases, and even where appropriate list comprehensions may be preferred for their clarity. Consequently, this patch attempts to use list comprehensions where it makes sense. When the mapped function has two arguments there is another problem that can arise. In Python 3 map stops execution when the shortest argument list is exhausted, while in Python 2 it stops when the longest argument list is exhausted. Consequently the two argument case might need special care. However, we have been running Python3 converted versions of numpy since 1.5 without problems, so it is probably not something that affects us. Closes #3068
* Merge pull request #3202 from charris/2to3-reduce-fixupsnjsmith2013-04-071-2/+1
|\ | | | | MAINT: Cleanup some imports involving reduce.
| * MAINT: Cleanup some imports involving reduce.Charles Harris2013-04-061-2/+1
| | | | | | | | | | | | | | | | | | | | Because reduce has been available in functools since Python 2.6 we can get rid of the version checks we currently have before we import it. Also removes some reduce related skips in tools/py3tool.py. We were already skipping the reduce fixer so this has no effect other than cleaning up the code.
* | 2to3: Apply `print` fixer.Charles Harris2013-04-0624-52/+52
|/ | | | | | | 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-022-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-2823-52/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* 2to3: Replace xrange by range and use list(range(...)) where neededCharles Harris2013-03-271-1/+1
| | | | | | | | | | | | | | | 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
* 2to3: Put `from __future__ import division in every python file.Charles Harris2013-03-0124-22/+77
| | | | | | | | 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 `raise` fixes. Closes #3077.Charles Harris2013-03-013-14/+14
| | | | | | | | | | Replaces the raise Exception, msg: form with raise Exception(msg):
* DEP: Remove scons related files and code.Charles Harris2013-01-131-8/+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.
* STY: Fix up some remaining old-style exceptions.Charles Harris2011-04-053-7/+8
| | | | I think that is the end of it.
* STY: Fix up some two line old-style exceptions.Charles Harris2011-04-051-2/+1
|
* STY: Update exception styles, trickier ones.Charles Harris2011-04-051-1/+1
|
* STY: Update exception style, easy ones.Charles Harris2011-04-056-37/+37
|
* Don't deprecated bias keyword, just add ddof.Charles Harris2010-07-071-1/+1
|
* ENH: Add ddof keyword to cov and corrcoef. Deprecate bias keyword.Charles Harris2010-07-071-1/+1
|
* 3K: ENH: make oldnumeric to import -- but don't implement ↵Pauli Virtanen2010-02-212-6/+21
| | | | oldnumeric.Unpickler as it's not straightforward to do
* 3K: BUG: work around bugs in Python 3.1.1 2to3 by not using fixes_reducePauli Virtanen2010-02-201-0/+3
| | | | Instead, manually import reduce where necessary.
* All non core regressions tests moved to their respective modules.David Cournapeau2009-09-161-0/+10
|
* ran reindentJarrod Millman2008-12-313-4/+4
|
* Rewrapped __all__ definition to conform to PEP8.Alan McIntyre2008-09-134-24/+29
| | | | | | | Standardize NumPy import as "import numpy as np". Removed unused imports. Fixed undefined reference to ndarray (should be np.ndarray). Fixed undefined references to exp (should be math.exp).
* Standardize NumPy import as "import numpy as np".Alan McIntyre2008-07-251-17/+17
|
* Correct the oldnumeric typecodes, update the tests to work on 32-bit ↵Robert Kern2008-07-033-17/+24
| | | | machines, make sure these tests are installed with numpy so they can be run with numpy.test().
* Clean up test output such that a completely-passing test suite has no ↵Robert Kern2008-07-031-1/+3
| | | | extraneous output.
* Restore old test framework classes.Alan McIntyre2008-06-212-2/+2
| | | | | | | | | | | Added numpy.testing.run_module_suite to simplify "if __name__ == '__main__'" boilerplate code in test modules. Removed numpy/testing/pkgtester.py since it just consisted of an import statement after porting SciPy r4424. Allow numpy.*.test() to accept the old keyword arguments (but issue a deprecation warning when old arguments are seen). numpy.*.test() returns a test result object as before. Fixed typo in distutils doc.
* Switched to use nose to run tests. Added test and bench functions to all ↵Alan McIntyre2008-06-172-2/+6
| | | | modules.
* ran reindent in preparation for the 1.1 releaseJarrod Millman2008-04-202-5/+3
|
* Fix typo.Travis Oliphant2008-04-031-1/+1
|
* Fix-up a few errors in oldnumeric.Travis Oliphant2008-04-011-3/+3
|
* fix-up imports in oldnumeric/ma.pyTravis Oliphant2008-04-011-6/+6
|
* Add old ma.py interface to oldnumeric compatibility layer so that it stays ↵Travis Oliphant2008-04-011-7/+2262
| | | | the same.
* Fix typo from last checkin.Travis Oliphant2008-03-251-1/+1
|
* Improve support for old pickles.Travis Oliphant2008-03-252-19/+49
|
* NotImplementedError is the exception, not NotImplementedRobert Kern2008-03-241-4/+4
|
* Fix oldnumeric compatibility with maTravis Oliphant2008-03-131-2/+2
|
* Add setupscons.py for pure python packagesDavid Cournapeau2008-01-071-0/+8
|
* more janitorial workJarrod Millman2007-12-292-40/+40
|
* ran reindent.py to clean up whitespaceJarrod Millman2007-10-293-6/+3
|
* using faster string methods rather than deprecated string moduleJarrod Millman2007-10-292-3/+2
|
* fixed typoJarrod Millman2007-10-291-1/+1
|
* Fix randint. Closes ticket #552.Stefan van der Walt2007-07-231-6/+4
|