Reporting

Overview Structs

Overview Functions

Structs

GEMS.BatchReportType
BatchReport <: 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 title
  • subtitle::String: Report subtitle
  • author::String: Report authors
  • date::String: Simulation execution date (post processing)
  • abstract::String: Report abstract

Configuration

  • glossary::Bool: flag to add or remove glossary with term definitions
  • dpi::Int64: dots per inch for report plots (default: 300)
  • fontfamily::String: font family for report (default: Times New)
GEMS.PlotSectionType
PlotSection <: 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.ReportType

Supertype for all simulation reports

GEMS.SectionType
Section(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.

TypeTitleContent
:DebugDebug InformationContains :Memory, :Processor,:Repo, and :System section.
:GeneralGeneralGeeral simulation info; tick unit, start conditions, and others.
:InputFilesInput FilesConfig- and population file paths.
:InterventionsInterventionsTriggers, strategies, and measures.
:MemoryMemoryAvailable and used system memory.
:ModelModel ConfigurationContains :InputFiles, :Interventions, :General, :Pathogens, and :Settings
:ObservationsObservationsSummary of observed progression, detection rate, dark figure, and others.
:OverviewOverviewSimulation summmary with initial infections, total attack rate, and others.
:PathogensPathogensPathogen configuration with one subsection per pathogen.
:ProcessorProcessorProcessor model, cores, and others.
:RepoRepositoryCurrent repo-, branch- and commit-ID.
:SettingsSettingsNumber of settings per type and min, max, average number of individuals.
:SystemSystem InformationJulia config, number of threads, and others.

Default Sections for Batch Reports

Input must be BatchData.

TypeTitleContent
:AllocationsAllocationsSummary statistics on memory usage across simulation runs in BatchData object.
:DebugDebug InformationContains :Memory, :Processor,:Repo, and :System section.
:GeneralGeneraGeeral simulation info; tick unit, start conditions, and others.
:MemoryMemoryAvailable and used system memory.
:OverviewOverviewSummary statistics on total infections, attack rates, and others.
:ProcessorProcessorProcessor model, cores, and others.
:RepoRepositoryCurrent repo-, branch- and commit-ID.
:ResoucesResourcesContains :Runtime and :Allocations sections.
:RuntimeRuntimeSummary statistics on runtime across simulation runs in BatchData object.
:SettingsSettingsNumber of settings per type and min, max, average number of individuals.
:SystemSystem InformationJulia config, number of threads, and others.
GEMS.SimulationReportType
SimulationReport <: 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 title
  • subtitle::String: Report subtitle
  • author::String: Report authors
  • date::String: Simulation execution date (post processing)
  • abstract::String: Report abstract

Configuration

  • glossary::Bool: flag to add or remove glossary with term definitions
  • dpi::Int64: dots per inch for report plots (default: 300)
  • fontfamily::String: font family for report (default: Times New)

Functions

GEMS.abstractFunction
abstract(report::Report)

Returns the abstract of a Report.

GEMS.abstract!Function
abstract!(report::Report, abstract::String)

setss the abstract of a Report.

GEMS.addsection!Function
addsection!(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!Function
addtimer!(rep::SimulationReport, to::TimerOutput)

Generates a Section from the consolue output of a TimerOutput object and adds it to a SimulationReport.

GEMS.author!Function
author!(report::Report, author::String)

Sets the author of a Report.

GEMS.authorFunction
author(report::Report)

Returns the author of a Report.

GEMS.buildreportFunction
buildreport(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!Function
content!(section::Section, content::String)

Sets a section's content.

GEMS.contentFunction
content(section::Section)

Returns a section's content.

GEMS.date!Function
date!(report::Report, date::String)

Sets the date of a Report.

GEMS.dateFunction
date(report::Report)

Returns the date of a Report.

GEMS.description!Method
description!(plot::ReportPlot, description::String)

Setter for report plot description.

GEMS.descriptionMethod
description(plot::ReportPlot)

Return description from report plot object.

GEMS.dpiFunction
dpi(report)

Returns dpi (dots per inch) from a report object. dpi conditions the resolution of images generated for the report.

GEMS.dpi!Method
dpi!(report, dpi)

Setter for report dpi (dot per inch) for images.

GEMS.escape_markdownMethod
escape_markdown(str::String)

Replaces markdown controls (e.g. "_" or "*") with their escaped version.

GEMS.filename!Method
filename!(plot::ReportPlot, filename::String)

Setter for report plot filename.

GEMS.filenameMethod
filename(plot::ReportPlot)

Return filename from report plot object.

GEMS.fontfamily!Function
fontfamily!(report, fontfamily)

Setter for report fontfamily.

GEMS.fontfamilyFunction
fontfamily(report)

Returns font family config from a report object.

GEMS.generateMethod
generate(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!Function
glossary!(report::Report, glossary::Bool)

Sets the glossary flag of a Report. If true, the glossary will be copied into the report upon generation.

GEMS.glossaryFunction
glossary(report::Report)

Returns the glossary flag of a Report.

GEMS.markdownFunction
markdown(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.plotpackageMethod
plotpackage(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.pltFunction
plt(section::PlotSection)

Return the nested ReportPlot from a PlotSection object.

GEMS.reportdataMethod
reportdata(report::Report)

Returns the associated ReportData object from a Report.

GEMS.savepathMethod
savepath(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.sectionsMethod
sections(report::Report)

Returns the array of sections of a Report.

GEMS.subsectionsMethod
subsections(section::Section)

Returns a section's array of subsections.

GEMS.subtitle!Method
subtitle!(report::Report, subtitle::String)

Sets the subtitle of a Report.

GEMS.subtitleMethod
subtitle(report::Report)

Returns the subtitle of a Report.

GEMS.title!Function
title!(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.titleFunction
title(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.