Skip to content

Commit

Permalink
add [...] to transpose to allow for dimensions not present
Browse files Browse the repository at this point in the history
  • Loading branch information
semvijverberg committed Feb 12, 2024
1 parent 1b0b2d4 commit bb0189f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions s2spy/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def _get_lineartrend_timeseries(data: Union[xr.DataArray, xr.Dataset], trend: di
trend_timeseries = trend["intercept"] + trend["slope"] * (
data["time"].astype(float)
)
return trend_timeseries.transpose(*data.dims)
return trend_timeseries.transpose(*list(data.dims) + [...])


def _trend_poly(data: Union[xr.DataArray, xr.Dataset], degree: int = 2) -> dict:
Expand Down Expand Up @@ -140,7 +140,7 @@ def _get_polytrend_timeseries(data: Union[xr.DataArray, xr.Dataset], trend: dict
polynomial_trend.name = (
data.name if data.name is not None else "timeseries_polyfit"
)
return polynomial_trend.transpose(*data.dims)
return polynomial_trend.transpose(*list(data.dims) + [...])


def _subtract_linear_trend(data: Union[xr.DataArray, xr.Dataset], trend: dict):
Expand Down

0 comments on commit bb0189f

Please sign in to comment.