Skip to content

Commit

Permalink
🧹 Address squeeze deprecated in xarray groupby call
Browse files Browse the repository at this point in the history
glotaran/optimization/data_provider.py:615: UserWarning: The `squeeze` kwarg to GroupBy is being removed.Pass .groupby(..., squeeze=False) to disable squeezing, which is the new default, and to silence this warning.
    ["".join(sub_arr.values) for _, sub_arr in aligned_groups.groupby("global")]
  • Loading branch information
s-weigand committed May 30, 2024
1 parent 03a3549 commit 7ca64ae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion glotaran/optimization/data_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,10 @@ def align_groups(
# as an alternative to the more elegant xarray built-in which is limited to 32 datasets
# aligned_group_labels = aligned_groups.str.join(dim="dataset").data
aligned_group_labels = np.asarray(
["".join(sub_arr.values) for _, sub_arr in aligned_groups.groupby("global")]
tuple(
"".join(sub_arr.to_numpy().flatten())
for _, sub_arr in aligned_groups.groupby("global", squeeze=False)
)
)

group_definitions: dict[str, list[str]] = {}
Expand Down

0 comments on commit 7ca64ae

Please sign in to comment.