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
Show file tree
Hide file tree
Changes from all commits
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions qiskit/algorithms/amplitude_amplifiers/grover.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ def __init__(
"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]:
r"""Pending deprecation\; Get the quantum instance.
Expand All @@ -211,6 +212,7 @@ def quantum_instance(self) -> Optional[QuantumInstance]:
"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:
r"""Pending deprecation\; Set quantum instance.
Expand Down
2 changes: 2 additions & 0 deletions qiskit/algorithms/amplitude_estimators/ae.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def sampler(self, sampler: BaseSampler) -> None:
"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:
"""Pending deprecation; Get the quantum instance.
Expand All @@ -144,6 +145,7 @@ def quantum_instance(self) -> QuantumInstance | None:
"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:
"""Pending deprecation; Set quantum instance.
Expand Down
2 changes: 2 additions & 0 deletions qiskit/algorithms/amplitude_estimators/fae.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def sampler(self, sampler: BaseSampler) -> None:
"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:
"""Pending deprecation; Get the quantum instance.
Expand All @@ -129,6 +130,7 @@ def quantum_instance(self) -> QuantumInstance | None:
"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:
"""Pending deprecation; Set quantum instance.
Expand Down
2 changes: 2 additions & 0 deletions qiskit/algorithms/amplitude_estimators/iae.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def sampler(self, sampler: BaseSampler) -> None:
"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:
"""Pending deprecation; Get the quantum instance.
Expand All @@ -152,6 +153,7 @@ def quantum_instance(self) -> QuantumInstance | None:
"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:
"""Pending deprecation; Set quantum instance.
Expand Down
2 changes: 2 additions & 0 deletions qiskit/algorithms/amplitude_estimators/mlae.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def sampler(self, sampler: BaseSampler) -> None:
"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:
"""Pending deprecation; Get the quantum instance.
Expand All @@ -156,6 +157,7 @@ def quantum_instance(self) -> QuantumInstance | None:
"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:
"""Pending deprecation; Set quantum instance.
Expand Down
5 changes: 2 additions & 3 deletions qiskit/algorithms/aux_ops_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@

@deprecate_function(
"The eval_observables function has been superseded by the "
"qiskit.algorithms.observables_evaluator.estimate_observables function. "
"This function will be deprecated in a future release and subsequently "
"removed after that.",
"qiskit.algorithms.observables_evaluator.estimate_observables function. ",
category=PendingDeprecationWarning,
since="0.23.0",
)
def eval_observables(
quantum_instance: Union[QuantumInstance, Backend],
Expand Down
12 changes: 5 additions & 7 deletions qiskit/algorithms/eigen_solvers/eigen_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ class Eigensolver(ABC):

@deprecate_function(
"The Eigensolver interface has been superseded by the "
"qiskit.algorithms.eigensolvers.Eigensolver interface. "
"This interface will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
"qiskit.algorithms.eigensolvers.Eigensolver interface. ",
category=DeprecationWarning,
since="0.23.0",
)
def __init__(self) -> None:
pass
Expand Down Expand Up @@ -90,10 +89,9 @@ class EigensolverResult(AlgorithmResult):

@deprecate_function(
"The EigensolverResult class has been superseded by the "
"qiskit.algorithms.eigensolvers.EigensolverResult class. "
"This class will be deprecated in a future release and subsequently "
"removed after that.",
"qiskit.algorithms.eigensolvers.EigensolverResult class. ",
category=PendingDeprecationWarning,
since="0.23.0",
)
def __init__(self) -> None:
super().__init__()
Expand Down
5 changes: 2 additions & 3 deletions qiskit/algorithms/eigen_solvers/numpy_eigen_solver.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,9 @@ class NumPyEigensolver(Eigensolver):

@deprecate_function(
"The NumPyEigensolver class has been superseded by the "
"qiskit.algorithms.eigensolvers.NumPyEigensolver class. "
"This class will be deprecated in a future release and subsequently "
"removed after that.",
"qiskit.algorithms.eigensolvers.NumPyEigensolver class. ",
category=PendingDeprecationWarning,
since="0.23.0",
)
def __init__(
self,
Expand Down
11 changes: 4 additions & 7 deletions qiskit/algorithms/eigen_solvers/vqd.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,9 @@ class VQD(VariationalAlgorithm, Eigensolver):
"""

@deprecate_function(
"The VQD class has been superseded by the "
"qiskit.algorithms.eigensolvers.VQD class. "
"This class will be deprecated in a future release and subsequently "
"removed after that.",
"The VQD class has been superseded by the " "qiskit.algorithms.eigensolvers.VQD class. ",
category=PendingDeprecationWarning,
since="0.23.0",
)
def __init__(
self,
Expand Down Expand Up @@ -768,10 +766,9 @@ class VQDResult(VariationalResult, EigensolverResult):

@deprecate_function(
"The VQDResult class has been superseded by the "
"qiskit.algorithms.eigensolvers.VQDResult class. "
"This class will be deprecated in a future release and subsequently "
"removed after that.",
"qiskit.algorithms.eigensolvers.VQDResult class. ",
category=PendingDeprecationWarning,
since="0.23.0",
)
def __init__(self) -> None:
super().__init__()
Expand Down
5 changes: 2 additions & 3 deletions qiskit/algorithms/evolvers/evolution_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ class EvolutionProblem:

@deprecate_function(
"The EvolutionProblem class has been superseded by the "
"qiskit.algorithms.time_evolvers.TimeEvolutionProblem class. "
"This class will be deprecated in a future release and subsequently "
"removed after that.",
"qiskit.algorithms.time_evolvers.TimeEvolutionProblem class. ",
category=PendingDeprecationWarning,
since="0.23.0",
)
def __init__(
self,
Expand Down
5 changes: 2 additions & 3 deletions qiskit/algorithms/evolvers/evolution_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ class EvolutionResult(AlgorithmResult):

@deprecate_function(
"The EvolutionResult class has been superseded by the "
"qiskit.algorithms.time_evolvers.TimeEvolutionResult class. "
"This class will be deprecated in a future release and subsequently "
"removed after that.",
"qiskit.algorithms.time_evolvers.TimeEvolutionResult class. ",
category=PendingDeprecationWarning,
since="0.23.0",
)
def __init__(
self,
Expand Down
7 changes: 3 additions & 4 deletions qiskit/algorithms/evolvers/imaginary_evolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ class ImaginaryEvolver(ABC):

@deprecate_function(
"The ImaginaryEvolver interface has been superseded by the "
"qiskit.algorithms.time_evolvers.ImaginaryTimeEvolver interface. "
"This interface will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
"qiskit.algorithms.time_evolvers.ImaginaryTimeEvolver interface. ",
category=DeprecationWarning,
since="0.23.0",
)
def __init__(self) -> None:
pass
Expand Down
7 changes: 3 additions & 4 deletions qiskit/algorithms/evolvers/real_evolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ class RealEvolver(ABC):

@deprecate_function(
"The RealEvolver interface has been superseded by the "
"qiskit.algorithms.time_evolvers.RealTimeEvolver interface. "
"This interface will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
"qiskit.algorithms.time_evolvers.RealTimeEvolver interface. ",
category=DeprecationWarning,
since="0.23.0",
)
def __init__(self) -> None:
pass
Expand Down
5 changes: 2 additions & 3 deletions qiskit/algorithms/evolvers/trotterization/trotter_qrte.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,9 @@ class TrotterQRTE(RealEvolver):

@deprecate_function(
"The TrotterQRTE class has been superseded by the "
"qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE class. "
"This class will be deprecated in a future release and subsequently "
"removed after that.",
"qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE class. ",
category=PendingDeprecationWarning,
since="0.23.0",
)
def __init__(
self,
Expand Down
3 changes: 2 additions & 1 deletion qiskit/algorithms/factorizers/shor.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ class Shor:
"""The Shor class is deprecated as of Qiskit Terra 0.22.0 and will be removed
no sooner than 3 months after the release date.
It is replaced by the tutorial at https://qiskit.org/textbook/ch-algorithms/shor.html
"""
""",
since="0.22.0",
)
def __init__(self, quantum_instance: Optional[Union[QuantumInstance, Backend]] = None) -> None:
"""
Expand Down
3 changes: 2 additions & 1 deletion qiskit/algorithms/linear_solvers/hhl.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ class HHL(LinearSolver):
"""The HHL class is deprecated as of Qiskit Terra 0.22.0 and will be removed
no sooner than 3 months after the release date.
It is replaced by the tutorial at https://qiskit.org/textbook/ch-applications/hhl_tutorial.html"
"""
""",
since="0.22.0",
)
def __init__(
self,
Expand Down
6 changes: 4 additions & 2 deletions qiskit/algorithms/linear_solvers/linear_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ class LinearSolverResult(AlgorithmResult):

@deprecate_function(
"The LinearSolverResult class is deprecated as of Qiskit Terra 0.22.0 "
"and will be removed no sooner than 3 months after the release date. "
"and will be removed no sooner than 3 months after the release date. ",
since="0.22.0",
)
def __init__(self) -> None:
super().__init__()
Expand Down Expand Up @@ -102,7 +103,8 @@ class LinearSolver(ABC):

@deprecate_function(
"The LinearSolver class is deprecated as of Qiskit Terra 0.22.0 "
"and will be removed no sooner than 3 months after the release date. "
"and will be removed no sooner than 3 months after the release date. ",
since="0.22.0",
)
def __init__(self) -> None:
pass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ class LinearSystemMatrix(BlueprintCircuit, ABC):

@deprecate_function(
"The LinearSystemMatrix class is deprecated as of Qiskit Terra 0.22.0 "
"and will be removed no sooner than 3 months after the release date. "
"and will be removed no sooner than 3 months after the release date. ",
since="0.22.0",
)
def __init__(
self,
Expand Down
3 changes: 2 additions & 1 deletion qiskit/algorithms/linear_solvers/matrices/numpy_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ class NumPyMatrix(LinearSystemMatrix):

@deprecate_function(
"The NumPyMatrix class is deprecated as of Qiskit Terra 0.22.0 "
"and will be removed no sooner than 3 months after the release date. "
"and will be removed no sooner than 3 months after the release date. ",
since="0.22.0",
)
def __init__(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ class TridiagonalToeplitz(LinearSystemMatrix):

@deprecate_function(
"The TridiagonalToeplitz class is deprecated as of Qiskit Terra 0.22.0 "
"and will be removed no sooner than 3 months after the release date. "
"and will be removed no sooner than 3 months after the release date. ",
since="0.22.0",
)
def __init__(
self,
Expand Down
3 changes: 2 additions & 1 deletion qiskit/algorithms/linear_solvers/numpy_linear_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ class NumPyLinearSolver(LinearSolver):

@deprecate_function(
"The NumPyLinearSolver class is deprecated as of Qiskit Terra 0.22.0 "
"and will be removed no sooner than 3 months after the release date. "
"and will be removed no sooner than 3 months after the release date. ",
since="0.22.0",
)
def __init__(self) -> None:
super().__init__()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ class AbsoluteAverage(LinearSystemObservable):

@deprecate_function(
"The AbsoluteAverage class is deprecated as of Qiskit Terra 0.22.0 "
"and will be removed no sooner than 3 months after the release date. "
"and will be removed no sooner than 3 months after the release date. ",
since="0.22.0",
)
def __init__(self) -> None:
super().__init__()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class LinearSystemObservable(ABC):

@deprecate_function(
"The LinearSystemObservable class is deprecated as of Qiskit Terra 0.22.0 "
"and will be removed no sooner than 3 months after the release date. "
"and will be removed no sooner than 3 months after the release date. ",
since="0.22.0",
)
def __init__(self) -> None:
pass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ class MatrixFunctional(LinearSystemObservable):

@deprecate_function(
"The MatrixFunctional class is deprecated as of Qiskit Terra 0.22.0 "
"and will be removed no sooner than 3 months after the release date. "
"and will be removed no sooner than 3 months after the release date. ",
since="0.22.0",
)
def __init__(self, main_diag: float, off_diag: int) -> None:
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ class MinimumEigensolver(ABC):

@deprecate_function(
"The Minimum Eigensolver interface has been superseded by the "
"qiskit.algorithms.minimum_eigensolvers.MinimumEigensolver interface. "
"This interface will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
"qiskit.algorithms.minimum_eigensolvers.MinimumEigensolver interface. ",
category=DeprecationWarning,
since="0.23.0",
)
def __init__(self) -> None:
pass
Expand Down Expand Up @@ -94,10 +93,9 @@ class MinimumEigensolverResult(AlgorithmResult):

@deprecate_function(
"The MinimumEigensolverResult class has been superseded by the "
"qiskit.algorithms.minimum_eigensolvers.MinimumEigensolverResult class. "
"This class will be deprecated in a future release and subsequently "
"removed after that.",
"qiskit.algorithms.minimum_eigensolvers.MinimumEigensolverResult class.",
category=PendingDeprecationWarning,
since="0.23.0",
)
def __init__(self) -> None:
super().__init__()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ class NumPyMinimumEigensolver(MinimumEigensolver):

@deprecate_function(
"The NumPyMinimumEigensolver class has been superseded by the "
"qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver class. "
"This class will be deprecated in a future release and subsequently "
"removed after that.",
"qiskit.algorithms.minimum_eigensolvers.NumPyMinimumEigensolver class. ",
category=PendingDeprecationWarning,
since="0.23.0",
)
def __init__(
self,
Expand Down
5 changes: 2 additions & 3 deletions qiskit/algorithms/minimum_eigen_solvers/qaoa.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,9 @@ class QAOA(VQE):

@deprecate_function(
"The QAOA class has been superseded by the "
"qiskit.algorithms.minimum_eigensolvers.QAOA class. "
"This class will be deprecated in a future release and subsequently "
"removed after that.",
"qiskit.algorithms.minimum_eigensolvers.QAOA class. ",
category=PendingDeprecationWarning,
since="0.23.0",
)
def __init__(
self,
Expand Down