From 98ef33432ae87536c8f5f42b0013074f185ff73e Mon Sep 17 00:00:00 2001 From: Steffen Schneider Date: Wed, 21 Jan 2026 21:35:03 +0100 Subject: [PATCH 1/2] fix readonly issues in pandas --- cebra/integrations/deeplabcut.py | 3 ++- cebra/integrations/sklearn/dataset.py | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cebra/integrations/deeplabcut.py b/cebra/integrations/deeplabcut.py index 4c5b292d..387210ab 100644 --- a/cebra/integrations/deeplabcut.py +++ b/cebra/integrations/deeplabcut.py @@ -169,7 +169,8 @@ def load_data(self, pcutoff: float = 0.6) -> npt.NDArray: pred_xy = [] for i, _ in enumerate(self.dlc_df.index): data = (self.dlc_df.iloc[i].loc[self.scorer].loc[ - self.keypoints_list].to_numpy().reshape(-1, len(dlc_df_coords))) + self.keypoints_list].to_numpy().copy().reshape( + -1, len(dlc_df_coords))) # Handles nan values with interpolation if i > 0 and i < len(self.dlc_df) - 1: diff --git a/cebra/integrations/sklearn/dataset.py b/cebra/integrations/sklearn/dataset.py index 1bb635ec..c7cb269a 100644 --- a/cebra/integrations/sklearn/dataset.py +++ b/cebra/integrations/sklearn/dataset.py @@ -110,6 +110,9 @@ def _parse_data(self, X: npt.NDArray): # one sample is a conservative default here to ensure that sklearn tests # passes with the correct error messages. X = cebra_sklearn_utils.check_input_array(X, min_samples=2) + # Ensure array is writable (pandas 3.0+ may return read-only arrays) + if not X.flags.writeable: + X = X.copy() self.neural = torch.from_numpy(X).float().to(self.device) def _parse_labels(self, labels: Optional[tuple]): @@ -145,6 +148,9 @@ def _parse_labels(self, labels: Optional[tuple]): # Define the index as either continuous or discrete indices, depending # on the dtype in the index array. + # Ensure array is writable (pandas 3.0+ may return read-only arrays) + if not y.flags.writeable: + y = y.copy() if cebra.helper._is_floating(y): y = torch.from_numpy(y).float() if y.dim() == 1: From 2118a813386f2d3b6405888c3f64f2d45fe80cfd Mon Sep 17 00:00:00 2001 From: Steffen Schneider Date: Wed, 21 Jan 2026 21:38:41 +0100 Subject: [PATCH 2/2] upgrade build pipeline --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 76df6056..3eb5bb80 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,7 +27,7 @@ jobs: # We aim to support the versions on pytorch.org # as well as selected previous versions on # https://pytorch.org/get-started/previous-versions/ - torch-version: ["2.6.0", "2.9.1"] + torch-version: ["2.6.0", "2.10.0"] sklearn-version: ["latest"] include: # windows test with standard config