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

Use n_steps + 1 instead of len(t) #124

Closed dburov190 closed 4 years ago

dburov190 commented 4 years ago

Here https://github.com/dburov190/risk-networks/blob/839d2a02518290180fc863183e36973b12a03c26/epiforecast/risk_simulator.py#L239 and here https://github.com/dburov190/risk-networks/blob/839d2a02518290180fc863183e36973b12a03c26/epiforecast/risk_simulator.py#L278

I would use n_steps + 1 instead of len(t) for consistency: later on, the for-loop uses total = n_steps, not len(t) - 1

odunbar commented 4 years ago

I think in this case it would be better changing the loop actually, The for loop is explicitly over ... in enumerate(t[:-1]) so it's more natural to have the total = t.size - 1. I'll change to using size though, as it is a 1d np.array

dburov190 commented 4 years ago

yeah, agreed: I didn't have a preference of one or the other, but it has to be consistent