@@ -60,12 +60,12 @@ def test_is_empty(self, constructor, left, right, closed):
60
60
61
61
62
62
class TestMethods :
63
- @pytest .mark .parametrize ("new_closed " , ["left" , "right" , "both" , "neither" ])
64
- def test_set_closed (self , closed , new_closed ):
63
+ @pytest .mark .parametrize ("new_inclusive " , ["left" , "right" , "both" , "neither" ])
64
+ def test_set_inclusive (self , closed , new_inclusive ):
65
65
# GH 21670
66
66
array = IntervalArray .from_breaks (range (10 ), inclusive = closed )
67
- result = array .set_closed ( new_closed )
68
- expected = IntervalArray .from_breaks (range (10 ), inclusive = new_closed )
67
+ result = array .set_inclusive ( new_inclusive )
68
+ expected = IntervalArray .from_breaks (range (10 ), inclusive = new_inclusive )
69
69
tm .assert_extension_array_equal (result , expected )
70
70
71
71
@pytest .mark .parametrize (
@@ -134,10 +134,10 @@ def test_set_na(self, left_right_dtypes):
134
134
135
135
tm .assert_extension_array_equal (result , expected )
136
136
137
- def test_setitem_mismatched_closed (self ):
137
+ def test_setitem_mismatched_inclusive (self ):
138
138
arr = IntervalArray .from_breaks (range (4 ), "right" )
139
139
orig = arr .copy ()
140
- other = arr .set_closed ("both" )
140
+ other = arr .set_inclusive ("both" )
141
141
142
142
msg = "'value.inclusive' is 'both', expected 'right'"
143
143
with pytest .raises (ValueError , match = msg ):
@@ -488,17 +488,8 @@ def test_from_arrays_deprecation():
488
488
IntervalArray .from_arrays ([0 , 1 , 2 ], [1 , 2 , 3 ], closed = "right" )
489
489
490
490
491
- def test_set_closed_deprecated_closed ():
491
+ def test_set_closed_deprecated ():
492
492
# GH#40245
493
493
array = IntervalArray .from_breaks (range (10 ))
494
494
with tm .assert_produces_warning (FutureWarning ):
495
495
array .set_closed (closed = "both" )
496
-
497
-
498
- def test_set_closed_both_provided_deprecation ():
499
- # GH#40245
500
- array = IntervalArray .from_breaks (range (10 ))
501
- msg = "Can only specify 'closed' or 'inclusive', not both."
502
- with pytest .raises (TypeError , match = msg ):
503
- with tm .assert_produces_warning (FutureWarning ):
504
- array .set_closed (inclusive = "both" , closed = "both" )
0 commit comments