Skip to content

Commit

Permalink
convert pandas to numpy datetime to fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinaHutter committed Oct 25, 2024
1 parent 0aa7ca3 commit c81933c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def aggregate_temporal(
labels_nans = labels_nans[~mask]

intervals_flat = np.unique(intervals_flat)
data[t] = data[t].values.astype(float)
t_coords = data[t].values.astype(str)
data[t] = np.array(t_coords, dtype="datetime64[s]").astype(float)
grouped_data = data.groupby_bins(t, bins=intervals_flat)
positional_parameters = {"data": 0}
groups = grouped_data.reduce(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_aggregate.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"temporal_extent,intervals,labels, expected",
[
(
["2018-01-01", "2019-01-01"],
["2018-01-01T00:00:00", "2019-01-01T00:00:00"],
[
["2018-01-01T12:00:00", "2018-06-01T12:00:00"],
["2018-07-01T12:00:00", "2018-12-01T12:00:00"],
Expand Down

0 comments on commit c81933c

Please sign in to comment.