From 3af9f0599e9669f1f04a3a6dfe19234e5a5d1a97 Mon Sep 17 00:00:00 2001 From: Eirik Narjord Date: Sun, 8 Sep 2024 13:03:43 -0400 Subject: [PATCH] get base path programmatically --- src/tools/extract_best_config.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/tools/extract_best_config.py b/src/tools/extract_best_config.py index cd91817ff..1cb1a6ebc 100644 --- a/src/tools/extract_best_config.py +++ b/src/tools/extract_best_config.py @@ -127,9 +127,8 @@ def process_single(file_location, verbose=False): coins = [s.replace("USDT", "") for s in best_d["backtest"]["symbols"]] print_(file_location) full_path = file_location.replace("_all_results.txt", "") + ".json" - full_path = make_get_filepath( - full_path.replace("optimize_results/", "optimize_results_analysis/") - ) + base_path = os.path.split(full_path)[0] + full_path = make_get_filepath(full_path.replace(base_path, base_path + "_analysis/")) dump_config(format_config(best_d), full_path) return best_d