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

Remove DagDepNode.condition (deprecated in #6110) #9406

Merged
merged 10 commits into from
Feb 6, 2023
40 changes: 0 additions & 40 deletions qiskit/dagcircuit/dagdepnode.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

"""Object to represent the information at a node in the DAGCircuit."""

import warnings

from qiskit.exceptions import QiskitError


Expand Down Expand Up @@ -51,7 +49,6 @@ def __init__(
name=None,
qargs=(),
cargs=(),
condition=None,
successors=None,
predecessors=None,
reachable=None,
Expand All @@ -68,15 +65,6 @@ def __init__(
self.name = name
self._qargs = tuple(qargs) if qargs is not None else ()
self.cargs = tuple(cargs) if cargs is not None else ()
if condition:
warnings.warn(
"The DAGDepNode 'condition' kwarg and 'condition' attribute are deprecated "
"as of 0.18.0 and will be removed no earlier than 3 months after the "
"release date. You can use 'DAGDepNode.op.condition' if the DAGDepNode "
"is of type 'op'.",
DeprecationWarning,
2,
)
self.node_id = nid
self.sort_key = str(self._qargs)
self.successors = successors if successors is not None else []
Expand All @@ -99,34 +87,6 @@ def op(self):
def op(self, data):
self._op = data

@property
def condition(self):
"""Returns the condition of the node.op"""
if not self.type or self.type != "op":
raise QiskitError("The node %s is not an op node" % (str(self)))
warnings.warn(
"The DAGDepNode 'condition' attribute is deprecated as of 0.18.0 and "
"will be removed no earlier than 3 months after the release date. "
"You can use 'DAGDepNode.op.condition' if the DAGDepNode is of type 'op'.",
DeprecationWarning,
2,
)
return getattr(self._op, "condition", None)

@condition.setter
def condition(self, new_condition):
"""Sets the node.condition which sets the node.op.condition."""
if not self.type or self.type != "op":
raise QiskitError("The node %s is not an op node" % (str(self)))
warnings.warn(
"The DAGDepNode 'condition' attribute is deprecated as of 0.18.0 and "
"will be removed no earlier than 3 months after the release date. "
"You can use 'DAGDepNode.op.condition' if the DAGDepNode is of type 'op'.",
DeprecationWarning,
2,
)
self._op.condition = new_condition

@property
def qargs(self):
"""
Expand Down
6 changes: 6 additions & 0 deletions releasenotes/notes/6110-709f6fa891bdb26b.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
upgrade:
- |
For the class :class:`~DagDepNode`, the previously deprecated ``condition``
attribute has been removed. It was deprecated since 0.18 release.
You can use :meth:`~DAGDepNode.op.condition~ if the ``DAGDepNode`` is of type ``op``.