@@ -403,10 +403,11 @@ def test_get_finder(self):
403
403
def test_finder_daily (self ):
404
404
day_lst = [10 , 40 , 252 , 400 , 950 , 2750 , 10000 ]
405
405
406
- if self .mpl_ge_3_0_0 or not self .mpl_ge_2_0_1 :
407
- # 2.0.0 and >= 3.0.0
406
+ if (self .mpl_ge_3_0_0 or not self .mpl_ge_2_0_1
407
+ or (self .mpl_ge_2_1_0 and not self .mpl_ge_2_2_2 )):
408
+ # 2.0.0, 2.2.0 (exactly) or >= 3.0.0
408
409
xpl1 = xpl2 = [Period ('1999-1-1' , freq = 'B' ).ordinal ] * len (day_lst )
409
- else :
410
+ else : # 2.0.1, 2.1.0, 2.2.2, 2.2.3
410
411
xpl1 = [7565 , 7564 , 7553 , 7546 , 7518 , 7428 , 7066 ]
411
412
xpl2 = [7566 , 7564 , 7554 , 7546 , 7519 , 7429 , 7066 ]
412
413
@@ -432,10 +433,11 @@ def test_finder_daily(self):
432
433
def test_finder_quarterly (self ):
433
434
yrs = [3.5 , 11 ]
434
435
435
- if self .mpl_ge_3_0_0 or not self .mpl_ge_2_0_1 :
436
- # 2.0.0 and >= 3.0.0
436
+ if (self .mpl_ge_3_0_0 or not self .mpl_ge_2_0_1
437
+ or (self .mpl_ge_2_1_0 and not self .mpl_ge_2_2_2 )):
438
+ # 2.0.0, 2.2.0 (exactly) or >= 3.0.0
437
439
xpl1 = xpl2 = [Period ('1988Q1' ).ordinal ] * len (yrs )
438
- else :
440
+ else : # 2.0.1, 2.1.0, 2.2.2, 2.2.3
439
441
xpl1 = [68 , 68 ]
440
442
xpl2 = [72 , 68 ]
441
443
@@ -461,10 +463,11 @@ def test_finder_quarterly(self):
461
463
def test_finder_monthly (self ):
462
464
yrs = [1.15 , 2.5 , 4 , 11 ]
463
465
464
- if self .mpl_ge_3_0_0 or not self .mpl_ge_2_0_1 :
465
- # 2.0.0 or >= 3.0.0
466
+ if (self .mpl_ge_3_0_0 or not self .mpl_ge_2_0_1
467
+ or (self .mpl_ge_2_1_0 and not self .mpl_ge_2_2_2 )):
468
+ # 2.0.0, 2.2.0 (exactly) or >= 3.0.0
466
469
xpl1 = xpl2 = [Period ('Jan 1988' ).ordinal ] * len (yrs )
467
- else :
470
+ else : # 2.0.1, 2.1.0, 2.2.2, 2.2.3
468
471
xpl1 = [216 , 216 , 204 , 204 ]
469
472
xpl2 = [216 , 216 , 216 , 204 ]
470
473
@@ -498,10 +501,11 @@ def test_finder_monthly_long(self):
498
501
499
502
@pytest .mark .slow
500
503
def test_finder_annual (self ):
501
- if self .mpl_ge_3_0_0 or not self .mpl_ge_2_0_1 :
502
- # 2.0.0 or >= 3.0.0
504
+ if (self .mpl_ge_3_0_0 or not self .mpl_ge_2_0_1
505
+ or (self .mpl_ge_2_1_0 and not self .mpl_ge_2_2_2 )):
506
+ # 2.0.0, 2.2.0 (exactly) or >= 3.0.0
503
507
xp = [1987 , 1988 , 1990 , 1990 , 1995 , 2020 , 2070 , 2170 ]
504
- else :
508
+ else : # 2.0.1, 2.1.0, 2.2.2, 2.2.3
505
509
xp = [1986 , 1986 , 1990 , 1990 , 1995 , 2020 , 1970 , 1970 ]
506
510
507
511
xp = [Period (x , freq = 'A' ).ordinal for x in xp ]
@@ -555,8 +559,10 @@ def test_gaps(self):
555
559
assert len (lines ) == 1
556
560
l = lines [0 ]
557
561
data = l .get_xydata ()
558
- if self .mpl_ge_3_0_0 or not self .mpl_ge_2_0_1 :
559
- # 2.0.0 or >= 3.0.0
562
+
563
+ if (self .mpl_ge_3_0_0 or not self .mpl_ge_2_0_1
564
+ or (self .mpl_ge_2_1_0 and not self .mpl_ge_2_2_2 )):
565
+ # 2.0.0, 2.2.0 (exactly) or >= 3.0.0
560
566
data = np .ma .MaskedArray (data , mask = isna (data ), fill_value = np .nan )
561
567
562
568
assert isinstance (data , np .ma .core .MaskedArray )
@@ -574,8 +580,10 @@ def test_gaps(self):
574
580
assert len (lines ) == 1
575
581
l = lines [0 ]
576
582
data = l .get_xydata ()
577
- if self .mpl_ge_3_0_0 or not self .mpl_ge_2_0_1 :
578
- # 2.0.0 or >= 3.0.0
583
+
584
+ if (self .mpl_ge_3_0_0 or not self .mpl_ge_2_0_1
585
+ or (self .mpl_ge_2_1_0 and not self .mpl_ge_2_2_2 )):
586
+ # 2.0.0, 2.2.0 (exactly) or >= 3.0.0
579
587
data = np .ma .MaskedArray (data , mask = isna (data ), fill_value = np .nan )
580
588
581
589
assert isinstance (data , np .ma .core .MaskedArray )
@@ -593,8 +601,9 @@ def test_gaps(self):
593
601
assert len (lines ) == 1
594
602
l = lines [0 ]
595
603
data = l .get_xydata ()
596
- if self .mpl_ge_3_0_0 or not self .mpl_ge_2_0_1 :
597
- # 2.0.0 or >= 3.0.0
604
+ if (self .mpl_ge_3_0_0 or not self .mpl_ge_2_0_1
605
+ or (self .mpl_ge_2_1_0 and not self .mpl_ge_2_2_2 )):
606
+ # 2.0.0, 2.2.0 (exactly) or >= 3.0.0
598
607
data = np .ma .MaskedArray (data , mask = isna (data ), fill_value = np .nan )
599
608
600
609
assert isinstance (data , np .ma .core .MaskedArray )
@@ -616,8 +625,9 @@ def test_gap_upsample(self):
616
625
assert len (ax .right_ax .get_lines ()) == 1
617
626
l = lines [0 ]
618
627
data = l .get_xydata ()
619
- if self .mpl_ge_3_0_0 or not self .mpl_ge_2_0_1 :
620
- # 2.0.0 or >= 3.0.0
628
+ if (self .mpl_ge_3_0_0 or not self .mpl_ge_2_0_1
629
+ or (self .mpl_ge_2_1_0 and not self .mpl_ge_2_2_2 )):
630
+ # 2.0.0, 2.2.0 (exactly) or >= 3.0.0
621
631
data = np .ma .MaskedArray (data , mask = isna (data ), fill_value = np .nan )
622
632
623
633
assert isinstance (data , np .ma .core .MaskedArray )
@@ -1403,6 +1413,7 @@ def test_format_timedelta_ticks_narrow(self):
1403
1413
1404
1414
def test_format_timedelta_ticks_wide (self ):
1405
1415
expected_labels = [
1416
+ '' ,
1406
1417
'00:00:00' ,
1407
1418
'1 days 03:46:40' ,
1408
1419
'2 days 07:33:20' ,
@@ -1411,9 +1422,13 @@ def test_format_timedelta_ticks_wide(self):
1411
1422
'5 days 18:53:20' ,
1412
1423
'6 days 22:40:00' ,
1413
1424
'8 days 02:26:40' ,
1414
- '9 days 06:13:20'
1425
+ '9 days 06:13:20' ,
1426
+ ''
1415
1427
]
1416
- if not self .mpl_ge_2_0_1 : # 2.0.0
1428
+ if self .mpl_ge_2_2_0 :
1429
+ expected_labels = expected_labels [1 :- 1 ]
1430
+ elif self .mpl_ge_2_0_1 :
1431
+ expected_labels = expected_labels [1 :- 1 ]
1417
1432
expected_labels [- 1 ] = ''
1418
1433
1419
1434
rng = timedelta_range ('0' , periods = 10 , freq = '1 d' )
0 commit comments