From a74a0c29dfa9b8ce291ee608cb0084396e2a2d73 Mon Sep 17 00:00:00 2001 From: Henri Casanova Date: Fri, 13 Sep 2024 21:37:15 -1000 Subject: [PATCH] code cleanup --- wrench/action.py | 2 ++ wrench/batch_compute_service.py | 2 +- wrench/cloud_compute_service.py | 2 +- wrench/compound_job.py | 1 - wrench/compute_action.py | 3 ++- wrench/file_copy_action.py | 1 - wrench/file_delete_action.py | 2 +- wrench/file_registry_service.py | 2 +- wrench/file_write_action.py | 2 +- wrench/sleep_action.py | 1 + wrench/workflow.py | 2 +- 11 files changed, 11 insertions(+), 9 deletions(-) diff --git a/wrench/action.py b/wrench/action.py index 14eea49..523270d 100644 --- a/wrench/action.py +++ b/wrench/action.py @@ -8,6 +8,8 @@ # (at your option) any later version. from wrench.simulation_item import SimulationItem from wrench.compound_job import CompoundJob + + # from enum import Enum diff --git a/wrench/batch_compute_service.py b/wrench/batch_compute_service.py index fd2f924..f79279d 100644 --- a/wrench/batch_compute_service.py +++ b/wrench/batch_compute_service.py @@ -51,4 +51,4 @@ def submit_compound_job(self, compound_job: CompoundJob, service_specific_args: :param service_specific_args: the service-specific arguments :type service_specific_args: dict[str, str] """ - return self.simulation._submit_compound_job(compound_job, self, json.dumps(service_specific_args)) \ No newline at end of file + return self.simulation._submit_compound_job(compound_job, self, json.dumps(service_specific_args)) diff --git a/wrench/cloud_compute_service.py b/wrench/cloud_compute_service.py index 97d095c..c52c49c 100644 --- a/wrench/cloud_compute_service.py +++ b/wrench/cloud_compute_service.py @@ -53,4 +53,4 @@ def destroy_vm(self, vm: VirtualMachine) -> None: :param vm: A virtual machine :type vm: VirtualMachine """ - return self.simulation._destroy_vm(vm) \ No newline at end of file + return self.simulation._destroy_vm(vm) diff --git a/wrench/compound_job.py b/wrench/compound_job.py index 5be89fe..e5e56f1 100644 --- a/wrench/compound_job.py +++ b/wrench/compound_job.py @@ -183,4 +183,3 @@ def __repr__(self) -> str: """ s = f"CompoundJob(name={self.name})" return s - diff --git a/wrench/compute_action.py b/wrench/compute_action.py index 4687b7a..1a6003a 100644 --- a/wrench/compute_action.py +++ b/wrench/compute_action.py @@ -11,13 +11,14 @@ from typing import Tuple + class ComputeAction(Action): """ WRENCH Action class """ + def __init__(self, simulation, compound_job: CompoundJob, name: str, flops: float, ram: float, min_num_cores: int, max_num_cores: int, parallel_model: tuple) -> None: - """ Constructor :param simulation: simulation object diff --git a/wrench/file_copy_action.py b/wrench/file_copy_action.py index 58fa844..843b27d 100644 --- a/wrench/file_copy_action.py +++ b/wrench/file_copy_action.py @@ -19,7 +19,6 @@ class FileCopyAction(Action): def __init__(self, simulation, compound_job: CompoundJob, name: str, file: File, src_storage_service: StorageService, dest_storage_service: StorageService, uses_scratch: bool) -> None: - """ Constructor :param simulation: simulation object diff --git a/wrench/file_delete_action.py b/wrench/file_delete_action.py index 5fe3823..8ecc37f 100644 --- a/wrench/file_delete_action.py +++ b/wrench/file_delete_action.py @@ -16,9 +16,9 @@ class FileDeleteAction(Action): """ WRENCH File Delete Action class """ + def __init__(self, simulation, compound_job: CompoundJob, name: str, file: File, storage_service: StorageService, uses_scratch: bool) -> None: - """ Constructor :param simulation: simulation object diff --git a/wrench/file_registry_service.py b/wrench/file_registry_service.py index b308c96..c39b67b 100644 --- a/wrench/file_registry_service.py +++ b/wrench/file_registry_service.py @@ -17,6 +17,7 @@ class FileRegistryService(SimulationItem): """ WRENCH File Registry Service class """ + def __init__(self, simulation, name: str) -> None: """ Constructor @@ -77,4 +78,3 @@ def __repr__(self) -> str: """ s = f"FileRegistryService(name={self.name})" return s - diff --git a/wrench/file_write_action.py b/wrench/file_write_action.py index 0241265..edd1d46 100644 --- a/wrench/file_write_action.py +++ b/wrench/file_write_action.py @@ -16,9 +16,9 @@ class FileWriteAction(Action): """ WRENCH File Write Action class """ + def __init__(self, simulation, compound_job: CompoundJob, name: str, file: File, storage_service: StorageService, uses_scratch: bool) -> None: - """ Constructor :param simulation: simulation object diff --git a/wrench/sleep_action.py b/wrench/sleep_action.py index bed4bb5..3fe7d1b 100644 --- a/wrench/sleep_action.py +++ b/wrench/sleep_action.py @@ -14,6 +14,7 @@ class SleepAction(Action): """ WRENCH Sleep Action class """ + def __init__(self, simulation, compound_job: CompoundJob, name: str, sleep_time: float) -> None: """ Constructor diff --git a/wrench/workflow.py b/wrench/workflow.py index 2673aa3..537bc57 100644 --- a/wrench/workflow.py +++ b/wrench/workflow.py @@ -11,7 +11,7 @@ from typing import TYPE_CHECKING -if TYPE_CHECKING: # pragma: no cover +if TYPE_CHECKING: # pragma: no cover from wrench.simulation import Simulation from wrench.task import Task from wrench.file import File