Skip to content

Commit 11f1111

Browse files
committed
Fix flake8 warnings
1 parent 8f971cf commit 11f1111

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

investing_algorithm_framework/app/analysis/backtest_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
logger = getLogger("investing_algorithm_framework")
1111

12+
1213
def save_backtests_to_directory(
1314
backtests: List[Backtest],
1415
directory_path: Union[str, Path]
@@ -25,7 +26,6 @@ def save_backtests_to_directory(
2526
None
2627
"""
2728

28-
2929
if not os.path.exists(directory_path):
3030
os.makedirs(directory_path)
3131

investing_algorithm_framework/domain/backtesting/backtest_run.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,14 +256,20 @@ def save(self, directory_path: Union[str, Path]) -> None:
256256

257257
if backtest_start_date.tzinfo is None:
258258
# Naive datetime - treat as UTC
259-
backtest_start_date = backtest_start_date.replace(tzinfo=timezone.utc)
259+
backtest_start_date = backtest_start_date.replace(
260+
tzinfo=timezone.utc
261+
)
260262
else:
261263
# Timezone-aware - convert to UTC
262-
backtest_start_date = backtest_start_date.astimezone(timezone.utc)
264+
backtest_start_date = backtest_start_date.astimezone(
265+
timezone.utc
266+
)
263267

264268
backtest_end_date = self.backtest_end_date
265269
if backtest_end_date.tzinfo is None:
266-
backtest_end_date = backtest_end_date.replace(tzinfo=timezone.utc)
270+
backtest_end_date = backtest_end_date.replace(
271+
tzinfo=timezone.utc
272+
)
267273
else:
268274
backtest_end_date = backtest_end_date.astimezone(timezone.utc)
269275

0 commit comments

Comments
 (0)