tidying styles
@@ -2000,7 +2000,6 @@ class historical_vaccinate_prob(BaseVaccination):
def NB_cdf(k, p, r=1):
'''note that the NB distribution shows the fraction '''
return 1 - sp.special.betainc(k + 1, r, p)
- # return 1 - sp.special.betainc(k + 1, r, p) * sp.special.beta(k + 1, r)
class historical_wave(Intervention):
@@ -2018,7 +2017,7 @@ class historical_wave(Intervention):
kwargs (dict) : passed to Intervention()
**Example**::
- cv.Sim(use_waning=True, interventions=[cv.historical_wave(120, 0.05)]).run().plot()
+ cv.Sim(interventions=[cv.historical_wave(120, 0.30)]).run().plot()
'''
super().__init__(**kwargs)
self.days_prior = sc.dcp(days_prior)
@@ -2033,10 +2032,10 @@ class historical_wave(Intervention):
# Check that the simulation parameters are correct
if not sim['use_waning']:
- errormsg = 'The cv.historical_wave() intervention requires use_waning=True. Please enable waning.'
+ errormsg = 'cv.historical_wave() requires use_waning=True. Please enable waning.'
raise RuntimeError(errormsg)
if sim['rescale']:
- errormsg = 'The cv.historical_wave() intervention requires rescale=False. Please disable dynamic rescaling.'
+ errormsg = 'cv.historical_wave() requires rescale=False, since rescaling assumes non-included agents are naive. Please disable dynamic rescaling.'
raise RuntimeError(errormsg)
# deal with values for multiple waves
@@ -2066,7 +2065,7 @@ class historical_wave(Intervention):
if variant in mapping:
variants += [mapping[variant]]
else:
- errormsg = f'historical_wave() cannot add a new variant, must be added to sim via cv.variant: {variant}'
+ errormsg = f'cv.historical_wave() cannot add the new variant "{variant}", must be added to sim via cv.variant(). Current variants are: {sc.strjoin(mapping.keys())}'
raise ValueError(errormsg)
# pick individuls for each wave
