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

Fixing bugs encountered while working on scenario modeling #389

Merged
merged 5 commits into from
Mar 18, 2024

Conversation

daniel-klein
Copy link
Contributor

  • SIR duration of infection now accounts for dt
  • Reworked sir_vaccine to modify rel_sus instead of moving agents from susceptible to recovered.
  • n_years no longer necessarily an integer
  • yearvec had an extra year
  • Convert network keys to lowercase
  • In Interventions, CampaignDelivery now is just discrete timepoints. Interpolation and annual_prob options removed. Fixed timepoints as ss.true functionality differs in Starsim than previous models, now using sc.findnearest.
  • Also in Interventions, adding coverage_dist to BasicVaccination, which was missing.

* Reworked sir_vaccine to modify rel_sus instead of moving agents from susceptible to recovered.
* n_years no longer necessarily an integer
* yearvec had an extra year
* Convert network keys to lowercase
* In Interventions, CampaignDelivery now is just discrete timepoints. Interpolation and annual_prob options removed. Fixed timepoints as `ss.true` functionality differs in Starsim than previous models, now using sc.findnearest.
* Also in Interventions, adding `coverage_dist` to BasicVaccination, which was missing.
Comment on lines +75 to +76
self.ti_dead[dead_uids] = sim.ti + dur_inf[will_die] / sim.dt # Consider rand round, but not CRN safe
self.ti_recovered[rec_uids] = sim.ti + dur_inf[~will_die] / sim.dt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be //?

starsim/sim.py Outdated
@@ -188,7 +188,7 @@ def init_time_vecs(self):
"""
Construct vectors things that keep track of time
"""
self.yearvec = sc.inclusiverange(start=self.pars.start, stop=self.pars.end + 1 - self.pars.dt,
self.yearvec = sc.inclusiverange(start=self.pars.start, stop=self.pars.end - self.pars.dt,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much as I love Sciris, this has evolved into a very convoluted way to replicate the behavior of np.arange(self.pars.start, self.pars.end, self.pars.dt)!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the previous version was correct, based on the comment "# Includes all the timepoints in the last year".

Base automatically changed from fix_348 to main March 18, 2024 14:02
@cliffckerr cliffckerr merged commit 909b2e0 into main Mar 18, 2024
2 of 3 checks passed
@cliffckerr cliffckerr deleted the bug-fixes-from-crn-experimentation branch March 18, 2024 14:52
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.

2 participants