Reporting
Overview Structs
GEMS.AbstractSection
GEMS.BatchReport
GEMS.PlotSection
GEMS.Report
GEMS.ReportPlot
GEMS.Section
GEMS.SimulationReport
Overview Functions
GEMS.abstract
GEMS.abstract!
GEMS.addsection!
GEMS.addtimer!
GEMS.author
GEMS.author!
GEMS.buildreport
GEMS.content
GEMS.content!
GEMS.date
GEMS.date!
GEMS.description
GEMS.description!
GEMS.dpi
GEMS.dpi!
GEMS.escape_markdown
GEMS.filename
GEMS.filename!
GEMS.fontfamily
GEMS.fontfamily!
GEMS.generate
GEMS.glossary
GEMS.glossary!
GEMS.markdown
GEMS.plotpackage
GEMS.plt
GEMS.reportdata
GEMS.savepath
GEMS.sections
GEMS.subsections
GEMS.subtitle
GEMS.subtitle!
GEMS.title
GEMS.title!
Structs
GEMS.AbstractSection
— TypeSupetype for all report sections
GEMS.BatchReport
— TypeBatchReport <: Report
A Type for generating a batch-run simulation report.
Fields
Batch Data
bd::BatchData
: Batch data object used to generate this report
Meta Information
title::String
: Report titlesubtitle::String
: Report subtitleauthor::String
: Report authorsdate::String
: Simulation execution date (post processing)abstract::String
: Report abstract
Configuration
glossary::Bool
: flag to add or remove glossary with term definitionsdpi::Int64
: dots per inch for report plots (default: 300)fontfamily::String
: font family for report (default: Times New)
GEMS.PlotSection
— TypePlotSection <: AbstractSection
This type wraps a ReportPlot
into an AbstractSection
struct. Thus the only field is a report plot. Its mainly used to add plots to reports. You can look up the aviailable default report styles to get an idea how that might look like.
You can either pass an instance of a SimulationPlot
to the constructor like:
PlotSection(TickCases())
or pass the SimulationPlot
type as a Symbol
like:
PlotSection(:TickCases)
The gemsplot()
function contains a comprehensive list on the available plot types.
GEMS.Report
— TypeSupertype for all simulation reports
GEMS.ReportPlot
— TypeSupertype for all plots that go into reports
GEMS.Section
— TypeSection(title::String = "", content::String = "", subsections::Vector{AbstractSection} = [])
Section(rd::ResultData, type::Symbol)
Section(rd::BatchData, type::Symbol)
A type for Report Sections. All reports consist of (nested) sections. A report section will be parsed into a markdown section (indicated by "#"s) during report generation. Each section must have a title
and content
. It can have an arbitrary number of subsections
.
Example
This code creates two sections. The first one having a title and some content. The second section contains the first secion as a subsection.
sec_1 = Section(
title = "My Section Title",
content = "Great section contents"
)
sec_2 = Section(
title = "My Second Section
subsections = [sec_1]
)
Defaut Sections
There are a number of default sections that you can simply plug into your report by calling the Section()
constructor and pass a ResultData
or BatchData
object and a Symbol
qualifying the type of section you'd like to get:
# run simulation
sim = Simulation()
run!(sim)
rd = ResultData(sim)
overview_section = Section(rd, :Overview)
Default Sections for Single Simulation Reports
Input must be ResultData
.
Type | Title | Content |
---|---|---|
:Debug | Debug Information | Contains :Memory , :Processor ,:Repo , and :System section. |
:General | General | Geeral simulation info; tick unit, start conditions, and others. |
:InputFiles | Input Files | Config- and population file paths. |
:Interventions | Interventions | Triggers, strategies, and measures. |
:Memory | Memory | Available and used system memory. |
:Model | Model Configuration | Contains :InputFiles , :Interventions , :General , :Pathogens , and :Settings |
:Observations | Observations | Summary of observed progression, detection rate, dark figure, and others. |
:Overview | Overview | Simulation summmary with initial infections, total attack rate, and others. |
:Pathogens | Pathogens | Pathogen configuration with one subsection per pathogen. |
:Processor | Processor | Processor model, cores, and others. |
:Repo | Repository | Current repo-, branch- and commit-ID. |
:Settings | Settings | Number of settings per type and min, max, average number of individuals. |
:System | System Information | Julia config, number of threads, and others. |
Default Sections for Batch Reports
Input must be BatchData
.
Type | Title | Content |
---|---|---|
:Allocations | Allocations | Summary statistics on memory usage across simulation runs in BatchData object. |
:Debug | Debug Information | Contains :Memory , :Processor ,:Repo , and :System section. |
:General | Genera | Geeral simulation info; tick unit, start conditions, and others. |
:Memory | Memory | Available and used system memory. |
:Overview | Overview | Summary statistics on total infections, attack rates, and others. |
:Processor | Processor | Processor model, cores, and others. |
:Repo | Repository | Current repo-, branch- and commit-ID. |
:Resouces | Resources | Contains :Runtime and :Allocations sections. |
:Runtime | Runtime | Summary statistics on runtime across simulation runs in BatchData object. |
:Settings | Settings | Number of settings per type and min, max, average number of individuals. |
:System | System Information | Julia config, number of threads, and others. |
GEMS.SimulationReport
— TypeSimulationReport <: Report
A Type for generating a single-run simulation report.
Fields
Result Data
rd::ResultData
: Result data object used to generate this report
Meta Information
title::String
: Report titlesubtitle::String
: Report subtitleauthor::String
: Report authorsdate::String
: Simulation execution date (post processing)abstract::String
: Report abstract
Configuration
glossary::Bool
: flag to add or remove glossary with term definitionsdpi::Int64
: dots per inch for report plots (default: 300)fontfamily::String
: font family for report (default: Times New)
Functions
GEMS.abstract
— Functionabstract(report::Report)
Returns the abstract of a Report
.
GEMS.abstract!
— Functionabstract!(report::Report, abstract::String)
setss the abstract of a Report
.
GEMS.addsection!
— Functionaddsection!(section::Section, subsection::AbstractSection)
Adds a subsection
to a provided section
.
addsection!(section::Section, subsections::Vector)
Adds multiple subsection
to a provided section
.
addsection!(report::Report, section::AbstractSection)
Adds a Section
to a Report
. It can either be a regular section or a plot section.
GEMS.addtimer!
— Functionaddtimer!(rep::SimulationReport, to::TimerOutput)
Generates a Section
from the consolue output of a TimerOutput
object and adds it to a SimulationReport
.
GEMS.author!
— Functionauthor!(report::Report, author::String)
Sets the author of a Report
.
GEMS.author
— Functionauthor(report::Report)
Returns the author of a Report
.
GEMS.buildreport
— Functionbuildreport(data::Union{ResultData,BatchData}, style::String = "")
Initializes and configures a simulation report with the tile, abstract, sections etc. provided in config. If config is an empty dictionary all available standard sections, plots, and the glossary etc. will be used. It returns a full SimulationReport
object which can then be generated using the generate()
function.
GEMS.content!
— Functioncontent!(section::Section, content::String)
Sets a section's content.
GEMS.content
— Functioncontent(section::Section)
Returns a section's content.
GEMS.date!
— Functiondate!(report::Report, date::String)
Sets the date of a Report
.
GEMS.date
— Functiondate(report::Report)
Returns the date of a Report
.
GEMS.description!
— Methoddescription!(plot::ReportPlot, description::String)
Setter for report plot description.
GEMS.description
— Methoddescription(plot::ReportPlot)
Return description from report plot object.
GEMS.dpi
— Functiondpi(report)
Returns dpi (dots per inch) from a report object. dpi conditions the resolution of images generated for the report.
GEMS.dpi!
— Methoddpi!(report, dpi)
Setter for report dpi (dot per inch) for images.
GEMS.escape_markdown
— Methodescape_markdown(str::String)
Replaces markdown controls (e.g. "_" or "*") with their escaped version.
GEMS.filename!
— Methodfilename!(plot::ReportPlot, filename::String)
Setter for report plot filename.
GEMS.filename
— Methodfilename(plot::ReportPlot)
Return filename from report plot object.
GEMS.fontfamily!
— Functionfontfamily!(report, fontfamily)
Setter for report fontfamily.
GEMS.fontfamily
— Functionfontfamily(report)
Returns font family config from a report object.
GEMS.generate
— Methodgenerate(report::Report, directory::AbstractString)
Generates markdown string from a Report
object including its nested subsections. The report will be stored as PDF, HTML, and MD in the provided directory
. Images are generated and stored in an "/img" subfolder.
GEMS.glossary!
— Functionglossary!(report::Report, glossary::Bool)
Sets the glossary flag of a Report
. If true, the glossary will be copied into the report upon generation.
GEMS.glossary
— Functionglossary(report::Report)
Returns the glossary flag of a Report
.
GEMS.markdown
— Functionmarkdown(infFrac::InfectedFraction)
Returns a markdown string with all parameters (mainly for documentation purposes).
markdown(tu::TimesUp)
Returns a markdown string with all parameters (mainly for documentation purposes).
markdown(pathogen::Pathogen)
Returns a markdown string with all parameters (mainly for documentation purposes).
markdown(unDist::Uniform)
Returns a markdown string with all parameters (mainly for documentation purposes).
markdown(poisDist::Poisson)
Returns a markdown string with all parameters (mainly for documentation purposes).
markdown(binDist::Binomial)
Returns a markdown string with all parameters (mainly for documentation purposes).
markdown(dist::Distribution)
Return a markdown string with all parameters (mainly for documentation purposes). Fallback function for arbitrary distributions without dedicated formatting.
markdown(stngs::SettingsContainer, sim::Simulation)
Returns a markdown string with all parameters (mainly for documentation purposes).
GEMS.plotpackage
— Methodplotpackage(ps::PlotSection)
This function is local to the report.jl script. It extracts the plotting package a PlotSection relies on (:plots, :vega, :gmt, etc...). This information is used to parallelize plot generation. It will return :other, if to package information is available in the Plot struct.
GEMS.plt
— Functionplt(section::PlotSection)
Return the nested ReportPlot
from a PlotSection
object.
GEMS.reportdata
— Methodreportdata(report::Report)
Returns the associated ReportData
object from a Report
.
GEMS.savepath
— Methodsavepath(str::String)
Replaces all backslashes in a path-string with forward slashes to prevent weaving issues while generating TeX-PDFs as backslashes indicate control structures in TeX.
GEMS.sections
— Methodsections(report::Report)
Returns the array of sections of a Report
.
GEMS.subsections
— Methodsubsections(section::Section)
Returns a section's array of subsections.
GEMS.subtitle!
— Methodsubtitle!(report::Report, subtitle::String)
Sets the subtitle of a Report
.
GEMS.subtitle
— Methodsubtitle(report::Report)
Returns the subtitle of a Report
.
GEMS.title!
— Functiontitle!(plot::ReportPlot, title::String)
Setter for report plot title.
title!(section::Section, title::String)
Sets a section's title.
title!(report::Report, title::String)
Sets the title of a Report
.
GEMS.title
— Functiontitle(plot::ReportPlot)
Returns title from report plot object.
title(section::Section)
Returns a section's title.
title(report::Report)
Returns the title of a Report
.