armi.bookkeeping.report.newReports module¶
- class armi.bookkeeping.report.newReports.ReportContent(title)[source]¶
Bases:
object
Holds the report contents
- tableOfContents()[source]¶
Creates a Table of Contents at the top of the document that links to later Sections
- Parameters
elements (ReportContent) – Contains sections of subsections that make up the report.
- class armi.bookkeeping.report.newReports.ReportNode[source]¶
Bases:
abc.ABC
- levelDict = {0: <htmltree.htmltree.HtmlElement object>, 1: <htmltree.htmltree.HtmlElement object>, 2: <htmltree.htmltree.HtmlElement object>, 3: <htmltree.htmltree.HtmlElement object>}¶
- abstract render(level, idPrefix)[source]¶
Renders the section to a htmltree element for inserting into HTML document tree
- Parameters
level (int) – level of the nesting for this section, determines the size of the heading title for the Section (The higher the level, the smaller the title font-size). Ranges from H1 - H4 in html terms.
idPrefix (String) – used for href/id referencing for the left hand side table of contents to be paired with the item that render() is called upon.
- Returns
HtmlElement – after it is rendered within writeReports().
- Return type
an html representation of this Nodes report content. Appended into the report
- class armi.bookkeeping.report.newReports.Section(title)[source]¶
Bases:
armi.bookkeeping.report.newReports.ReportNode
A grouping of objects within the report. These items can be either of type ReportNode (Table, Image, Section, etc) of, HtmlElements as defined by htmltree.
- addChildElement(element, heading='', subheading=None)[source]¶
Add an element to the group of Sections.
- Parameters
element (ReportNode, or an HtmlElement as defined by htmltree) – Item to be added as child to this Section.
- render(level, idPrefix='') htmltree.htmltree.HtmlElement [source]¶
Renders a Section into the appropriate html representation
- Parameters
level (int) – level of the nesting for this section, determines the size of the heading title for the Section (The higher the level, the smaller the title font-size). Ranges from H2 - H5 in html terms.
idPrefix (String) – used for href/id referencing for the left hand side table of contents to be paired with the item that render() is called upon.
- Returns
HtmlElement – after it is rendered within writeReports().
- Return type
an html representation of this Nodes report content. Appended into the report
- class armi.bookkeeping.report.newReports.Image(caption, imagePath, title=None, encode=True)[source]¶
Bases:
armi.bookkeeping.report.newReports.ReportNode
For Images within the report (such as Hexplots premade and not time dependent) (For time dependent images see TimeSeries)
- Parameters
title (String) –
caption (String) –
imagePath (String) – .png or .img image name to reference later
encode (boolean) – Default true, will result in an encoded file path when rendered to html.
- class armi.bookkeeping.report.newReports.Table(title, caption='', header=None)[source]¶
Bases:
armi.bookkeeping.report.newReports.ReportNode
For Table Objects that are then later converted to htmltree tables
- Parameters
title (String) – for Table Title
caption (String) – for Table Caption
header (List) – a list of column headings, optional, for when tables have columns with headings.
- class armi.bookkeeping.report.newReports.TimeSeries(title, rName, labels, yaxis, fName, caption='', encode=True)[source]¶
Bases:
armi.bookkeeping.report.newReports.ReportNode
Handles storing new data point values for use in graphing later.
- Parameters
title (String) – Title for eventual graph
caption (String) – Eventual graph’s title caption, “” default.
labels (List) – list of stored labels where length = number of lines within graph
yaxis (String) – label for the y-axis
fName (String) – identifier for the resulting image file name (i.e. rName.[fName], where key may be peakDPA.img or Keff.png)
rName (Reactor Name for graphs title and file name) –
encode (boolean) – Default true, whether to encode the resulting file path in the html.
Example
>>> series = TimeSeries("Plot of K-effective", "plot", ["k-effective"], "k-eff", "keff.png") # Adding to a plot with k-effective >>> time = r.p.time # The current time node of the reactor. >>> data = r.core.p.keff # The parameter k-effective value at that time. >>> uncertainty = r.core.p.keffUnc # Since the parameter yields keff-uncontrolled value at the current time. >>> series.add("k-effective", time, data, uncertainty) # Adds this point to be plotted later.
>>> # Adding to a plot with multiple lines for fuel Burn-Up Plot. >>> labels = [] # Start collecting labels for the lines to plot... >>> for a in r.core.getAssemblies(Flags.FUEL): >>> if a.p.type not in labels: >>> labels.append(a.p.type) >>> series = TimeSeries("Plot of Burn-Up", r.name, labels, "PeakBU", "bu.png") >>> maxValue = defaultdict(float) >>> for a in r.core.getAssemblies(Flags.FUEL): >>> maxValue[a.p.type] = max(maxValue[a.p.type], a.p.maxPercentBu) >>> # Add this data for each assembly type (which will each be it's own line) >>> for a in r.core.getAssemblies(Flags.FUEL): >>> series.add(a.p.type, r.p.time, maxValue[a.p.type], None) >>> # (Adding a point for line labeled for this type of fuel, >>> # at this time, with the found maxValue, and no uncertainty...)