@@ -40,50 +40,6 @@ def allow_na_ops(obj: Any) -> bool:
40
40
return not is_bool_index and obj ._can_hold_na
41
41
42
42
43
- class Ops :
44
- def setup_method (self , method ):
45
- self .bool_index = tm .makeBoolIndex (10 , name = "a" )
46
- self .int_index = tm .makeIntIndex (10 , name = "a" )
47
- self .float_index = tm .makeFloatIndex (10 , name = "a" )
48
- self .dt_index = tm .makeDateIndex (10 , name = "a" )
49
- self .dt_tz_index = tm .makeDateIndex (10 , name = "a" ).tz_localize (tz = "US/Eastern" )
50
- self .period_index = tm .makePeriodIndex (10 , name = "a" )
51
- self .string_index = tm .makeStringIndex (10 , name = "a" )
52
- self .unicode_index = tm .makeUnicodeIndex (10 , name = "a" )
53
-
54
- arr = np .random .randn (10 )
55
- self .bool_series = Series (arr , index = self .bool_index , name = "a" )
56
- self .int_series = Series (arr , index = self .int_index , name = "a" )
57
- self .float_series = Series (arr , index = self .float_index , name = "a" )
58
- self .dt_series = Series (arr , index = self .dt_index , name = "a" )
59
- self .dt_tz_series = self .dt_tz_index .to_series ()
60
- self .period_series = Series (arr , index = self .period_index , name = "a" )
61
- self .string_series = Series (arr , index = self .string_index , name = "a" )
62
- self .unicode_series = Series (arr , index = self .unicode_index , name = "a" )
63
-
64
- types = ["bool" , "int" , "float" , "dt" , "dt_tz" , "period" , "string" , "unicode" ]
65
- self .indexes = [getattr (self , f"{ t } _index" ) for t in types ]
66
- self .series = [getattr (self , f"{ t } _series" ) for t in types ]
67
-
68
- # To test narrow dtypes, we use narrower *data* elements, not *index* elements
69
- index = self .int_index
70
- self .float32_series = Series (arr .astype (np .float32 ), index = index , name = "a" )
71
-
72
- arr_int = np .random .choice (10 , size = 10 , replace = False )
73
- self .int8_series = Series (arr_int .astype (np .int8 ), index = index , name = "a" )
74
- self .int16_series = Series (arr_int .astype (np .int16 ), index = index , name = "a" )
75
- self .int32_series = Series (arr_int .astype (np .int32 ), index = index , name = "a" )
76
-
77
- self .uint8_series = Series (arr_int .astype (np .uint8 ), index = index , name = "a" )
78
- self .uint16_series = Series (arr_int .astype (np .uint16 ), index = index , name = "a" )
79
- self .uint32_series = Series (arr_int .astype (np .uint32 ), index = index , name = "a" )
80
-
81
- nrw_types = ["float32" , "int8" , "int16" , "int32" , "uint8" , "uint16" , "uint32" ]
82
- self .narrow_series = [getattr (self , f"{ t } _series" ) for t in nrw_types ]
83
-
84
- self .objs = self .indexes + self .series + self .narrow_series
85
-
86
-
87
43
@pytest .mark .parametrize (
88
44
"op_name, op" ,
89
45
[
@@ -132,12 +88,7 @@ def test_numpy_transpose(self, index_or_series_obj):
132
88
np .transpose (obj , axes = 1 )
133
89
134
90
135
- class TestIndexOps (Ops ):
136
- def setup_method (self , method ):
137
- super ().setup_method (method )
138
- self .is_valid_objs = self .objs
139
- self .not_valid_objs = []
140
-
91
+ class TestIndexOps :
141
92
def test_none_comparison (self , series_with_simple_index ):
142
93
series = series_with_simple_index
143
94
if isinstance (series .index , IntervalIndex ):
0 commit comments