From 5fb963abbfe555c25c6e0b1f26a053f0727091a7 Mon Sep 17 00:00:00 2001 From: onerobotband <25308655+onerobotband@users.noreply.github.com> Date: Sun, 8 Feb 2026 11:42:31 +0000 Subject: [PATCH 1/2] Fix regex pattern for model folder matching Allows freqai to purge model train folders with non-alphanumeric characters in them (eg. hip3 pairs with hyphen) --- freqtrade/freqai/data_drawer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freqtrade/freqai/data_drawer.py b/freqtrade/freqai/data_drawer.py index 7886bc896..2e381f981 100644 --- a/freqtrade/freqai/data_drawer.py +++ b/freqtrade/freqai/data_drawer.py @@ -446,7 +446,7 @@ class FreqaiDataDrawer: model_folders = [x for x in self.full_path.iterdir() if x.is_dir()] - pattern = re.compile(r"sub-train-(\w+)_(\d{10})") + pattern = re.compile(r"sub-train-([^_]+)_(\d{10})") delete_dict: dict[str, Any] = {} From c5697c7d68070e6a166ee2396029550f52694e4e Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 9 Feb 2026 06:52:56 +0100 Subject: [PATCH 2/2] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- freqtrade/freqai/data_drawer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freqtrade/freqai/data_drawer.py b/freqtrade/freqai/data_drawer.py index 2e381f981..5afa5a74a 100644 --- a/freqtrade/freqai/data_drawer.py +++ b/freqtrade/freqai/data_drawer.py @@ -446,7 +446,7 @@ class FreqaiDataDrawer: model_folders = [x for x in self.full_path.iterdir() if x.is_dir()] - pattern = re.compile(r"sub-train-([^_]+)_(\d{10})") + pattern = re.compile(r"^sub-train-(.+)_(\d{10})$") delete_dict: dict[str, Any] = {}