Skip to content

Commit 2f4e84a

Browse files
committed
Fix dir path recursion
1 parent 861791c commit 2f4e84a

File tree

1 file changed

+5
-5
lines changed
  • investing_algorithm_framework/domain/backtesting

1 file changed

+5
-5
lines changed

investing_algorithm_framework/domain/backtesting/backtest.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,11 @@ def save(self, directory_path: Union[str, Path]) -> None:
292292
run_path = os.path.join(directory_path, "runs")
293293
os.makedirs(run_path, exist_ok=True)
294294

295-
for bm in self.backtest_runs:
296-
dir_name = bm.create_directory_name()
297-
run_path = os.path.join(run_path, dir_name)
298-
os.makedirs(run_path, exist_ok=True)
299-
bm.save(run_path)
295+
for br in self.backtest_runs:
296+
dir_name = br.create_directory_name()
297+
destination_run_path = os.path.join(run_path, dir_name)
298+
os.makedirs(destination_run_path, exist_ok=True)
299+
br.save(destination_run_path)
300300

301301
# Save combined backtest metrics if available
302302
if self.backtest_summary:

0 commit comments

Comments
 (0)