diff options
author | Bas van Beek <43369155+BvB93@users.noreply.github.com> | 2020-10-02 23:25:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-02 15:25:14 -0600 |
commit | 47a918f644da4ed3947ee2f797c790027041f29b (patch) | |
tree | c63ba285cf88307d1ff521ae058a34c35e77836a /numpy/lib/nanfunctions.py | |
parent | f4a4ddd56e1c3107a8b376d2e72cd5334676627a (diff) | |
download | numpy-47a918f644da4ed3947ee2f797c790027041f29b.tar.gz |
ENH: Annotate the arithmetic operations of `ndarray` and `generic` (#17273)
* ENH: Added annotations for arithmetic-based magic methods
* TST: Added arithmetic tests
* TST: Moved a number of tests to `arithmetic.py`
* ENH: Ensure that objects annotated as `number` support arithmetic operations
* MAINT: Arithmetic operations on 0d arrays return scalars
* MAINT: Clarify the type of generics returned by `ufunc.__call__`
* TST: Added more arithmetic tests
* MAINT: Use `_CharLike` when both `str` and `bytes` are accepted
* MAINT: Change the `timedelta64` baseclass to `generic`
* MAINT: Add aliases for common scalar unions
* MAINT: Update the defition of `_NumberLike`
* MAINT: Replace `_NumberLike` with `_ComplexLike` in the `complexfloating` annotations
* MAINT: Move the callback protocols to their own module
* MAINT: Make `typing._callback` available at runtime
* DOC: Provide further clarification about callback protocols
* MAINT: Replace `_callback` with `_callable`
Addresses https://github.com/numpy/numpy/pull/17273#discussion_r485821346
The use of `__call__`-defining protocols is not limited to callbacks. The module name name & docstring now reflects this.
* MAINT: Removed `__add__` from `str_` and `bytes_`
Most `np.bytes_` / `np.str_` methods return their builtin `bytes` / `str` counterpart.
This includes addition.
* MAINT: Fix the return type of boolean division
Addresses https://github.com/numpy/numpy/pull/17273#discussion_r486271220
Dividing a `np.bool_` by an integer (or vice versa) always returns `float64`
* MAINT: Renamed all `_<x>Arithmetic` protocols to `_<x>Op
Addresses https://github.com/numpy/numpy/pull/17273#discussion_r486272745
* TST: Add tests for boolean division
* ENH: Make `np.number` generic w.r.t. its precision
* ENH,WIP: Add a mypy plugin for casting `np.number` instances to appropiate subclasses
* Revert "ENH,WIP: Add a mypy plugin for casting `np.number` instances to appropiate subclasses"
This reverts commit c526fb619d20902bfd77709c8983c7a7d5477c95.
* Revert "ENH: Make `np.number` generic w.r.t. its precision"
This reverts commit dbf20183cf7ff71e379cd1a165d07e1a1d643135.
* MAINT: Narow the definition of `_ComplexLike`
Addresses https://github.com/numpy/numpy/pull/17273#discussion_r490440238
* MAINT: Refined the return type of `unint + int` ops
`unsignedinteger + signedinteger` generally returns a `signedinteger` subclass.
The exception to this is `uint64 + signedinteger`, which returns `float64`.
Addresses https://github.com/numpy/numpy/pull/17273#discussion_r490442023
* MAINT: Use `_IntLike` and `_FloatLike` in the definition of `_ComplexLike`
Diffstat (limited to 'numpy/lib/nanfunctions.py')
0 files changed, 0 insertions, 0 deletions