Add a sink operation to avoid dangling nodes
2 unresolved threads
2 unresolved threads
Closes #132 (closed)
Adds a sink operation
No tests were added because I didn't think there was a nice way to test something that does "nothing".
Edited by Hugo Winbladh
Merge request reports
Activity
added Operations Signal flow graph labels
1282 1283 def __init__(self, name: Name = ""): 1284 """Construct a Sink operation.""" 1285 super().__init__( 1286 input_count=1, 1287 output_count=0, 1288 name=name, 1289 latency_offsets={"in0": 0}, 1290 ) 1291 1292 @classmethod 1293 def type_name(cls) -> TypeName: 1294 return TypeName("sink") 1295 1296 def evaluate(self): 1297 return self.param("value") Right. I suppose just throwing a
NotImplementedError
would be easiestEdited by Hugo Winbladhchanged this line in version 2 of the diff
1285 super().__init__( 1286 input_count=1, 1287 output_count=0, 1288 name=name, 1289 latency_offsets={"in0": 0}, 1290 ) 1291 1292 @classmethod 1293 def type_name(cls) -> TypeName: 1294 return TypeName("sink") 1295 1296 def evaluate(self): 1297 return self.param("value") 1298 1299 @property 1300 def latency(self) -> int: Btw, I think a suitable test may be like a two-port adaptor or a butterfly, where only one output is connected to an Output and the other to a Sink. Then check that an SFG can be created and that it only has one output etc. (Not sure that it errors currently if not both outputs are connected, but it should ideally...)
added 6 commits
-
a0edea7c...ce58bd0e - 3 commits from branch
master
- 8ea707df - add sink operation
- dead8fed - fix pipeline error
- 4f48765e - raise exception for Sink.evaluate() and add simple test
Toggle commit list-
a0edea7c...ce58bd0e - 3 commits from branch
Please register or sign in to reply