| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
More detail: Views are only sensitive to under-the-hood storage when
the dtype storage size has changed.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Since most numpy operations are not sensitive to underlying data
structure (C-ordered arrays vs fortran-ordered arrays, versus slices or
transposes of arrays, etc.), but structured-array views ARE sensitive to
that, it is worth saying it explicitly in the documentation.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
BUG: gh-2687 make multiarray dot method accept out array and keyword args
|
| | | | | | | |
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Use PyUnicode_FromString instead.
|