Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitset index2 everywhere #12

Closed
wants to merge 36 commits into from
Closed

Bitset index2 everywhere #12

wants to merge 36 commits into from

Conversation

plietar
Copy link
Owner

@plietar plietar commented Jul 10, 2024

No description provided.

RJSheppard and others added 30 commits May 9, 2024 12:16
…(containing an outcome following resolution and rates that that outcome occurs for each individual in the population) and CompetingHazard (contains all CompetingOutcomes and process function to resolve hazards).

processes.R: create_biting_process now replaced with create_infection_rates_process and biting_process, that uses essentially the same functional pathway, but which stops when the rates of infection are generated, storing them in the infection_outcome object within human_infection.R

Similarly, disease_progression_process(es) are replaced with new functions: create_recovery_rates_process and calculate_recovery_rates, that get the recovery rates for each individual based on disease state.

We then add these processes to the process list, including the resolution function create_infection_recovery_hazard_process$resolve.

This process (create_infection_recovery_hazard_process) contains infection_outcome and recovery_outcome. infection_outcome calls infection_process_resolved_hazard, which follows the rest of the infection pathway functions: assigning new infections to different human states. Note that this requires probability of infection which gets used in the incidence renderer function.

recovery_outcome also updates human states and infectivities.

I've adjusted some of the tests to reflect the changes in functions required to generate results.

Removed white space deletions.
…(containing an outcome following resolution and rates that that outcome occurs for each individual in the population) and CompetingHazard (contains all CompetingOutcomes and process function to resolve hazards).

processes.R: create_biting_process now replaced with create_infection_rates_process and biting_process, that uses essentially the same functional pathway, but which stops when the rates of infection are generated, storing them in the infection_outcome object within human_infection.R

Similarly, disease_progression_process(es) are replaced with new functions: create_recovery_rates_process and calculate_recovery_rates, that get the recovery rates for each individual based on disease state.

We then add these processes to the process list, including the resolution function create_infection_recovery_hazard_process$resolve.

This process (create_infection_recovery_hazard_process) contains infection_outcome and recovery_outcome. infection_outcome calls infection_process_resolved_hazard, which follows the rest of the infection pathway functions: assigning new infections to different human states. Note that this requires probability of infection which gets used in the incidence renderer function.

recovery_outcome also updates human states and infectivities.

I've adjusted some of the tests to reflect the changes in functions required to generate results.

Removed white space deletions.
…olution (any rendering in the infection outcome does not occur), I've split the incidence renderer into three functions: age rendering, n incidence rendering and p incidence rendering. This allows much more flexibility in when these are called in the code sequence. All age inputs are now consolidated and rendered in a single function. In addition, we intitate and populate these incidence columns with 0 when they are used.
Corrected dt variables recovery rate assignment when antimalarial resistance is modelled.
Merge branch 'competing_hazards_recovery_infection_resolution' of https://github.com/mrc-ide/malariasimulation into competing_hazards_recovery_infection_resolution

# Conflicts:
#	R/disease_progression.R
#	R/human_infection.R
…now occurs in biting_process.R. Similarly, create_recovery_rates_process functionality is now in disease_progression.R

stash_source_humans in competing hazard resolution is now redundant and has been removed from infection processes.

recovery rates are now assigned to a variable which is updated as infections, recoveries (via update_infection) and deaths occur. This also takes into account recovery time of treated due to slow parasite clearance and replaced the dt variable. I've also noticed (I think) that Tr->S and U->S recoveries can be done in a single step, so have attempted to combine these at risk of making the code more complicated!

Added a metapopulation incidence rendering wrapper function for initialising multiple renderers.

Rewrote create_age_group_renderer for clarity following feedback.

Some tests have been adjusted to reflect these changes.
…(containing an outcome following resolution and rates that that outcome occurs for each individual in the population) and CompetingHazard (contains all CompetingOutcomes and process function to resolve hazards).

processes.R: create_biting_process now replaced with create_infection_rates_process and biting_process, that uses essentially the same functional pathway, but which stops when the rates of infection are generated, storing them in the infection_outcome object within human_infection.R

Similarly, disease_progression_process(es) are replaced with new functions: create_recovery_rates_process and calculate_recovery_rates, that get the recovery rates for each individual based on disease state.

We then add these processes to the process list, including the resolution function create_infection_recovery_hazard_process$resolve.

This process (create_infection_recovery_hazard_process) contains infection_outcome and recovery_outcome. infection_outcome calls infection_process_resolved_hazard, which follows the rest of the infection pathway functions: assigning new infections to different human states. Note that this requires probability of infection which gets used in the incidence renderer function.

recovery_outcome also updates human states and infectivities.

I've adjusted some of the tests to reflect the changes in functions required to generate results.

Removed white space deletions.
…olution (any rendering in the infection outcome does not occur), I've split the incidence renderer into three functions: age rendering, n incidence rendering and p incidence rendering. This allows much more flexibility in when these are called in the code sequence. All age inputs are now consolidated and rendered in a single function. In addition, we intitate and populate these incidence columns with 0 when they are used.

Rebasing
Corrected dt variables recovery rate assignment when antimalarial resistance is modelled.
…(containing an outcome following resolution and rates that that outcome occurs for each individual in the population) and CompetingHazard (contains all CompetingOutcomes and process function to resolve hazards).

processes.R: create_biting_process now replaced with create_infection_rates_process and biting_process, that uses essentially the same functional pathway, but which stops when the rates of infection are generated, storing them in the infection_outcome object within human_infection.R

Similarly, disease_progression_process(es) are replaced with new functions: create_recovery_rates_process and calculate_recovery_rates, that get the recovery rates for each individual based on disease state.

We then add these processes to the process list, including the resolution function create_infection_recovery_hazard_process$resolve.

This process (create_infection_recovery_hazard_process) contains infection_outcome and recovery_outcome. infection_outcome calls infection_process_resolved_hazard, which follows the rest of the infection pathway functions: assigning new infections to different human states. Note that this requires probability of infection which gets used in the incidence renderer function.

recovery_outcome also updates human states and infectivities.

I've adjusted some of the tests to reflect the changes in functions required to generate results.

Removed white space deletions.
…now occurs in biting_process.R. Similarly, create_recovery_rates_process functionality is now in disease_progression.R

stash_source_humans in competing hazard resolution is now redundant and has been removed from infection processes.

recovery rates are now assigned to a variable which is updated as infections, recoveries (via update_infection) and deaths occur. This also takes into account recovery time of treated due to slow parasite clearance and replaced the dt variable. I've also noticed (I think) that Tr->S and U->S recoveries can be done in a single step, so have attempted to combine these at risk of making the code more complicated!

Added a metapopulation incidence rendering wrapper function for initialising multiple renderers.

Rewrote create_age_group_renderer for clarity following feedback.

Some tests have been adjusted to reflect these changes.
We only need to perform the selection for individuals that passed the
occurs check, not the entire population.
@plietar
Copy link
Owner Author

plietar commented Jul 10, 2024

/benchmark

Copy link

This is how benchmark results would change (along with a 95% confidence interval in relative change) if b3d06db is merged into dev:

  • ❗🐌large_population: 2.09m -> 2.43m [+15.34%, +16.96%]
  • ✔️small_population: 32.8s -> 32.5s [-2.77%, +0.73%]

Further explanation regarding interpretation and methodology can be found in the documentation.
Plots and raw data are available as artifacts of the workflow run.

@plietar plietar closed this Aug 20, 2024
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.

3 participants