17 Define datatypes for later serialization by json
30 Base object for all json-serializable objects of the validation suite
37 Contains information about a specific revision
46 creation_timezone=None,
49 Create a new Revision object and fill all members
71 self.
packagespackages = []
if (packages
is None)
else packages
77 Container for a list of revisions
82 Create a new Revisions object and fill all members
92 Contains information about a script and its execution output
95 def __init__(self, name, path, status, log_url=None, return_code=None):
97 Create a new Script object and fill all members
119 Wrapper for a file containing a set of plots, only
123 def __init__(self, package, title, rootfile, plots, description=""):
125 Create a new PlotFile object and fill all members
145 Wrapper for one specfic plot.
158 Create a new Plot object and fill all members
178 Wrapper for NTuple lists. This is not a graphical plot, but a list of
182 def __init__(self, is_expert=False, description=None, check=None):
184 Create a new NTuple object and fill all members
198 Wrapper for user HTML Content. This is not a graphical plot but HTML
199 code which will be directly output on the validation website.
203 def __init__(self, is_expert=False, description=None, check=None):
205 Create a new NTuple object and fill all members
219 One high-level package of the validation suites which contains a set of
220 scripts and output plot files
223 def __init__(self, name, plotfiles=None, scriptfiles=None, fail_count=0):
225 Create a new NTuple object and fill all members
248 Enum to classify the comparison result of two validation plots
253 NotCompared =
"not_compared"
256 NotSupported =
"not_supported"
259 FailureTechnical =
"technical_failure"
262 FailureStastical =
"statistical_failure"
271 Contains the comparison result of two plots
276 Create a new ComparisonResult object and fill all members
288 Contains information about a file containing plots and the comparison which
289 have been performed for the content of this file
297 compared_revisions=None,
305 Create a new ComparisonPlotFile object and fill all members
316 package, title, rootfile, plots, description=description
330 [plt
for plt
in self.
plotsplots
if plt.comparison_result ==
"error"]
336 for plt
in self.
plotsplots
337 if (
not plt.is_expert)
and plt.comparison_result ==
"error"
342 [plt
for plt
in self.
plotsplots
if plt.comparison_result ==
"warning"]
349 for plt
in self.
plotsplots
350 if (
not plt.is_expert)
and plt.comparison_result ==
"warning"
356 [
not tuple.is_expert
for tuple
in self.
ntuplesntuples]
368 One individual plot including its comparison outcome.
374 comparison_result=None,
382 comparison_text=None,
388 Create a new ComparisonPlot object and fill all members
394 description=description,
428 Comparison outcome for NTuples
441 Create a new ComparisonNTuple object and fill all members
446 is_expert=is_expert, description=description, check=check
460 Compiled HTLM Content
473 Create a new ComparisonNTuple object and fill all members
478 is_expert=is_expert, description=description, check=check
492 Information about a Package which was used in a comparison operation
496 self, name, plotfiles=None, scriptfiles=None, ntuplefiles=None
499 Create a new ComparisonPackage object and fill all members
509 super().
__init__(name, plotfiles=plotfiles, scriptfiles=scriptfiles)
515 [pf.comparison_error_shifter
for pf
in plotfiles]
519 [pf.comparison_warning
for pf
in plotfiles]
524 [pf.comparison_warning_shifter
for pf
in plotfiles]
531 Revision information enriched by the information gained during
535 def __init__(self, label, git_hash=None, creation_date=None, color=None):
537 Create a new ComparisonRevision object and fill all members
541 super().
__init__(label, git_hash=git_hash, creation_date=
None)
550 Contains information and plots generated for comparisons
556 Create a new ComparisonRevision object and fill all members
568 sorted_revs = sorted(revisions, key=
lambda x: x.label)
571 lambda x, y: x +
"_" + y.label, sorted_revs,
""
580 def dump(file_name, obj):
582 Output a tree of objects into a json file
585 with open(file_name,
"w+")
as f:
586 json.dump(dump_rec(obj), f, sort_keys=
True, indent=4)
591 Convert a tree of python objects into a json file
595 return json.dumps(kk, sort_keys=
True, indent=4)
598 def dump_rec(top_object):
600 Recursive generating of dictionary from a tree
606 for (k, v)
in top_object.__dict__.items():
609 if isinstance(v, list):
614 if isinstance(it, JsonBase):
616 obj_list.append(dump_rec(it))
622 this_dict[k] = obj_list
625 elif isinstance(v, JsonBase):
626 this_dict[k] = dump_rec(v)
628 elif isinstance(v, enum.Enum):
629 this_dict[k] = v.value
title
Text used as title for the ntuple item.
def __init__(self, title, contact=None, description=None, check=None, is_expert=None, html_content=None)
contact
name of contact person
html_content
path to the json file which contains the individual numbers of the ntuple
title
Text used as title for the ntuple item.
contact
name of contact person
json_file_path
path to the json file which contains the individual numbers of the ntuple (must be relative to html d...
def __init__(self, title, contact=None, description=None, check=None, is_expert=None, json_file_path=None)
comparison_warning_shifter
the number of comparisons of shifter plots which resulted in a warning
comparison_error
the number of failed comparisons in this package
def __init__(self, name, plotfiles=None, scriptfiles=None, ntuplefiles=None)
comparison_error_shifter
the number of failed comparisons of shifter plots in this package
comparison_warning
the number of comparisons which resulted in a warning
has_reference
true if a reference file is available for this plot file
def __init__(self, package, title, rootfile, compared_revisions=None, plots=None, has_reference=False, ntuples=None, html_content=None, description=None)
comparison_warning_shifter
the number of comparisons of shifter plots in this file which resulted in a warning
comparison_error
the number of failed comparisons in this file
show_shifter
Show to shifter, i.e.
comparison_error_shifter
the number of failed comparisons of shifter plots in this file
ntuples
the ntuples which were compared
comparison_warning
the number of comparisons which resulted in a warning
compared_revision
label of the revision which were used in this comparison
html_content
user's html content
n_shifter_ntuples
Number of shifter ntuples.
title
tile used to display this plot
pdf_filename
the filename of the pdf file plotted with the comparison graphs
warnings
Warnings ("no contact" person etc.)
comparison_result
text string for the comparison outcome
plot_path
path were the png and pdf files are located (relative to the html directory; has to end with trailing...
def __init__(self, title, comparison_result=None, png_filename=None, pdf_filename=None, contact=None, description=None, check=None, is_expert=None, plot_path=None, comparison_text=None, height=None, width=None, warnings=None)
png_filename
the filename of the png file plotted with the comparison graphs
comparison_text
verbose text describing the outcome of the comparison
chi2
the chi2 value computed during the comparison
state
a string containing a description of the comparison's outcome
def __init__(self, state, chi2)
color
the color which was used for this revision in the comparison plots
def __init__(self, label, git_hash=None, creation_date=None, color=None)
label
the unique label of this comparison
packages
the list of packages looked at in this comparison
revisions
the list of revisions used in this comparison
def __init__(self, revisions=None, packages=None)
description
telling description for this HTML code
def __init__(self, is_expert=False, description=None, check=None)
is_expert
true if this is marked as an expert-only HTML code
check
what should be checked for in this HTML code
description
telling description for this ntuple
def __init__(self, is_expert=False, description=None, check=None)
is_expert
true if this is marked as an expert-only ntuple list
check
what should be checked for in this ntuple ?
visible
true if this package is displayed on the default validation website
def __init__(self, name, plotfiles=None, scriptfiles=None, fail_count=0)
plotfiles
list of plotfiles which were produced by the scripts in this package
scriptfiles
scripts which were run or skipped as this package was executed
fail_count
contains the number how many scripts failed to execute with error
title
Display name of this file.
description
Description of plot file.
plots
list of plots which are contained inside this plot file
n_shifter_plots
Number of shifter plots.
package
name of the package which created this file
rootfile
filename of the root file
def __init__(self, package, title, rootfile, plots, description="")
description
telling description for this plot
contact
Who is the contact person for this plot ?
height
height of the plot in pixels
width
width of the plot in pixels
is_expert
true if this is marked as an expert-only plot
def __init__(self, is_expert=False, description=None, check=None, contact=None, width=None, height=None)
check
What should be checked for in this plot ?
label
label (or tag) used to display this revision
packages
list of packages contained in this revision
def __init__(self, label, git_hash=None, creation_date=None, packages=None, creation_timezone=None)
most_recent
is this the most recent revision in the list this revision is contained ?
git_hash
The git commit hash which has the HEAD while the validation scripts were executed.
creation_date
date when the validation output of this revision was created, as datetime object
creation_timezone
timezone used by the creation date
def __init__(self, revisions)
status
Output status of the script execution, can be one of the strings "failed", "finished",...
def __init__(self, name, path, status, log_url=None, return_code=None)
path
path the script file is located
return_code
integer which is the return code of the script execution
name
the name of the script file
log_url
location where the log output of the script execution can be found