Skip to content

Commit bc03bb3

Browse files
committed
Slightly cleanup axes3d imports
1 parent c09af11 commit bc03bb3

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,16 @@
1212

1313
from collections import defaultdict
1414
import functools
15-
from functools import reduce
16-
from itertools import compress
15+
import itertools
1716
import math
1817
import textwrap
1918

2019
import numpy as np
2120

22-
from matplotlib import artist
23-
from matplotlib import _api
21+
from matplotlib import _api, artist, cbook, docstring
2422
import matplotlib.axes as maxes
25-
import matplotlib.cbook as cbook
2623
import matplotlib.collections as mcoll
2724
import matplotlib.colors as mcolors
28-
import matplotlib.docstring as docstring
2925
import matplotlib.scale as mscale
3026
import matplotlib.container as mcontainer
3127
import matplotlib.transforms as mtransforms
@@ -2710,7 +2706,7 @@ def calc_arrows(UVW, angle=15):
27102706
masks = bcast[argi:]
27112707
if masks:
27122708
# combine the masks into one
2713-
mask = reduce(np.logical_or, masks)
2709+
mask = functools.reduce(np.logical_or, masks)
27142710
# put mask on and compress
27152711
input_args = [np.ma.array(k, mask=mask).compressed()
27162712
for k in input_args]
@@ -3203,7 +3199,7 @@ def errorbar(self, x, y, z, zerr=None, yerr=None, xerr=None, fmt='',
32033199
def _apply_mask(arrays, mask):
32043200
# Return, for each array in *arrays*, the elements for which *mask*
32053201
# is True, without using fancy indexing.
3206-
return [[*compress(array, mask)] for array in arrays]
3202+
return [[*itertools.compress(array, mask)] for array in arrays]
32073203

32083204
def _extract_errs(err, data, lomask, himask):
32093205
# For separate +/- error values we need to unpack err

0 commit comments

Comments
 (0)