summaryrefslogtreecommitdiff
path: root/numpy
Commit message (Collapse)AuthorAgeFilesLines
* 2to3: Use absolute imports.Charles Harris2013-03-28340-624/+619
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-2849-134/+134
|\ | | | | 2to3: Replace xrange by range and use list(range(...)) where needed
| * 2to3: Replace xrange by range and use list(range(...)) where neededCharles Harris2013-03-2749-134/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge pull request #3168 from juliantaylor/numarray-fixesnjsmith2013-03-281-5/+18
|\ \ | | | | | | fix undefined function and add integer divisions
| * | fix undefined function and add integer divisionsJulian Taylor2013-03-261-5/+18
| |/
* | Merge pull request #3141 from ewmoore/test_fast_powerCharles Harris2013-03-271-3/+3
|\ \ | |/ |/| TST: test_umath: fix wrong indent in test_fast_power
| * TST: test_umath: fix wrong indent in test_fast_powerEric Moore2013-03-121-3/+3
| | | | | | | | Also, use assert_ instead of assert
* | TST: open the TemporaryFile in ASCII modeOndrej Certik2013-03-251-1/+1
| | | | | | | | | | | | | | This should fix gh-3165. Conflicts: numpy/distutils/tests/test_exec_command.py
* | TST: skip general test on non-posix platformsOndrej Certik2013-03-101-10/+15
| | | | | | | | Add a comment explaining the issue.
* | TST: Redirect the other stream to temp. fileOndrej Certik2013-03-101-6/+11
| | | | | | | | | | | | | | Now things behave the same if executed with either of: nosetests nosetests -s
* | Implement separate checking for stdout and stderrOndrej Certik2013-03-092-15/+14
| | | | | | | | And enable a test for this that was failing before.
* | TST: add robust tests for exec_command()Ondrej Certik2013-03-091-1/+44
| | | | | | | | | | | | | | | | | | First, we test both stdout and stderr. Second, we now test both _exec_command_posix() and _exec_command(), see numpy/distutils/exec_command.py. This reveals a bug in the implementation which will be fixed in the next commit. For now the failing test is commented out so that all tests still pass.
* | PEP8: don't use \Ondrej Certik2013-03-071-2/+2
| |
* | FIX: add _supports_fileno() for testing fileno()Ondrej Certik2013-03-071-2/+15
| | | | | | | | | | | | The new _supports_fileno() function works in all versions of Python. The problem was that in Python 2.x, the fileno() method of StringIO() is missing, while in Python 3.x, it is present, but raises an exception.
* | BUG: fix issue with distutils.exec_command introduced in 1.7.0.Ralf Gommers2013-03-062-16/+55
|/ | | | | | | | Closes gh-2999 and gh-2915. There are several packages (nose, scipy.weave.inline, Sage inline Fortran) that replace stdout, in which case it doesn't have a fileno method. This method was attempted to be used (change in gh-2766 to fix a py3k issue).
* DOC: Fix typo in fft docs (the indexing variable is 'm', not 'n').Maximilian Albert2013-03-061-1/+1
|
* 2to3: Remove xreadlines and replace f.readlines() by f where valid.Charles Harris2013-03-0510-16/+13
| | | | | | | | | | An open file `f` has been an iterator since python2.3 and `f.xreadlines()` is no longer needed, so replace it with `f`. Also replace `f.readlines()` with `f` where an iterator will do. The replacement of `f.readlines()` is not critical because it is a list in both python2 and python3, but the code is a bit cleaner. Closes #3093
* 2to3:DEP: Remove interactive setup and gnu compiler configuration.Charles Harris2013-03-053-208/+2
| | | | | | | | | | | | | | | | | | | | | | These havn't been deprecated, but I think few have heard of them, much less used them. Before this change, running setup.py without any arguments would result in interactive help. This patch removes that interactive help and lets setup print its usual list of commands and options. All the script uses of the numpy/distutils/fcompiler compilers look quite broken to me, but I have tried to maintain compatibility with the earlier version of gnu.py after the removal of `raw_input`. These removals solve an incompatibility between Python3 and Python2. The current interactive setup help uses `raw_input`, which has been removed in python3 and replaced by `input`. However, python2 already has an `input` that has different semantics. Rather than deal with this, I think it simpler to keep both `raw_input` and `input` out of numpy. Closes #3063 Closes #3079
* Merge pull request #3114 from charris/fix-resource-warningsnjsmith2013-03-042-7/+21
|\ | | | | Fix resource warnings
| * TST: Get rid of a ResourceWarning.Charles Harris2013-03-031-6/+15
| | | | | | | | | | | | | | | | I'm not sure this is the right fix, but test_closing_fid need to check that garbage collection will close a file that goes through a bunch of openings followed by dropping the reference. So the fix is to ignore warnings during the test. I'd just ignore ResourceWarning, but it does not look to be a built in warning in Python 2.7.
| * MAINT: Get rid of a ResourceWarning.Charles Harris2013-03-031-1/+6
| | | | | | | | | | This one in numpy/distutils/system_info.py. Just keep an explicit reference to a file, then close it.
* | Merge pull request #2992 from seberg/choice-object-scalarseberg2013-03-043-4241/+4450
|\ \ | |/ |/| BUG: fix random.choice scalar object result and disallow 0-d arrays
| * MAINT: regenerate mtrand.cSebastian Berg2013-03-041-4223/+4405
| |
| * BUG: fix random.choice scalar object result and disallow 0-d arraysSebastian Berg2013-03-042-18/+45
| | | | | | | | | | | | | | | | | | | | | | Object arrays failed due to bad check for finding out if the result should be a scalar type and not an array when size=None. Also in this case the creation of the new array was wrong. This should be fixed with this. The second fix is to forbid 0-d arrays. Allowing 0-d arrays does not make much sense. But it is dangerous because for example floats will be interpreted as 1-d arrays, while one may expect that they are interpreted as integers. This also saves the trouble of reliably detecting all integers...
* | BUG: fix NPY_NO_DEPRECATED_API mechanism.Ralf Gommers2013-03-023-2/+6
| |
* | Merge pull request #2953 from ContinuumIO/gufunc-fixCharles Harris2013-03-012-50/+199
|\ \ | | | | | | generalized ufunc signature problem fix
| * | compile fix on linux/macovillellas2013-01-211-2/+8
| | |
| * | BUG: Fix for generalized ufunc zero-sized input caseMark Wiebe2013-01-171-2/+33
| | |
| * | TST: Test for a generalized ufunc bug, for zero-sized inputsMark Wiebe2013-01-171-0/+7
| | |
| * | BUG: Fix bug in gufunc scalar caseMark Wiebe2013-01-171-2/+13
| | |
| * | TST: Add test for gufunc scalar caseMark Wiebe2013-01-171-0/+2
| | |
| * | BUG: Make sure the nditer doesn't complain when 0 broadcast dimsMark Wiebe2013-01-171-1/+3
| | |
| * | BUG: Missed case of broadcasting onto core dimensions in gufuncMark Wiebe2013-01-171-16/+32
| | |
| * | BUG: Fix generalized ufunc so repeating labels in one input/output is okMark Wiebe2013-01-171-46/+120
| | |
* | | Merge pull request #3014 from bfroehle/f2py_unque_symbolCharles Harris2013-03-011-1/+1
|\ \ \ | | | | | | | | BUG: Choose a more unique PY_ARRAY_UNIQUE_SYMBOL in f2py.
| * | | BUG: Choose a more unique PY_ARRAY_UNIQUE_SYMBOL in f2py.Bradley M. Froehle2013-02-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a few exceptional cases where symbols are shared between different Python modules the use of `PyArray_API` in f2py (fortranobject.h) conflicts with the regular use of the same symbol in the multiarray module. Generally the symptom of this conflicting use is a segfault when importing a f2py'ed module. This occurs because the module init code somehow overwrites the first element of `PyArray_API` with the location of `PyArray_API`, causing a crash when `PyArray_GetNDArrayCVersion` is called. Closes gh-2521.
* | | | Merge pull request #3026 from charris/2to3-fix-printCharles Harris2013-03-01349-223/+888
|\ \ \ \ | | | | | | | | | | 2to3: Put `from __future__ import division` in every python file.
| * | | | MAINT: Make numpy/f2py/crackfortran docstring read better.Charles Harris2013-03-011-13/+12
| | | | | | | | | | | | | | | | | | | | | | | | | The copyright and short summary were moved to the top of the docstring with the usage description below.
| * | | | 2to3: Put `from __future__ import division in every python file.Charles Harris2013-03-01349-222/+888
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | BUG: initialize op_axes when only itershape is givenSebastian Berg2013-03-012-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In this case, the initialization used the number of dimensions instead of setting it to NULL for each operand, leading to possible segmentation faults.
* | | | | Merge pull request #3099 from charris/2to3-methodattrsnjsmith2013-03-014-10/+7
|\ \ \ \ \ | |/ / / / |/| | | | 2to3: Apply `methodattrs` fixes.
| * | | | 2to3: Apply `methodattrs` fixes.Charles Harris2013-03-014-10/+7
| | | | | | | | | | | | | | | | | | | | | | | | | Replaces old style `f.im_func` and `f.im_class` method attributes with `f.__func__` and `f.__class__`. Closes #3070.
* | | | | Merge pull request #3056 from charris/2to3-filterCharles Harris2013-03-017-24/+30
|\ \ \ \ \ | |/ / / / |/| | | | 2to3: Apply `filter` fixes. Closes #3053.
| * | | | BUG: Fix `not a in ...` to `a not in ...`.Charles Harris2013-02-281-14/+15
| | | | | | | | | | | | | | | | | | | | Also break regular expression compiles out of the loop.
| * | | | REF: Replace filters with list comprehensions.Charles Harris2013-02-285-21/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2to3 does a lot of list(filter(...)) sort of thing which can be avoided by using list comprehensions instead of filters. This also seems to clarify the code to a considerable degree.
| * | | | 2to3: Apply `filter` fixes. Closes #3053.Charles Harris2013-02-287-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | Generally, this involves using list comprehension, or explicit list construction as `filter` is an iterator in Python 3.
* | | | | 2to3: Apply `raise` fixes. Closes #3077.Charles Harris2013-03-019-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaces the raise Exception, msg: form with raise Exception(msg):
* | | | | Merge pull request #3097 from charris/2to3-sys_excnjsmith2013-03-012-4/+4
|\ \ \ \ \ | | | | | | | | | | | | 2to3: Apply `sys_exc` fixes. Closes #3086.
| * | | | | 2to3: Apply `sys_exc` fixes. Closes #3086.Charles Harris2013-02-282-4/+4
| |/ / / / | | | | | | | | | | | | | | | | | | | | This uses sys.exc_info in place of sys.exc_value. The new function goes back to at least 2002, so should be safe.
* | | | | Merge pull request #2967 from sbyrnes321/masterCharles Harris2013-02-282-0/+34
|\ \ \ \ \ | | | | | | | | | | | | DOC -- add another paragraph note to ndarray.view docs