Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate warning box in docs #8600

Closed
wants to merge 54 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
2dd1af7
deprecate_arguments and deprecate_function: add a deprecation note box
1ucian0 Aug 28, 2022
c77d833
Merge branch 'main' into deprecate_docstrings
1ucian0 Sep 4, 2022
82a1111
linting
1ucian0 Sep 4, 2022
8efdcf6
testing
1ucian0 Sep 4, 2022
51e7e72
testing docstrings
1ucian0 Sep 4, 2022
18bd25d
deprecate parameter in the parameter description
1ucian0 Sep 5, 2022
f24b3ea
Merge branch 'main' into deprecate_docstrings
1ucian0 Sep 6, 2022
4fc029c
deprecate_arguments
1ucian0 Sep 6, 2022
da68919
implementing all the deprecate_function
1ucian0 Sep 7, 2022
071fa5d
ups. testing
1ucian0 Sep 7, 2022
397e336
implement deprecate_arguments around
1ucian0 Sep 7, 2022
b873393
conflict and in-place
1ucian0 Sep 8, 2022
fbc2d74
ref to pep-0257
1ucian0 Sep 8, 2022
def73fc
deprecation message on top of Args
1ucian0 Sep 8, 2022
91c821d
avoiding being ate by Lev
1ucian0 Sep 8, 2022
c01fa65
Merge branch 'main' of github.com:Qiskit/qiskit-terra into deprecate_…
1ucian0 Sep 22, 2022
e5a22bc
docstring
1ucian0 Sep 22, 2022
ab7277a
docstring
1ucian0 Sep 22, 2022
e5feaf8
split tests
1ucian0 Sep 22, 2022
25c3a1e
Merge branch 'main' of github.com:Qiskit/qiskit-terra into deprecate_…
1ucian0 Sep 28, 2022
427a334
raise warning instead of exception
1ucian0 Sep 28, 2022
e67ce35
conflict solving
1ucian0 Oct 24, 2022
c9d4e38
lint
1ucian0 Oct 25, 2022
a7f0e0b
base_estimator
1ucian0 Oct 25, 2022
d48ef7c
Merge branch 'main' of github.com:Qiskit/qiskit-terra into deprecate_…
1ucian0 Oct 25, 2022
bdf623e
more merging conflicts
1ucian0 Oct 25, 2022
82b9cc2
turn into exception
1ucian0 Oct 25, 2022
b32cfc5
back to warning
1ucian0 Oct 25, 2022
033f49f
warnings.filterwarnings()
1ucian0 Oct 25, 2022
1f047e2
stacklevel=4
1ucian0 Oct 26, 2022
6a5b710
skip warning when a parameter is qobj
1ucian0 Oct 26, 2022
c7235cc
back to error
1ucian0 Oct 26, 2022
5baedd0
Merge branch 'main' of github.com:Qiskit/qiskit-terra into deprecate_…
1ucian0 Oct 26, 2022
25d1660
conf.py
1ucian0 Oct 26, 2022
39f28d2
adapt message
1ucian0 Oct 26, 2022
453cdfc
back to warning, to avoid braking integration tests
1ucian0 Oct 26, 2022
30175a1
Merge branch 'main' into deprecate_docstrings
1ucian0 Oct 31, 2022
624123b
Merge branch 'main' into deprecate_docstrings
1ucian0 Nov 12, 2022
3bb43f1
using regex
1ucian0 Nov 12, 2022
f4f54c8
fixing test
1ucian0 Nov 12, 2022
8f601ad
multi lines and empty
1ucian0 Nov 12, 2022
77c5c2f
type doc support
1ucian0 Nov 12, 2022
e73ae49
Merge branch 'main' into deprecate_docstrings
1ucian0 Nov 23, 2022
80f3def
Merge branch 'main' into deprecate_docstrings
1ucian0 Nov 30, 2022
172eef9
Merge branch 'main' into deprecate_docstrings
1ucian0 Jan 5, 2023
5503b05
Merge branch 'main' into deprecate_docstrings
1ucian0 Jan 9, 2023
44f3183
Merge branch 'main' into deprecate_docstrings
1ucian0 Jan 11, 2023
b98ebab
conflict solving
1ucian0 Jan 24, 2023
82aaba9
DeprecationWarning to PendingDeprecationWarning
1ucian0 Jan 24, 2023
97472d3
DeprecationWarning to PendingDeprecationWarning
1ucian0 Jan 25, 2023
3f005c8
Merge branch 'main' into deprecate_docstrings
1ucian0 Jan 25, 2023
5e8298f
DeprecationWarning to PendingDeprecationWarning
1ucian0 Jan 25, 2023
c94339c
Merge branch 'deprecate_docstrings' of github.com:1ucian0/qiskit-terr…
1ucian0 Jan 25, 2023
1fb35ec
DeprecationWarning to PendingDeprecationWarning
1ucian0 Jan 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
conflict solving
1ucian0 committed Jan 24, 2023
commit b98ebab0e0b0917b22956dfd6dbe6266e7452c13
14 changes: 8 additions & 6 deletions qiskit/algorithms/amplitude_amplifiers/grover.py
Original file line number Diff line number Diff line change
@@ -192,9 +192,10 @@ def __init__(

@property
@deprecate_function(
"The Grover.quantum_instance getter is deprecated. "
"This property will be removed in a future release.",
category=DeprecationWarning,
"The Grover.quantum_instance getter is pending deprecation. "
"This property will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
since="0.23.0",
)
def quantum_instance(self) -> Optional[QuantumInstance]:
@@ -207,9 +208,10 @@ def quantum_instance(self) -> Optional[QuantumInstance]:

@quantum_instance.setter
@deprecate_function(
"The Grover.quantum_instance setter is deprecated. "
"This property will be removed in a future release.",
category=DeprecationWarning,
"The Grover.quantum_instance setter is pending deprecation. "
"This property will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
since="0.23.0",
)
def quantum_instance(self, quantum_instance: Union[QuantumInstance, Backend]) -> None:
14 changes: 8 additions & 6 deletions qiskit/algorithms/amplitude_estimators/ae.py
Original file line number Diff line number Diff line change
@@ -125,9 +125,10 @@ def sampler(self, sampler: BaseSampler) -> None:

@property
@deprecate_function(
"The AmplitudeEstimation.quantum_instance getter is deprecated. "
"This property will be removed in a future release.",
category=DeprecationWarning,
"The AmplitudeEstimation.quantum_instance getter is pending deprecation. "
"This property will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
since="0.23.0",
)
def quantum_instance(self) -> QuantumInstance | None:
@@ -140,9 +141,10 @@ def quantum_instance(self) -> QuantumInstance | None:

@quantum_instance.setter
@deprecate_function(
"The AmplitudeEstimation.quantum_instance setter is deprecated. "
"This property will be removed in a future release.",
category=DeprecationWarning,
"The AmplitudeEstimation.quantum_instance setter is pending deprecation. "
"This property will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
since="0.23.0",
)
def quantum_instance(self, quantum_instance: QuantumInstance | Backend) -> None:
14 changes: 8 additions & 6 deletions qiskit/algorithms/amplitude_estimators/fae.py
Original file line number Diff line number Diff line change
@@ -110,9 +110,10 @@ def sampler(self, sampler: BaseSampler) -> None:

@property
@deprecate_function(
"The FasterAmplitudeEstimation.quantum_instance getter is deprecated. "
"This property will be removed in a future release.",
category=DeprecationWarning,
"The FasterAmplitudeEstimation.quantum_instance getter is pending deprecation. "
"This property will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
since="0.23.0",
)
def quantum_instance(self) -> QuantumInstance | None:
@@ -125,9 +126,10 @@ def quantum_instance(self) -> QuantumInstance | None:

@quantum_instance.setter
@deprecate_function(
"The FasterAmplitudeEstimation.quantum_instance setter is deprecated. "
"This property will be removed in a future release.",
category=DeprecationWarning,
"The FasterAmplitudeEstimation.quantum_instance setter is pending deprecation. "
"This property will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
since="0.23.0",
)
def quantum_instance(self, quantum_instance: QuantumInstance | Backend) -> None:
14 changes: 8 additions & 6 deletions qiskit/algorithms/amplitude_estimators/iae.py
Original file line number Diff line number Diff line change
@@ -133,9 +133,10 @@ def sampler(self, sampler: BaseSampler) -> None:

@property
@deprecate_function(
"The IterativeAmplitudeEstimation.quantum_instance getter is deprecated. "
"This property will be removed in a future release.",
category=DeprecationWarning,
"The IterativeAmplitudeEstimation.quantum_instance getter is pending deprecation. "
"This property will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
since="0.23.0",
)
def quantum_instance(self) -> QuantumInstance | None:
@@ -148,9 +149,10 @@ def quantum_instance(self) -> QuantumInstance | None:

@quantum_instance.setter
@deprecate_function(
"The IterativeAmplitudeEstimation.quantum_instance setter is deprecated. "
"This property will be removed in a future release.",
category=DeprecationWarning,
"The IterativeAmplitudeEstimation.quantum_instance setter is pending deprecation. "
"This property will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
since="0.23.0",
)
def quantum_instance(self, quantum_instance: QuantumInstance | Backend) -> None:
14 changes: 8 additions & 6 deletions qiskit/algorithms/amplitude_estimators/mlae.py
Original file line number Diff line number Diff line change
@@ -137,9 +137,10 @@ def sampler(self, sampler: BaseSampler) -> None:

@property
@deprecate_function(
"The MaximumLikelihoodAmplitudeEstimation.quantum_instance getter is deprecated. "
"This property will be removed in a future release.",
category=DeprecationWarning,
"The MaximumLikelihoodAmplitudeEstimation.quantum_instance getter is pending deprecation. "
"This property will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
since="0.23.0",
)
def quantum_instance(self) -> QuantumInstance | None:
@@ -152,9 +153,10 @@ def quantum_instance(self) -> QuantumInstance | None:

@quantum_instance.setter
@deprecate_function(
"The MaximumLikelihoodAmplitudeEstimation.quantum_instance setter is deprecated. "
"This property will be removed in a future release.",
category=DeprecationWarning,
"The MaximumLikelihoodAmplitudeEstimation.quantum_instance setter is pending deprecation. "
"This property will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
since="0.23.0",
)
def quantum_instance(self, quantum_instance: QuantumInstance | Backend) -> None:
3 changes: 1 addition & 2 deletions qiskit/algorithms/aux_ops_evaluator.py
Original file line number Diff line number Diff line change
@@ -33,8 +33,7 @@

@deprecate_function(
"The eval_observables function has been superseded by the "
"qiskit.algorithms.observables_evaluator.estimate_observables function. "
"This function will be removed in a future release.",
"qiskit.algorithms.observables_evaluator.estimate_observables function. ",
category=DeprecationWarning,
since="0.23.0",
)
6 changes: 2 additions & 4 deletions qiskit/algorithms/eigen_solvers/eigen_solver.py
Original file line number Diff line number Diff line change
@@ -38,8 +38,7 @@ class Eigensolver(ABC):

@deprecate_function(
"The Eigensolver interface has been superseded by the "
"qiskit.algorithms.eigensolvers.Eigensolver interface. "
"This interface will be removed in the future.",
"qiskit.algorithms.eigensolvers.Eigensolver interface. ",
category=DeprecationWarning,
since="0.23.0",
)
@@ -90,8 +89,7 @@ class EigensolverResult(AlgorithmResult):

@deprecate_function(
"The EigensolverResult class has been superseded by the "
"qiskit.algorithms.eigensolvers.EigensolverResult class. "
"This class will be removed in the future.",
"qiskit.algorithms.eigensolvers.EigensolverResult class. ",
category=DeprecationWarning,
since="0.23.0",
)
3 changes: 1 addition & 2 deletions qiskit/algorithms/eigen_solvers/numpy_eigen_solver.py
Original file line number Diff line number Diff line change
@@ -51,8 +51,7 @@ class NumPyEigensolver(Eigensolver):

@deprecate_function(
"The NumPyEigensolver class has been superseded by the "
"qiskit.algorithms.eigensolvers.NumPyEigensolver class. "
"This class will be removed in the future.",
"qiskit.algorithms.eigensolvers.NumPyEigensolver class. ",
category=DeprecationWarning,
since="0.23.0",
)
7 changes: 2 additions & 5 deletions qiskit/algorithms/eigen_solvers/vqd.py
Original file line number Diff line number Diff line change
@@ -97,9 +97,7 @@ class VQD(VariationalAlgorithm, Eigensolver):
"""

@deprecate_function(
"The VQD class has been superseded by the "
"qiskit.algorithms.eigensolvers.VQD class. "
"This class will be removed in the future.",
"The VQD class has been superseded by the " "qiskit.algorithms.eigensolvers.VQD class. ",
category=DeprecationWarning,
since="0.23.0",
)
@@ -768,8 +766,7 @@ class VQDResult(VariationalResult, EigensolverResult):

@deprecate_function(
"The VQDResult class has been superseded by the "
"qiskit.algorithms.eigensolvers.VQDResult class. "
"This class will be removed in the future.",
"qiskit.algorithms.eigensolvers.VQDResult class. ",
category=DeprecationWarning,
since="0.23.0",
)
3 changes: 1 addition & 2 deletions qiskit/algorithms/evolvers/evolution_problem.py
Original file line number Diff line number Diff line change
@@ -35,8 +35,7 @@ class EvolutionProblem:

@deprecate_function(
"The EvolutionProblem class has been superseded by the "
"qiskit.algorithms.time_evolvers.TimeEvolutionProblem class. "
"This class will be removed in the future.",
"qiskit.algorithms.time_evolvers.TimeEvolutionProblem class. ",
category=DeprecationWarning,
since="0.23.0",
)
3 changes: 1 addition & 2 deletions qiskit/algorithms/evolvers/evolution_result.py
Original file line number Diff line number Diff line change
@@ -33,8 +33,7 @@ class EvolutionResult(AlgorithmResult):

@deprecate_function(
"The EvolutionResult class has been superseded by the "
"qiskit.algorithms.time_evolvers.TimeEvolutionResult class. "
"This class will be removed in the future.",
"qiskit.algorithms.time_evolvers.TimeEvolutionResult class. ",
category=DeprecationWarning,
since="0.23.0",
)
3 changes: 1 addition & 2 deletions qiskit/algorithms/evolvers/imaginary_evolver.py
Original file line number Diff line number Diff line change
@@ -31,8 +31,7 @@ class ImaginaryEvolver(ABC):

@deprecate_function(
"The ImaginaryEvolver interface has been superseded by the "
"qiskit.algorithms.time_evolvers.ImaginaryTimeEvolver interface. "
"This interface will be removed in the future.",
"qiskit.algorithms.time_evolvers.ImaginaryTimeEvolver interface. ",
category=DeprecationWarning,
since="0.23.0",
)
3 changes: 1 addition & 2 deletions qiskit/algorithms/evolvers/real_evolver.py
Original file line number Diff line number Diff line change
@@ -31,8 +31,7 @@ class RealEvolver(ABC):

@deprecate_function(
"The RealEvolver interface has been superseded by the "
"qiskit.algorithms.time_evolvers.RealTimeEvolver interface. "
"This interface will be removed in the future.",
"qiskit.algorithms.time_evolvers.RealTimeEvolver interface. ",
category=DeprecationWarning,
since="0.23.0",
)
3 changes: 1 addition & 2 deletions qiskit/algorithms/evolvers/trotterization/trotter_qrte.py
Original file line number Diff line number Diff line change
@@ -66,8 +66,7 @@ class TrotterQRTE(RealEvolver):

@deprecate_function(
"The TrotterQRTE class has been superseded by the "
"qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE class. "
"This class will be removed in the future.",
"qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE class. ",
category=DeprecationWarning,
since="0.23.0",
)
Original file line number Diff line number Diff line change
@@ -38,8 +38,7 @@ class MinimumEigensolver(ABC):

@deprecate_function(
"The Minimum Eigensolver interface has been superseded by the "
"qiskit.algorithms.minimum_eigensolvers.MinimumEigensolver interface. "
"This interface will be removed in the future.",
"qiskit.algorithms.minimum_eigensolvers.MinimumEigensolver interface. ",
category=DeprecationWarning,
since="0.23.0",
)
@@ -94,8 +93,7 @@ class MinimumEigensolverResult(AlgorithmResult):

@deprecate_function(
"The MinimumEigensolverResult class has been superseded by the "
"qiskit.algorithms.minimum_eigensolvers.MinimumEigensolverResult class. "
"This class will be removed in the future.",
"qiskit.algorithms.minimum_eigensolvers.MinimumEigensolverResult class.",
category=DeprecationWarning,
since="0.23.0",
)
Original file line number Diff line number Diff line change
@@ -39,8 +39,7 @@ class NumPyMinimumEigensolver(MinimumEigensolver):

@deprecate_function(
"The NumPyMinimumEigensolver class has been superseded by the "
"qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver class. "
"This class will be removed in the future.",
"qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver class. ",
category=DeprecationWarning,
since="0.23.0",
)
3 changes: 1 addition & 2 deletions qiskit/algorithms/minimum_eigen_solvers/qaoa.py
Original file line number Diff line number Diff line change
@@ -61,8 +61,7 @@ class QAOA(VQE):

@deprecate_function(
"The QAOA class has been superseded by the "
"qiskit.algorithms.minimum_eigensolvers.QAOA class. "
"This class will be removed in the future.",
"qiskit.algorithms.minimum_eigensolvers.QAOA class. ",
category=DeprecationWarning,
since="0.23.0",
)
8 changes: 3 additions & 5 deletions qiskit/algorithms/minimum_eigen_solvers/vqe.py
Original file line number Diff line number Diff line change
@@ -129,8 +129,7 @@ def my_minimizer(fun, x0, jac=None, bounds=None) -> OptimizerResult:

@deprecate_function(
"The VQE class has been superseded by the "
"qiskit.algorithms.minimum_eigensolvers.VQE class. "
"This class will be removed in the future.",
"qiskit.algorithms.minimum_eigensolvers.VQE class. ",
category=DeprecationWarning,
since="0.23.0",
)
@@ -668,9 +667,8 @@ class VQEResult(VariationalResult, MinimumEigensolverResult):

@deprecate_function(
"The VQEResult class has been superseded by the "
"qiskit.algorithms.minimum_eigensolvers.VQEResult class. "
"This class will be removed in the future.",
category=DeprecationWarning,
"qiskit.algorithms.minimum_eigensolvers.VQEResult class. ",
category=PendingDeprecationWarning,
since="0.23.0",
)
def __init__(self) -> None:
1 change: 0 additions & 1 deletion qiskit/transpiler/passes/basis/decompose.py
Original file line number Diff line number Diff line change
@@ -23,7 +23,6 @@
class Decompose(TransformationPass):
"""Expand a gate in a circuit using its decomposition rules."""

@deprecate_arguments({"gate": "gates_to_decompose"}, since="0.19.0")
def __init__(
self,
gates_to_decompose: Optional[Union[Type[Gate], List[Type[Gate]], List[str], str]] = None,
You are viewing a condensed version of this merge commit. You can view the full changes here.