From ac5f76ddc2dd22ca573c243987433b227abaf028 Mon Sep 17 00:00:00 2001 From: Tom Andersson Date: Wed, 11 Oct 2023 16:21:35 +0100 Subject: [PATCH] Fix elwise comparison in sampling strategy check --- deepsensor/data/loader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deepsensor/data/loader.py b/deepsensor/data/loader.py index feb7f57e..3bae6387 100644 --- a/deepsensor/data/loader.py +++ b/deepsensor/data/loader.py @@ -1010,8 +1010,8 @@ def sample_variable(var, sampling_strat, seed): if split_frac < 0 or split_frac > 1: raise ValueError(f"split_frac must be between 0 and 1, got {split_frac}") if self.links is None: - b1 = any([strat in ["split", "gapfill"] for strat in context_sampling]) - b2 = any([strat in ["split", "gapfill"] for strat in target_sampling]) + b1 = any([strat == _ for _ in ["split", "gapfill"] for strat in context_sampling]) + b2 = any([strat == _ for _ in ["split", "gapfill"] for strat in target_sampling]) if b1 or b2: raise ValueError( "If using 'split' or 'gapfill' sampling strategies, the context and target "