-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15271 from seberg/splitup-faster-argparsing
ENH: Optimize and cleanup ufunc calls and ufunc CheckOverrides
- Loading branch information
Showing
9 changed files
with
929 additions
and
1,177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Error type changes in universal functions | ||
----------------------------------------- | ||
The universal functions may now raise different errors | ||
on invalid input in some cases. | ||
The main changes should be that a ``RuntimeError`` was | ||
replaced with a more fitting ``TypeError``. | ||
When multiple errors were present in the same call, | ||
NumPy may now raise a different one. | ||
|
||
|
||
``__array_ufunc__`` argument validation | ||
--------------------------------------- | ||
NumPy will now partially validate arguments before calling | ||
``__array_ufunc__``. Previously, it was possible to pass | ||
on invalid arguments (such as a non-existing keyword | ||
argument) when dispatch was known to occur. | ||
|
||
|
||
``__array_ufunc__`` and additional positional arguments | ||
------------------------------------------------------- | ||
Previously, all positionally passed arguments were checked for | ||
``__array_ufunc__`` support. In the case of ``reduce``, | ||
``accumulate``, and ``reduceat`` all arguments may be passed by | ||
position. This means that when they were passed by | ||
position, they could previously have been asked to handle | ||
the ufunc call via ``__array_ufunc__``. | ||
Since this depended on the way the arguments were passed | ||
(by position or by keyword), NumPy will now only dispatch | ||
on the input and output array. | ||
For example, NumPy will never dispatch on the ``where`` array | ||
in a reduction such as ``np.add.reduce``. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.