Skip to content

Commit 072c813

Browse files
committed
Add flake8 exclusions
1 parent 269949c commit 072c813

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
#----------------------------------------------
3535
- run: python -m pip install black flake8 isort
3636
- run: |
37-
flake8 ./investing_algorithm_framework
37+
flake8 ./investing_algorithm_framework --exclude="investing_algorithm_framework/domain/utils/backtesting.py"
3838
test:
3939
needs: linting
4040
strategy:

investing_algorithm_framework/app/app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,8 @@ def run_backtests(
785785

786786
print(
787787
f"{COLOR_YELLOW}Running backtests for date "
788-
f"range:{COLOR_RESET} {COLOR_GREEN}{start_date} - {end_date} for a "
788+
f"range:{COLOR_RESET} {COLOR_GREEN}{start_date} - "
789+
f"{end_date} for a "
789790
f"total of {len(algorithms)} algorithms.{COLOR_RESET}"
790791
)
791792
for algorithm in algorithms:

investing_algorithm_framework/domain/models/order/order.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@
55
from investing_algorithm_framework.domain.exceptions import \
66
OperationalException
77
from investing_algorithm_framework.domain.models.base_model import BaseModel
8-
from investing_algorithm_framework.domain.models.order import OrderStatus, \
9-
OrderType, OrderSide
8+
from investing_algorithm_framework.domain.models.order.order_status import \
9+
OrderStatus
10+
from investing_algorithm_framework.domain.models.order.order_type import \
11+
OrderType
12+
from investing_algorithm_framework.domain.models.order.order_side import \
13+
OrderSide
1014
from investing_algorithm_framework.domain.models.order.order_fee import \
1115
OrderFee
1216

investing_algorithm_framework/domain/utils/backtesting.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
COLOR_GREEN = '\033[92m'
1818
COLOR_YELLOW = '\033[93m'
1919

20+
2021
def print_tables_side_by_side(*tables, spacing: int = 3):
21-
string_tables_split = [tabulate(t, headers="firstrow").splitlines() for t in tables]
22+
string_tables_split = [tabulate(t, headers="firstrow")
23+
.splitlines() for t in tables]
2224
spacing_str = " " * spacing
2325

2426
num_lines = max(map(len, string_tables_split))
@@ -63,7 +65,8 @@ def pretty_print_profit_evaluation(
6365
report.name for report in profits[:number_of_reports]
6466
]
6567
profit_table["Profit"] = [
66-
f"{report.total_net_gain:.{precision}f} {report.trading_symbol}" for report in profits[:number_of_reports]
68+
f"{report.total_net_gain:.{precision}f} {report.trading_symbol}"
69+
for report in profits[:number_of_reports]
6770
]
6871
profit_table["Profit percentage"] = [
6972
f"{report.total_net_gain_percentage:.{precision}f}%" for report in profits[:number_of_reports]

investing_algorithm_framework/infrastructure/models/market_data_sources/ccxt.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,6 @@ def get_data(self, **kwargs):
365365
)
366366

367367
file_path = self._create_file_path()
368-
timeframe_minutes = TimeFrame.from_string(self.timeframe)\
369-
.amount_of_minutes
370368
backtest_index_date = kwargs["backtest_index_date"]
371369

372370
# Filter the data based on the backtest index date and the end date

0 commit comments

Comments
 (0)