diff --git a/pyproject.toml b/pyproject.toml index 623bdb5fba..7be6a0ef39 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,7 +60,7 @@ extras = [ "clifford.rb_default" = "qiskit_experiments.library.randomized_benchmarking.clifford_synthesis:RBDefaultCliffordSynthesis" [dependency-groups] -formatting = ["black~=22.0"] +formatting = ["black~=25.1"] devbase = [] testing = [ {include-group = "devbase"}, @@ -89,8 +89,7 @@ docs = [ ] linting = [ # Linters - "pylint~=3.3.1", - "astroid~=3.3.4", # Must be kept aligned to what pylint wants + "pylint~=4.0.3", # Test dependencies needed because the test files are linted {include-group = "testing"}, ] diff --git a/qiskit_experiments/curve_analysis/base_curve_analysis.py b/qiskit_experiments/curve_analysis/base_curve_analysis.py index f278839cda..f1493b6fe2 100644 --- a/qiskit_experiments/curve_analysis/base_curve_analysis.py +++ b/qiskit_experiments/curve_analysis/base_curve_analysis.py @@ -166,7 +166,7 @@ def _default_options(cls) -> Options: database as a dedicated entry. This is a list of parameter representation which is either string or ParameterRepr object. If you provide more information other than name, you can specify - ``[ParameterRepr("alpha", "\u03B1", "a.u.")]`` for example. + ``[ParameterRepr("alpha", "\u03b1", "a.u.")]`` for example. The parameter name should be defined in the series definition. Representation should be printable in standard output, i.e. no latex syntax. extra (Dict[str, Any]): A dictionary that is appended to all database entries diff --git a/qiskit_experiments/curve_analysis/utils.py b/qiskit_experiments/curve_analysis/utils.py index 90172a7462..3e8d840fed 100644 --- a/qiskit_experiments/curve_analysis/utils.py +++ b/qiskit_experiments/curve_analysis/utils.py @@ -100,9 +100,9 @@ def _format_val(value): if result.value.std_dev is not None and np.isfinite(result.value.std_dev): s_repr, s_unit = _format_val(result.value.std_dev) if n_unit == s_unit: - value_repr = f" {n_repr} \u00B1 {s_repr}{n_unit}" + value_repr = f" {n_repr} \u00b1 {s_repr}{n_unit}" else: - value_repr = f" {n_repr + n_unit} \u00B1 {s_repr + s_unit}" + value_repr = f" {n_repr + n_unit} \u00b1 {s_repr + s_unit}" else: value_repr = n_repr + n_unit diff --git a/qiskit_experiments/framework/deprecation.py b/qiskit_experiments/framework/deprecation.py index 03ce5b5e2d..a1373765e5 100644 --- a/qiskit_experiments/framework/deprecation.py +++ b/qiskit_experiments/framework/deprecation.py @@ -152,9 +152,9 @@ def _write_deprecation_msg( removal_timeline: str, ) -> tuple[str, Type[DeprecationWarning] | Type[PendingDeprecationWarning]]: if pending: - category: Type[DeprecationWarning] | Type[ + category: Type[DeprecationWarning] | Type[PendingDeprecationWarning] = ( PendingDeprecationWarning - ] = PendingDeprecationWarning + ) deprecation_status = "pending deprecation" removal_desc = f"marked deprecated in a future release, and then removed {removal_timeline}" else: diff --git a/qiskit_experiments/framework/experiment_data.py b/qiskit_experiments/framework/experiment_data.py index dddc308872..8f26d87ff5 100644 --- a/qiskit_experiments/framework/experiment_data.py +++ b/qiskit_experiments/framework/experiment_data.py @@ -1296,7 +1296,10 @@ def add_figures( else: fig_name = figure_names[idx] if not fig_name.endswith(".svg"): - LOG.info("File name %s does not have an SVG extension. A '.svg' is added.") + LOG.info( + "File name %s does not have an SVG extension. A '.svg' is added.", + fig_name, + ) fig_name += ".svg" existing_figure = fig_name in self._figures diff --git a/qiskit_experiments/library/quantum_volume/qv_analysis.py b/qiskit_experiments/library/quantum_volume/qv_analysis.py index 92bc1a207a..8097789fd3 100644 --- a/qiskit_experiments/library/quantum_volume/qv_analysis.py +++ b/qiskit_experiments/library/quantum_volume/qv_analysis.py @@ -214,8 +214,7 @@ def _calc_ideal_heavy_output(probabilities_vector, depth): format_spec = f"{{0:0{depth}b}}" # Keys are bit strings and values are probabilities of observing those strings all_output_prob_ideal = { - format_spec.format(b): float(np.real(probabilities_vector[b])) - for b in range(2**depth) + format_spec.format(b): float(np.real(probabilities_vector[b])) for b in range(2**depth) } median_probabilities = float(np.real(np.median(probabilities_vector))) diff --git a/qiskit_experiments/library/randomized_benchmarking/__init__.py b/qiskit_experiments/library/randomized_benchmarking/__init__.py index dc3c6c94ab..414edca1fc 100644 --- a/qiskit_experiments/library/randomized_benchmarking/__init__.py +++ b/qiskit_experiments/library/randomized_benchmarking/__init__.py @@ -64,14 +64,14 @@ There are a few built-in options for the Clifford synthesis method: -* ``rb_default`` (default) for n<=2 Cliffords this methods will transpile using ``optimization_level=1``. +* ``rb_default`` (default) for n<=2 Cliffords this methods will transpile using ``optimization_level=1``. For 3 or more qubits the behavior is similar but a custom transpilation sequence is used to avoid the transpiler changing the layout of the circuit. * ``clifford_synthesis_method='basis_only'`` will use ``optimization_level=0``. -* ``clifford_synthesis_method='1Q_fixed`` will use a ``rz-sx-rz-sx-rz`` decomposition for the 1Q - Cliffords and the default for the 2Q cliffords. This is most relevant for :class:`.LayerFidelity` +* ``clifford_synthesis_method='1Q_fixed`` will use a ``rz-sx-rz-sx-rz`` decomposition for the 1Q + Cliffords and the default for the 2Q cliffords. This is most relevant for :class:`.LayerFidelity` experiments because it will keep a fixed structure. """ diff --git a/test/database_service/test_fake_service.py b/test/database_service/test_fake_service.py index f1f78803a9..679a6efd00 100644 --- a/test/database_service/test_fake_service.py +++ b/test/database_service/test_fake_service.py @@ -141,7 +141,10 @@ def test_creation(self): def test_query_for_single(self): """Test FakeService methods experiment and analysis_result""" - for (query_method, reference_dict,) in zip( + for ( + query_method, + reference_dict, + ) in zip( [self.service.experiment, self.service.analysis_result], [self.expdict, self.resdict] ): for id_value in range(len(reference_dict)): diff --git a/tox.ini b/tox.ini index 4e44a6d9f0..dcde90dfea 100644 --- a/tox.ini +++ b/tox.ini @@ -40,7 +40,6 @@ commands = python -m build -o .tox/dist [testenv:cover] -basepython = python3 setenv = {[testenv]setenv} PYTHON=coverage3 run --source qiskit_experiments --parallel-mode