From 029f852ade2b50821701abe16f571e4e84b72bfe Mon Sep 17 00:00:00 2001 From: Kyle Sunden Date: Fri, 11 Aug 2023 20:21:30 -0500 Subject: [PATCH] TYP: Add overload to specify output of Colormap.__call__ when possible Closes #26501 --- lib/matplotlib/colors.pyi | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/matplotlib/colors.pyi b/lib/matplotlib/colors.pyi index 354250a7bd22..9bb1725f4f78 100644 --- a/lib/matplotlib/colors.pyi +++ b/lib/matplotlib/colors.pyi @@ -69,6 +69,15 @@ class Colormap: N: int colorbar_extend: bool def __init__(self, name: str, N: int = ...) -> None: ... + @overload + def __call__( + self, X: Sequence[float] | np.ndarray, alpha: ArrayLike | None = ..., bytes: bool = ... + ) -> np.ndarray: ... + @overload + def __call__( + self, X: float, alpha: float | None = ..., bytes: bool = ... + ) -> tuple[float, float, float, float]: ... + @overload def __call__( self, X: ArrayLike, alpha: ArrayLike | None = ..., bytes: bool = ... ) -> tuple[float, float, float, float] | np.ndarray: ... 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