| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
The `__array_function__` API currently will exhaust iterators so we
cannot accept sequences reasonably. Checking for `__getitem__` is presumably
enough to reject that (and was what the deprecation used).
Future changes could allow this again, although it is not a useful API
anyway, since we have to materialize the iterable in any case.
|
| |
|
|
|
|
|
|
|
| |
* Added `mat` cases to smoke tests
* Changed type checks to handle new change which uses ufuncs order for
result determination
* Added cases for `ma` to check subclass info retention
|
| |
|
|
|
|
|
|
| |
* Smoke tests to ensure `np.kron` works.
* Shape tests to check if `np.kron` computes the right shape for
different edge cases of input arrays
|
| |
|
|
|
|
|
|
|
| |
Inheriting from object was necessary for Python 2 compatibility to use
new-style classes. In Python 3, this is unnecessary as there are no
old-style classes.
Dropping the object is more idiomatic Python.
|
|
|
|
|
| |
As numpy is Python 3 only, these import statements are now unnecessary
and don't alter runtime behavior.
|
|
|
|
| |
* Remove a few unused imports in several files.
|
|
|
|
|
|
|
|
|
| |
This PR allows the axis keyword in expand_dims to be a tuple of ints. Previously, axis could only be an int.
This issue was previously discussed in gh-12290 and the changes are based on gh-12290 (comment).
This PR also removes the deprecation added in v1.13 (2017-05-17), where previously axis could be outside of the range (-a.ndim - 1) <= axis <= a.ndim. Such an axis value will now raise an AxisError. Please let me know if it's too soon to remove this deprecation (I could not find any dev docs stating the length of the numpy deprecation cycle).
Closes gh-12290.
|
| |
|
|
|
|
|
|
| |
Fixes gh-12263
We can't support generators with dispatch for ``__array_function__``.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#11813)
Fixes #11809.
* BUG: fix array_split incorrect behavior with array size bigger MAX_INT32
* TST: added test for array_split with array size greater MAX_INT32
* addressed review comments
|
| |
|
|
|
|
| |
This is the reduced version that does not allow any insertion of extra dimensions
|
|\
| |
| | |
Move remaining Matrix tests to matrixlib
|
| | |
|
|/
|
|
|
|
|
|
|
| |
User- and non-user-facing typos.
Some source typos fixes as well.
Found via `codespell`.
|
|
|
|
|
| |
That function is nose specific and has not worked since `__init__` files
were added to the tests directories.
|
|
|
|
|
|
| |
I don't know what that argument was used for, but it showis up in old
tests and is not explicitly used within the tests. I assume it was part
of an old testing framework and is now longer needed.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Expand_dims works as documented when the index of the inserted NewAxis
in the resulting array satisfies -a.ndim - 1 <= index <= a.ndim.
However, when index > a.ndim index is replaced by a.ndim and, when
index < -a.ndim - 1, it is replaced by index + a.ndim + 1, which may be
negative and results in incorrect placement. The latter two cases are
now deprecated.
Closes #9100.
|
|
|
|
| |
Fixes #8642
|
|
|
|
| |
Fixes #7454
|
|
|
|
|
| |
Note that this is not a full subsitute for np.ma.apply_along_axis,
as that allows functions to return a mix of np.ma.masked and scalars
|
| |
|
|
|
|
|
|
| |
Also:
ENH: Support arbitrary dimensionality of return value
MAINT: remove special casing
|
|
|
|
|
|
|
|
|
|
|
|
| |
* BUG: Closes issue #8419
Fixes issue in apply_along_axis() where func1d() returns a non ndarray
* BUG: Fix apply_along_axis() when func1d() returns a non-ndarray
Closes issue #8419. Fixes issue in apply_along_axis() where
func1d() returns a non ndarray by calling asanyarray() on
result. This commit fixes a too long line in the test case.
|
|
|
|
|
|
|
| |
This commit modifies the numpy.apply_along_axis() function so that if
it is called with an ndarray subclass, the internal func1d calls
receive subclass instances and the overall function returns an instance
of the subclass. There are two new tests for these two behaviours.
|
|
|
|
|
|
| |
...to hstack, vstack, stack,
hsplit, vsplit, dsplit, dstack
that check that they raise exceptions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously an empty array resulting from split always had dimension 1-D.
In Numpy 1.9 a FutureWarning was raised to notify users that it was
planned to preserve the dimensions of empty arrays in a future numpy
release. This removes the FutureWarning and implements preservation of
dimensions.
Note that there was a bug in numpy 1.9 and the dimensions of empty
arrays was already preserved in some cases and no warning was issued.
This PR fixes that inconsistency by preserving the dimensions in all
cases rather than fixing the bug, as the dimension preserving behavior
was already depended on by some users. See the discussion in gh-6575
about this change.
|
|\
| |
| | |
BUG: Make sure warning for array split is always applied
|
| | |
|
|/ |
|
|
|
|
|
| |
Tile now copies the input when it is a numpy array and all dimensions are
repeated only once.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes the result type of empty output arrays.
The FutureWarning warns about changed behaviour. A "kludge" was
introduced into array split converting converting the result of
something like:
>>> np.array_split(np.array([[1, 1]]), 2)
[array([[1, 1]]), array([], dtype=int64)]
instead of retaining the shape of the empty/second array to
be (0, 2). A FutureWarning is now raised when such a
replacement occurs.
Closes gh-612
|
|
|
|
|
|
|
| |
Run autopep8 over the test files in numpy/lib/test and make fixes
to the result.
Also remove Python5 workaround.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Add `print_function` to all `from __future__ import ...` statements
and use the python3 print function syntax everywhere.
Closes #3078.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
assert in non-testing files that should be checked for correctness.
|
| |
|
| |
|
| |
|
|
|
|
| |
Renamed TestPiecewise methods so that they will be picked up by nose.
|