Skip to content

Commit

Permalink
avoid datetime median issue
Browse files Browse the repository at this point in the history
  • Loading branch information
d-chambers committed Nov 3, 2024
1 parent 0e9d2a5 commit e4835ca
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
2 changes: 1 addition & 1 deletion dascore/proc/aggregate.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ def _maybe_handle_datatypes(func, data):
def aggregate(
patch: PatchType,
dim: str | Sequence[str] | None = None,
dim_reduce: str | Callable = "empty",
method: str | Callable = "mean",
dim_reduce: str | Callable = "empty",
) -> PatchType:
"""
Aggregate values along a specified dimension.
Expand Down
7 changes: 0 additions & 7 deletions tests/test_proc/test_aggregate.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,6 @@ def test_dim_reduce_first(self, random_patch):
assert len(new_time) == 1
assert new_time[0] == out.get_array("time")[0]

def test_dim_reduce_median(self, random_patch):
"""Ensure the median values also work on dim reduction."""
new_time = dc.to_timedelta64(random_patch.get_array("time"))
patch = random_patch.update_coords(time=new_time)
out = patch.aggregate(dim="time", method="mean", dim_reduce="median")
assert "time" in out.dims

def test_dim_reduce_distance(self, random_patch):
"""Ensure non-time dims also work."""
out = random_patch.aggregate(dim="distance", method="mean", dim_reduce=np.var)
Expand Down

0 comments on commit e4835ca

Please sign in to comment.