Closed CWiswell-IDM closed 4 years ago
Looking at failures now...
One was a test defect that I'm pushing a fix for.
One I believe to be a real bug: https://github.com/InstituteforDiseaseModeling/covasim/issues/150
One is a real issue #176, but I changed the test to work around it (set test_delay to 1 instead of 0)
Somewhere along the way, change beta began showing effects on the day it was invoked, rather than the following day (either way is acceptable depending on how you want it to work...) the feature is doing a thing that is acceptable, but we really ought to write this down. @JSchripsema-IDM, if we have / are ready to create intervention documentation this would go in there. Script to demonstrate the timing effect below:
import covasim as cv
import json
change_beta_intervention = cv.change_beta(
days =[ 30, 32, 40, 42, 50],
changes= [0.0, 1.0, 0.0, 1.0, 0.0]
)
params = {
'pop_size': 10000,
'n_days': 60,
'interventions': change_beta_intervention
}
sim = cv.Sim(pars=params)
sim.run()
save_filename = "DEBUG_change_beta_days_test.json"
sim.to_json(filename=save_filename,
indent=4)
with open(save_filename) as infile:
sim_json = json.load(infile)
pass
results = sim_json['results']
new_infections = results['new_infections']
print(f"New infections before, during, after brutal change beta: {new_infections[29:33]}")
Hope this helps! I pushed a commit to update that test (test_change_beta_days) and the test is now passing locally.
Failing test is because of #150, I think this is good.
@CWiswell-IDM thank you! it wasn't documented before and remains undocumented, except in the docstring. probably don't need to document that it now works as expected, though :) @CWiswell-IDM is this PR ready for review? (i just updated master btw, if you want to merge)
I'm not sure why the number of commits shown is wrong...but it seems fine.
I'll try your code! I'll be trying a 0.9 sensitivity though.
Should add tests necessary for
131 (contact tracing, this is the barest minimum of a test)
130 (test_prob, this test is okay)
129 (change beta, feel pretty good here)
Any suggestions of things to add, ground to cover, appreciated!