@@ -406,11 +406,10 @@ def test_get_finder(self):
406
406
def test_finder_daily (self ):
407
407
day_lst = [10 , 40 , 252 , 400 , 950 , 2750 , 10000 ]
408
408
409
- if (self .mpl_ge_3_0_0
410
- or (self .mpl_ge_2_1_0 and not self .mpl_ge_2_2_2 )):
411
- # 2.2.0 (exactly) or >= 3.0.0
409
+ if self .mpl_ge_3_0_0 or self .mpl_eq_2_0_2 or self .mpl_eq_2_2_0 :
410
+ # 2.0.2, 2.2.0 (exactly) or >= 3.0.0
412
411
xpl1 = xpl2 = [Period ('1999-1-1' , freq = 'B' ).ordinal ] * len (day_lst )
413
- else : # 2.0.2, 2. 1.0, 2.2.2, 2.2.3, 2.2.4
412
+ else : # 2.1.0, 2.2.2, 2.2.3, 2.2.4
414
413
xpl1 = [7565 , 7564 , 7553 , 7546 , 7518 , 7428 , 7066 ]
415
414
xpl2 = [7566 , 7564 , 7554 , 7546 , 7519 , 7429 , 7066 ]
416
415
@@ -436,11 +435,10 @@ def test_finder_daily(self):
436
435
def test_finder_quarterly (self ):
437
436
yrs = [3.5 , 11 ]
438
437
439
- if (self .mpl_ge_3_0_0
440
- or (self .mpl_ge_2_1_0 and not self .mpl_ge_2_2_2 )):
441
- # 2.2.0 (exactly) or >= 3.0.0
438
+ if self .mpl_ge_3_0_0 or self .mpl_eq_2_0_2 or self .mpl_eq_2_2_0 :
439
+ # 2.0.2, 2.2.0 (exactly) or >= 3.0.0
442
440
xpl1 = xpl2 = [Period ('1988Q1' ).ordinal ] * len (yrs )
443
- else : # 2.0.2, 2. 1.0, 2.2.2, 2.2.3, 2.2.4
441
+ else : # 2.1.0, 2.2.2, 2.2.3, 2.2.4
444
442
xpl1 = [68 , 68 ]
445
443
xpl2 = [72 , 68 ]
446
444
@@ -466,11 +464,10 @@ def test_finder_quarterly(self):
466
464
def test_finder_monthly (self ):
467
465
yrs = [1.15 , 2.5 , 4 , 11 ]
468
466
469
- if (self .mpl_ge_3_0_0
470
- or (self .mpl_ge_2_1_0 and not self .mpl_ge_2_2_2 )):
471
- # 2.2.0 (exactly) or >= 3.0.0
467
+ if self .mpl_ge_3_0_0 or self .mpl_eq_2_0_2 or self .mpl_eq_2_2_0 :
468
+ # 2.0.2, 2.2.0 (exactly) or >= 3.0.0
472
469
xpl1 = xpl2 = [Period ('Jan 1988' ).ordinal ] * len (yrs )
473
- else : # 2.0.2, 2. 1.0, 2.2.2, 2.2.3, 2.2.4
470
+ else : # 2.1.0, 2.2.2, 2.2.3, 2.2.4
474
471
xpl1 = [216 , 216 , 204 , 204 ]
475
472
xpl2 = [216 , 216 , 216 , 204 ]
476
473
@@ -504,11 +501,10 @@ def test_finder_monthly_long(self):
504
501
505
502
@pytest .mark .slow
506
503
def test_finder_annual (self ):
507
- if (self .mpl_ge_3_0_0
508
- or (self .mpl_ge_2_1_0 and not self .mpl_ge_2_2_2 )):
509
- # 2.2.0 (exactly) or >= 3.0.0
504
+ if self .mpl_ge_3_0_0 or self .mpl_eq_2_0_2 or self .mpl_eq_2_2_0 :
505
+ # 2.0.2, 2.2.0 (exactly) or >= 3.0.0
510
506
xp = [1987 , 1988 , 1990 , 1990 , 1995 , 2020 , 2070 , 2170 ]
511
- else : # 2.0.2, 2. 1.0, 2.2.2, 2.2.3, 2.2.4
507
+ else : # 2.1.0, 2.2.2, 2.2.3, 2.2.4
512
508
xp = [1986 , 1986 , 1990 , 1990 , 1995 , 2020 , 1970 , 1970 ]
513
509
514
510
xp = [Period (x , freq = 'A' ).ordinal for x in xp ]
@@ -560,9 +556,8 @@ def test_gaps(self):
560
556
line = lines [0 ]
561
557
data = line .get_xydata ()
562
558
563
- if (self .mpl_ge_3_0_0
564
- or (self .mpl_ge_2_1_0 and not self .mpl_ge_2_2_2 )):
565
- # 2.2.0 (exactly) or >= 3.0.0
559
+ if self .mpl_ge_3_0_0 or self .mpl_eq_2_0_2 or self .mpl_eq_2_2_0 :
560
+ # 2.0.2, 2.2.0 (exactly) or >= 3.0.0
566
561
data = np .ma .MaskedArray (data , mask = isna (data ), fill_value = np .nan )
567
562
568
563
assert isinstance (data , np .ma .core .MaskedArray )
@@ -581,9 +576,8 @@ def test_gaps(self):
581
576
line = lines [0 ]
582
577
data = line .get_xydata ()
583
578
584
- if (self .mpl_ge_3_0_0
585
- or (self .mpl_ge_2_1_0 and not self .mpl_ge_2_2_2 )):
586
- # 2.2.0 (exactly) or >= 3.0.0
579
+ if self .mpl_ge_3_0_0 or self .mpl_eq_2_0_2 or self .mpl_eq_2_2_0 :
580
+ # 2.0.2, 2.2.0 (exactly) or >= 3.0.0
587
581
data = np .ma .MaskedArray (data , mask = isna (data ), fill_value = np .nan )
588
582
589
583
assert isinstance (data , np .ma .core .MaskedArray )
@@ -601,9 +595,8 @@ def test_gaps(self):
601
595
assert len (lines ) == 1
602
596
line = lines [0 ]
603
597
data = line .get_xydata ()
604
- if (self .mpl_ge_3_0_0
605
- or (self .mpl_ge_2_1_0 and not self .mpl_ge_2_2_2 )):
606
- # 2.2.0 (exactly) or >= 3.0.0
598
+ if self .mpl_ge_3_0_0 or self .mpl_eq_2_0_2 or self .mpl_eq_2_2_0 :
599
+ # 2.0.2, 2.2.0 (exactly) or >= 3.0.0
607
600
data = np .ma .MaskedArray (data , mask = isna (data ), fill_value = np .nan )
608
601
609
602
assert isinstance (data , np .ma .core .MaskedArray )
@@ -626,9 +619,8 @@ def test_gap_upsample(self):
626
619
627
620
line = lines [0 ]
628
621
data = line .get_xydata ()
629
- if (self .mpl_ge_3_0_0
630
- or (self .mpl_ge_2_1_0 and not self .mpl_ge_2_2_2 )):
631
- # 2.2.0 (exactly) or >= 3.0.0
622
+ if self .mpl_ge_3_0_0 or self .mpl_eq_2_0_2 or self .mpl_eq_2_2_0 :
623
+ # 2.0.2, 2.2.0 (exactly) or >= 3.0.0
632
624
data = np .ma .MaskedArray (data , mask = isna (data ), fill_value = np .nan )
633
625
634
626
assert isinstance (data , np .ma .core .MaskedArray )
0 commit comments