tapios / risk-networks

Code for risk networks: a blend of compartmental models, graphs, data assimilation and semi-supervised learning
Other
2 stars 2 forks source link

Speed up assmilation-loop code by ~27% & fix couple minor bugs #172

Closed dburov190 closed 3 years ago

dburov190 commented 3 years ago

This PR returns the if-statements to assimilation loops for calling setters of master equations, i.e. the setters are only called when assimilation was carried out. This speeds up that part of the code by ~27% (at least for the 1e3 case).

There are also a couple of minor stylistic changes and minor bug fixes.

Also, one thing I'm not sure about (whether it's a bug or not) is which statuses we should be loading on the backward-DA sweep... it used to be start_statuses but since now we're doing DA first and then master equations, should that be end_statuses instead? I changed it to end_statuses but this is open for discussion. I'll mark the place in the code.

odunbar commented 3 years ago

These small changes are fine with me.