merge_changepoints#
- ethograph.features.changepoints.merge_changepoints(ds)[source]#
Merge all changepoint variables in a dataset into a single boolean mask.
Combines every variable with
attrs["type"] == "changepoints"using logical OR across all non-time dimensions. All changepoint variables must share the sametarget_featureattribute.- Parameters:
ds (xr.Dataset) – Dataset containing one or more changepoint variables.
- Returns:
ds (xr.Dataset) – Copy of the input with a new
"changepoints"DataArray (float 0/1) replacing the individual changepoint variables.target_feature (str) – The shared
target_featureattribute from the input variables.
- Raises:
ValueError – If changepoint variables reference different target features.