From 2ad5fa82b959984c17a871e378cf46254ea86280 Mon Sep 17 00:00:00 2001 From: Raffi Khatchadourian Date: Fri, 2 Aug 2024 06:06:55 -0400 Subject: [PATCH] Raise an exception if the pickle file dir is empty. Currently, the processing just ends very quickly, which can be confusing. More than likely, the user was trying to enter some files to process. --- data.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/data.py b/data.py index e9b238c..7df3348 100644 --- a/data.py +++ b/data.py @@ -9,6 +9,10 @@ class Data: def __init__(self, dir_path): self.files = list(utils.find_files_by_extensions(dir_path, ['.pickle'])) + + if len(self.files) == 0: + raise ValueError("No pickle files found to analyze.") + self.file_dict = { 'train': self.files[:int(len(self.files) * 0.8)], 'eval': self.files[int(len(self.files) * 0.8): int(len(self.files) * 0.9)],