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 qiskit.pulse.utils.deprecated_functionality in favor of qiskit.utils.deprecation.deprecate_function #8696

Merged
merged 7 commits into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
25 changes: 10 additions & 15 deletions qiskit/pulse/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@

"""Module for common pulse programming utilities."""
import functools
import warnings
from typing import List, Dict, Union

import numpy as np

from qiskit.circuit.parameterexpression import ParameterExpression
from qiskit.pulse.exceptions import UnassignedDurationError, QiskitError
from qiskit.utils import deprecate_function # pylint: disable=cyclic-import


def format_meas_map(meas_map: List[List[int]]) -> Dict[int, List[int]]:
Expand Down Expand Up @@ -98,19 +98,14 @@ def instruction_duration_validation(duration: int):
)


@deprecate_function("Deprecated since Terra 0.22.0. Use 'qiskit.utils.deprecate_function' instead.")
def deprecated_functionality(func):
"""A decorator that raises deprecation warning without showing alternative method."""

@functools.wraps(func)
def wrapper(*args, **kwargs):
warnings.warn(
f"Calling {func.__name__} is being deprecated and will be removed soon. "
"No alternative method will be provided with this change. "
"If there is any practical usage of this functionality, please write "
"an issue in Qiskit/qiskit-terra repository.",
category=DeprecationWarning,
stacklevel=2,
)
return func(*args, **kwargs)

return wrapper
return deprecate_function(
f"Calling {func.__name__} is being deprecated and will be removed soon. "
"No alternative method will be provided with this change. "
"If there is any practical usage of this functionality, please write "
"an issue in Qiskit/qiskit-terra repository.",
category=DeprecationWarning,
stacklevel=2,
)(func)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
deprecations:
- |
The pulse-module function ``qiskit.pulse.utils.deprecate_functionality`` is
deprecated and will be removed in a future release. This was a primarily
internal-only function. The same functionality is supplied by
``qiskit.utils.deprecate_function``, which should be used instead.