diff --git a/b_asic/GUI/drag_button.py b/b_asic/GUI/drag_button.py index a6e36c9c77b372c5723377d19fc4645753f6d075..84433e9e5881baf867d210a825c6c4776dd35f9c 100644 --- a/b_asic/GUI/drag_button.py +++ b/b_asic/GUI/drag_button.py @@ -114,7 +114,9 @@ class DragButton(QPushButton): path_to_image = os.path.join( os.path.dirname(__file__), "operation_icons", - f"{self.operation_path_name}{'_grey.png' if self.pressed else '.png'}", + ( + f"{self.operation_path_name}{'_grey.png' if self.pressed else '.png'}" + ), ) self.setIcon(QIcon(path_to_image)) self.setIconSize(QSize(55, 55)) diff --git a/b_asic/core_operations.py b/b_asic/core_operations.py index 73941405ea09d9e60d6f480ac7f21029f7f5a875..a6984423b8014b55b5c7696ac6fed021d7e9ce6b 100644 --- a/b_asic/core_operations.py +++ b/b_asic/core_operations.py @@ -277,7 +277,8 @@ class Min(AbstractOperation): def evaluate(self, a, b): if isinstance(a, complex) or isinstance(b, complex): raise ValueError( - "core_operations.Min does not support complex numbers.") + "core_operations.Min does not support complex numbers." + ) return a if a < b else b @@ -316,7 +317,8 @@ class Max(AbstractOperation): def evaluate(self, a, b): if isinstance(a, complex) or isinstance(b, complex): raise ValueError( - "core_operations.Max does not support complex numbers.") + "core_operations.Max does not support complex numbers." + ) return a if a > b else b diff --git a/b_asic/scheduler_gui/graphics_graph_event.py b/b_asic/scheduler_gui/graphics_graph_event.py index 346f6e88bf74d0b93b30612785e847fc7b2875f3..dab4c1e95360114b5eb246b3e9ac314134dd1e67 100644 --- a/b_asic/scheduler_gui/graphics_graph_event.py +++ b/b_asic/scheduler_gui/graphics_graph_event.py @@ -193,6 +193,7 @@ class GraphicsGraphEvent: # PyQt5 translate coordinates of the cursor within the graphic element in the coordinate system of the parent object. The object can only move horizontally in x-axis scale steps.""" + # Qt.DragMoveCursor # button = event.button() def update_pos(item, delta_x): @@ -245,6 +246,7 @@ class GraphicsGraphEvent: # PyQt5 translate coordinates of the cursor within the graphic element in the coordinate system of the parent object. The object can only move horizontally in x-axis scale steps.""" + # Qt.DragMoveCursor # button = event.button() def update_pos(item, delta_x): diff --git a/b_asic/scheduler_gui/main_window.py b/b_asic/scheduler_gui/main_window.py index 7e3f1e2d289c9744db8db160339f439d965afba1..cb3e9a20d75e4da72fe1bcad8b695f3ef1a06881 100644 --- a/b_asic/scheduler_gui/main_window.py +++ b/b_asic/scheduler_gui/main_window.py @@ -212,8 +212,8 @@ class MainWindow(QMainWindow, Ui_MainWindow): ).load_module() except Exception as e: log.exception( - "Exception occurred. Could not load module from file '{}'.\n\n{}" - .format(abs_path_filename, e) + "Exception occurred. Could not load module from file" + " '{}'.\n\n{}".format(abs_path_filename, e) ) return diff --git a/b_asic/signal.py b/b_asic/signal.py index 63914c008d116def63287b5792d5292ca9b4f9bc..0ec3cfa637280dd5592fe209dd6ba88a79f5e3bf 100644 --- a/b_asic/signal.py +++ b/b_asic/signal.py @@ -141,7 +141,8 @@ class Signal(AbstractGraphComponent): if bits is not None: if not isinstance(bits, int): raise TypeError( - f"Bits must be an int, not {type(bits)}: {bits!r}") + f"Bits must be an int, not {type(bits)}: {bits!r}" + ) if bits < 0: raise ValueError("Bits cannot be negative") self.set_param("bits", bits) diff --git a/b_asic/signal_flow_graph.py b/b_asic/signal_flow_graph.py index 37baeca884be6682d151ca708c99b544aa773fe0..80c3db57e1df1151a6eae865bb94a1c4d384f9ee 100644 --- a/b_asic/signal_flow_graph.py +++ b/b_asic/signal_flow_graph.py @@ -624,15 +624,14 @@ class SFG(AbstractOperation): if output_comp is None: return None - if isinstance( - output_comp, Output - ): + if isinstance(output_comp, Output): raise TypeError("Source operation cannot be an output operation.") if len(output_comp.output_signals) != component.input_count: raise TypeError( - f"Source operation output count ({len(output_comp.output_signals)})" - f" does not match input count for component ({component.input_count})." - ) + "Source operation output count" + f" ({len(output_comp.output_signals)}) does not match input" + f" count for component ({component.input_count})." + ) assert len(output_comp.output_signals) == component.output_count, ( "Destination operation input count does not match output for" " component." diff --git a/test/test_sfg.py b/test/test_sfg.py index 300409959d9f74b6c49353431f113d1e00d0e46b..63287b1d7b82f896f02a11af4813b2ec786fa10b 100644 --- a/test/test_sfg.py +++ b/test/test_sfg.py @@ -250,7 +250,9 @@ class TestEvaluateOutput: def test_evaluate_output_cycle(self, operation_graph_with_cycle): sfg = SFG(outputs=[Output(operation_graph_with_cycle)]) - with pytest.raises(RuntimeError, match="Direct feedback loop detected"): + with pytest.raises( + RuntimeError, match="Direct feedback loop detected" + ): sfg.evaluate_output(0, [])