diff --git a/b_asic/_preferences.py b/b_asic/_preferences.py index 53857f98f27a4136d587daf85e96eba021b2728c..c9bb219cf4478d4e12a6774c54f2e4dda1509615 100644 --- a/b_asic/_preferences.py +++ b/b_asic/_preferences.py @@ -2,10 +2,10 @@ LATENCY_COLOR = (0, 185, 231) EXECUTION_TIME_COLOR = (255, 100, 66, 200) SIGNAL_COLOR = (0, 0, 0) -SIGNAL_LINEWIDTH = 1.0 +SIGNAL_LINEWIDTH: float = 1.0 -OPERATION_GAP = 0.5 +OPERATION_GAP: float = 0.5 -SCHEDULE_OFFSET = 0.2 +SCHEDULE_OFFSET: float = 0.2 -SPLINE_OFFSET = 0.2 +SPLINE_OFFSET: float = 0.2 diff --git a/b_asic/save_load_structure.py b/b_asic/save_load_structure.py index 74d531312112425011bcf5ad065ec81287ca53cb..2a65db0a77d47d4900a15783efeaaec2c4f83d3b 100644 --- a/b_asic/save_load_structure.py +++ b/b_asic/save_load_structure.py @@ -16,7 +16,7 @@ from b_asic.signal_flow_graph import SFG def sfg_to_python( - sfg: SFG, counter: int = 0, suffix: Optional[str] = None, schedule=False + sfg: SFG, counter: int = 0, suffix: Optional[str] = None, schedule: bool = False ) -> str: """ Given an SFG structure try to serialize it for saving to a file. diff --git a/b_asic/schedule.py b/b_asic/schedule.py index b07d41d53492b4416e1dbc22809cf7c04f0e3543..6d25eac3643d3af7a2e5b00f7ad8123fe6a0b807 100644 --- a/b_asic/schedule.py +++ b/b_asic/schedule.py @@ -7,7 +7,7 @@ Contains the schedule class for scheduling operations in an SFG. import io import sys from collections import defaultdict -from typing import Dict, List, Optional, Tuple, cast +from typing import Dict, List, Optional, Sequence, Tuple, cast import matplotlib.pyplot as plt import numpy as np @@ -720,8 +720,8 @@ class Schedule: line_cache = [] def _draw_arrow( - start: List[float], end: List[float], name: str = "", laps: int = 0 - ): + start: Sequence[float], end: Sequence[float], name: str = "", laps: int = 0 + ) -> None: """Draw an arrow from *start* to *end*.""" if end[0] < start[0] or laps > 0: # Wrap around if start not in line_cache: @@ -802,7 +802,14 @@ class Schedule: ) ax.add_patch(path_patch) - def _draw_offset_arrow(start, end, start_offset, end_offset, name="", laps=0): + def _draw_offset_arrow( + start: Sequence[float], + end: Sequence[float], + start_offset: Sequence[float], + end_offset: Sequence[float], + name: str = "", + laps: int = 0, + ) -> None: """Draw an arrow from *start* to *end*, but with an offset.""" _draw_arrow( [start[0] + start_offset[0], start[1] + start_offset[1]],