@@ -270,26 +270,17 @@ def test_DivergingNorm_Odd():
270
270
271
271
272
272
def test_DivergingNorm_VminEqualsVcenter ():
273
- norm = mcolors . DivergingNorm ( vmin = - 2 , vcenter = - 2 , vmax = 2 )
274
- vals = np . array ([ - 2.0 , - 1.0 , 0.0 , 1.0 , 2.0 ])
275
- expected = np . array ([ 0.5 , 0.625 , 0.75 , 0.875 , 1.0 ] )
276
- assert_array_equal ( norm (vals ), expected )
273
+ vals = np . arange ( 50 )
274
+ with pytest . raises ( ValueError ):
275
+ norm = mcolors . DivergingNorm ( vmin = 10 , vcenter = 10 , vmax = 20 )
276
+ norm (vals )
277
277
278
278
279
279
def test_DivergingNorm_VmaxEqualsVcenter ():
280
- norm = mcolors .DivergingNorm (vmin = - 2 , vcenter = 2 , vmax = 2 )
281
- vals = np .array ([- 2.0 , - 1.0 , 0.0 , 1.0 , 1.999 , 2.0 ])
282
- expected = np .array ([0.0 , 0.125 , 0.25 , 0.375 , 0.499875 , 1.0 ])
283
- assert_array_equal (norm (vals ), expected )
284
-
285
-
286
- def test_DivergingNorm_VsAllEqual ():
287
- v = 10
288
- mcolors .DivergingNorm = mcolors .DivergingNorm
289
- norm = mcolors .DivergingNorm (vmin = v , vcenter = v , vmax = v )
290
- vals = np .array ([- 2.0 , - 1.0 , 0.0 , 1.0 , 2.0 ])
291
- expected = np .array ([0.0 , 0.0 , 0.0 , 0.0 , 0.0 ])
292
- assert_array_equal (norm (vals ), expected )
280
+ vals = np .arange (50 )
281
+ with pytest .raises (ValueError ):
282
+ norm = mcolors .DivergingNorm (vmin = 0 , vcenter = 10 , vmax = 10 )
283
+ norm (vals )
293
284
294
285
295
286
def test_DivergingNorm_VminGTVcenter ():
0 commit comments