Closed dburov190 closed 3 years ago
Can we only store epidemic data by the end of each day? It turns out that we currently store data every contact interval, and we seem to waste some memories on storing those unnecessary data.
regarding memory issues, I'm on it; but I think we can merge this one in if no other concerns — I'll address memory in a subsequent one (otherwise, this one can get stale)
This PR implements saving and loading of epidemic data.
There is one crucial edition to
epiforecast.epidemic_storage_data
, a simple change fromnamedtuple
to an inner-classKeyType
which, essentially, emulates thenamedtuple
behavior.Second, there is one new wrapper written to load and save data in
backward_forward_assimilation.py
(and corresponding constants, args etc.)By default,
backward_forward_assimilation.py
will try to load data, and if it fails, it will run the epidemic (but it won't save — sort of backwards compatibility). To alter that, there are two flags:and two additional arguments:
--epidemic-storage-name
and--epidemic-kinetic-states-name
which can be used to specify file names (again, don't need to do that by default).