tlo.methods.mockitis module

class Mockitis(name=None, resourcefilepath=None)[source]

This is a dummy infectious disease.

It demonstrates the following behaviours in respect of the healthsystem module:

  • Registration of the disease module with healthsystem

  • Reading DALY weights and reporting daly values related to this disease

  • Health care seeking

  • Usual HSI behaviour

  • Restrictive requirements on the facility_level for the HSI_event

  • Use of the SymptomManager

Bases: tlo.core.Module

PARAMETERS:

Item

Type

Description

p_infection

REAL

Probability that an uninfected individual becomes infected

level_of_symptoms

CATEGORICAL

Level of symptoms that the individual will have. Possible values are: [low, high, ]

p_cure

REAL

Probability that a treatment is successful in curing the individual

initial_prevalence

REAL

Prevalence of the disease in the initial population

daly_wts

DICT

DALY weights for conditions

PROPERTIES:

Item

Type

Description

mi_is_infected

BOOL

Current status of mockitis

mi_status

CATEGORICAL

Historical status: N=never; C=currently; P=previously. Possible values are: [N, C, P, ]

mi_date_infected

DATE

Date of latest infection

mi_scheduled_date_death

DATE

Date of scheduled death of infected individual

mi_date_cure

DATE

Date an infected individual was cured

Class attributes:

CAUSES_OF_DEATH : {‘Mockitis’: <tlo.methods.causes.Cause object at 0x135f2e150>}

CAUSES_OF_DISABILITY : {‘Mockitis’: <tlo.methods.causes.Cause object at 0x135f2e1d0>}

INIT_DEPENDENCIES : {‘SymptomManager’, ‘Demography’}

METADATA : {<Metadata.USES_HEALTHBURDEN: 4>, <Metadata.USES_SYMPTOMMANAGER: 2>, <Metadata.DISEASE_MODULE: 1>, <Metadata.USES_HEALTHSYSTEM: 3>}

OPTIONAL_INIT_DEPENDENCIES : {‘HealthBurden’}

Functions (defined or overridden in class Mockitis):

__init__(name=None, resourcefilepath=None)[source]

Construct a new disease module ready to be included in a simulation.

Initialises an empty parameters dictionary and module-specific random number generator.

Parameters:

name – the name to use for this module. Defaults to the concrete subclass’ name.

read_parameters(data_folder)[source]

Read in parameters and do the registration of this module and its symptoms

initialise_population(population)[source]

Set our property values for the initial population.

This method is called by the simulation when creating the initial population, and is responsible for assigning initial values, for every individual, of those properties ‘owned’ by this module, i.e. those declared in the PROPERTIES dictionary above.

Parameters:

population – the population of individuals

initialise_simulation(sim)[source]

Get ready for simulation start.

This method is called just before the main simulation loop begins, and after all modules have read their parameters and the initial population has been created. It is a good place to add initial events to the event queue.

on_birth(mother_id, child_id)[source]

Initialise our properties for a newborn individual.

This is called by the simulation whenever a new person is born.

Parameters:
  • mother_id – the ID for the mother for this child

  • child_id – the ID for the new child

on_hsi_alert(person_id, treatment_id)[source]

This is called whenever there is an HSI event commissioned by one of the other disease modules.

report_daly_values()[source]
class MockitisEvent(module)[source]

This event is occurring regularly at one monthly intervals and controls the infection process and onset of symptoms of Mockitis.

Bases: tlo.events.RegularEvent, tlo.events.Event, tlo.events.PopulationScopeEventMixin

Class attributes:

__annotations__ : {}

Functions (defined or overridden in class MockitisEvent):

__init__(module)[source]

Create a new regular event.

Parameters:
  • module – the module that created this event

  • frequency (pandas.tseries.offsets.DateOffset) – the interval from one occurrence to the next (must be supplied as a keyword argument)

apply(population)[source]

Apply this event to the given target.

This is a no-op; subclasses should override this method.

Parameters:

target – the target of the event

class MockitisDeathEvent(module, person_id)[source]

This is the death event for mockitis

Bases: tlo.events.Event, tlo.events.IndividualScopeEventMixin

Functions (defined or overridden in class MockitisDeathEvent):

__init__(module, person_id)[source]

Create a new event.

Note that just creating an event does not schedule it to happen; that must be done by calling Simulation.schedule_event.

Parameters:
  • module – the module that created this event. All subclasses of Event take this as the first argument in their constructor, but may also take further keyword arguments.

  • priority – a keyword-argument to set the priority (see Priority enum)

apply(person_id)[source]

Apply this event to the given target.

Must be implemented by subclasses.

Parameters:

target – the target of the event

class HSI_Mockitis_PresentsForCareWithSevereSymptoms(module, person_id)[source]

This is a Health System Interaction Event. It is first appointment that someone has when they present to the healthcare system with the severe symptoms of Mockitis. If they are aged over 15, then a decision is taken to start treatment at the next appointment. If they are younger than 15, then another initial appointment is scheduled for then are 15 years old.

Bases: tlo.methods.healthsystem.HSI_Event, tlo.events.IndividualScopeEventMixin

Functions (defined or overridden in class HSI_Mockitis_PresentsForCareWithSevereSymptoms):

__init__(module, person_id)[source]

Create a new event.

Note that just creating an event does not schedule it to happen; that must be done by calling Simulation.schedule_event.

Parameters:

module – the module that created this event. All subclasses of Event take this as the first argument in their constructor, but may also take further keyword arguments.

apply(person_id, squeeze_factor)[source]

Apply this event to the population.

Must be implemented by subclasses.

did_not_run()[source]

Called when this event is due but it is not run. Return False to prevent the event being rescheduled, or True to allow the rescheduling. This is called each time that the event is tried to be run but it cannot be.

class HSI_Mockitis_StartTreatment(module, person_id)[source]

This is a Health System Interaction Event.

It is appointment at which treatment for mockitiis is inititaed.

Bases: tlo.methods.healthsystem.HSI_Event, tlo.events.IndividualScopeEventMixin

Functions (defined or overridden in class HSI_Mockitis_StartTreatment):

__init__(module, person_id)[source]

Create a new event.

Note that just creating an event does not schedule it to happen; that must be done by calling Simulation.schedule_event.

Parameters:

module – the module that created this event. All subclasses of Event take this as the first argument in their constructor, but may also take further keyword arguments.

apply(person_id, squeeze_factor)[source]

Apply this event to the population.

Must be implemented by subclasses.

did_not_run()[source]

Called when this event is due but it is not run. Return False to prevent the event being rescheduled, or True to allow the rescheduling. This is called each time that the event is tried to be run but it cannot be.

class HSI_Mockitis_TreatmentMonitoring(module, person_id)[source]

This is a Health System Interaction Event.

It is appointment at which treatment for mockitis is monitored. (In practise, nothing happens!)

Bases: tlo.methods.healthsystem.HSI_Event, tlo.events.IndividualScopeEventMixin

Functions (defined or overridden in class HSI_Mockitis_TreatmentMonitoring):

__init__(module, person_id)[source]

Create a new event.

Note that just creating an event does not schedule it to happen; that must be done by calling Simulation.schedule_event.

Parameters:

module – the module that created this event. All subclasses of Event take this as the first argument in their constructor, but may also take further keyword arguments.

apply(person_id, squeeze_factor)[source]

Apply this event to the population.

Must be implemented by subclasses.

did_not_run()[source]

Called when this event is due but it is not run. Return False to prevent the event being rescheduled, or True to allow the rescheduling. This is called each time that the event is tried to be run but it cannot be.

class MockitisLoggingEvent(module)[source]

Bases: tlo.events.RegularEvent, tlo.events.Event, tlo.events.PopulationScopeEventMixin

Class attributes:

__annotations__ : {}

Functions (defined or overridden in class MockitisLoggingEvent):

__init__(module)[source]

Produce a summmary of the numbers of people with respect to their ‘mockitis status’

apply(population)[source]

Apply this event to the given target.

This is a no-op; subclasses should override this method.

Parameters:

target – the target of the event