From 17d3d441b2b14a20fa7ef5e328892a529de5b1ca Mon Sep 17 00:00:00 2001 From: Rasmus Oersoe Date: Sat, 14 Sep 2024 15:55:09 +0200 Subject: [PATCH] cast list to str --- src/graphnet/data/curated_datamodule.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/graphnet/data/curated_datamodule.py b/src/graphnet/data/curated_datamodule.py index 9f7ff317a..942d91bfa 100644 --- a/src/graphnet/data/curated_datamodule.py +++ b/src/graphnet/data/curated_datamodule.py @@ -404,6 +404,10 @@ def _prepare_args( """ if backend == "sqlite": dataset_path = glob(os.path.join(self.dataset_dir, "*.db")) + # Cast from list to string if just 1 path + if isinstance(dataset_path, list) & len(dataset_path) == 1: + dataset_path: str = dataset_path[0] # type: ignore + if self._mode == "train": train_val = pd.read_parquet( os.path.join(