Skip to content

Commit

Permalink
Update comment about .where concatenating time din
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvothecoder committed Oct 23, 2024
1 parent acf1ab9 commit 4c3e8dd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions xcdat/temporal.py
Original file line number Diff line number Diff line change
Expand Up @@ -1286,9 +1286,8 @@ def _drop_incomplete_seasons(self, ds: xr.Dataset) -> xr.Dataset:
elif len(indexes_to_drop) > 0:
# The dataset needs to be split into a dataset with and a dataset
# without the time dimension because the xarray `.where()` method
# concatenates the time dimension to non-time dimension data vars,
# which is an undesired behavior.
# FIXME: Figure out if this code block is still necessary
# adds the time dimension to non-time dimension data vars when
# broadcasting, which is a behavior we do not desire.
# https://github.com/pydata/xarray/issues/1234
# https://github.com/pydata/xarray/issues/8796#issuecomment-1974878267
ds_no_time = ds.get([v for v in ds.data_vars if self.dim not in ds[v].dims]) # type: ignore
Expand Down

0 comments on commit 4c3e8dd

Please sign in to comment.