Skip to content

Commit c0093c3

Browse files
[pre-commit.ci] Add auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 7f4a4c3 commit c0093c3

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

vec_inf/cli/_helper.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,17 @@ class ListStatusDisplay:
263263
List of model status information
264264
"""
265265

266-
def __init__(self, job_ids: list[str], statuses: list[StatusResponse], json_mode: bool = False):
266+
def __init__(
267+
self,
268+
job_ids: list[str],
269+
statuses: list[StatusResponse],
270+
json_mode: bool = False,
271+
):
267272
self.job_ids = job_ids
268273
self.statuses = statuses
269274
self.json_mode = json_mode
270-
271-
self.table = Table(show_header=True,header_style="bold magenta")
275+
276+
self.table = Table(show_header=True, header_style="bold magenta")
272277
self.table.add_column("Job ID")
273278
self.table.add_column("Model Name")
274279
self.table.add_column("Status", style="blue")
@@ -301,6 +306,7 @@ def display_multiple_status_output(self, console: Console) -> None:
301306
)
302307
console.print(self.table)
303308

309+
304310
class MetricsResponseFormatter:
305311
"""CLI Helper class for formatting MetricsResponse.
306312

vec_inf/client/api.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
vec_inf.client.models : Data models for API responses
1111
"""
1212

13+
import re
1314
import shutil
15+
import subprocess
1416
import time
1517
import warnings
1618
from pathlib import Path
17-
import re
18-
import subprocess
1919
from typing import Any, Optional, Union
2020

2121
from vec_inf.client._exceptions import (
@@ -192,14 +192,17 @@ def fetch_running_jobs(self) -> list[str]:
192192
list[str]
193193
List of matching job names; empty list if squeue unavailable.
194194
"""
195-
196195
try:
197196
# Run squeue for current user
198197
res = subprocess.run(
199198
["squeue", "--me", "--noheader"],
200-
capture_output=True, text=True, check=True
199+
capture_output=True,
200+
text=True,
201+
check=True,
201202
)
202-
job_ids = [ln.strip().split()[0] for ln in res.stdout.splitlines() if ln.strip()]
203+
job_ids = [
204+
ln.strip().split()[0] for ln in res.stdout.splitlines() if ln.strip()
205+
]
203206

204207
if not job_ids:
205208
return []
@@ -210,7 +213,9 @@ def fetch_running_jobs(self) -> list[str]:
210213
try:
211214
sctl = subprocess.run(
212215
["scontrol", "show", "job", "-o", jid],
213-
capture_output=True, text=True, check=True
216+
capture_output=True,
217+
text=True,
218+
check=True,
214219
)
215220
# Example: "JobId=12345 JobName=my-long-job-name-vec-inf ..."
216221
m = re.search(r"\bJobName=([^\s]+)", sctl.stdout)
@@ -225,7 +230,6 @@ def fetch_running_jobs(self) -> list[str]:
225230
except subprocess.CalledProcessError as e:
226231
raise SlurmJobError(f"Error running slurm command: {e}") from e
227232

228-
229233
def get_status(self, slurm_job_id: str) -> StatusResponse:
230234
"""Get the status of a running model.
231235

0 commit comments

Comments
 (0)