-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdashboard.py
74 lines (60 loc) · 2.35 KB
/
dashboard.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Copyright (c) 2022-2025 The Regents of the University of Michigan.
# Part of HOOMD-blue, released under the BSD 3-Clause License.
"""Dashboard."""
from signac_dashboard import Dashboard
from signac_dashboard.modules import ImageViewer, StatepointList
modules = [
StatepointList(),
ImageViewer(context='JobContext', img_globs=('*.png', '*.jpg', '*.gif', '*.svg')),
ImageViewer(
context='ProjectContext', img_globs=('*.png', '*.jpg', '*.gif', '*.svg')
),
]
class ValidationDashboard(Dashboard):
"""Dashboard application."""
def job_title(self, job):
"""Name jobs."""
if job.cached_statepoint['subproject'] == 'lj_fluid':
return (
f'lj_fluid: kT={job.cached_statepoint["kT"]}, '
f'rho={job.cached_statepoint["density"]}, '
f'N={job.cached_statepoint["num_particles"]}'
)
if job.cached_statepoint['subproject'] == 'lj_union':
return (
f'lj_union: kT={job.cached_statepoint["kT"]}, '
f'rho={job.cached_statepoint["density"]}'
)
if job.cached_statepoint['subproject'] == 'alj_2d':
return (
f'alj_2d: kT={job.cached_statepoint["kT"]}, '
f'rho={job.cached_statepoint["density"]}'
)
if job.cached_statepoint['subproject'] in (
'hard_disk',
'hard_sphere',
'simple_polygon',
'patchy_particle_pressure',
):
return (
f'{job.cached_statepoint["subproject"]}: '
f'rho={job.cached_statepoint["density"]}'
)
raise RuntimeError('Unexpected job')
def job_sorter(self, job):
"""Sort jobs."""
if job.cached_statepoint['subproject'] == 'patchy_particle_pressure':
return (
job.cached_statepoint['subproject'],
job.cached_statepoint['density'],
job.cached_statepoint['pressure'],
job.cached_statepoint['temperature'],
job.cached_statepoint['chi'],
job.cached_statepoint['replicate_idx'],
)
return (
job.cached_statepoint['subproject'],
job.cached_statepoint['num_particles'],
)
if __name__ == '__main__':
ValidationDashboard(modules=modules).main()