From da79e6db7ec9635d39ec74503217fff5e7f03c21 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidl Date: Thu, 26 Sep 2024 20:44:22 +0200 Subject: [PATCH] [BUG] fix training data check for TSDA dataset loader (#2100) * fix: training data check for TSDA dataset loader * use pandas nulls-check instead of numpys --- aeon/datasets/_tsad_data_loaders.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aeon/datasets/_tsad_data_loaders.py b/aeon/datasets/_tsad_data_loaders.py index 70cef49b73..7a8d373b75 100644 --- a/aeon/datasets/_tsad_data_loaders.py +++ b/aeon/datasets/_tsad_data_loaders.py @@ -147,12 +147,13 @@ def load_anomaly_detection( df_meta = df_meta.set_index(["collection_name", "dataset_name"]) metadata = df_meta.loc[name] if split.lower() == "train": - if metadata["train_path"] is None or np.isnan(metadata["train_path"]): + train_path = metadata["train_path"] + if train_path is None or pd.isnull(train_path): raise ValueError( f"Dataset {name} does not have a training partition. Only " "`split='test'` is supported." ) - dataset_path = data_folder / metadata["train_path"] + dataset_path = data_folder / train_path else: dataset_path = data_folder / metadata["test_path"]