diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f7c6b6deab..0f59ee62fa 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -54,7 +54,7 @@ repos: ## Ensure uv.lock is up to date - repo: https://github.com/astral-sh/uv-pre-commit - rev: 0.11.21 + rev: 0.11.23 hooks: - id: uv-lock priority: 0 @@ -112,7 +112,7 @@ repos: ## Format Markdown files with rumdl - repo: https://github.com/rvben/rumdl-pre-commit - rev: v0.2.18 + rev: v0.2.20 hooks: - id: rumdl args: [--fix] @@ -145,7 +145,7 @@ repos: ## Format and lint Python files with ruff - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.17 + rev: v0.15.18 hooks: - id: ruff-format types_or: [python, pyi, jupyter, markdown] @@ -156,7 +156,7 @@ repos: ## Check Python types with ty - repo: https://github.com/astral-sh/ty-pre-commit - rev: v0.0.49 + rev: v0.0.51 hooks: - id: ty args: [--only-dev] diff --git a/bindings/fomac/fomac.cpp b/bindings/fomac/fomac.cpp index 150c0091ee..3714d91c6a 100644 --- a/bindings/fomac/fomac.cpp +++ b/bindings/fomac/fomac.cpp @@ -158,16 +158,16 @@ All authentication parameters are optional and can be provided as keyword argume "Returns the sparse probabilities from the job (typically only " "available from simulator devices)."); - job.def_prop_ro("id", &fomac::Session::Job::getId, "Returns the job ID."); + job.def_prop_ro("id", &fomac::Session::Job::getId, "The job ID."); job.def_prop_ro("program_format", &fomac::Session::Job::getProgramFormat, - "Returns the program format used for the job."); + "The format of the submitted program."); job.def_prop_ro("program", &fomac::Session::Job::getProgram, - "Returns the quantum program submitted for the job."); + "The submitted program."); job.def_prop_ro("num_shots", &fomac::Session::Job::getNumShots, - "Returns the number of shots for the job."); + "The number of shots."); job.def(nb::self == nb::self, nb::sig("def __eq__(self, arg: object, /) -> bool")); diff --git a/python/mqt/core/_compat/optional.py b/python/mqt/core/_compat/optional.py index 48177a49d9..0f717291b3 100644 --- a/python/mqt/core/_compat/optional.py +++ b/python/mqt/core/_compat/optional.py @@ -158,11 +158,7 @@ def disable_locally(self) -> Generator[None, None, None]: @property def module_name(self) -> str: - """Get the module name being tested. - - Returns: - The module name string. - """ + """The name of the module being tested.""" return self._module def __repr__(self) -> str: diff --git a/python/mqt/core/fomac.pyi b/python/mqt/core/fomac.pyi index 5875f6c108..6dfef7e4db 100644 --- a/python/mqt/core/fomac.pyi +++ b/python/mqt/core/fomac.pyi @@ -117,19 +117,19 @@ class Job: @property def id(self) -> str: - """Returns the job ID.""" + """The job ID.""" @property def program_format(self) -> ProgramFormat: - """Returns the program format used for the job.""" + """The format of the submitted program.""" @property def program(self) -> str: - """Returns the quantum program submitted for the job.""" + """The submitted program.""" @property def num_shots(self) -> int: - """Returns the number of shots for the job.""" + """The number of shots.""" def __eq__(self, arg: object, /) -> bool: ... def __ne__(self, arg: object, /) -> bool: ... diff --git a/python/mqt/core/plugins/qiskit/backend.py b/python/mqt/core/plugins/qiskit/backend.py index 1bda6a239c..8c6a009d63 100644 --- a/python/mqt/core/plugins/qiskit/backend.py +++ b/python/mqt/core/plugins/qiskit/backend.py @@ -186,22 +186,22 @@ def __init__(self, device: fomac.Device, provider: QDMIProvider | None = None) - @property def target(self) -> Target: - """Return the Target describing backend capabilities.""" + """The Target describing the capabilities of the backend.""" return self._target @property def provider(self) -> Any | None: # noqa: ANN401 - """Return the provider that created this backend.""" + """The provider that created the backend.""" return self._provider @property def max_circuits(self) -> int | None: - """Maximum number of circuits that can be run in a single job.""" + """The maximum number of circuits that can be run in a single job.""" return None # No limit, processed sequentially @property def options(self) -> Options: - """Return backend options.""" + """The backend options.""" return self._options @classmethod diff --git a/python/mqt/core/plugins/qiskit/estimator.py b/python/mqt/core/plugins/qiskit/estimator.py index 44fd259e22..d0ffd22206 100644 --- a/python/mqt/core/plugins/qiskit/estimator.py +++ b/python/mqt/core/plugins/qiskit/estimator.py @@ -64,7 +64,7 @@ def __init__( @property def backend(self) -> QDMIBackend: - """Return the backend used by this estimator.""" + """The backend used by the estimator.""" return self._backend def run( @@ -136,7 +136,7 @@ def _run_pub(self, pub: EstimatorPub) -> PubResult: # Flatten all combinations of bound circuits and measurement preparations total_circuits_to_run = [] - metadata_map = [] # type: list[tuple[tuple[int, ...], complex, NDArray[np.int_]]] + metadata_map = [] for index in np.ndindex(*bc_bound_circuits.shape): bound_circuit = bc_bound_circuits[index] diff --git a/python/mqt/core/plugins/qiskit/sampler.py b/python/mqt/core/plugins/qiskit/sampler.py index 1283913d91..eb1c8832bf 100644 --- a/python/mqt/core/plugins/qiskit/sampler.py +++ b/python/mqt/core/plugins/qiskit/sampler.py @@ -65,7 +65,7 @@ def __init__( @property def backend(self) -> QDMIBackend: - """Return the backend used by this sampler.""" + """The backend used by the sampler.""" return self._backend def run( diff --git a/test/python/plugins/qiskit/test_mock_backend.py b/test/python/plugins/qiskit/test_mock_backend.py index 97abac98fb..4ebf0bae8e 100644 --- a/test/python/plugins/qiskit/test_mock_backend.py +++ b/test/python/plugins/qiskit/test_mock_backend.py @@ -150,12 +150,12 @@ def __init__(self, num_clbits: int, shots: int) -> None: @property def id(self) -> str: - """Return job ID.""" + """The job ID.""" return self._id @property def num_shots(self) -> int: - """Return number of shots.""" + """The number of shots.""" return self._shots def check(self) -> fomac.Job.Status: