Closed baluballa closed 3 years ago
kwargs
(a dictionary) at line 51in ges\covsirphy\ode\ode_solver.py may have "Fatal" and "Recovered", but not "Fatal or Recovered". I think "Fatal or Recovered" key should be created to solve this error. I will investigate this issue this weekend.
Ok, the SET has been trhough this process, in the dataloader without flaws.:
data_loader.lock(
# Always required
date="date", country="country", province="province",
confirmed="confirmed", fatal="fatal", population="population",
# Optional regarding location
iso3="iso3",
# Optional regarding JHUData
recovered="recovered",
# Optional regarding PCData
tests="tests",
# Optional regarding VaccineData
product="product", vaccinations="vaccinations",
vaccinated_once="vaccinated_once", vaccinated_full="vaccinated_full",
)
I have more or less followed the guide on covsirphy github pages "documentation", how ever data is from local government and scenario is for province.
Fucntions still returns:
KeyError: 'Value of Fatal or Recovered was not specified with keyword arguments.'
in version '2.22.1-beta'
I tryed some changes with #960, but failed.
The following script also shows KeyError
.
import covsirphy as cs
loader = cs.DataLoader()
jhu_data = loader.jhu()
snl = cs.Scenario(country="Norway")
snl.register(jhu_data)
snl.trend()
snl.estimate(cs.SIR)
snl.summary()
snl.simulate()
snl.summary()
worked, but snl.simulate()
caused KeyError
. Something error in calculating initial values of variables ("Fatal or Recovered", "Infected", "Susceptible”) in simulation.
Here is the csv export from snl.records(variables="all"). Hope it helps... Province you can call whatever... Guess you can load it in to the
Scenariousing DataLoader load from csv.
snl = cs.Scenario(country="Norway", province='local)`
Thank you. I found a cause for the error and this may me fixied with #961. After merged, I will report to you.
"Spot on". Solved in 2.22.1-gamma
. Good job! Thanks!
My pleasure. I will release stable version 2.22.2 for #954 and #957 today!
Summary
snl.estimate_accuracy(phase="last") returns: KeyError: 'Value of Fatal or Recovered was not specified with keyword arguments.'
Codes
Outputs
KeyError: 'Value of Fatal or Recovered was not specified with keyword arguments.'
snl.records(variables="all", show_figure=False).head(10).to_clipboard( index=True)
yelds:snl.fit()
returns:and
snl.estimate_accuracy(phase="last")
returns:Environment
Note:
Its the same dataset as in issue 954 (https://github.com/lisphilar/covid19-sir/issues/954) only different is using ODE SIR instead of SIR-F. Troubled functions runs fine on ODE SIR-F.
Regards