|
16 | 16 |
|
17 | 17 | from .base import UNSET, Items, Operation, PlotArgs, Plottable, RenArgs, aslist, jetsam |
18 | 18 | from .modifiers import dep_renamed |
19 | | -from .op import FunctionalOperation, reparse_operation_data |
20 | 19 |
|
21 | 20 | log = logging.getLogger(__name__) |
22 | 21 |
|
23 | 22 |
|
24 | | -class NULL_OP(FunctionalOperation): |
| 23 | +class NULL_OP(Operation): |
25 | 24 | """ |
26 | 25 | Eliminates same-named operations added later during term:`operation merging`. |
27 | 26 |
|
28 | 27 | :seealso: :ref:`operation-merging` |
29 | 28 | """ |
30 | 29 |
|
31 | 30 | def __init__(self, name): |
32 | | - super().__init__(name=name) |
| 31 | + self.name = name |
| 32 | + |
| 33 | + def __hash__(self): |
| 34 | + return hash(self.name) |
| 35 | + |
| 36 | + def __eq__(self, o): |
| 37 | + return self.name == o.name |
| 38 | + |
| 39 | + def __repr__(self): |
| 40 | + return f"{type(self).__name__}({self.name})" |
33 | 41 |
|
34 | 42 | def compute(self, *args, **kw): |
35 | | - raise AssertionError("Should have been eliminated!") |
| 43 | + raise AssertionError(f"{self} should have been eliminated!") |
| 44 | + |
| 45 | + def prepare_plot_args(self, *args, **kw): |
| 46 | + raise AssertionError(f"{self} should have been eliminated!") |
36 | 47 |
|
37 | 48 |
|
38 | 49 | def _id_bool(b): |
@@ -85,6 +96,7 @@ def __init__( |
85 | 96 | *Operations may only be added once, ...* |
86 | 97 | """ |
87 | 98 | from .network import build_network |
| 99 | + from .op import reparse_operation_data |
88 | 100 |
|
89 | 101 | ## Set data asap, for debugging, although `net.withset()` will reset them. |
90 | 102 | self.name = name |
|
0 commit comments