@@ -209,7 +209,6 @@ def __rainbow_discrete(self, lut=None):
209209 '#90C987' , '#CAE0AB' , '#F7F056' , '#F7CB45' , '#F6C141' ,
210210 '#F4A736' , '#F1932D' , '#EE8026' , '#E8601C' , '#E65518' ,
211211 '#DC050C' , '#A5170E' , '#72190E' , '#42150A' ]
212- if lut == None or lut < 1 or lut > 23 :
213212 indexes = [[9 ], [9 , 25 ], [9 , 17 , 25 ], [9 , 14 , 17 , 25 ],
214213 [9 , 13 , 14 , 17 , 25 ], [9 , 13 , 14 , 16 , 17 , 25 ],
215214 [8 , 9 , 13 , 14 , 16 , 17 , 25 ], [8 , 9 , 13 , 14 , 16 , 17 , 22 , 25 ],
@@ -235,6 +234,7 @@ def __rainbow_discrete(self, lut=None):
235234 24 , 25 , 26 , 27 , 28 ],
236235 [0 , 1 , 3 , 4 , 6 , 7 , 8 , 9 , 10 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 20 ,
237236 22 , 24 , 25 , 26 , 27 , 28 ]]
237+ if lut is None or lut < 1 or lut > 23 :
238238 lut = 22
239239 self .cmap = discretemap (self .cname , [clrs [i ] for i in indexes [lut - 1 ]])
240240 if lut == 23 :
@@ -268,7 +268,7 @@ def tol_cmap(colormap=None, lut=None):
268268 Parameter lut is ignored for all colormaps except 'rainbow_discrete'.
269269 """
270270 obj = TOLcmaps ()
271- if colormap == None :
271+ if colormap is None :
272272 return obj .namelist
273273 if colormap not in obj .namelist :
274274 colormap = 'rainbow_PuRd'
@@ -291,7 +291,7 @@ def tol_cset(colorset=None):
291291 from collections import namedtuple
292292
293293 namelist = ('bright' , 'high-contrast' , 'vibrant' , 'muted' , 'light' )
294- if colorset == None :
294+ if colorset is None :
295295 return namelist
296296 if colorset not in namelist :
297297 colorset = 'bright'
0 commit comments