make_scen#
- class make_scen(*args, **kwargs)[source]#
Alias for
fp.Scenario().Store the specification for a single scenario (which may consist of multiple interventions).
Note, this class may be deprecated. See the scripts in the examples folder and the tests in test_interventions for examples of how to define simulations with different parameters or interventions and run them in parallel.
- Args (shared):
spec (dict): a pre-made specification of a scenario; see keyword explanations below (optional) args (list): additional specifications (optional) label (str): the sim label to use for this scenario pars (dict): optionally supply additional sim parameters to use with this scenario (that take effect at the beginning of the sim, not at the point of intervention) year (float): the year at which to activate efficacy and probability scenarios eff (dict): a dictionary of method names and new efficacy values par (str): the parameter to modify par_years (float/list): the year(s) at which to apply the modifications par_vals (float/list): the value(s) of the parameter for each year interventions (Intervention/list): any custom intervention(s) to be applied to the scenario
Congratulations on making it this far.
Examples:
# Basic efficacy scenario s1 = fp.make_scen(eff={'Injectables':0.99}, year=2020) # Parameter scenario: halve exposure s2 = fp.make_scen(par='exposure_factor', par_years=2010, par_vals=0.5) # Custom scenario def update_sim(sim): sim.updated = True s3 = fp.make_scen(interventions=update_sim) # Scenarios can be combined (although this is not necessarily recommended) s4 = s1 + s2