 |
Belle II Software
release-05-02-19
|
10 Define datatypes for later serialization by json
23 Base object for all json-serializable objects of the validation suite
31 Contains information about a specific revision
34 def __init__(self, label, git_hash=None, creation_date=None, packages=None,
35 creation_timezone=None):
37 Create a new Revision object and fill all members
59 self.
packages = []
if (packages
is None)
else packages
65 Container for a list of revisions
70 Create a new Revisions object and fill all members
80 Contains information about a script and its execution output
83 def __init__(self, name, path, status, log_url=None, return_code=None):
85 Create a new Script object and fill all members
107 Wrapper for a file containing a set of plots, only
111 def __init__(self, package, title, rootfile, plots, description=""):
113 Create a new PlotFile object and fill all members
133 Wrapper for one specfic plot.
136 def __init__(self, is_expert=False, description=None, check=None,
137 contact=None, width=None, height=None):
139 Create a new Plot object and fill all members
159 Wrapper for NTuple lists. This is not a graphical plot, but a list of
163 def __init__(self, is_expert=False, description=None, check=None):
165 Create a new NTuple object and fill all members
179 Wrapper for user HTML Content. This is not a graphical plot but HTML
180 code which will be directly output on the validation website.
184 def __init__(self, is_expert=False, description=None, check=None):
186 Create a new NTuple object and fill all members
200 One high-level package of the validation suites which contains a set of
201 scripts and output plot files
204 def __init__(self, name, plotfiles=None, scriptfiles=None, fail_count=0):
206 Create a new NTuple object and fill all members
229 Enum to classify the comparison result of two validation plots
234 NotCompared =
"not_compared"
237 NotSupported =
"not_supported"
240 FailureTechnical =
"technical_failure"
243 FailureStastical =
"statistical_failure"
252 Contains the comparison result of two plots
257 Create a new ComparisonResult object and fill all members
269 Contains information about a file containing plots and the comparison which
270 have been performed for the content of this file
278 compared_revisions=None,
286 Create a new ComparisonPlotFile object and fill all members
296 super().
__init__(package, title, rootfile, plots,
297 description=description)
310 plt
for plt
in self.
plots if plt.comparison_result ==
"error"
314 plt
for plt
in self.
plots
315 if (
not plt.is_expert)
and plt.comparison_result ==
"error"
319 plt
for plt
in self.
plots if plt.comparison_result ==
"warning"
324 plt
for plt
in self.
plots
325 if (
not plt.is_expert)
and plt.comparison_result ==
"warning"
330 not tuple.is_expert
for tuple
in self.
ntuples
344 One individual plot including its comparison outcome.
350 comparison_result=None,
358 comparison_text=None,
363 Create a new ComparisonPlot object and fill all members
369 description=description,
403 Comparison outcome for NTuples
413 json_file_path=None):
415 Create a new ComparisonNTuple object and fill all members
421 description=description,
436 Compiled HTLM Content
448 Create a new ComparisonNTuple object and fill all members
452 super().
__init__(is_expert=is_expert, description=description, check=check)
465 Information about a Package which was used in a comparison operation
468 def __init__(self, name, plotfiles=None, scriptfiles=None,
471 Create a new ComparisonPackage object and fill all members
481 super().
__init__(name, plotfiles=plotfiles, scriptfiles=scriptfiles)
485 pf.comparison_error
for pf
in plotfiles
489 pf.comparison_error_shifter
for pf
in plotfiles
493 pf.comparison_warning
for pf
in plotfiles
498 pf.comparison_warning_shifter
for pf
in plotfiles
505 Revision information enriched by the information gained during
509 def __init__(self, label, git_hash=None, creation_date=None, color=None):
511 Create a new ComparisonRevision object and fill all members
515 super().
__init__(label, git_hash=git_hash, creation_date=
None)
524 Contains information and plots generated for comparisons
530 Create a new ComparisonRevision object and fill all members
542 sorted_revs = sorted(revisions, key=
lambda x: x.label)
545 lambda x, y: x +
"_" + y.label,
554 def dump(file_name, obj):
556 Output a tree of objects into a json file
559 with open(file_name,
'w+')
as f:
560 json.dump(dump_rec(obj), f, sort_keys=
True, indent=4)
565 Convert a tree of python objects into a json file
569 return json.dumps(kk, sort_keys=
True, indent=4)
572 def dump_rec(top_object):
574 Recursive generating of dictionary from a tree
580 for (k, v)
in top_object.__dict__.items():
583 if isinstance(v, list):
588 if isinstance(it, JsonBase):
590 obj_list.append(dump_rec(it))
596 this_dict[k] = obj_list
599 elif isinstance(v, JsonBase):
600 this_dict[k] = dump_rec(v)
602 elif isinstance(v, enum.Enum):
603 this_dict[k] = v.value
pdf_filename
the filename of the pdf file plotted with the comparison graphs
title
Display name of this file.
show_shifter
Show to shifter, i.e.
is_expert
true if this is marked as an expert-only ntuple list
comparison_result
text string for the comparison outcome
scriptfiles
scripts which were run or skipped as this package was executed
state
a string containing a description of the comparison's outcome
def __init__(self, revisions=None, packages=None)
package
name of the package which created this file
def __init__(self, label, git_hash=None, creation_date=None, packages=None, creation_timezone=None)
html_content
user's html content
packages
list of packages contained in this revision
def __init__(self, revisions)
most_recent
is this the most recent revision in the list this revision is contained ?
creation_timezone
timezone used by the creation date
color
the color which was used for this revision in the comparison plots
def __init__(self, name, plotfiles=None, scriptfiles=None, ntuplefiles=None)
description
telling description for this HTML code
n_shifter_plots
Number of shifter plots.
def __init__(self, title, contact=None, description=None, check=None, is_expert=None, html_content=None)
def __init__(self, is_expert=False, description=None, check=None, contact=None, width=None, height=None)
comparison_error_shifter
the number of failed comparisons of shifter plots in this file
def __init__(self, label, git_hash=None, creation_date=None, color=None)
chi2
the chi2 value computed during the comparison
label
label (or tag) used to display this revision
ntuples
the ntuples which were compared
creation_date
date when the validation output of this revision was created, as datetime object
title
tile used to display this plot
log_url
location where the log output of the script execution can be found
html_content
path to the json file which contains the individual numbers of the ntuple
contact
name of contact person
revisions
the list of revisions used in this comparison
comparison_warning_shifter
the number of comparisons of shifter plots which resulted in a warning
comparison_text
verbose text describing the outcome of the comparison
n_shifter_ntuples
Number of shifter ntuples.
has_reference
true if a reference file is available for this plot file
status
Output status of the script execution, can be one of the strings "failed", "finished",...
def __init__(self, state, chi2)
def __init__(self, package, title, rootfile, plots, description="")
fail_count
contains the number how many scripts failed to execute with error
check
what should be checked for in this HTML code
label
the unique label of this comparison
description
telling description for this plot
contact
name of contact person
width
width of the plot in pixels
name
the name of the script file
git_hash
The git commit hash which has the HEAD while the validation scripts were executed.
check
what should be checked for in this ntuple ?
png_filename
the filename of the png file plotted with the comparison graphs
title
Text used as title for the ntuple item.
rootfile
filename of the root file
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, is_expert=False, description=None, check=None)
def __init__(self, title, contact=None, description=None, check=None, is_expert=None, json_file_path=None)
compared_revision
label of the revision which were used in this comparison
def __init__(self, name, plotfiles=None, scriptfiles=None, fail_count=0)
def __init__(self, name, path, status, log_url=None, return_code=None)
comparison_warning_shifter
the number of comparisons of shifter plots in this file which resulted in a warning
packages
the list of packages looked at in this comparison
plot_path
path were the png and pdf files are located (relative to the html directory; has to end with trailing...
check
What should be checked for in this plot ?
comparison_warning
the number of comparisons which resulted in a warning
description
Description of plot file.
warnings
Warnings ("no contact" person etc.)
is_expert
true if this is marked as an expert-only plot
description
telling description for this ntuple
def __init__(self, is_expert=False, description=None, check=None)
path
path the script file is located
return_code
integer which is the return code of the script execution
is_expert
true if this is marked as an expert-only HTML code
def __init__(self, package, title, rootfile, compared_revisions=None, plots=None, has_reference=False, ntuples=None, html_content=None, description=None)
comparison_error_shifter
the number of failed comparisons of shifter plots in this package
plotfiles
list of plotfiles which were produced by the scripts in this package
height
height of the plot in pixels
comparison_error
the number of failed comparisons in this file
comparison_error
the number of failed comparisons in this package
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)
contact
Who is the contact person for this plot ?
title
Text used as title for the ntuple item.
plots
list of plots which are contained inside this plot file
visible
true if this package is displayed on the default validation website
comparison_warning
the number of comparisons which resulted in a warning