| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
| |
|
| |
|
|
|
|
| |
Also add test for IndexError exception when axis is out of bounds.
|
| |
|
| |
|
| |
|
|\
| |
| | |
Updated documentation for histogram2d() in twodim_base.py according to discussion
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
WarningManager was a workaround for the lack of the with statement
in Python versions < 2.6. As those versions are no longer supported
it can be removed.
Deprecation notes are added to WarningManager and WarningMessage, but
to avoid a cascade of messages in third party apps, no warnings are
raised at this time, that can be done later.
Closes #3519.
|
|\ \
| | |
| | | |
MAINT: Use np.errstate context manager.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Now that Python < 2.6 is no longer supported we can use the errstate
context manager in places where constructs like
```
old = seterr(invalid='ignore')
try:
blah
finally:
seterr(**old)
```
were used.
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| |
| | |
np.pad will now accept a pad_width containing zeros. The functionality
was already implemented, but validation of input was too strict.
|
| |
| |
| |
| |
| |
| |
| | |
This assures that when the loaded file is closed it also closes the
file descriptor, avoiding a resource warning in Python3.
Closes #3457.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Maximum data size limitations in the crc32 module cause errors when
reading more than 2 ** 32 bytes from gzip streams. Work around this
issue when reading large arrays from npz files by chunking reads to
256mb.
This appears to resolve bug #2922.
|
| | |
|
|\ \
| | |
| | | |
Deprecate non integer arguments
|
| | |
| | |
| | |
| | | |
Also minor changes in the documentation.
|
| | |
| | |
| | |
| | | |
Following deprecations would cause problems otherwise.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Correct the implementation of the npv function, its documentation, and
the mirr function that depends on it. The test_financial.py is also
corrected to take into account those modifications
The npv function behavior was contrary to what the documentation stated
as it summed indexes 1 to M instead of 0 to M-1. The mirr function used
a corrective factor to get the correct result in spite of that error so
that factor is removed.
Closes #649
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
memmap needs to call it in __array_finalize__ to determine if it can
drop the references on copies.
The python version if may_share_memory caused significant slowdowns when
slicing these maps.
closes gh-3364
|
| | | |
|
|\ \ \
| | | |
| | | | |
DOC: Min max docstrings
|
| | | | |
|
| |/ / |
|
|\ \ \
| |/ /
|/| | |
ENH: improved, faster algorithm for array padding
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
New padding method which scales much better with dimensionality.
This new implementation is fully vectorized, builds each abstracted
n-dimensional padding block in a single step, and takes advantage
of separability. The API is completely preserved, and the old
algorithm is used if a vector function is input for `mode`.
The new algorithm is faster for all tested combinations of inputs,
and scales much better with dimensionality. Execution time reductions
from ~25% for small rank 1 arrays to >99% for rank 4+ arrays observed.
|
|/ /
| |
| |
| | |
broadcast_arrays() does not handle struct and custom dtypes correctly. Dtype of returned broadcasted arrays is always '|V8'. Fix broadcast_arrays() so that dtype of returned arrays is correct dtype for user defined dtypes.
|
| |
| |
| |
| |
| |
| | |
Audit numpy/lib/arraypad.py for pep8 and pep257 compliance.
Also fix a few minor docstring corrections converting ] into ) or
vice versa.
|
|\ \
| | |
| | | |
DOC: Change example to demonstrate function
|
| | |
| | |
| | | |
"a * 0.5" example might as well be new_func(a) directly, it doesn't demonstrate the purpose of apply_along_axis().
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| | | |
| | | | |
BUG: np.insert must copy index array
|
| | | |
| | | |
| | | |
| | | | |
Otherwise it would do in-place changes to it. Fixes gh-3279.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Now that only Python versions 2.6-2.7 and 3.2-3.3 are supported
some version checks are no longer needed. This patch removes them
so as to clean up the code.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
For Python versions 2.6 and 2.7 the iterator forms of zip and map
can be imported from future_builtins. That is done here so as to
avoid using itertools.{izip, imap}.
|
| |/ /
|/| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The unicode fixer strips the u from u'hi' and converts the unicode type
to str. The first won't work for Python 2 and instead we replace the u
prefix with the sixu function borrowed from the six compatibility
package. That function calls the unicode constructor with the
'unicode_escape' encoder so that the many tests using escaped unicode
characters like u'\u0900' will be handled correctly. That makes the
sixu function a bit different from the asunicode function currently in
numpy.compat and also provides a target that can be converted back to
the u prefix when support for Python 3.2 is dropped. Python 3.3
reintroduced the u prefix for compatibility.
The unicode fixer also replaces 'unicode' with 'str' as 'unicode' is no
longer a builtin in Python 3. For code compatibility, 'unicode' is
defined either as 'str' or 'unicode' in numpy.compat so that checks like
if isinstance(x, unicode):
...
will work properly for all python versions.
Closes #3089.
|
|\ \ \
| | | |
| | | | |
2to3: Apply next fixer.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The next builtin has been available since Python 2.6 and allows
`it.next()` to be replaced by `next(it)`. In Python 3 the `next` method
is gone entirely, replaced entirely by the `__next__` method. The next
fixer changes all the `it.next()` calls to the new form and renames the
`next` methods to `__next__`. In order to keep Numpy code backwards
compatible with Python 2, a `next` method was readded to all the Numpy
iterators after the fixer was run so they all contain both methods. The
presence of the appropriate method could have been made version
dependent, but that looked unduly complicated.
Closes #3072.
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Various functions have been moved around in the stdlib for Python 3,
this fixes that up so that the code is valid in both Python 2 and
Python 3.
Note: monkey patching the stlib urlopen for testing looks a bit hokey
to me, but I don't see an easier, more reliable way to do the test.
Closes #3090.
|
|\ \ \
| | | |
| | | | |
2to3: Apply zip fixer.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
In Python 3 zip returns an iterator instead of a list. Consequently, in
places where an iterator won't do it must be enclosed in list(...).
Lists instead of iterators are also used in array constructors as using
iterators there usually results in an object array containing an
iterator object.
Closes #3094
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The basestring class is not defined in Python 3 and the fixer replaces
it with str. In order to have a common code base we define basestring in
numpy/compat/py3k.py to be str when the Python version is >= 3,
otherwise basestring and import it where needed. That works for most
cases, but there are a few files where the version dependent define
needs to be in the file.
Closes #3042.
|