@@ -174,36 +174,36 @@ def test_ceil_floor_edge(self, test_input, rounder, freq, expected):
174
174
('2018-01-01' , '12H' , 25 ),
175
175
('2018-01-01 0:0:0.124999' , '1ns' , 1000 ),
176
176
])
177
- @pytest .mark .parametrize ('rounding_freq ' , [
177
+ @pytest .mark .parametrize ('round_freq ' , [
178
178
'2ns' , '3ns' , '4ns' , '5ns' , '6ns' , '7ns' ,
179
179
'250ns' , '500ns' , '750ns' ,
180
180
'1us' , '19us' , '250us' , '500us' , '750us' ,
181
181
'1s' , '2s' , '3s' ,
182
182
'12H' , '1D' ,
183
183
])
184
- def test_round_int64 (self , start , index_freq , periods , rounding_freq ):
184
+ def test_round_int64 (self , start , index_freq , periods , round_freq ):
185
185
dt = DatetimeIndex (start = start , freq = index_freq , periods = periods )
186
- unit = to_offset (rounding_freq ).nanos
186
+ unit = to_offset (round_freq ).nanos
187
187
188
188
# test floor
189
- result = dt .floor (rounding_freq )
189
+ result = dt .floor (round_freq )
190
190
diff = dt .asi8 - result .asi8
191
191
mod = result .asi8 % unit
192
- assert (mod == 0 ).all (), "floor not a %s multiple" % ( rounding_freq , )
192
+ assert (mod == 0 ).all (), "floor not a {} multiple" . format ( round_freq )
193
193
assert (0 <= diff ).all () and (diff < unit ).all (), "floor error"
194
194
195
195
# test ceil
196
- result = dt .ceil (rounding_freq )
196
+ result = dt .ceil (round_freq )
197
197
diff = result .asi8 - dt .asi8
198
198
mod = result .asi8 % unit
199
- assert (mod == 0 ).all (), "ceil not a %s multiple" % ( rounding_freq , )
199
+ assert (mod == 0 ).all (), "ceil not a {} multiple" . format ( round_freq )
200
200
assert (0 <= diff ).all () and (diff < unit ).all (), "ceil error"
201
201
202
202
# test round
203
- result = dt .round (rounding_freq )
203
+ result = dt .round (round_freq )
204
204
diff = abs (result .asi8 - dt .asi8 )
205
205
mod = result .asi8 % unit
206
- assert (mod == 0 ).all (), "round not a %s multiple" % ( rounding_freq , )
206
+ assert (mod == 0 ).all (), "round not a {} multiple" . format ( round_freq )
207
207
assert (diff <= unit // 2 ).all (), "round error"
208
208
if unit % 2 == 0 :
209
209
assert (
0 commit comments