Skip to content

Commit 55b85e3

Browse files
trygvradQuLogic
andauthored
Apply suggestions from code review
Thank you @QuLogic Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
1 parent 6985111 commit 55b85e3

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

lib/matplotlib/colors.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3242,13 +3242,13 @@ def __init__(self, norms, vmin=None, vmax=None, clip=False):
32423242
The constituent norms. The list must have a minimum length of 2.
32433243
vmin, vmax : float, None, or list of float or None
32443244
Limits of the constituent norms.
3245-
If a list, each each value is assigned to one of the constituent
3245+
If a list, each value is assigned to each of the constituent
32463246
norms. Single values are repeated to form a list of appropriate size.
32473247
32483248
clip : bool or list of bools, default: False
32493249
Determines the behavior for mapping values outside the range
32503250
``[vmin, vmax]`` for the constituent norms.
3251-
If a list, each each value is assigned to one of the constituent
3251+
If a list, each value is assigned to each of the constituent
32523252
norms. Single values are repeated to form a list of appropriate size.
32533253
32543254
"""
@@ -3348,7 +3348,8 @@ def _changed(self):
33483348
def __call__(self, value, clip=None):
33493349
"""
33503350
Normalize the data and return the normalized data.
3351-
Each variate in the input is assigned to the a constituent norm.
3351+
3352+
Each variate in the input is assigned to the constituent norm.
33523353
33533354
Parameters
33543355
----------
@@ -3381,8 +3382,7 @@ def __call__(self, value, clip=None):
33813382

33823383
def inverse(self, value):
33833384
"""
3384-
Maps the normalized value (i.e., index in the colormap) back to image
3385-
data value.
3385+
Map the normalized value (i.e., index in the colormap) back to image data value.
33863386
33873387
Parameters
33883388
----------
@@ -3449,7 +3449,7 @@ def _iterable_variates_in_data(data, n_input):
34493449
"""
34503450
if isinstance(data, np.ndarray) and data.dtype.fields is not None:
34513451
data = [data[descriptor[0]] for descriptor in data.dtype.descr]
3452-
if not len(data) == n_input:
3452+
if len(data) != n_input:
34533453
raise ValueError("The input to this `MultiNorm` must be of shape "
34543454
f"({n_input}, ...), or have a data type with {n_input} "
34553455
"fields.")

lib/matplotlib/colors.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -403,17 +403,17 @@ class MultiNorm(Normalize):
403403
clip: ArrayLike | bool = ...
404404
) -> None: ...
405405
@property
406-
def norms(self) -> tuple: ...
406+
def norms(self) -> tuple[Normalize, ...]: ...
407407
@property # type: ignore[override]
408-
def vmin(self) -> tuple[float | None]: ...
408+
def vmin(self) -> tuple[float | None, ...]: ...
409409
@vmin.setter
410410
def vmin(self, value: ArrayLike | float | None) -> None: ...
411411
@property # type: ignore[override]
412-
def vmax(self) -> tuple[float | None]: ...
412+
def vmax(self) -> tuple[float | None, ...]: ...
413413
@vmax.setter
414414
def vmax(self, value: ArrayLike | float | None) -> None: ...
415415
@property # type: ignore[override]
416-
def clip(self) -> tuple[bool]: ...
416+
def clip(self) -> tuple[bool, ...]: ...
417417
@clip.setter
418418
def clip(self, value: ArrayLike | bool) -> None: ...
419419
def __call__(self, value: ArrayLike, clip: ArrayLike | bool | None = ...) -> list: ... # type: ignore[override]

0 commit comments

Comments
 (0)
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