Skip to content

TYP: Type MaskedArray.__{iadd,isub,imul,itruediv,ifloordiv,ipow}__ #28986

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 9 commits into from
May 19, 2025
Prev Previous commit
Next Next commit
🔥 remove outdated variable
  • Loading branch information
MarcoGorelli committed May 17, 2025
commit c4be2d9015f73dbbe28a27d659fb4a3bf1492ead
12 changes: 3 additions & 9 deletions numpy/typing/tests/data/pass/ma.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
from typing import Any, TypeAlias, TypeVar, cast

import numpy as np
import numpy.ma
import numpy.typing as npt
from numpy import dtype, generic
from numpy._typing import _Shape

_ScalarT = TypeVar("_ScalarT", bound=generic)
MaskedArray: TypeAlias = np.ma.MaskedArray[_Shape, dtype[_ScalarT]]
ar_b: npt.NDArray[np.bool] = np.array([True, False, True])
m: np.ma.MaskedArray[Any, np.dtype[np.float64]] = np.ma.masked_array(
[1.5, 2, 3], mask=[True, False, True]
)

m.mask = ar_b
m.mask = np.False_

MAR_b: MaskedArray[np.bool] = np.ma.MaskedArray([True])
MAR_u: MaskedArray[np.uint32] = np.ma.MaskedArray([1], dtype=np.uint32)
Expand All @@ -35,6 +26,9 @@
AR_LIKE_m = [np.timedelta64(1, "D")]
AR_LIKE_M = [np.datetime64(1, "D")]

MAR_f.mask = AR_LIKE_b
MAR_f.mask = np.False_

# Inplace addition

MAR_b += AR_LIKE_b
Expand Down
Loading
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