@@ -134,8 +134,10 @@ class ExponentialMovingWindow(BaseWindow):
134
134
Provide exponentially weighted (EW) calculations.
135
135
136
136
Exactly one of ``com``, ``span``, ``halflife``, or ``alpha`` must be
137
- provided if ``times`` is not provided. If ``times`` is provided,
137
+ provided if ``times`` is not provided. If ``times`` is provided and ``adjust=True`` ,
138
138
``halflife`` and one of ``com``, ``span`` or ``alpha`` may be provided.
139
+ If ``times`` is provided and ``adjust=False``, ``halflife`` must be the only
140
+ provided decay-specification parameter.
139
141
140
142
Parameters
141
143
----------
@@ -358,8 +360,6 @@ def __init__(
358
360
self .ignore_na = ignore_na
359
361
self .times = times
360
362
if self .times is not None :
361
- if not self .adjust :
362
- raise NotImplementedError ("times is not supported with adjust=False." )
363
363
times_dtype = getattr (self .times , "dtype" , None )
364
364
if not (
365
365
is_datetime64_dtype (times_dtype )
@@ -376,6 +376,9 @@ def __init__(
376
376
# Halflife is no longer applicable when calculating COM
377
377
# But allow COM to still be calculated if the user passes other decay args
378
378
if common .count_not_none (self .com , self .span , self .alpha ) > 0 :
379
+ if not self .adjust :
380
+ raise NotImplementedError ('None of com, span, or alpha can be specified if '
381
+ 'times is provided and adjust=False' )
379
382
self ._com = get_center_of_mass (self .com , self .span , None , self .alpha )
380
383
else :
381
384
self ._com = 1.0
0 commit comments