Closed dburov190 closed 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
yeah, agreed: I didn't have a preference of one or the other, but it has to be consistent
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 oflen(t)
for consistency: later on, thefor
-loop usestotal = n_steps
, notlen(t) - 1