diff --git a/covalent/_file_transfer/strategies/s3_strategy.py b/covalent/_file_transfer/strategies/s3_strategy.py index 7431ad03f..5011d2744 100644 --- a/covalent/_file_transfer/strategies/s3_strategy.py +++ b/covalent/_file_transfer/strategies/s3_strategy.py @@ -27,7 +27,6 @@ class S3(FileTransferStrategy): - """ Implements Base FileTransferStrategy class to upload/download files from S3 Bucket. """ diff --git a/covalent/_shared_files/defaults.py b/covalent/_shared_files/defaults.py index a1b9983a4..aef61086d 100644 --- a/covalent/_shared_files/defaults.py +++ b/covalent/_shared_files/defaults.py @@ -67,9 +67,9 @@ def get_default_sdk_config(): + "/covalent/dispatches" ), "task_packing": "true" if os.environ.get("COVALENT_ENABLE_TASK_PACKING") else "false", - "multistage_dispatch": "false" - if os.environ.get("COVALENT_DISABLE_MULTISTAGE_DISPATCH") == "1" - else "true", + "multistage_dispatch": ( + "false" if os.environ.get("COVALENT_DISABLE_MULTISTAGE_DISPATCH") == "1" else "true" + ), "results_dir": os.environ.get( "COVALENT_RESULTS_DIR" ) # COVALENT_RESULTS_DIR is where the client downloads workflow artifacts during get_result() which is different from COVALENT_DATA_DIR @@ -156,9 +156,11 @@ def get_default_workflow_data_config(): def get_default_ui_config(): return { "address": "localhost", - "port": int(os.environ.get("COVALENT_SVC_PORT")) - if os.environ.get("COVALENT_SVC_PORT") - else 48008, + "port": ( + int(os.environ.get("COVALENT_SVC_PORT")) + if os.environ.get("COVALENT_SVC_PORT") + else 48008 + ), "dev_port": 49009, "log_dir": os.environ.get("COVALENT_LOGDIR") or os.path.join( diff --git a/covalent/_shared_files/qinfo.py b/covalent/_shared_files/qinfo.py index 4c93bfc2f..67568b9d2 100644 --- a/covalent/_shared_files/qinfo.py +++ b/covalent/_shared_files/qinfo.py @@ -54,9 +54,9 @@ class QElectronInfo(BaseModel): description: Optional[str] = None device_name: str # name of the original device, e.g. "default.qubit" device_import_path: str # used to inherit type converters and other methods - device_shots: Union[ - None, int, Sequence[int], Sequence[Union[int, Sequence[int]]] - ] = None # optional default for execution devices + device_shots: Union[None, int, Sequence[int], Sequence[Union[int, Sequence[int]]]] = ( + None # optional default for execution devices + ) device_shots_type: Any = None device_wires: int # this can not be reliably inferred from tapes alone pennylane_active_return: bool # client-side status of `pennylane.active_return()` diff --git a/covalent/_workflow/qdevice.py b/covalent/_workflow/qdevice.py index 418c167f9..a9d26ea58 100644 --- a/covalent/_workflow/qdevice.py +++ b/covalent/_workflow/qdevice.py @@ -28,7 +28,6 @@ class QEDevice(QubitDevice): - """ The purpose of this device is to redirect circuit execution through Covalent's Quantum Executors and to enable asynchronous execution. diff --git a/covalent/_workflow/transportable_object.py b/covalent/_workflow/transportable_object.py index 4ba789662..7dcb4e073 100644 --- a/covalent/_workflow/transportable_object.py +++ b/covalent/_workflow/transportable_object.py @@ -32,7 +32,6 @@ class _TOArchive: - """Archived transportable object.""" def __init__(self, header: bytes, object_string: bytes, data: bytes): diff --git a/covalent/cloud_resource_manager/core.py b/covalent/cloud_resource_manager/core.py index eb63bb604..2d31a47a6 100644 --- a/covalent/cloud_resource_manager/core.py +++ b/covalent/cloud_resource_manager/core.py @@ -98,13 +98,15 @@ def get_plugin_settings( infra_settings = ExecutorInfraDefaults.schema()["properties"] settings_dict = { - key: { - "required": "No", - "default": value["default"], - "value": value["default"], - } - if "default" in value - else {"required": "Yes", "default": None, "value": None} + key: ( + { + "required": "No", + "default": value["default"], + "value": value["default"], + } + if "default" in value + else {"required": "Yes", "default": None, "value": None} + ) for key, value in plugin_settings.items() } for key, value in infra_settings.items(): diff --git a/covalent/executor/quantum_plugins/qiskit_plugin/devices_base.py b/covalent/executor/quantum_plugins/qiskit_plugin/devices_base.py index 744c3034e..bb5f850f6 100644 --- a/covalent/executor/quantum_plugins/qiskit_plugin/devices_base.py +++ b/covalent/executor/quantum_plugins/qiskit_plugin/devices_base.py @@ -131,7 +131,6 @@ def post_process_all(self, *args) -> Tuple[Any, List[dict]]: class QiskitSamplerDevice(_PennylaneQiskitDevice): - """ A base class for devices that use the Sampler primitive. """ diff --git a/covalent/executor/schemas.py b/covalent/executor/schemas.py index 40b4c732e..f8a5f1bd1 100644 --- a/covalent/executor/schemas.py +++ b/covalent/executor/schemas.py @@ -69,7 +69,6 @@ class TaskSpec(BaseModel): class ResourceMap(BaseModel): - """Map resource identifiers to URIs. The resources may be loaded in the compute environment from these diff --git a/covalent/quantum/qserver/core.py b/covalent/quantum/qserver/core.py index 2bc31c913..ac7e4b668 100644 --- a/covalent/quantum/qserver/core.py +++ b/covalent/quantum/qserver/core.py @@ -348,9 +348,9 @@ def get_results(self, batch_id): { "execution_time": sub_result_obj.execution_time, "result": sub_result_obj.results if executor.persist_data else None, - "result_metadata": sub_result_obj.metadata - if executor.persist_data - else None, + "result_metadata": ( + sub_result_obj.metadata if executor.persist_data else None + ), } ) diff --git a/covalent_dispatcher/_dal/asset.py b/covalent_dispatcher/_dal/asset.py index d524dc389..146b47624 100644 --- a/covalent_dispatcher/_dal/asset.py +++ b/covalent_dispatcher/_dal/asset.py @@ -56,7 +56,6 @@ class StorageType(Enum): class Asset(Record[AssetRecord]): - """Metadata for an object in blob storage""" model = AssetRecord diff --git a/covalent_ui/api/v1/data_layer/electron_dal.py b/covalent_ui/api/v1/data_layer/electron_dal.py index 9e10ee154..b064a25a3 100644 --- a/covalent_ui/api/v1/data_layer/electron_dal.py +++ b/covalent_ui/api/v1/data_layer/electron_dal.py @@ -105,9 +105,11 @@ def get_jobs( "job_id": circuit["circuit_id"], "start_time": circuit["save_time"], "executor": circuit["result_metadata"]["executor_name"], - "status": "COMPLETED" - if len(circuit["result"]) != 0 and len(circuit["result_metadata"]) != 0 - else "RUNNING", + "status": ( + "COMPLETED" + if len(circuit["result"]) != 0 and len(circuit["result_metadata"]) != 0 + else "RUNNING" + ), }, jobs.values(), ) @@ -164,39 +166,49 @@ def get_job_detail(self, dispatch_id, electron_id, job_id) -> JobDetailsResponse selected_job["result"] = str(selected_job["result"])[1:-1] job_overview = { "overview": { - "job_name": selected_job["circuit_name"] - if "circuit_name" in selected_job - else None, - "backend": selected_job["result_metadata"]["executor_backend_name"] - if "result_metadata" in selected_job - and "executor_backend_name" in selected_job["result_metadata"] - else None, - "time_elapsed": selected_job["execution_time"] - if "execution_time" in selected_job - else None, + "job_name": ( + selected_job["circuit_name"] if "circuit_name" in selected_job else None + ), + "backend": ( + selected_job["result_metadata"]["executor_backend_name"] + if "result_metadata" in selected_job + and "executor_backend_name" in selected_job["result_metadata"] + else None + ), + "time_elapsed": ( + selected_job["execution_time"] + if "execution_time" in selected_job + else None + ), "result": selected_job["result"] if "result" in selected_job else None, - "status": "COMPLETED" - if len(selected_job["result"]) != 0 - and len(selected_job["result_metadata"]) != 0 - else "RUNNING", - "start_time": selected_job["save_time"] - if "save_time" in selected_job - else None, + "status": ( + "COMPLETED" + if len(selected_job["result"]) != 0 + and len(selected_job["result_metadata"]) != 0 + else "RUNNING" + ), + "start_time": ( + selected_job["save_time"] if "save_time" in selected_job else None + ), }, "circuit": { "total_qbits": None, "depth": None, - "circuit_diagram": selected_job["circuit_diagram"] - if "circuit_diagram" in selected_job - else None, + "circuit_diagram": ( + selected_job["circuit_diagram"] + if "circuit_diagram" in selected_job + else None + ), }, "executor": { - "name": selected_job["qexecutor"]["name"] - if "qexecutor" in selected_job and "name" in selected_job["qexecutor"] - else None, - "executor": str(selected_job["qexecutor"]) - if "qexecutor" in selected_job - else None, + "name": ( + selected_job["qexecutor"]["name"] + if "qexecutor" in selected_job and "name" in selected_job["qexecutor"] + else None + ), + "executor": ( + str(selected_job["qexecutor"]) if "qexecutor" in selected_job else None + ), }, } diff --git a/covalent_ui/api/v1/data_layer/summary_dal.py b/covalent_ui/api/v1/data_layer/summary_dal.py index 892db0406..f9da85635 100644 --- a/covalent_ui/api/v1/data_layer/summary_dal.py +++ b/covalent_ui/api/v1/data_layer/summary_dal.py @@ -230,12 +230,12 @@ def get_summary_overview(self) -> Lattice: return DispatchDashBoardResponse( total_jobs_running=total_jobs_running[0], total_jobs_completed=total_jobs_done[0], - latest_running_task_status=last_ran_job_status[0] - if last_ran_job_status is not None - else None, - total_dispatcher_duration=int(run_time[0]) - if run_time is not None and run_time[0] is not None - else 0, + latest_running_task_status=( + last_ran_job_status[0] if last_ran_job_status is not None else None + ), + total_dispatcher_duration=( + int(run_time[0]) if run_time is not None and run_time[0] is not None else 0 + ), total_jobs_failed=total_failed[0], total_jobs_cancelled=total_jobs_cancelled[0], total_jobs_new_object=total_jobs_new_object[0],