Skip to content

Implementing deaths #46

Draft
erik-rosenstrom wants to merge 4 commits intomainfrom
etr-deaths
Draft

Implementing deaths #46
erik-rosenstrom wants to merge 4 commits intomainfrom
etr-deaths

Conversation

@erik-rosenstrom
Copy link
Copy Markdown
Collaborator

@erik-rosenstrom erik-rosenstrom commented Mar 11, 2026

This PR implements the effects of a dead symptom status. This involves disallowing future plans that are scheduled to happen for dead individuals and removing them from setting membership.

Changes

  • A death module was created with event subscription to listen for dead symtpom status progression.
  • Upon death the alive person property is set to false, they are removed from setting membership, and if they are infectious when they die, the directly transition to the recovered infection status.
  • A death context extension was created with the method to ergonomically check the alive status. This context extension includes a lightweight wrapper on add_plan called add_plan_if_alive that checks if the person is alive before executing the callback.
  • An additional method was added to the settings context extension to remove the person from setting membership. Their itineraries are maintained in case additional analysis on a dead person's itinerary is required.
  • Tests were add to the death module to ensure all functionality of death occurs how we expect.
  • Checks were add to multiple places in the infection_manager and infection_propagation_loop modules to check if the person is alive before proceeding

Open Question

Should the add_plan_if_alive be used for all plans? Even those in the symptom status manager that execute before a person dies?

Additional Resource

A design document for deaths in models can be found here

@erik-rosenstrom erik-rosenstrom marked this pull request as draft March 11, 2026 15:11
@erik-rosenstrom erik-rosenstrom linked an issue Mar 11, 2026 that may be closed by this pull request
@erik-rosenstrom erik-rosenstrom changed the base branch from main to pgv5_clinical_status March 11, 2026 21:21
Base automatically changed from pgv5_clinical_status to main March 17, 2026 15:41
@KOVALW KOVALW added this to the Phase 2: Initial growth milestone Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implementing deaths upon a Dead symptom status

2 participants