@@ -151,7 +151,6 @@ def __init__(
151
151
* ,
152
152
group_keys : bool | lib .NoDefault = lib .no_default ,
153
153
selection = None ,
154
- ** kwargs ,
155
154
) -> None :
156
155
self ._timegrouper = groupby
157
156
self .keys = None
@@ -171,18 +170,6 @@ def __init__(
171
170
else :
172
171
self .exclusions = frozenset ()
173
172
174
- @final
175
- def _shallow_copy (self , obj , ** kwargs ):
176
- """
177
- return a new object with the replacement attributes
178
- """
179
- if isinstance (obj , self ._constructor ):
180
- obj = obj .obj
181
- for attr in self ._attributes :
182
- if attr not in kwargs :
183
- kwargs [attr ] = getattr (self , attr )
184
- return self ._constructor (obj , ** kwargs )
185
-
186
173
def __str__ (self ) -> str :
187
174
"""
188
175
Provide a nice str repr of our rolling object.
@@ -1181,7 +1168,7 @@ def _apply(self, f, *args, **kwargs):
1181
1168
"""
1182
1169
1183
1170
def func (x ):
1184
- x = self ._shallow_copy (x , groupby = self ._timegrouper )
1171
+ x = self ._resampler_cls (x , groupby = self ._timegrouper )
1185
1172
1186
1173
if isinstance (f , str ):
1187
1174
return getattr (x , f )(** kwargs )
@@ -1364,7 +1351,7 @@ class DatetimeIndexResamplerGroupby(_GroupByMixin, DatetimeIndexResampler):
1364
1351
"""
1365
1352
1366
1353
@property
1367
- def _constructor (self ):
1354
+ def _resampler_cls (self ):
1368
1355
return DatetimeIndexResampler
1369
1356
1370
1357
@@ -1476,7 +1463,7 @@ class PeriodIndexResamplerGroupby(_GroupByMixin, PeriodIndexResampler):
1476
1463
"""
1477
1464
1478
1465
@property
1479
- def _constructor (self ):
1466
+ def _resampler_cls (self ):
1480
1467
return PeriodIndexResampler
1481
1468
1482
1469
@@ -1504,7 +1491,7 @@ class TimedeltaIndexResamplerGroupby(_GroupByMixin, TimedeltaIndexResampler):
1504
1491
"""
1505
1492
1506
1493
@property
1507
- def _constructor (self ):
1494
+ def _resampler_cls (self ):
1508
1495
return TimedeltaIndexResampler
1509
1496
1510
1497
0 commit comments