Skip to content

Commit 80e8995

Browse files
authored
Fix rolling_exp type for alpha values (#5145)
1 parent 2896a80 commit 80e8995

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

xarray/core/rolling_exp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import TYPE_CHECKING, Generic, Hashable, Mapping, Optional, TypeVar
1+
from typing import TYPE_CHECKING, Generic, Hashable, Mapping, Optional, TypeVar, Union
22

33
import numpy as np
44

@@ -74,7 +74,7 @@ class RollingExp(Generic[T_DSorDA]):
7474
----------
7575
obj : Dataset or DataArray
7676
Object to window.
77-
windows : mapping of hashable to int
77+
windows : mapping of hashable to int (or float for alpha type)
7878
A mapping from the name of the dimension to create the rolling
7979
exponential window along (e.g. `time`) to the size of the moving window.
8080
window_type : {"span", "com", "halflife", "alpha"}, default: "span"
@@ -90,7 +90,7 @@ class RollingExp(Generic[T_DSorDA]):
9090
def __init__(
9191
self,
9292
obj: T_DSorDA,
93-
windows: Mapping[Hashable, int],
93+
windows: Mapping[Hashable, Union[int, float]],
9494
window_type: str = "span",
9595
):
9696
self.obj: T_DSorDA = obj

0 commit comments

Comments
 (0)