You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When use theoretical data, we know the parameter values without estimation. It is the best way to apply parameter values with Scenario.add(), but this failed with errors.
Codes and outputs:
importcovsirphyascs# Instance to save population valuespopulation_data=cs.PopulationData(filename=None)
# Set tau value and start date of recordsexample_data=cs.ExampleData(tau=1440, start_date="01Jan2020")
# Preset of SIR-F parameterspreset_dict=cs.SIRF.EXAMPLE["param_dict"]
# Create dataset from 01Jan2020 to 31Jan2020area= {"country": "Theoretical"}
example_data.add(cs.SIRF, step_n=30, **area)
# Register population valuepopulation_data.update(cs.SIRF.EXAMPLE["population"], **area)
# Create Scenario classsnl=cs.Scenario(example_data, population_data, tau=1440, **area)
# Set 0th phase from 02Jan2020 to 31Jan2020 with preset parameter valuessnl.clear(include_past=True)
snl.add(end_date="31Jan2020", model=cs.SIRF, **preset_dict)
# Add main scenariosnl.add(end_date="31Dec2020", name="Main")
# Add lockdown scenariorho_lock=snl.get("rho", phase="0th") /2snl.add(end_date="31Dec2020", name="Lockdown", rho=rho_lock)
# Add medicine scenariokappa_med=snl.get("kappa", phase="0th") /2sigma_med=snl.get("sigma", phase="0th") *2snl.add(end_date="31Dec2020", name="Medicine", kappa=kappa_med, sigma=sigma_med)
# Add vaccine scenariosnl.add(end_date="31Dec2020", name="Vaccine", model=cs.SIRFV, omega=0.001)
# Summarizesnl.summary()
# Compare scenariossnl.describe(y0_dict={"Vaccinated": 0})
This causes KeyError in creation of PopulationData instance, IndexError in Scenario.add() and KeyError in Scenario.describe() when model was change in the future phases.
Environment
CovsirPhy version: 2.6.0-alpha.fix.120
Python version; 3.8
Installation: pipenv
OS: WSL
The text was updated successfully, but these errors were encountered:
Summary
When use theoretical data, we know the parameter values without estimation. It is the best way to apply parameter values with
Scenario.add()
, but this failed with errors.Codes and outputs:
This causes KeyError in creation of
PopulationData
instance, IndexError inScenario.add()
and KeyError inScenario.describe()
when model was change in the future phases.Environment
The text was updated successfully, but these errors were encountered: