richqueue 1.2__tar.gz → 1.3__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.3}/PKG-INFO +1 -1
- {richqueue-1.2 → richqueue-1.3}/pyproject.toml +1 -1
- {richqueue-1.2 → richqueue-1.3}/richqueue/layout.py +9 -2
- {richqueue-1.2 → richqueue-1.3}/richqueue/slurm.py +56 -31
- {richqueue-1.2 → richqueue-1.3}/.gitignore +0 -0
- {richqueue-1.2 → richqueue-1.3}/LICENSE +0 -0
- {richqueue-1.2 → richqueue-1.3}/README.md +0 -0
- {richqueue-1.2 → richqueue-1.3}/richqueue/__init__.py +0 -0
- {richqueue-1.2 → richqueue-1.3}/richqueue/console.py +0 -0
- {richqueue-1.2 → richqueue-1.3}/richqueue/main.py +0 -0
- {richqueue-1.2 → richqueue-1.3}/richqueue/table.py +0 -0
- {richqueue-1.2 → richqueue-1.3}/richqueue/tools.py +0 -0
- {richqueue-1.2 → richqueue-1.3}/richqueue/wisdom.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,67 @@ 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
|
-
running_limit = None
|
|
50
|
+
max_rows = console_height - 2 * PANEL_PADDING
|
|
51
|
+
|
|
52
|
+
if n_rows > max_rows:
|
|
50
53
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
# hide history?
|
|
55
|
+
if n_running + n_pending + PANEL_PADDING + 1 < console_height:
|
|
56
|
+
history_limit = 0
|
|
57
|
+
running_limit = None
|
|
58
|
+
|
|
59
|
+
# hide pending?
|
|
60
|
+
elif n_rows - n_pending < max_rows:
|
|
61
|
+
# running_df = running_df[running_df["job_state"]=="RUNNING"]
|
|
62
|
+
running_limit = None
|
|
63
|
+
history_limit = None
|
|
64
|
+
hide_pending = n_pending
|
|
65
|
+
|
|
66
|
+
# fallback clip
|
|
67
|
+
else:
|
|
68
|
+
running_limit = 5
|
|
69
|
+
history_limit = 5
|
|
70
|
+
|
|
71
|
+
else:
|
|
54
72
|
running_limit = None
|
|
55
73
|
history_limit = None
|
|
56
|
-
hide_pending = n_pending
|
|
57
74
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
75
|
+
running = Panel(
|
|
76
|
+
running_job_table(
|
|
77
|
+
running_df,
|
|
78
|
+
limit=running_limit,
|
|
79
|
+
hide_pending=hide_pending,
|
|
80
|
+
user=user,
|
|
81
|
+
**kwargs,
|
|
82
|
+
),
|
|
83
|
+
expand=False,
|
|
84
|
+
)
|
|
62
85
|
|
|
63
86
|
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
|
-
)
|
|
87
|
+
|
|
88
|
+
history_limit = console_height - PANEL_PADDING - 3
|
|
89
|
+
running = Panel(Text("No active jobs", style="bold"), expand=False)
|
|
77
90
|
|
|
78
91
|
if history_limit == 0:
|
|
79
|
-
history = Text("history hidden, resize window or use --hist")
|
|
92
|
+
history = Panel(Text("history hidden, resize window or use smaller --hist value", style="bold"), expand=False)
|
|
80
93
|
else:
|
|
81
94
|
history = Panel(
|
|
82
95
|
history_job_table(history_df, limit=history_limit, user=user, **kwargs),
|
|
@@ -177,6 +190,9 @@ def get_squeue(
|
|
|
177
190
|
# filter columns
|
|
178
191
|
columns = COLUMNS["squeue"]
|
|
179
192
|
|
|
193
|
+
if not len(df):
|
|
194
|
+
return DataFrame(columns=columns)
|
|
195
|
+
|
|
180
196
|
try:
|
|
181
197
|
df = df[columns]
|
|
182
198
|
except KeyError:
|
|
@@ -342,7 +358,16 @@ def combined_df(**kwargs) -> "DataFrame":
|
|
|
342
358
|
"""Get combined DataFrame of SLURM job information"""
|
|
343
359
|
df1 = get_squeue(**kwargs)
|
|
344
360
|
df2 = get_sacct(**kwargs)
|
|
345
|
-
|
|
361
|
+
|
|
362
|
+
if len(df1) and len(df2):
|
|
363
|
+
df = concat([df1, df2], ignore_index=True)
|
|
364
|
+
elif len(df1):
|
|
365
|
+
df = df1
|
|
366
|
+
elif len(df2):
|
|
367
|
+
df = df2
|
|
368
|
+
else:
|
|
369
|
+
return None
|
|
370
|
+
|
|
346
371
|
df["run_time"] = add_run_time(df)
|
|
347
372
|
df = df.sort_values(by="submit_time", ascending=True)
|
|
348
373
|
return df
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|