diff --git a/b_asic/resources.py b/b_asic/resources.py index a9d5fbf2056b17af178c6bdfff2dd3dc0200279f..f87b0a16d7062cc66c2067fc663f500c0b506669 100644 --- a/b_asic/resources.py +++ b/b_asic/resources.py @@ -133,7 +133,7 @@ class ProcessCollection: """ self._collection.add(process) - def draw_lifetime_chart( + def plot( self, ax: Optional[Axes] = None, show_name: bool = True, diff --git a/b_asic/schedule.py b/b_asic/schedule.py index cff3a16681ca69b88a605bf3bae7e15d99cdb259..971c885a67acd19d6467bc93784bbd8988b8c6a4 100644 --- a/b_asic/schedule.py +++ b/b_asic/schedule.py @@ -898,7 +898,7 @@ class Schedule: """Reset all the y-locations in the schedule to None""" self._y_locations = defaultdict(lambda: None) - def plot_in_axes(self, ax: Axes, operation_gap: Optional[float] = None) -> None: + def plot(self, ax: Axes, operation_gap: Optional[float] = None) -> None: """ Plot the schedule in a :class:`matplotlib.axes.Axes` or subclass. @@ -912,9 +912,9 @@ class Schedule: """ self._plot_schedule(ax, operation_gap=operation_gap) - def plot(self, operation_gap: Optional[float] = None) -> None: + def show(self, operation_gap: Optional[float] = None) -> None: """ - Plot the schedule. Will display based on the current Matplotlib backend. + Show the schedule. Will display based on the current Matplotlib backend. Parameters ---------- diff --git a/examples/secondorderdirectformiir.py b/examples/secondorderdirectformiir.py index f6aefffe3a8f84b005af7d0e154c0519b67d6262..e78a48f32e25b53cfa18f301de2aa2873379b1f1 100644 --- a/examples/secondorderdirectformiir.py +++ b/examples/secondorderdirectformiir.py @@ -27,9 +27,7 @@ a0 = ConstantMultiplication(0.7, add1, "A0") add4 = Addition(a0, add3, "ADD4") out1 = Output(add4, "OUT1") -sfg = SFG( - inputs=[in1], outputs=[out1], name="Second-order direct form IIR filter" -) +sfg = SFG(inputs=[in1], outputs=[out1], name="Second-order direct form IIR filter") # %% # Set latencies and execution times @@ -42,4 +40,4 @@ sfg.set_execution_time_of_type(Addition.type_name(), 1) # Create schedule schedule = Schedule(sfg, cyclic=True) -schedule.plot() +schedule.show() diff --git a/examples/threepointwinograddft.py b/examples/threepointwinograddft.py index 36a332f0353660713203b9e2ad6a0cda6416a580..17ec5c42248e4635677dcca13381a6c0d47ec1de 100644 --- a/examples/threepointwinograddft.py +++ b/examples/threepointwinograddft.py @@ -6,11 +6,7 @@ Three-point Winograd DFT from math import cos, pi, sin -from b_asic.core_operations import ( - Addition, - ConstantMultiplication, - Subtraction, -) +from b_asic.core_operations import Addition, ConstantMultiplication, Subtraction from b_asic.schedule import Schedule from b_asic.signal_flow_graph import SFG from b_asic.special_operations import Input, Output @@ -53,6 +49,6 @@ sfg.set_execution_time_of_type(Subtraction.type_name(), 1) # %% # Generate schedule schedule = Schedule(sfg, cyclic=True) -schedule.plot() +schedule.show() pc = schedule.get_memory_variables() diff --git a/test/test_resources.py b/test/test_resources.py index ea0b0d0099aad604b6f54390c436f4a108a910a2..5d00ccf248b9db8bbd5e6a0632619fa7988be869 100644 --- a/test/test_resources.py +++ b/test/test_resources.py @@ -14,13 +14,13 @@ class TestProcessCollectionPlainMemoryVariable: @pytest.mark.mpl_image_compare(style='mpl20') def test_draw_process_collection(self, simple_collection): fig, ax = plt.subplots() - simple_collection.draw_lifetime_chart(ax=ax, show_markers=False) + simple_collection.plot(ax=ax, show_markers=False) return fig @pytest.mark.mpl_image_compare(style='mpl20') def test_draw_matrix_transposer_4(self): fig, ax = plt.subplots() - generate_matrix_transposer(4).draw_lifetime_chart(ax=ax) + generate_matrix_transposer(4).plot(ax=ax) return fig def test_split_memory_variable(self, simple_collection: ProcessCollection):