A defect instance. Forms a row in the table.
Definition at line 49 of file dq_defect_info_table.py.
◆ __init__()
def dq_defect_info_table.Defect.__init__ |
( |
|
self, |
|
|
|
name, |
|
|
|
description, |
|
|
|
iovs, |
|
|
|
virtual, |
|
|
|
intolerable, |
|
|
|
lumi |
|
) |
| |
Definition at line 53 of file dq_defect_info_table.py.
53 def __init__(self, name, description, iovs, virtual, intolerable, lumi):
54 if description == name:
59 (self.name, self.description, self.iovs, self.lumi, self.virtual,
61 name, description, iovs, lumi / 1e6, virtual, intolerable)
62 self.nlumi =
sum(iov.length
for iov
in iovs
63 if iov.since.run == iov.until.run)
64 self.nlumi_rec =
sum(iov.length
for iov
in iovs
65 if iov.recoverable
and iov.since.run == iov.until.run)
66 if self.nlumi
and self.nlumi_rec:
67 self.rec_lb_frac =
"{0:.0%}".
format(self.nlumi_rec / self.nlumi)
69 self.rec_lb_frac =
"-"
71 self.users =
set(iov.user
for iov
in iovs)
72 self.users -=
set([
"sys:virtual"])
73 self.bots =
set(u
for u
in self.users
if u.startswith(
"sys:"))
74 self.users -= self.bots
77 self.nruns = len(runs)
if runs
else "-"
78 self.latest_run =
max(runs)
if runs
else "-"
79 self.lumi =
"{0:.3f}".
format(self.lumi)
if runs
else "-"
◆ content()
def dq_defect_info_table.Defect.content |
( |
|
self | ) |
|
Definition at line 89 of file dq_defect_info_table.py.
90 td =
'<td class="icon {class_}"><span>{0}</span></td>'
91 bot_cls = user_cls =
""
92 if len(self.users) == 1: user_cls =
"user"
93 if len(self.users) > 1: user_cls =
"users"
94 if len(self.bots): bot_cls =
"bots"
96 virt_class =
"virtual" if self.virtual
else "primary"
97 tol_class =
"intolerable" if self.intolerable
else "tolerable"
98 virt_sort = 1
if self.virtual
else 0
99 tol_sort = 1
if self.virtual
else 0
102 td.format(virt_sort, class_=virt_class),
103 td.format(tol_sort, class_=tol_class),
104 td.format(
", ".
join(self.users), class_=user_cls),
105 td.format(
", ".
join(self.bots), class_=bot_cls),
106 content_string.format(d=self)
◆ name_with_url()
def dq_defect_info_table.Defect.name_with_url |
( |
|
self | ) |
|
Definition at line 82 of file dq_defect_info_table.py.
82 def name_with_url(self):
83 if self.virtual
or self.intolerable:
84 return '<a href="{0}/{1}.svg">{1}</a>'.
format(GRAPH_URL, self.name)
86 return "{0}".
format(self.name)
◆ bots
dq_defect_info_table.Defect.bots |
◆ latest_run
dq_defect_info_table.Defect.latest_run |
◆ lumi
dq_defect_info_table.Defect.lumi |
◆ nlumi
dq_defect_info_table.Defect.nlumi |
◆ nlumi_rec
dq_defect_info_table.Defect.nlumi_rec |
◆ nruns
dq_defect_info_table.Defect.nruns |
◆ rec_lb_frac
dq_defect_info_table.Defect.rec_lb_frac |
◆ users
dq_defect_info_table.Defect.users |
The documentation for this class was generated from the following file:
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.