| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 needed
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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 divisions
|
| |/ |
|
|\ \
| |/
|/| |
TST: test_umath: fix wrong indent in test_fast_power
|
| |
| |
| |
| | |
Also, use assert_ instead of assert
|
| |
| |
| |
| |
| |
| |
| | |
This should fix gh-3165.
Conflicts:
numpy/distutils/tests/test_exec_command.py
|
| |
| |
| |
| | |
Add a comment explaining the issue.
|
| |
| |
| |
| |
| |
| |
| | |
Now things behave the same if executed with either of:
nosetests
nosetests -s
|
| |
| |
| |
| | |
And enable a test for this that was failing before.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| |
| |
| | |
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.
|
|/
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|\
| |
| | |
Fix resource warnings
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| | |
This one in numpy/distutils/system_info.py. Just keep an explicit
reference to a file, then close it.
|
|\ \
| |/
|/| |
BUG: fix random.choice scalar object result and disallow 0-d arrays
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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...
|
| | |
|
|\ \
| | |
| | | |
generalized ufunc signature problem fix
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | | |
BUG: Choose a more unique PY_ARRAY_UNIQUE_SYMBOL in f2py.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
|\ \ \ \
| | | | |
| | | | | |
2to3: Put `from __future__ import division` in every python file.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The copyright and short summary were moved to the top of the
docstring with the usage description below.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
In this case, the initialization used the number of dimensions instead
of setting it to NULL for each operand, leading to possible segmentation
faults.
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
2to3: Apply `methodattrs` fixes.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Replaces old style `f.im_func` and `f.im_class` method attributes
with `f.__func__` and `f.__class__`. Closes #3070.
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
2to3: Apply `filter` fixes. Closes #3053.
|
| | | | |
| | | | |
| | | | |
| | | | | |
Also break regular expression compiles out of the loop.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Generally, this involves using list comprehension, or explicit list
construction as `filter` is an iterator in Python 3.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Replaces the
raise Exception, msg:
form with
raise Exception(msg):
|
|\ \ \ \ \
| | | | | |
| | | | | | |
2to3: Apply `sys_exc` fixes. Closes #3086.
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | | |
This uses sys.exc_info in place of sys.exc_value. The new function
goes back to at least 2002, so should be safe.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
DOC -- add another paragraph note to ndarray.view docs
|