Skip to content

Commit 5f3c280

Browse files
Organize ouput of bld folder into data and backtest folders. Delete a duplicated test case.
1 parent deaf7f0 commit 5f3c280

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

src/backtest_bay/backtest/task_backtest.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
id_backtest = (
1616
f"{row.stock}_{row.start_date}_{row.end_date}_" f"{row.interval}_{row.strategy}"
1717
)
18-
19-
data_path = BLD / f"{row.stock}_{row.start_date}_{row.end_date}_{row.interval}.pkl"
20-
produces = BLD / f"{id_backtest}.pkl"
18+
data_path = (
19+
BLD / "data" / f"{row.stock}_{row.start_date}_{row.end_date}_{row.interval}.pkl"
20+
)
21+
produces = BLD / "backtest" / f"{id_backtest}.pkl"
2122
strategy = row.strategy
2223

2324
@pytask.task(id=id_backtest)

src/backtest_bay/data/task_download_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
for row in data_to_download.itertuples(index=False):
1313
id_download = f"{row.stock}_{row.start_date}_{row.end_date}_{row.interval}"
1414

15-
produces = BLD / f"{id_download}.pkl"
15+
produces = BLD / "data" / f"{id_download}.pkl"
1616

1717
@pytask.task(id=id_download)
1818
def task_download_data(depends_on=scripts, produces=produces, param=row):

tests/backtest/test_backtest_signals.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,6 @@ def test_is_buy_trade_affordable_not_enough_cash():
9090
assert not affordable
9191

9292

93-
def test_is_buy_trade_affordable_not_enough_shares():
94-
"""Test buying when buy shares are less than 1."""
95-
affordable = _is_buy_trade_affordable(buy_shares=0.1, cost=10, cash=9)
96-
assert not affordable
97-
98-
9993
# tests for _execute_buy
10094
def test_execute_buy_enough_cash():
10195
"""Test buying when there is enough cash to purchase at least one share."""

0 commit comments

Comments
 (0)