Skip to content

Commit

Permalink
Fix pre-existing linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
njmei committed May 6, 2024
1 parent 392da29 commit 7c80f85
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 34 deletions.
12 changes: 6 additions & 6 deletions src/aibs_informatics_cdk_lib/constructs_/efs/file_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ def __init__(
scope,
id,
vpc=vpc,
file_system_name=self.get_name_with_env(file_system_name)
if file_system_name
else None,
file_system_name=(
self.get_name_with_env(file_system_name) if file_system_name else None
),
allow_anonymous_access=allow_anonymous_access,
enable_automatic_backups=enable_automatic_backups,
encrypted=encrypted,
Expand Down Expand Up @@ -158,9 +158,9 @@ def __init__(
self,
"fs",
env_base=self.env_base,
file_system_name=self.get_name_with_env(file_system_name)
if file_system_name
else None,
file_system_name=(
self.get_name_with_env(file_system_name) if file_system_name else None
),
lifecycle_policy=efs.LifecyclePolicy.AFTER_7_DAYS,
out_of_infrequent_access_policy=efs.OutOfInfrequentAccessPolicy.AFTER_1_ACCESS,
enable_automatic_backups=False,
Expand Down
16 changes: 10 additions & 6 deletions src/aibs_informatics_cdk_lib/constructs_/monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@ def add_function_widgets(
self.dashboard_tools.add_text_widget(f"{group_name} Lambda Functions", 1)

function_names_groups: List[Tuple[str, List[str]]] = [
cast(Tuple[str, List[str]], _)
if isinstance(_, tuple) and len(_) == 2 and isinstance(_[-1], list)
else ("/".join(_), _)
(
cast(Tuple[str, List[str]], _)
if isinstance(_, tuple) and len(_) == 2 and isinstance(_[-1], list)
else ("/".join(_), _)
)
for _ in function_names_groups
]

Expand Down Expand Up @@ -184,9 +186,11 @@ def add_state_machine_widgets(
*grouped_state_machine_names: Union[Tuple[str, List[str]], List[str]],
):
grouped_state_machine_names: List[Tuple[str, List[str]]] = [
cast(Tuple[str, List[str]], _)
if isinstance(_, tuple) and len(_) == 2 and isinstance(_[-1], list)
else ("/".join(_), _)
(
cast(Tuple[str, List[str]], _)
if isinstance(_, tuple) and len(_) == 2 and isinstance(_[-1], list)
else ("/".join(_), _)
)
for _ in grouped_state_machine_names
]
self.dashboard_tools.add_text_widget(f"{group_name} State Machines", 1)
Expand Down
4 changes: 1 addition & 3 deletions src/aibs_informatics_cdk_lib/constructs_/ssm/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ def upload_file(
)

# Store the S3 URI location in an SSM parameter
s3_uri = S3URI.build(
destination_bucket.bucket_name, destination_key, full_validate=False
)
s3_uri = S3URI.build(destination_bucket.bucket_name, destination_key, full_validate=False)

parameter_name = self.env_base.get_ssm_param_name(*param_name_components)
cmd_wrapper_param = ssm.StringParameter(
Expand Down
39 changes: 20 additions & 19 deletions src/aibs_informatics_cdk_lib/stacks/data_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ def code_asset(self) -> CodeAsset:
return self._code_asset

def create_lambda_functions(self) -> None:

# ----------------------------------------------------------
# Data Transfer functions
# ----------------------------------------------------------
Expand Down Expand Up @@ -251,7 +250,6 @@ def create_lambda_functions(self) -> None:
self.add_managed_policies(self.prepare_batch_data_sync_fn.role, "AmazonS3ReadOnlyAccess")

def create_step_functions(self):

start_pass_state = sfn.Pass(
self,
"Data Sync: Start",
Expand Down Expand Up @@ -300,14 +298,16 @@ def create_step_functions(self):
},
)
],
platform_capabilities=["FARGATE"]
if any(
[
isinstance(ce.compute_environment, batch.FargateComputeEnvironment)
for ce in self._job_queue.compute_environments
]
)
else None,
platform_capabilities=(
["FARGATE"]
if any(
[
isinstance(ce.compute_environment, batch.FargateComputeEnvironment)
for ce in self._job_queue.compute_environments
]
)
else None
),
)
)
# fmt: off
Expand Down Expand Up @@ -360,7 +360,6 @@ def create_step_functions(self):
)

def create_rclone_step_function(self):

start_pass_state = sfn.Pass(
self,
"Rclone: Start",
Expand Down Expand Up @@ -413,14 +412,16 @@ def create_rclone_step_function(self):
},
)
],
platform_capabilities=["FARGATE"]
if any(
[
isinstance(ce.compute_environment, batch.FargateComputeEnvironment)
for ce in self._job_queue.compute_environments
]
)
else None,
platform_capabilities=(
["FARGATE"]
if any(
[
isinstance(ce.compute_environment, batch.FargateComputeEnvironment)
for ce in self._job_queue.compute_environments
]
)
else None
),
)
)
# fmt: off
Expand Down

0 comments on commit 7c80f85

Please sign in to comment.