Skip to content

Commit cebe181

Browse files
committed
Fix linting issues
- Remove trailing whitespace - Change elif to if after return statement - Add pylint disable comments for acceptable complexity warnings
1 parent b106b5c commit cebe181

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

toolchain/mfc/sched.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def run(self):
3939

4040

4141
@dataclasses.dataclass
42-
class WorkerThreadHolder:
42+
class WorkerThreadHolder: # pylint: disable=too-many-instance-attributes
4343
thread: threading.Thread
4444
ppn: int
4545
load: float
@@ -60,7 +60,7 @@ class Task:
6060
args: typing.List[typing.Any]
6161
load: float
6262

63-
def sched(tasks: typing.List[Task], nThreads: int, devices: typing.Set[int] = None) -> None:
63+
def sched(tasks: typing.List[Task], nThreads: int, devices: typing.Set[int] = None) -> None: # pylint: disable=too-many-locals,too-many-statements
6464
nAvailable: int = nThreads
6565
threads: typing.List[WorkerThreadHolder] = []
6666

@@ -75,17 +75,16 @@ def get_case_dimensionality(case: typing.Any) -> int:
7575
"""
7676
if not hasattr(case, 'params'):
7777
return 1 # Default to 1D if we can't determine
78-
78+
7979
params = case.params
8080
p = params.get('p', 0)
8181
n = params.get('n', 0)
82-
82+
8383
if p != 0:
8484
return 3 # 3D
85-
elif n != 0:
85+
if n != 0:
8686
return 2 # 2D
87-
else:
88-
return 1 # 1D
87+
return 1 # 1D
8988

9089
def get_threshold_for_case(case: typing.Any) -> float:
9190
"""
@@ -100,10 +99,10 @@ def notify_long_running_threads(
10099
progress: rich.progress.Progress,
101100
running_tracker: typing.Optional[rich.progress.TaskID],
102101
interactive: bool
103-
) -> None:
102+
) -> None: # pylint: disable=too-many-branches
104103
"""
105104
Monitor and notify about long-running tests.
106-
105+
107106
In interactive mode: prints once when a test crosses its dimension-aware threshold
108107
and updates the live progress bar. In headless mode: prints milestone notifications
109108
at 2, 10, and 30 minutes.
@@ -123,10 +122,10 @@ def notify_long_running_threads(
123122
# --- interactive: dimension-aware thresholds ---
124123
if interactive:
125124
threshold = get_threshold_for_case(case)
126-
125+
127126
if elapsed >= threshold:
128127
long_running_for_progress.append((case_uuid, case_trace))
129-
128+
130129
# Print explicit line once when crossing threshold
131130
if not holder.notified_interactive:
132131
dim = get_case_dimensionality(case)

0 commit comments

Comments
 (0)