emodpy.reporters.common module#
- class emodpy.reporters.common.SpatialReportChannels(value)[source]#
Bases:
StrEnum
An enumeration.
- Air_Temperature = 'Air_Temperature'#
- Births = 'Births'#
- Campaign_Cost = 'Campaign_Cost'#
- Disease_Deaths = 'Disease_Deaths'#
- Human_Infectious_Reservoir = 'Human_Infectious_Reservoir'#
- Infected = 'Infected'#
- New_Infections = 'New_Infections'#
- New_Reported_Infections = 'New_Reported_Infections'#
- Population = 'Population'#
- Prevalence = 'Prevalence'#
- class emodpy.reporters.common.ReportHumanMigrationTracking(reporters_object: Reporters)[source]#
Bases:
BuiltInReporter
The human migration tracking report (ReportHumanMigrationTracking.csv) is a CSV-formatted report that provides details about human travel during simulations. The finished report will provide one line for each surviving individual that migrates during the simulation.
For HIV, see ReportHumanMigrationTracking and for malaria, see ReportHumanMigrationTracking.
- Parameters:
reporters_object (Reporters) – The reporters object given by the emodpy.
- class emodpy.reporters.common.ReportNodeDemographics(reporters_object: Reporters, ip_key_to_collect: str | None = None, age_bins: list[float] | None = None, stratify_by_gender: bool = True)[source]#
Bases:
BuiltInReporter
The node demographics report (ReportNodeDemographics.csv) is a CSV-formatted report that provides population information stratified by node. For each time step, the report will collect data on each node and age bin.
For HIV, see ReportNodeDemographics and for malaria, see ReportNodeDemographics.
- Parameters:
reporters_object (Reporters) – The reporters object given by the emodpy.
ip_key_to_collect (str) –
Name of the IndividualProperties Key to stratify the report. For malaria, see Individual and node properties and for HIV, see Individual and node properties.
Default is None.
Age bins (in years) to stratify by, in ascending order.
Default is None.
stratify_by_gender (bool) –
If True, stratify by gender.
Default: True.
- class emodpy.reporters.common.ReportPluginAgeAtInfection(reporters_object: Reporters)[source]#
Bases:
BuiltInReporter
Creates ReportPluginAgeAtInfection report to be added to the simulation.
For more information: HIV’s ReportPluginAgeAtInfection or Malaria’s ReportPluginAgeAtInfection
- Parameters:
reporters_object (Reporters) – The reporters object given by the emodpy.
- class emodpy.reporters.common.ReportPluginAgeAtInfectionHistogram(reporters_object: Reporters, age_bin_upper_edges: list[float] | None = None, reporting_interval: float = 1)[source]#
Bases:
BuiltInReporter
Creates ReportPluginAgeAtInfectionHistogram report to be added to the simulation.
For more information: HIV’s ReportPluginAgeAtInfectionHistogram or Malaria’s ReportPluginAgeAtInfectionHistogram
- Parameters:
reporters_object (Reporters) – The reporters object given by the emodpy.
age_bin_upper_edges (list[float]) – A list of ages (in years) where an individual will count in the upper value bin when their age is between two bins.
reporting_interval (float) – Repeating time period (in years) for which the data is collected and reported
- class emodpy.reporters.common.SqlReport(reporters_object: Reporters, include_health_table: bool = True, include_individual_properties: bool = False, include_infection_data_table: bool = True, report_filter: ReportFilter | None = None)[source]#
Bases:
BuiltInReporter
The SqlReport outputs epidemiological and transmission data. Because of the quantity and complexity of the data, the report output is a multi-table SQLite relational database (see https://sqlitebrowser.org/). Use the configuration parameters to manage the size of the database.
For more information: HIV’s SqlReport or Malaria’s SqlReport
- Parameters:
reporters_object (Reporters) – The reporters object given by the emodpy.
include_health_table (bool) –
If True, include health-related data in the report.
Default: True
include_individual_properties (bool) –
If True, include individual properties in the report. For malaria, see Individual and node properties and for HIV, see Individual and node properties.
Default: False
include_infection_data_table (bool) –
If True, include infection data in the report.
Default: True
report_filter (ReportFilter, optional) –
Common report filtering parameters. Valid filtering parameters for this report are:
start_day
end_day
- class emodpy.reporters.common.ReportEventCounter(reporters_object: Reporters, event_list: list[str], report_filter: ReportFilter | None = None)[source]#
Bases:
BuiltInReporter
The event counter report (ReportEventCounter.json) is a JSON-formatted file that keeps track of how many of each individual-level event types occur during a time step. The report produced is similar to the InsetChart.json channel report, where there is one channel for each event defined in the ‘event_list’ parameter. This report only counts events; a similar report, ReportEventRecorder, will provide information about the person at the time of the event.
For HIV, see ReportEventCounter, and for malaria, see ReportEventCounter
- Parameters:
reporters_object (Reporters) – The reporters object given by the emodpy.
event_list (list[str]) – List of individual-level events which to count. There will be one channel for each event in the list. For HIV, see Event list and for malaria: Event list for available built-in events, as well as custom events you’ve defined in campaigns.
report_filter (ReportFilter, optional) –
Common report filtering parameters. Valid filtering parameters for this report are:
start_day
end_day
filename_suffix
node_ids
min_age_years
max_age_years
must_have_ip_key_value
must_have_intervention
- class emodpy.reporters.common.ReportSimulationStats(reporters_object: Reporters)[source]#
Bases:
BuiltInReporter
Creates the ReportSimulationStats to summarize key simulation statistics.
For more information: HIV’s ReportSimulationStats or Malaria’s ReportSimulationStats
- Parameters:
reporters_object (Reporters) – The reporters object given by the emodpy.
- class emodpy.reporters.common.ReportDrugStatus(reporters_object: Reporters, report_filter: ReportFilter | None = None)[source]#
Bases:
BuiltInReporter
The drug status report (ReportDrugStatus.csv) provides status information on the drugs that an individual has taken or is waiting to take.
For more information, see ReportDrugStatus
- Parameters:
reporters_object (Reporters) – The reporters object given by the emodpy.
report_filter (ReportFilter, optional) –
Common report filtering parameters. Valid filtering parameters for this report are:
start_day
end_day
- class emodpy.reporters.common.ReportInfectionDuration(reporters_object: Reporters, report_filter: ReportFilter | None = None)[source]#
Bases:
BuiltInReporter
The infection duration report (ReportInfectionDuration.csv)provides one line of information about an infection that has just cleared. It tells you who had the infection and how long they had it.
For more information: HIV’s ReportInfectionDuration or Malaria’s ReportInfectionDuration
- Parameters:
reporters_object (Reporters) – The reporters object given by the emodpy.
report_filter (ReportFilter, optional) –
Common report filtering parameters. Valid filtering parameters for this report are:
start_day
end_day
- class emodpy.reporters.common.ReportEventRecorder(reporters_object: Reporters, event_list: list[str], individual_properties: list[str] | None = None, property_change_ip_to_record: str | None = None, report_filter: ReportFilter | None = None)[source]#
Bases:
ConfigReporter
The health events and interventions report (ReportEventRecorder.csv) provides information on each individual’s demographics and health status at the time of an event. Additionally, it is possible to see the value of specific IndividualProperties, as assigned in the demographics file.
For more information, see HIV: ReportEventRecorder or Malaria: ReportEventRecorder
- Parameters:
reporters_object (Reporters) – The reporters object given by the emodpy.
event_list (list[str]) – The list of individual-level events to include in the output report. For HIV, see Event list, and for malaria, Event list events already used by EMOD or use your own custom events from campaigns.
individual_properties (list[str], optional) – A list of individual property keys, as defined in IndividualProperties in the demographics, to be added as additional columns to the output report. One column will be added to the report for each key in the list. For malaria, see Individual and node properties and for HIV, see Individual and node properties.
property_change_ip_to_record (str, optional) – IndividualProperty key string for which recorder will add the PropertyChange event to the list of events that the report is listening to. However, it will only record the events where the property changed the value of this given key. For malaria, see Individual and node properties and for HIV, see Individual and node properties.
report_filter (ReportFilter, optional) –
Common report filtering parameters. Valid filtering parameters for this report are:
start_day
end_day
node_ids
min_age_years
max_age_years
must_have_ip_key_value
must_have_intervention
- class emodpy.reporters.common.ReportNodeEventRecorder(reporters_object: Reporters, event_list: list[str], node_properties_to_record: list[str] | None = None, stats_by_ips: list[str] | None = None)[source]#
Bases:
ConfigReporter
The Node-level events report (ReportNodeEventRecorder.csv) provides information on node’s population and health status at the time of a node-level event. Additionally, it is possible to break up the population data by specific Node and Individual Properties.
For more information: HIV’s ReportNodeEventRecorder or Malaria’s ReportNodeEventRecorder
- Parameters:
reporters_object (Reporters) – The reporters object given by the emodpy.
event_list (list[str]) – The list of node-level events to include in the output report. These would be node-level events you have used in your campaigns.
node_properties_to_record (list[str], optional) – A list of node property keys, as defined in NodeProperties in the demographics, to be added as additional columns to the ReportNodeEventRecorder.csv output report. For malaria, see Individual and node properties and for HIV, see Individual and node properties.
stats_by_ips (list[str], optional) – A list of individual property keys, as defined in IndividualProperties in the demographics. For each key in this list, there are two columns added for each value of the key, key::NumIndividuals and key::NumInfected. For malaria, see Individual and node properties and for HIV, see Individual and node properties.
- class emodpy.reporters.common.ReportCoordinatorEventRecorder(reporters_object: Reporters, event_list: list[str])[source]#
Bases:
ConfigReporter
The Coordinator-level events report (ReportCoordinatorEventRecorder.csv) records the event, time, and the coordinator sending out the event.
For more information: HIV’s ReportCoordinatorEventRecorder or Malaria’s ReportCoordinatorEventRecorder
- class emodpy.reporters.common.ReportSurveillanceEventRecorder(reporters_object: Reporters, event_list: list[str], stats_by_ips: list[str] | None = None)[source]#
Bases:
ConfigReporter
The Coordinator-level events report (ReportSurveillanceEventRecorder.csv) for events sent out by a SurveillanceEventCoordinator. The report provides information on node’s population and health status at the time of an event. Additionally, it is possible to break up the population data by specific Node and Individual Properties. Only the nodes that the SurveillanceEventCoordinator listening to will be included in the report.
For more information: HIV’s ReportSurveillanceEventRecorder or Malaria’s ReportSurveillanceEventRecorder
- Parameters:
reporters_object (Reporters) – The reporters object given by the emodpy.
event_list (list[str]) – The list of coordinator-level events to include in the output report. These would be coordinator-level events you’ve used in campaigns.
stats_by_ips (list[str], optional) – A list of individual property keys, as defined in IndividualProperties in the demographics. For each key in this list, there are two columns added for each value of the key, key::NumIndividuals and key::NumInfected. For malaria, see Individual and node properties and for HIV, see Individual and node properties.
- class emodpy.reporters.common.InsetChart(reporters_object: Reporters, has_ip: list[str] | None = None, has_interventions: list[str] | None = None, include_pregnancies: bool = False)[source]#
Bases:
ConfigReporter
The InsetChart (InsetChart.json) report contains data for a variety of statistics for each time step of the simulation and can give you a good overview of what happened. Most statistics are collected by polling the population at the end of the time step, however, there can be statistics that count events that occur during the time step.
For HIV, see InsetChart, and for malaria, see InsetChart
- Parameters:
reporters_object (Reporters) – The reporters object given by the emodpy.
has_ip (list[str], optional) – A channel is added to InsetChart for each value of each IndividualProperty key provided. The channel name will be HasIP_<Key:Value> and will be the fraction of the population that has that value for that Individual Property Key. For malaria, see Individual and node properties and for HIV, see Individual and node properties.
has_interventions (list[str], optional) – A channel is added to InsetChart for each intervention name provided. The channel name will be Has_<InterventionName> and will be the fraction of the population that has that intervention. The ‘intervention_name’ parameters in the campaign are the possible values for this list.
include_pregnancies (bool, optional) – If true, channels are added about pregnancies and possible mothers.
- class emodpy.reporters.common.SpatialReport(reporters_object: Reporters, spatial_output_channels: list[str])[source]#
Bases:
ConfigReporter
Creates a separate spatially-distributed data binary (SpatialReport_{Channel_Name}.bin) for every channel listed.
For HIV, see SpatialReport, and for malaria, see SpatialReport
- Parameters:
reporters_object (Reporters) – The reporters object given by the emodpy.
spatial_output_channels (list[str]) –
List of data channels for which to create spatial reports. All the channels are defined in the SpatialReportChannels enum. Please use the enum to define the channels.
Example:
SpatialReport(reporters_object=reporters, spatial_output_channels=[SpatialReportChannels.Infected, SpatialReportChannels.Births])
- class emodpy.reporters.common.DemographicsReport(reporters_object: Reporters)[source]#
Bases:
ConfigReporter
BinnedReport.json and DemographicsSummary.json are both generated by the DemographicsReport.
The demographic summary output report (DemographicsSummary.json) is a JSON-formatted file with the demographic channel output results of the simulation, consisting of simulation-wide averages by time step. The format is identical to the inset chart output report, except the channels reflect demographic categories, such as gender ratio.
The binned output report (BinnedReport.json) is a JSON-formatted file where the channel data has been sorted into age bins. It is very similar to an inset chart, however, with the binned report all channels are broken down into sub-channels (bins) based on age. For example, instead of having a single prevalence channel, you might have prevalence in the ‘0-3 years old bin’ and the ‘4-6 years old bin’, and so forth.
For HIV, see DemographicsSummary and BinnedReport, and for malaria, see DemographicsSummary and BinnedReport.
- Parameters:
reporters_object (Reporters) – The reporters object given by the emodpy.
- class emodpy.reporters.common.PropertyReport(reporters_object: Reporters)[source]#
Bases:
ConfigReporter
The property output report (PropertyReport.json) is a JSON-formatted file with the channel output results of the simulation, defined by the groups set up using IndividualProperties in the demographics file. See IndividualProperties for more information. The report contains the count of individuals with each possible Individual Property (IP) key-value combination. The < channel-title > tells you the statistic and property that are being counted. For example, it allows you to compare disease deaths for people in the high risk group versus the low risk group.
- For HIV, see PropertyReport and for malaria, see
- Parameters:
reporters_object (Reporters) – The reporters object given by the emodpy.