summaryrefslogtreecommitdiff
path: root/numpy/typing/_callable.py
Commit message (Collapse)AuthorAgeFilesLines
* MAINT: Change `_callable.py` into a `.pyi` stub fileBas van Beek2021-09-301-325/+0
| | | | Previously it was already a stub-only file in all but name
* STY: Use the PEP 457 positional-only syntax in `numpy.typing`Bas van Beek2021-08-311-89/+89
|
* MAINT: Drop .py code-paths specific to Python 3.7Bas van Beek2021-08-301-309/+278
|
* MAINT: Added a missing `sys.version` checkBas van Beek2021-06-051-1/+1
|
* REV,BUG: Replace `NotImplemented` with `typing.Any`Bas van Beek2021-06-051-22/+22
|
* STY: Use the PEP 604 pipe operator over `Optional` and `Union`Bas van Beek2021-05-271-46/+46
| | | | PEP 604 -- Allow writing union types as X | Y
* STY: Replace all `Any`-based runtime placeholders with `NotImplemented`Bas van Beek2021-05-271-22/+22
|
* ENH: Add a global constant to `numpy.typing` denoting whether or not ↵Bas van Beek2021-05-271-11/+5
| | | | `typing_extensions` is available
* MAINT: removed unused imports listed in LGTMdefault-3032021-05-241-2/+0
|
* MAINT: Replace `_ArrayND` with `NDArray`Bas van Beek2021-05-121-2/+3
|
* MAINT: Remove unsafe unions from `np.typing._callable`Bas van Beek2021-04-301-5/+5
|
* Merge pull request #18322 from BvB93/plugin-precisionCharles Harris2021-02-081-18/+28
|\ | | | | ENH: Add a mypy plugin for exposing platform-specific extended-precision types
| * ENH: Add support for extended-precision `np.number` arithmeticBas van Beek2021-02-051-18/+28
| |
* | MAINT: Clarify that `timdelta64 / bool` raisesBas van Beek2021-02-051-0/+2
|/
* ENH: Add dtype support to the array comparison ops (#18128)Bas van Beek2021-01-211-6/+10
| | | | | | | | | | | | | | | | | | | | | * ENH: Added `_ArrayLikeNumber` * ENH: Added dtype support to the array comparison ops * MAINT: Made `dtype` and `ndarray` covariant The dtypes scalar-type and ndarrays' dtype are now covariant instead of invariant. This change is necasary in order to ensure that all generic subclasses can be used as underlying scalar type. * TST: Updated the comparison typing tests * MAINT: Fixed an issue where certain `array > arraylike` operations where neglected More specifically operations between array-likes of `timedelta64` and `ndarray`s that can be cast into `timedelta64`. For example: ar_i = np.array([1]) seq_m = [np.timedelta64()] ar_i > seq_m
* MAINT: Adjusted the return-type of `number` ops to `Any`Bas van Beek2021-01-191-1/+1
|
* MAINT: Changed the `NBitBase` variancy in `number` from co- to invariantBas van Beek2021-01-191-63/+63
|
* MAINT: Simplify a unionBas van Beek2021-01-181-12/+12
| | | | `_BoolLike_co` is already a subtype of `_IntLike_co`, no nead the use an explicit union here
* ENH: Take the precision of `np.int_` into account arithmetic operationsBas van Beek2020-12-221-14/+16
|
* Merge pull request #17795 from BvB93/x-likeMatti Picus2020-12-091-1/+1
|\ | | | | ENH: Add two new `_<X>Like` unions
| * MAINT: Simplify existing `_<X>Like` annotationsBas van Beek2020-11-171-1/+1
| |
* | ENH: Added annotations for `ndarray`/`generic` comparison opsBas van Beek2020-11-241-0/+9
|/
* MAINT: Removed unused importsBas van Beek2020-10-221-4/+0
|
* ENH: Add annotations for `__mod__` & `__divmod__`Bas van Beek2020-10-221-1/+123
|
* MAINT: Removed an unused importBas van Beek2020-10-171-1/+1
|
* MAINT: Fixed a few issues with the `__call__`-based protocolsBas van Beek2020-10-171-38/+34
| | | | | | * Removed redundant `type: ignore` messages * Set the return precision as `Union[_NBit_co, _NBit]` * Type the precision of `builtins.int` operations as `Any`
* MAINT: Removed a now redundant `TODO` commentBas van Beek2020-10-171-3/+0
|
* ENH: Make `complexfloating` generic w.r.t 2 typevarsBas van Beek2020-10-171-2/+6
|
* ENH: Added support for `number` precisionBas van Beek2020-10-171-24/+83
|
* Merge pull request #17465 from BvB93/bitwise-opsCharles Harris2020-10-091-0/+24
|\ | | | | ENH: Add annotations for bitwise operations
| * REV: Remove the `uint64`/`signedinteger` specific overloadBas van Beek2020-10-061-5/+2
| | | | | | | | | | | | Unfortunately the likes of `self: uint64` don't work with protocols. Revisit this once we add proper support for numerical precision.
| * ENH: Add annotations for `generic` and `ndarray` bitwise operationsBas van Beek2020-10-051-1/+28
| |
* | MAINT: Move aliases for common scalar unions to `numpy.typing` (#17429)Bas van Beek2020-10-071-5/+7
|/ | | * MAINT: Move the `<scalar>Like` unions to `numpy.typing`
* ENH: Annotate the arithmetic operations of `ndarray` and `generic` (#17273)Bas van Beek2020-10-021-0/+136
* 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`