8000 Apply suggestions from code review · timhoffm/matplotlib@0762613 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0762613

Browse files
scottshambaughQuLogicksunden
authored
Apply suggestions from code review
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com> Co-authored-by: Kyle Sunden <git@ksunden.space>
1 parent a5cb9ef commit 0762613

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/matplotlib/cbook.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,14 +1113,13 @@ def _broadcast_with_masks(*args, compress=False):
11131113
masks = bcast[len(args):]
11141114
if masks:
11151115
# combine the masks into one
1116-
mask = functools.reduce(np.logical_or, masks)
1116+
mask = np.logical_or.reduce(masks)
11171117
# put mask on and compress
11181118
if compress:
11191119
inputs = [np.ma.array(k, mask=mask).compressed()
11201120
for k in inputs]
11211121
else:
1122-
inputs = [np.ravel(np.ma.array(k, mask=mask,
1123-
dtype=float).filled(np.nan))
1122+
inputs = [np.ma.array(k, mask=mask, dtype=float).filled(np.nan).ravel()
11241123
for k in inputs]
11251124
else:
11261125
inputs = [np.ravel(k) for k in inputs]

lib/matplotlib/cbook.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class GrouperView(Generic[_T]):
130130

131131
def simple_linear_interpolation(a: ArrayLike, steps: int) -> np.ndarray: ...
132132
def delete_masked_points(*args): ...
133-
def _broadcast_with_masks(*args, compress: bool=False) -> list[ArrayLike]: ...
133+
def _broadcast_with_masks(*args: ArrayLike, compress: bool = ...) -> list[ArrayLike]: ...
134134
def boxplot_stats(
135135
X: ArrayLike,
136136
whis: float | tuple[float, float] = ...,

0 commit comments

Comments
 (0)
0