laser_cholera.metapop package¶
- class laser_cholera.metapop.Census(model, verbose: bool = False)[source]¶
Bases:
object
- class laser_cholera.metapop.HumanToHuman(model, verbose: bool = False)[source]¶
Bases:
object
- class laser_cholera.metapop.HumanToHumanVax(model, verbose: bool = False)[source]¶
Bases:
object
- laser_cholera.metapop.get_parameters(filename: str | Path | None = None, do_validation: bool = True, overrides: dict | None = None) PropertySet [source]¶
Submodules¶
laser_cholera.metapop.analyzer module¶
laser_cholera.metapop.census module¶
- class laser_cholera.metapop.census.Census(model, verbose: bool = False)[source]¶
Bases:
object
laser_cholera.metapop.derivedvalues module¶
laser_cholera.metapop.environmental module¶
- class laser_cholera.metapop.environmental.Environmental(model, verbose: bool = False)[source]¶
Bases:
object
- laser_cholera.metapop.environmental.map_suitability_to_decay(fast, slow, suitability, beta_a, beta_b)[source]¶
Map suitability to decay using a beta distribution.
- Parameters:
fast (float) – Fast decay time.
slow (float) – Slow decay time.
suitability (np.ndarray) – Suitability values.
beta_a (float) – Alpha parameter for the beta distribution.
beta_b (float) – Beta parameter for the beta distribution.
- Returns:
np.ndarray – Decay rates corresponding to the suitability values.
laser_cholera.metapop.envtohuman module¶
Environmental transmission rate.
laser_cholera.metapop.envtohumanvax module¶
Environmental transmission rate.
laser_cholera.metapop.exposed module¶
laser_cholera.metapop.humantohuman module¶
Human-to-human transmission rate.
- class laser_cholera.metapop.humantohuman.HumanToHuman(model, verbose: bool = False)[source]¶
Bases:
object
laser_cholera.metapop.humantohumanvax module¶
Human-to-human transmission rate.
- class laser_cholera.metapop.humantohumanvax.HumanToHumanVax(model, verbose: bool = False)[source]¶
Bases:
object
laser_cholera.metapop.infectious module¶
laser_cholera.metapop.model module¶
- class laser_cholera.metapop.model.Model(parameters: PropertySet, name: str = 'Cholera Metapop')[source]¶
Bases:
object
- property components: list¶
Retrieve the list of model components.
- Returns:
list – A list containing the components.
- run() None [source]¶
Execute the model for a specified number of ticks, recording the time taken for each phase.
This method initializes the start time, iterates over the number of ticks specified in the model parameters, and for each tick, it executes each phase of the model while recording the time taken for each phase.
The metrics for each tick are stored in a list. After completing all ticks, it records the finish time and, if verbose mode is enabled, prints a summary of the timing metrics.
- Variables:
tstart (datetime) – The start time of the model execution.
tfinish (datetime) – The finish time of the model execution.
metrics (list) – A list of timing metrics for each tick and phase.
- Returns:
None
laser_cholera.metapop.params module¶
- laser_cholera.metapop.params.get_parameters(filename: str | Path | None = None, do_validation: bool = True, overrides: dict | None = None) PropertySet [source]¶
- laser_cholera.metapop.params.load_compressed_hdf5_parameters(filename: str | Path) PropertySet [source]¶
laser_cholera.metapop.recorder module¶
laser_cholera.metapop.recovered module¶
laser_cholera.metapop.scenario module¶
laser_cholera.metapop.susceptible module¶
laser_cholera.metapop.utils module¶
- laser_cholera.metapop.utils.fourier_series_double(t, beta0, a1, b1, a2, b2, p)[source]¶
Computes the value of a Fourier series with two harmonics at a given time.
- Parameters:
t (array-like) – Time values.
beta0 (float) – Constant term of the Fourier series.
a1 (array-like) – Amplitudes of the first harmonic (cosine component).
b1 (array-like) – Amplitudes of the first harmonic (sine component).
a2 (array-like) – Amplitudes of the second harmonic (cosine component).
b2 (array-like) – Amplitudes of the second harmonic (sine component).
p (float) – Period of the Fourier series.
- Returns:
numpy.ndarray – The computed Fourier series values at the given time points.