richqueue 1.2__tar.gz → 1.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {richqueue-1.2 → richqueue-1.4}/PKG-INFO +1 -1
- {richqueue-1.2 → richqueue-1.4}/pyproject.toml +1 -1
- {richqueue-1.2 → richqueue-1.4}/richqueue/layout.py +9 -2
- {richqueue-1.2 → richqueue-1.4}/richqueue/slurm.py +64 -31
- {richqueue-1.2 → richqueue-1.4}/richqueue/table.py +2 -0
- {richqueue-1.2 → richqueue-1.4}/richqueue/wisdom.py +3 -1
- {richqueue-1.2 → richqueue-1.4}/.gitignore +0 -0
- {richqueue-1.2 → richqueue-1.4}/LICENSE +0 -0
- {richqueue-1.2 → richqueue-1.4}/README.md +0 -0
- {richqueue-1.2 → richqueue-1.4}/richqueue/__init__.py +0 -0
- {richqueue-1.2 → richqueue-1.4}/richqueue/console.py +0 -0
- {richqueue-1.2 → richqueue-1.4}/richqueue/main.py +0 -0
- {richqueue-1.2 → richqueue-1.4}/richqueue/tools.py +0 -0
|
@@ -13,8 +13,15 @@ def dual_layout(function, **kwargs):
|
|
|
13
13
|
upper = Layout(renderable=upper, name="upper")
|
|
14
14
|
lower = Layout(renderable=lower, name="lower")
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
try:
|
|
17
|
+
upper.size = upper.renderable.renderable.row_count + PANEL_PADDING
|
|
18
|
+
except AttributeError:
|
|
19
|
+
upper.size = 3 # + PANEL_PADDING
|
|
20
|
+
|
|
21
|
+
try:
|
|
22
|
+
lower.size = lower.renderable.renderable.row_count + PANEL_PADDING
|
|
23
|
+
except AttributeError:
|
|
24
|
+
lower.size = 3 # + PANEL_PADDING
|
|
18
25
|
|
|
19
26
|
layout.split_column(
|
|
20
27
|
upper,
|
|
@@ -29,54 +29,75 @@ def get_layout_pair(user: str | None, **kwargs):
|
|
|
29
29
|
|
|
30
30
|
df = combined_df(user=user, **kwargs)
|
|
31
31
|
|
|
32
|
+
# if df is None:
|
|
33
|
+
# running = Panel(Text("[bold]No active jobs"), expand=False)
|
|
34
|
+
# else:
|
|
35
|
+
|
|
32
36
|
n_rows = len(df)
|
|
33
37
|
n_running = len(df[df["job_state"] == "RUNNING"])
|
|
34
38
|
n_pending = len(df[df["job_state"] == "PENDING"])
|
|
35
39
|
|
|
36
40
|
hide_pending = False
|
|
37
41
|
|
|
38
|
-
|
|
42
|
+
console_height = console.size.height
|
|
43
|
+
|
|
39
44
|
history_df = df[~df["job_state"].isin(["RUNNING", "PENDING"])]
|
|
40
45
|
|
|
41
|
-
|
|
42
|
-
max_rows = console_height - 2 * PANEL_PADDING
|
|
46
|
+
if n_running + n_pending > 0:
|
|
43
47
|
|
|
44
|
-
|
|
48
|
+
running_df = df[df["job_state"].isin(["RUNNING", "PENDING"])]
|
|
45
49
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
active_height = n_running + n_pending + PANEL_PADDING
|
|
51
|
+
|
|
52
|
+
max_rows = console_height - 2 * PANEL_PADDING
|
|
53
|
+
|
|
54
|
+
if n_rows > max_rows:
|
|
50
55
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
# hide history?
|
|
57
|
+
if active_height < console_height - PANEL_PADDING:
|
|
58
|
+
history_limit = max(0, console_height - PANEL_PADDING - active_height)
|
|
59
|
+
running_limit = None
|
|
60
|
+
|
|
61
|
+
# hide pending?
|
|
62
|
+
elif n_rows - n_pending < max_rows:
|
|
63
|
+
# running_df = running_df[running_df["job_state"]=="RUNNING"]
|
|
64
|
+
running_limit = None
|
|
65
|
+
history_limit = None
|
|
66
|
+
hide_pending = n_pending
|
|
67
|
+
|
|
68
|
+
# fallback clip
|
|
69
|
+
else:
|
|
70
|
+
running_limit = 5
|
|
71
|
+
history_limit = 5
|
|
72
|
+
|
|
73
|
+
else:
|
|
54
74
|
running_limit = None
|
|
55
75
|
history_limit = None
|
|
56
|
-
hide_pending = n_pending
|
|
57
76
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
77
|
+
running = Panel(
|
|
78
|
+
running_job_table(
|
|
79
|
+
running_df,
|
|
80
|
+
limit=running_limit,
|
|
81
|
+
hide_pending=hide_pending,
|
|
82
|
+
user=user,
|
|
83
|
+
**kwargs,
|
|
84
|
+
),
|
|
85
|
+
expand=False,
|
|
86
|
+
)
|
|
62
87
|
|
|
63
88
|
else:
|
|
64
|
-
|
|
65
|
-
history_limit =
|
|
66
|
-
|
|
67
|
-
running = Panel(
|
|
68
|
-
running_job_table(
|
|
69
|
-
running_df,
|
|
70
|
-
limit=running_limit,
|
|
71
|
-
hide_pending=hide_pending,
|
|
72
|
-
user=user,
|
|
73
|
-
**kwargs,
|
|
74
|
-
),
|
|
75
|
-
expand=False,
|
|
76
|
-
)
|
|
89
|
+
|
|
90
|
+
history_limit = console_height - PANEL_PADDING - 3
|
|
91
|
+
running = Panel(Text("No active jobs", style="bold"), expand=False)
|
|
77
92
|
|
|
78
93
|
if history_limit == 0:
|
|
79
|
-
history =
|
|
94
|
+
history = Panel(
|
|
95
|
+
Text(
|
|
96
|
+
"history hidden, resize window or use smaller --hist value",
|
|
97
|
+
style="bold",
|
|
98
|
+
),
|
|
99
|
+
expand=False,
|
|
100
|
+
)
|
|
80
101
|
else:
|
|
81
102
|
history = Panel(
|
|
82
103
|
history_job_table(history_df, limit=history_limit, user=user, **kwargs),
|
|
@@ -177,6 +198,9 @@ def get_squeue(
|
|
|
177
198
|
# filter columns
|
|
178
199
|
columns = COLUMNS["squeue"]
|
|
179
200
|
|
|
201
|
+
if not len(df):
|
|
202
|
+
return DataFrame(columns=columns)
|
|
203
|
+
|
|
180
204
|
try:
|
|
181
205
|
df = df[columns]
|
|
182
206
|
except KeyError:
|
|
@@ -342,7 +366,16 @@ def combined_df(**kwargs) -> "DataFrame":
|
|
|
342
366
|
"""Get combined DataFrame of SLURM job information"""
|
|
343
367
|
df1 = get_squeue(**kwargs)
|
|
344
368
|
df2 = get_sacct(**kwargs)
|
|
345
|
-
|
|
369
|
+
|
|
370
|
+
if len(df1) and len(df2):
|
|
371
|
+
df = concat([df1, df2], ignore_index=True)
|
|
372
|
+
elif len(df1):
|
|
373
|
+
df = df1
|
|
374
|
+
elif len(df2):
|
|
375
|
+
df = df2
|
|
376
|
+
else:
|
|
377
|
+
return None
|
|
378
|
+
|
|
346
379
|
df["run_time"] = add_run_time(df)
|
|
347
380
|
df = df.sort_values(by="submit_time", ascending=True)
|
|
348
381
|
return df
|
|
@@ -213,6 +213,8 @@ def color_by_state(state):
|
|
|
213
213
|
return "[bright_yellow]Pending"
|
|
214
214
|
elif state == "MIXED":
|
|
215
215
|
return "[bright_yellow]Mixed"
|
|
216
|
+
elif state == "TIMEOUT":
|
|
217
|
+
return "[bold bright_yellow]Timed Out"
|
|
216
218
|
elif state == "CANCELLED":
|
|
217
219
|
return "[orange3]Cancelled"
|
|
218
220
|
elif state == "FAILED":
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|