emodpy.reporters.base module#
- class emodpy.reporters.base.ReportFilter(start_day: float | None = None, end_day: float | None = None, start_year: float | None = None, end_year: float | None = None, filename_suffix: str = '', node_ids: list[int] | None = None, min_age_years: float | None = None, max_age_years: float | None = None, must_have_ip_key_value: str = '', must_have_intervention: str = '')[source]#
Bases:
object
This class is designed to configure common filter parameters for generating simulation reports. It provides a range of options to specify the time period, nodes, and individual criteria for data collection.
- Parameters:
start_day (float, optional) –
The day of the simulation to start collecting data.
Minimum value: 0
Maximum value: 3.40282e+38
Default value: 0
end_day (float, optional) –
The day of simulation to stop collecting data.
Minimum value: 0
Maximum value: 3.40282e+38
Default value: 3.40282e+38
start_year (float, optional) –
This only applies to HIV_SIM
The simulation time in years to start collecting data. Use decimals to start collecting data not at the beginning of the year.
Minimum value: 1900
Maximum value: 2200
Default value: 1900
end_year (float, optional) –
This only applies to HIV_SIM
The simulation time in years to stop collecting data. Use decimals to start collecting data not at the beginning of the year.
Minimum value: 1900
Maximum value: 2200
Default value: 2200
filename_suffix (str, optional) –
Augments the filename of the report. This allows you to generate multiple reports for distinguishing among them.
Default value: “”
node_ids (list[int], optional) –
A list of nodes ids from which to collect data for the report. Use empty array or None to collect data from all nodes. Node ids must be integers.
Minimum value: 0
Maximum value: 3.40282e+38
Default value: None
min_age_years (float, optional) –
Minimum age, in years, that a person can be to be included in the report.
Minimum value: 0
Maximum value: 1000
Default value: 0
max_age_years (float, optional) –
Maximum age, in years, that a person can be to be included in the report.
Minimum value: 0
Maximum value: 1000
Default value: 1000
must_have_ip_key_value (str, optional) –
A string formatted as “Key:Value”, representing a specific IndividualProperty key-value pair required for an individual to be included in the report. For HIV_SIM, when reporting on relationships, at least one partner must have this property for the relationship to be included in the report. If set to an empty string or None, no filtering is applied, and all individuals are included. For malaria, see Individual and node properties and for HIV, see Individual and node properties.
Default value: “”
must_have_intervention (str, optional) –
The intervention_name parameter in the campaigns are the available values for this parameter. that an individual must have to be included in the report. For HIV_SIM, at least one partner must have this intervention for inclusion when reporting on relationships. If set to an empty string or None, no filtering is applied, and all individuals are included.
Default value: “”
- class emodpy.reporters.base.BuiltInReporter(reporters_object: Reporters, reporter_class_name: str, report_filter: ReportFilter | None = None)[source]#
Bases:
AbstractBaseReporter
BuiltInReporter class, not intended to be used directly
This class supports the reporters whose parameters are configured in “custom_reporters.json” file
- class emodpy.reporters.base.ConfigReporter(reporter_parameter_prefix: str, report_filter: ReportFilter | None = None)[source]#
Bases:
AbstractBaseReporter
ConfigReporter class, not intended to be used directly
This class supports the reporters whose parameters are configured in config.json
- class emodpy.reporters.base.Reporters(schema_path: str | None = None)[source]#
Bases:
InputFilesList
- add(reporter: AbstractBaseReporter) None [source]#
- property json#
- set_task_config(task: EMODTask) None [source]#
Note: not using this method in the current implementation because: task has Reporters object, but we have to give task to Reporters object so that Reporters object can configure stuff in task. It makes more sense for Task to take Reporters object and configure itself.
Configures reporter settings for config.json in the simulation
- Parameters:
task – Task to configure