Skip to content

TYP: Type MaskedArray.{trace,round,cumsum,cumprod} #29307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 2, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
sync comments
  • Loading branch information
MarcoGorelli committed Jul 2, 2025
commit 20e04cfbcf4ceaca47841c07c8f455bdf330b230
2 changes: 2 additions & 0 deletions numpy/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1777,13 +1777,15 @@ class _ArrayOrScalarCommon:
@overload
def compress(self, /, condition: _ArrayLikeInt_co, axis: SupportsIndex | None = None, *, out: _ArrayT) -> _ArrayT: ...

# Keep in sync with `MaskedArray.cumprod`
@overload # out: None (default)
def cumprod(self, /, axis: SupportsIndex | None = None, dtype: DTypeLike | None = None, out: None = None) -> NDArray[Any]: ...
@overload # out: ndarray
def cumprod(self, /, axis: SupportsIndex | None, dtype: DTypeLike | None, out: _ArrayT) -> _ArrayT: ...
@overload
def cumprod(self, /, axis: SupportsIndex | None = None, dtype: DTypeLike | None = None, *, out: _ArrayT) -> _ArrayT: ...

# Keep in sync with `MaskedArray.cumsum`
@overload # out: None (default)
def cumsum(self, /, axis: SupportsIndex | None = None, dtype: DTypeLike | None = None, out: None = None) -> NDArray[Any]: ...
@overload # out: ndarray
Expand Down
3 changes: 3 additions & 0 deletions numpy/ma/core.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,7 @@ class MaskedArray(ndarray[_ShapeT_co, _DTypeT_co]):
def dot(self, b, out=..., strict=...): ...
def sum(self, axis=..., dtype=..., out=..., keepdims=...): ...

# Keep in sync with `ndarray.cumsum`
@overload # out: None (default)
def cumsum(self, /, axis: SupportsIndex | None = None, dtype: DTypeLike | None = None, out: None = None) -> _MaskedArray[Any]: ...
@overload # out: ndarray
Expand All @@ -1213,6 +1214,8 @@ class MaskedArray(ndarray[_ShapeT_co, _DTypeT_co]):
def prod(self, axis=..., dtype=..., out=..., keepdims=...): ...
product: Any

# Keep in sync with `ndarray.cumprod`
@overload # out: None (default)
@overload # out: None (default)
def cumprod(self, /, axis: SupportsIndex | None = None, dtype: DTypeLike | None = None, out: None = None) -> _MaskedArray[Any]: ...
@overload # out: ndarray
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy