diff --git a/b_asic/resources.py b/b_asic/resources.py index 47fd48a0ab5c750d43e85c2fd62652e902948beb..82b5dc922d13994ed018fcd09973d18a719a3797 100644 --- a/b_asic/resources.py +++ b/b_asic/resources.py @@ -9,7 +9,7 @@ from matplotlib.axes import Axes from matplotlib.ticker import MaxNLocator from b_asic._preferences import LATENCY_COLOR -from b_asic.process import MemoryVariable, PlainMemoryVariable, Process +from b_asic.process import MemoryVariable, OperatorProcess, PlainMemoryVariable, Process from b_asic.types import TypeName # Default latency coloring RGB tuple @@ -1124,7 +1124,7 @@ class ProcessCollection: def get_by_type_name(self, type_name: TypeName) -> "ProcessCollection": """ - Return a ProcessCollection with only a given type of operations. + Return a ProcessCollection with only a given type of operation. Parameters ---------- @@ -1133,11 +1133,9 @@ class ProcessCollection: Returns ------- - None. + ProcessCollection """ - from b_asic.process import OperatorProcess - return ProcessCollection( { process @@ -1146,4 +1144,5 @@ class ProcessCollection: and process._operation.type_name() == type_name }, self._schedule_time, + self._cyclic, ) diff --git a/b_asic/schedule.py b/b_asic/schedule.py index 75e49cb253c02a1f87ef40022261cb45685ea80f..628117c462b6c01136e00d00104512dc018976d2 100644 --- a/b_asic/schedule.py +++ b/b_asic/schedule.py @@ -717,13 +717,14 @@ class Schedule: ProcessCollection """ - return ProcessCollection(set(self._get_operations_list()), self.schedule_time) - - def _get_operations_list(self) -> List[OperatorProcess]: - return [ - OperatorProcess(start_time, self._sfg.find_by_id(graph_id)) - for graph_id, start_time in self._start_times.items() - ] + return ProcessCollection( + { + OperatorProcess(start_time, self._sfg.find_by_id(graph_id)) + for graph_id, start_time in self._start_times.items() + }, + self.schedule_time, + self.cyclic, + ) def _get_y_position( self, graph_id, operation_height=1.0, operation_gap=None