Skip to content

Commit

Permalink
Pending deprecations set version to when the deprecation will become …
Browse files Browse the repository at this point in the history
…official
  • Loading branch information
Eric-Arellano committed Feb 20, 2023
1 parent 6883292 commit dc30bba
Show file tree
Hide file tree
Showing 19 changed files with 31 additions and 29 deletions.
4 changes: 2 additions & 2 deletions qiskit/algorithms/amplitude_amplifiers/grover.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def __init__(
"This property will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
since="0.23.0",
since="0.24.0",
)
def quantum_instance(self) -> Optional[QuantumInstance]:
r"""Pending deprecation\; Get the quantum instance.
Expand All @@ -212,7 +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",
since="0.24.0",
)
def quantum_instance(self, quantum_instance: Union[QuantumInstance, Backend]) -> None:
r"""Pending deprecation\; Set quantum instance.
Expand Down
4 changes: 2 additions & 2 deletions qiskit/algorithms/amplitude_estimators/ae.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +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",
since="0.24.0",
)
def quantum_instance(self) -> QuantumInstance | None:
"""Pending deprecation; Get the quantum instance.
Expand All @@ -145,7 +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",
since="0.24.0",
)
def quantum_instance(self, quantum_instance: QuantumInstance | Backend) -> None:
"""Pending deprecation; Set quantum instance.
Expand Down
4 changes: 2 additions & 2 deletions qiskit/algorithms/amplitude_estimators/fae.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +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",
since="0.24.0",
)
def quantum_instance(self) -> QuantumInstance | None:
"""Pending deprecation; Get the quantum instance.
Expand All @@ -130,7 +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",
since="0.24.0",
)
def quantum_instance(self, quantum_instance: QuantumInstance | Backend) -> None:
"""Pending deprecation; Set quantum instance.
Expand Down
4 changes: 2 additions & 2 deletions qiskit/algorithms/amplitude_estimators/iae.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +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",
since="0.24.0",
)
def quantum_instance(self) -> QuantumInstance | None:
"""Pending deprecation; Get the quantum instance.
Expand All @@ -153,7 +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",
since="0.24.0",
)
def quantum_instance(self, quantum_instance: QuantumInstance | Backend) -> None:
"""Pending deprecation; Set quantum instance.
Expand Down
4 changes: 2 additions & 2 deletions qiskit/algorithms/amplitude_estimators/mlae.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +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",
since="0.24.0",
)
def quantum_instance(self) -> QuantumInstance | None:
"""Pending deprecation; Get the quantum instance.
Expand All @@ -157,7 +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",
since="0.24.0",
)
def quantum_instance(self, quantum_instance: QuantumInstance | Backend) -> None:
"""Pending deprecation; Set quantum instance.
Expand Down
2 changes: 1 addition & 1 deletion qiskit/algorithms/aux_ops_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"This function will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
since="0.23.0",
since="0.24.0",
)
def eval_observables(
quantum_instance: Union[QuantumInstance, Backend],
Expand Down
4 changes: 2 additions & 2 deletions qiskit/algorithms/eigen_solvers/eigen_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Eigensolver(ABC):
"This interface will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
since="0.23.0",
since="0.24.0",
)
def __init__(self) -> None:
pass
Expand Down Expand Up @@ -95,7 +95,7 @@ class EigensolverResult(AlgorithmResult):
"This class will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
since="0.23.0",
since="0.24.0",
)
def __init__(self) -> None:
super().__init__()
Expand Down
2 changes: 1 addition & 1 deletion qiskit/algorithms/eigen_solvers/numpy_eigen_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class NumPyEigensolver(Eigensolver):
"This class will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
since="0.23.0",
since="0.24.0",
)
def __init__(
self,
Expand Down
4 changes: 2 additions & 2 deletions qiskit/algorithms/eigen_solvers/vqd.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class VQD(VariationalAlgorithm, Eigensolver):
"This class will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
since="0.23.0",
since="0.24.0",
)
def __init__(
self,
Expand Down Expand Up @@ -773,7 +773,7 @@ class VQDResult(VariationalResult, EigensolverResult):
"This class will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
since="0.23.0",
since="0.24.0",
)
def __init__(self) -> None:
super().__init__()
Expand Down
2 changes: 1 addition & 1 deletion qiskit/algorithms/evolvers/evolution_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class EvolutionProblem:
"This class will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
since="0.23.0",
since="0.24.0",
)
def __init__(
self,
Expand Down
2 changes: 1 addition & 1 deletion qiskit/algorithms/evolvers/evolution_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class EvolutionResult(AlgorithmResult):
"This class will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
since="0.23.0",
since="0.24.0",
)
def __init__(
self,
Expand Down
2 changes: 1 addition & 1 deletion qiskit/algorithms/evolvers/imaginary_evolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class ImaginaryEvolver(ABC):
"This interface will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
since="0.23.0",
since="0.24.0",
)
def __init__(self) -> None:
pass
Expand Down
2 changes: 1 addition & 1 deletion qiskit/algorithms/evolvers/real_evolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class RealEvolver(ABC):
"This interface will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
since="0.23.0",
since="0.24.0",
)
def __init__(self) -> None:
pass
Expand Down
2 changes: 1 addition & 1 deletion qiskit/algorithms/evolvers/trotterization/trotter_qrte.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class TrotterQRTE(RealEvolver):
"This class will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
since="0.23.0",
since="0.24.0",
)
def __init__(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class MinimumEigensolver(ABC):
"This interface will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
since="0.23.0",
since="0.24.0",
)
def __init__(self) -> None:
pass
Expand Down Expand Up @@ -99,7 +99,7 @@ class MinimumEigensolverResult(AlgorithmResult):
"This class will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
since="0.23.0",
since="0.24.0",
)
def __init__(self) -> None:
super().__init__()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class NumPyMinimumEigensolver(MinimumEigensolver):
"This class will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
since="0.23.0",
since="0.24.0",
)
def __init__(
self,
Expand Down
2 changes: 1 addition & 1 deletion qiskit/algorithms/minimum_eigen_solvers/qaoa.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class QAOA(VQE):
"This class will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
since="0.23.0",
since="0.24.0",
)
def __init__(
self,
Expand Down
4 changes: 2 additions & 2 deletions qiskit/algorithms/minimum_eigen_solvers/vqe.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def my_minimizer(fun, x0, jac=None, bounds=None) -> OptimizerResult:
"This class will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
since="0.23.0",
since="0.24.0",
)
def __init__(
self,
Expand Down Expand Up @@ -673,7 +673,7 @@ class VQEResult(VariationalResult, MinimumEigensolverResult):
"This class will be deprecated in a future release and subsequently "
"removed after that.",
category=PendingDeprecationWarning,
since="0.23.0",
since="0.24.0",
)
def __init__(self) -> None:
with warnings.catch_warnings():
Expand Down
6 changes: 4 additions & 2 deletions qiskit/utils/deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def deprecate_arguments(
kwarg_map: A dictionary of the old argument name to the new name.
category: Usually either DeprecationWarning or PendingDeprecationWarning.
since: The version the deprecation started at. Only Optional for backwards
compatibility - this should always be set.
compatibility - this should always be set. If the deprecation is pending,
set the version to when the deprecation will officially start.
Returns:
Callable: The decorated callable.
Expand Down Expand Up @@ -61,7 +62,8 @@ def deprecate_function(
stacklevel: The warning stacklevel to use, defaults to 2.
category: Usually either DeprecationWarning or PendingDeprecationWarning.
since: The version the deprecation started at. Only Optional for backwards
compatibility - this should always be set.
compatibility - this should always be set. If the deprecation is pending,
set the version to when the deprecation will officially start.
Returns:
Callable: The decorated, deprecated callable.
Expand Down

0 comments on commit dc30bba

Please sign in to comment.