parameters

parameters

Handle sim parameters

Classes

Name Description
SimPars Dictionary with all parameters used within an FPsim.

SimPars

parameters.SimPars(**kwargs)

Dictionary with all parameters used within an FPsim. All parameters that don’t vary across geographies are defined explicitly here. Keys for all location-specific parameters are also defined here with None values.

Functions

Name Description
all_pars Return a dictionary with all parameters used within an FPsim.
make_fp_pars Shortcut for making a new instance of FPPars
make_sim_pars Shortcut for making a new instance of SimPars
mergepars Merge all parameter dictionaries into a single dictionary with nested merging.

all_pars

parameters.all_pars(location=None)

Return a dictionary with all parameters used within an FPsim. This includes both simulation parameters and family planning parameters.

make_fp_pars

parameters.make_fp_pars(location=None)

Shortcut for making a new instance of FPPars

make_sim_pars

parameters.make_sim_pars(**kwargs)

Shortcut for making a new instance of SimPars

mergepars

parameters.mergepars(*args, _copy=False, **kwargs)

Merge all parameter dictionaries into a single dictionary with nested merging. This is used to initialize the SimPars class with all relevant parameters.

Unlike sc.mergedicts, this function recursively merges nested dictionaries instead of replacing them entirely. This allows partial dictionary specifications in calibration parameters (e.g., only specifying preference values in spacing_pref while preserving interval, n_bins, months from defaults).

Parameters

Name Type Description Default
_copy bool whether to deep copy the input dictionaries (default False, same as sc.mergedicts) False
*args dictionaries to merge ()
**kwargs additional parameters (for compatibility with sc.mergedicts) {}