11
11
pass
12
12
13
13
import numpy as np
14
- from pandas import Index , Series , DataFrame , NaT
14
+ from pandas import Index , Series , DataFrame , NaT , isna
15
15
from pandas .compat import PY3
16
16
from pandas .core .indexes .datetimes import date_range , bdate_range
17
17
from pandas .core .indexes .timedeltas import timedelta_range
@@ -581,8 +581,6 @@ def test_finder_hourly(self):
581
581
assert rs == xp
582
582
583
583
@pytest .mark .slow
584
- @pytest .mark .xfail (_mpl_ge_3_0_0 ,
585
- reason = "return type not a masked array anymore?" )
586
584
def test_gaps (self ):
587
585
ts = tm .makeTimeSeries ()
588
586
ts [5 :25 ] = np .nan
@@ -592,6 +590,8 @@ def test_gaps(self):
592
590
assert len (lines ) == 1
593
591
l = lines [0 ]
594
592
data = l .get_xydata ()
593
+ if _mpl_ge_3_0_0 :
594
+ data = np .ma .MaskedArray (data , mask = isna (data ), fill_value = np .nan )
595
595
if not isinstance (data , np .ma .core .MaskedArray ):
596
596
print (matplotlib .__version__ , np .__version__ , type (data ))
597
597
assert isinstance (data , np .ma .core .MaskedArray )
@@ -609,6 +609,8 @@ def test_gaps(self):
609
609
assert len (lines ) == 1
610
610
l = lines [0 ]
611
611
data = l .get_xydata ()
612
+ if _mpl_ge_3_0_0 :
613
+ data = np .ma .MaskedArray (data , mask = isna (data ), fill_value = np .nan )
612
614
if not isinstance (data , np .ma .core .MaskedArray ):
613
615
print (matplotlib .__version__ , np .__version__ , type (data ))
614
616
assert isinstance (data , np .ma .core .MaskedArray )
@@ -626,6 +628,8 @@ def test_gaps(self):
626
628
assert len (lines ) == 1
627
629
l = lines [0 ]
628
630
data = l .get_xydata ()
631
+ if _mpl_ge_3_0_0 :
632
+ data = np .ma .MaskedArray (data , mask = isna (data ), fill_value = np .nan )
629
633
if not isinstance (data , np .ma .core .MaskedArray ):
630
634
print (matplotlib .__version__ , np .__version__ , type (data ))
631
635
print (data )
@@ -634,8 +638,6 @@ def test_gaps(self):
634
638
assert mask [2 :5 , 1 ].all ()
635
639
636
640
@pytest .mark .slow
637
- @pytest .mark .xfail (_mpl_ge_3_0_0 ,
638
- reason = "return type not a masked array anymore?" )
639
641
def test_gap_upsample (self ):
640
642
low = tm .makeTimeSeries ()
641
643
low [5 :25 ] = np .nan
@@ -650,6 +652,8 @@ def test_gap_upsample(self):
650
652
assert len (ax .right_ax .get_lines ()) == 1
651
653
l = lines [0 ]
652
654
data = l .get_xydata ()
655
+ if _mpl_ge_3_0_0 :
656
+ data = np .ma .MaskedArray (data , mask = isna (data ), fill_value = np .nan )
653
657
654
658
if not isinstance (data , np .ma .core .MaskedArray ):
655
659
print (matplotlib .__version__ , np .__version__ , type (data ))
0 commit comments