A country model has parameters of very different kinds: how many agents to run, how transmissible HPV16 is, how many casual partners women report, how much protection clearing HPV18 gives against HPV16. In HPVsim these live on different modules, because each module owns the state it acts on. That is good for the code and inconvenient for you, since a parameter set arrives as one flat table from a spreadsheet or a calibration.
hpv.route_pars handles that. It takes one dictionary and delivers each entry to the module that owns it, so you can keep a country’s parameters in one place.
A bare key goes everywhere it fits.beta=0.2 sets beta on every genotype. n_agents=2000 sets it on the sim. A name that exists in two places is written to both, which is intended — ms_agent_ratio belongs on every genotype at once.
HIV is never reached by a bare key. HIV shares parameter names with HPV (beta, init_prev), so a bare beta= would silently switch on HIV transmission. HIV parameters must be scoped: hiv=dict(beta_m2f=0.008) or hiv_pars=dict(...).
Specific beats general. Scoped entries are applied after bare ones, whatever order your dictionary is in, so dict(beta=0.2, hpv16=dict(beta=0.3)) gives HPV16 0.3 and every other genotype 0.2. Dotted keys are accepted too — 'hpv16.cin_fn.k' is the same as hpv16=dict(cin_fn=dict(k=...)) — which is what calibration output looks like.
Nested parameter groups merge rather than replace. cin_fn, cancer_fn, age_risk and the network’s age_act_pars_* are parameter objects, so hpv16=dict(cin_fn=dict(k=0.4)) changes k and leaves form, x_infl and ttc alone.
An unrecognized name raises a ValueError listing it. That is deliberate: a typo in a country parameter file should stop the run, not run the defaults.
The sim-level defaults are in hpv.SimPars: 10,000 agents, 1990 to 2060, dt=0.25 (three months), seed 0. hpv.Sim itself does not assume a country — pass location= or you get the location-free playground described in Demographics.
How to organize a country parameter set
The simplest option is the define a dictionary of inputs for your setting, grouped by purpose, and pass it into hpv.Sim.
beta reached both genotypes but their per-act transmission probabilities still differ, because each genotype scales beta by its own rel_beta. Check what the model actually uses with sim.diseases.hpv16.validate_beta().
Within the nigeria_inputs dictionary there are different kinds of inputs: location is a constructor argument, not a routed parameter, so hpv.Sim(**nigeria) works while hpv.Sim(pars=nigeria) does not.
See also
Calibration, which uses the same nested form for calib_pars