Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#1807)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v4.6.0](pre-commit/pre-commit-hooks@v4.4.0...v4.6.0)
- [github.com/PyCQA/isort: 5.12.0 → 5.13.2](PyCQA/isort@5.12.0...5.13.2)
- [github.com/psf/black: 23.9.1 → 24.4.2](psf/black@23.9.1...24.4.2)
- [github.com/PyCQA/flake8: 6.1.0 → 7.0.0](PyCQA/flake8@6.1.0...7.0.0)
- [github.com/pre-commit/mirrors-prettier: v3.0.3 → v4.0.0-alpha.8](pre-commit/mirrors-prettier@v3.0.3...v4.0.0-alpha.8)
- [github.com/hadialqattan/pycln: v2.2.2 → v2.4.0](hadialqattan/pycln@v2.2.2...v2.4.0)
- [github.com/Yelp/detect-secrets: v1.4.0 → v1.5.0](Yelp/detect-secrets@v1.4.0...v1.5.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Will Cunningham <wjcunningham7@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] and wjcunningham7 authored Jun 10, 2024
1 parent 054a605 commit 215d8d3
Show file tree
Hide file tree
Showing 14 changed files with 77 additions and 68 deletions.
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fail_fast: true

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -30,25 +30,25 @@ repos:
- id: requirements-txt-fixer

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black"]

- repo: https://github.com/psf/black
rev: 23.9.1
rev: 24.4.2
hooks:
- id: black

- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
rev: 7.0.0
hooks:
- id: flake8
args:
- "--max-complexity=50"

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
rev: v4.0.0-alpha.8
hooks:
- id: prettier
types: [yaml, markdown]
Expand All @@ -58,13 +58,13 @@ repos:
)$
- repo: https://github.com/hadialqattan/pycln
rev: v2.2.2
rev: v2.4.0
hooks:
- id: pycln
args: [--config=pyproject.toml]

- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
rev: v1.5.0
hooks:
- id: detect-secrets
args:
Expand Down
1 change: 0 additions & 1 deletion covalent/_file_transfer/strategies/s3_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@


class S3(FileTransferStrategy):

"""
Implements Base FileTransferStrategy class to upload/download files from S3 Bucket.
"""
Expand Down
14 changes: 8 additions & 6 deletions covalent/_shared_files/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions covalent/_shared_files/qinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()`
1 change: 0 additions & 1 deletion covalent/_workflow/qdevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion covalent/_workflow/transportable_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@


class _TOArchive:

"""Archived transportable object."""

def __init__(self, header: bytes, object_string: bytes, data: bytes):
Expand Down
16 changes: 9 additions & 7 deletions covalent/cloud_resource_manager/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down
1 change: 0 additions & 1 deletion covalent/executor/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions covalent/quantum/qserver/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
),
}
)

Expand Down
1 change: 0 additions & 1 deletion covalent_dispatcher/_dal/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class StorageType(Enum):


class Asset(Record[AssetRecord]):

"""Metadata for an object in blob storage"""

model = AssetRecord
Expand Down
70 changes: 41 additions & 29 deletions covalent_ui/api/v1/data_layer/electron_dal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
)
Expand Down Expand Up @@ -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
),
},
}

Expand Down
12 changes: 6 additions & 6 deletions covalent_ui/api/v1/data_layer/summary_dal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
1 change: 0 additions & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ docutils
furo>=2022.6.21
ipython>=8.4.0
ipython_genutils==0.2.0
ipython_genutils==0.2.0
jinja2<3.1.0
myst-parser
nbsphinx
Expand Down

0 comments on commit 215d8d3

Please sign in to comment.