From 5a2cfbbfd3ab604e1383ebf5d1f010fe672b118f Mon Sep 17 00:00:00 2001 From: domonik Date: Wed, 21 Aug 2024 13:43:41 +0200 Subject: [PATCH] silences deprecation warning --- RAPDOR/datastructures.py | 2 +- RAPDOR/tests/test_datastructures.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/RAPDOR/datastructures.py b/RAPDOR/datastructures.py index 4188096..53246c9 100644 --- a/RAPDOR/datastructures.py +++ b/RAPDOR/datastructures.py @@ -277,7 +277,7 @@ def _set_design_and_array(self): self.array = array self.internal_design_matrix = tmp indices = self.internal_design_matrix.groupby("Treatment", group_keys=True, observed=False).apply( - lambda x: list(x.index)) + lambda x: list(x.index), include_groups=False) self.indices = tuple(np.asarray(index) for index in indices) p = ~np.any(self.array, axis=-1) diff --git a/RAPDOR/tests/test_datastructures.py b/RAPDOR/tests/test_datastructures.py index 55eaecc..1ba5272 100644 --- a/RAPDOR/tests/test_datastructures.py +++ b/RAPDOR/tests/test_datastructures.py @@ -70,11 +70,11 @@ def multi_intensities(intensities): def drop_replicates(design, rnase_rep, ctrl_rep): if rnase_rep > 0: - rnase = design[design["Treatment"] == "RNase"].groupby("Replicate").apply(lambda x: list(x.index)).sample(n=rnase_rep).sum() + rnase = design[design["Treatment"] == "RNase"].groupby("Replicate").apply(lambda x: list(x.index), include_groups=False).sample(n=rnase_rep).sum() else: rnase = [] if ctrl_rep > 0: - ctrl = design[design["Treatment"] == "Control"].groupby("Replicate").apply(lambda x: list(x.index)).sample(n=ctrl_rep).sum() + ctrl = design[design["Treatment"] == "Control"].groupby("Replicate").apply(lambda x: list(x.index), include_groups=False).sample(n=ctrl_rep).sum() else: ctrl = [] rnase = design.loc[rnase]