Closed p-robot closed 1 year ago
Good job removing all the very old ways of calling the model.
We could go one step further and remove all file calls completely (this is what I do with the R interface, although I've implemented for the Python interface as well). Look at /src/COVID19/model.py
where you can use:
import COVID19.model as abm
model = abm.Model( params = { "n_total" : 10000, "end_time": 20 } )
model.run()
Where params is a dictionary of overrides to the default parameters.
You also have:
model.get_individuals()
model.get_transmissions()
which directly returns dataframes from the C model object as opposed to going via files.
I've not yet implemented for the interactions (probably worth doing) or trace tokens (probably not worth doing).
Adjusted main test files to call the Python interface instead of the C executable. This removes any calls of subprocess module. This is in reference to issue #146.
Some minor formatting of tests also included in these commits.
Outstanding tests are those in
tests/test_infection_dynamics.py
andconftest.py
. These will be amended in a future commit (as they require a more involved restructure as they have functions that pass parameter objects etc).