Simple Cause

This module contains tools for creating a minimal representation of a cause as required by observers.

class vivarium_public_health.results.simple_cause.SimpleCause(state_id, model, cause_type)[source]

A simple dataclass to represent the bare minimum information needed by observers.

It also includes a class method to convert a provided cause into a SimpleCause instance.

Parameters:
  • state_id (str)

  • model (str)

  • cause_type (str)

state_id: str

The state_id of the cause.

model: str

The model of the cause.

cause_type: str

The cause type of the cause.

classmethod create_from_specific_cause(cause)[source]

Create a SimpleCause instance from a more specific cause.

Parameters:

cause (type) – The cause to be converted into a SimpleCause instance.

Return type:

SimpleCause

Returns:

A SimpleCause instance.