Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit adae051

Browse files
committed
Merge pull request #2949 from tacaswell/np_version_purge
CLN : removed version check that required numpy > 1.2
2 parents 018a3a0 + 09b5e55 commit adae051

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

lib/matplotlib/colors.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,13 @@
5050
unicode_literals)
5151

5252
import six
53-
from six.moves import map, zip
53+
from six.moves import zip
5454

5555
import re
5656
import numpy as np
5757
from numpy import ma
5858
import matplotlib.cbook as cbook
5959

60-
parts = np.__version__.split('.')
61-
NP_MAJOR, NP_MINOR = list(map(int, parts[:2]))
62-
# true if clip supports the out kwarg
63-
NP_CLIP_OUT = NP_MAJOR >= 1 and NP_MINOR >= 2
64-
6560
cnames = {
6661
'aliceblue': '#F0F8FF',
6762
'antiquewhite': '#FAEBD7',
@@ -577,10 +572,7 @@ def __call__(self, X, alpha=None, bytes=False):
577572
# conversion of large positive values to negative integers.
578573

579574
xa *= self.N
580-
if NP_CLIP_OUT:
581-
np.clip(xa, -1, self.N, out=xa)
582-
else:
583-
xa = np.clip(xa, -1, self.N)
575+
np.clip(xa, -1, self.N, out=xa)
584576

585577
# ensure that all 'under' values will still have negative
586578
# value after casting to int

0 commit comments

Comments
 (0)