Skip to content

Commit e6a7751

Browse files
committed
Fix flake8 issues
1 parent 311b3d0 commit e6a7751

File tree

11 files changed

+301
-587
lines changed

11 files changed

+301
-587
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,4 @@ bumpversion.egg-info/
148148
**/backtest_data/*
149149
*/backtest_reports/
150150
**/backtest_reports/*
151+
.vscode/

investing_algorithm_framework/deployment/azure/azure_functions.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@
44
from azure.mgmt.resource import ResourceManagementClient
55
from azure.mgmt.storage import StorageManagementClient
66
from azure.mgmt.web import WebSiteManagementClient
7-
from zipfile import ZipFile
87
import shutil
98

9+
1010
def deploy_to_azure_functions(azure_credentials_json, azure_function_path):
1111
"""
1212
This function deploys a Python function app to Azure Functions.
1313
1414
Parameters:
15-
- azure_credentials_json (str): Path to the Azure credentials JSON file.
16-
- azure_function_path (str): Path to the Python function app directory.
15+
- azure_credentials_json (str): Path to the Azure credentials
16+
JSON file.
17+
- azure_function_path (str): Path to the Python function
18+
app directory.
1719
1820
Returns:
1921
None
@@ -28,7 +30,6 @@ def deploy_to_azure_functions(azure_credentials_json, azure_function_path):
2830
LOCATION = "eastus"
2931
STORAGE_ACCOUNT_NAME = "mystorageaccount123"
3032
FUNCTION_APP_NAME = "my-python-function-app"
31-
APP_SERVICE_PLAN_NAME = "myAppServicePlan"
3233

3334
# Authenticate using DefaultAzureCredential
3435
credential = DefaultAzureCredential()
@@ -56,13 +57,22 @@ def deploy_to_azure_functions(azure_credentials_json, azure_function_path):
5657
# Create Function App (with a Consumption Plan)
5758
site_config = {
5859
"location": LOCATION,
59-
"server_farm_id": f"/subscriptions/{SUBSCRIPTION_ID}/resourceGroups/{RESOURCE_GROUP_NAME}/providers/Microsoft.Web/serverfarms/{APP_SERVICE_PLAN_NAME}",
60+
"server_farm_id": f"/subscriptions/{SUBSCRIPTION_ID}" +
61+
"/resourceGroups" +
62+
"/{RESOURCE_GROUP_NAME}/providers/Microsoft.Web/" +
63+
"serverfarms/{APP_SERVICE_PLAN_NAME}",
6064
"reserved": True, # This is necessary for Linux-based function apps
6165
"site_config": {
6266
"app_settings": [
63-
{"name": "FUNCTIONS_WORKER_RUNTIME", "value": "python"},
64-
{"name": "AzureWebJobsStorage",
65-
"value": f"DefaultEndpointsProtocol=https;AccountName={STORAGE_ACCOUNT_NAME};AccountKey=<account_key>"},
67+
{
68+
"name": "FUNCTIONS_WORKER_RUNTIME", "value": "python"
69+
},
70+
{
71+
"name": "AzureWebJobsStorage",
72+
"value": "DefaultEndpointsProtocol=https;" + \
73+
f"AccountName={STORAGE_ACCOUNT_NAME}" + \
74+
";AccountKey=account_key>",
75+
}
6676
]
6777
},
6878
"kind": "functionapp",

investing_algorithm_framework/domain/__init__.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
load_backtest_report, convert_polars_to_pandas, \
3131
csv_to_list, StoppableThread, pretty_print_backtest_reports_evaluation, \
3232
pretty_print_backtest, load_csv_into_dict, load_backtest_reports
33-
from .graphs import create_prices_graph, create_ema_graph, create_rsi_graph, create_line_graph
3433
from .metrics import get_price_efficiency_ratio
3534

3635
__all__ = [
@@ -116,11 +115,7 @@
116115
"RoundingService",
117116
"BacktestDateRange",
118117
"load_backtest_report",
119-
"create_prices_graph",
120-
"create_ema_graph",
121-
"create_rsi_graph",
122118
"get_price_efficiency_ratio",
123-
"create_line_graph",
124119
"convert_polars_to_pandas",
125120
"DateRange"
126121
]

0 commit comments

Comments
 (0)