Skip to content

Commit 640b79b

Browse files
committed
Fix flake8 warnings
1 parent 7b04c2d commit 640b79b

File tree

6 files changed

+21
-12
lines changed

6 files changed

+21
-12
lines changed

investing_algorithm_framework/app/app.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -529,12 +529,12 @@ def run(
529529
# Upload state if state handler is provided
530530
if self._state_handler is not None:
531531
logger.info("Detected state handler, saving state")
532-
config = self.container.configuration_service().get_config()
532+
config = \
533+
self.container.configuration_service().get_config()
533534
self._state_handler.save(config[RESOURCE_DIRECTORY])
534535
except Exception as e:
535536
logger.error(e)
536537

537-
538538
def reset(self):
539539
self._started = False
540540
self.algorithm.reset()

investing_algorithm_framework/cli/cli.py

+10-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"""
88
CLI for Investing Algorithm Framework
99
10-
This module provides a command-line interface (CLI) for the Investing Algorithm Framework.
10+
This module provides a command-line interface (CLI) for the
11+
Investing Algorithm Framework.
1112
"""
1213

1314

@@ -16,11 +17,13 @@ def cli():
1617
"""CLI for Investing Algorithm Framework"""
1718
pass
1819

20+
1921
@click.command()
2022
@click.option(
2123
'--type',
2224
default="default",
23-
help="Type of app to create. Options are: 'default', 'default-web', 'azure-function'."
25+
help="Type of app to create. "
26+
"Options are: 'default', 'default-web', 'azure-function'."
2427
)
2528
@click.option(
2629
'--path', default=None, help="Path to directory to initialize the app in"
@@ -29,7 +32,8 @@ def cli():
2932
'--replace',
3033
is_flag=True,
3134
default=False,
32-
help="If True, duplicate files will be replaced. If False, files will not be replaced."
35+
help="If True, duplicate files will be replaced."
36+
"If False, files will not be replaced."
3337
)
3438
def init(type, path, replace):
3539
"""
@@ -128,17 +132,18 @@ def deploy_azure_function(
128132
Returns:
129133
None
130134
"""
135+
crg = create_resource_group_if_not_exists
131136
deploy_to_azure_function_command(
132137
resource_group=resource_group,
133138
subscription_id=subscription_id,
134139
storage_account_name=storage_account_name,
135140
container_name=container_name,
136141
deployment_name=deployment_name,
137142
region=region,
138-
create_resource_group_if_not_exists=\
139-
create_resource_group_if_not_exists,
143+
create_resource_group_if_not_exists=crg,
140144
skip_login=skip_login
141145
)
142146

147+
143148
cli.add_command(init)
144149
cli.add_command(deploy_azure_function)

investing_algorithm_framework/cli/deploy_to_azure_function.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import string
66
import asyncio
77
import time
8-
import requests
98

109
from azure.identity import DefaultAzureCredential
1110
from azure.mgmt.resource import ResourceManagementClient
@@ -52,6 +51,7 @@ def ensure_azure_functools():
5251
print("npm install -g azure-functions-core-tools@4 --unsafe-perm true")
5352
exit(1)
5453

54+
5555
async def read_env_file_and_set_function_env_variables(
5656
function_app_name,
5757
storage_connection_string,

investing_algorithm_framework/cli/initialize_app.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def create_file_from_template(template_path, output_path, replace=False):
9999
file.write(template)
100100

101101

102-
def command(path = None, app_type = "default", replace = False):
102+
def command(path=None, app_type="default", replace=False):
103103
"""
104104
Function to create an azure function app skeleton.
105105
@@ -115,7 +115,7 @@ def command(path = None, app_type = "default", replace = False):
115115
None
116116
"""
117117

118-
if path == None:
118+
if path is None:
119119
path = os.getcwd()
120120
else:
121121
# check if directory exists

investing_algorithm_framework/infrastructure/services/azure/state_handler.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ class AzureBlobStorageStateHandler(StateHandler):
1212
"""
1313
A state handler for Azure Blob Storage.
1414
15-
This class provides methods to save and load state to and from Azure Blob Storage.
15+
This class provides methods to save and load state to and from
16+
Azure Blob Storage.
1617
1718
Attributes:
1819
connection_string (str): The connection string for Azure Blob Storage.

investing_algorithm_framework/infrastructure/services/market_service/ccxt_market_service.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,10 @@ def get_ohlcv(
421421
datetime_stamp = datetime_stamp\
422422
.strftime(datetime_format)
423423

424-
data.append([datetime_stamp] + [float(value) for value in candle[1:]])
424+
data.append(
425+
[datetime_stamp] +
426+
[float(value) for value in candle[1:]]
427+
)
425428

426429
sleep(exchange.rateLimit / 1000)
427430

0 commit comments

Comments
 (0)