Closed dburov190 closed 4 years ago
Here https://github.com/dburov190/risk-networks/blob/839d2a02518290180fc863183e36973b12a03c26/epiforecast/risk_simulator.py#L239-L240 and here https://github.com/dburov190/risk-networks/blob/839d2a02518290180fc863183e36973b12a03c26/epiforecast/risk_simulator.py#L278-L279 in the first line, self.y0.size should be written instead of len(...) because
self.y0.size
len(...)
In the second line, np.copy can be removed for clarity, since flatten returns a copy anyway.
np.copy
flatten
I can see why this was originally coded, as you make a container of size y0.flatten() and then use it to store y0.flatten(). But I also prefer size here.
y0.flatten()
Here https://github.com/dburov190/risk-networks/blob/839d2a02518290180fc863183e36973b12a03c26/epiforecast/risk_simulator.py#L239-L240 and here https://github.com/dburov190/risk-networks/blob/839d2a02518290180fc863183e36973b12a03c26/epiforecast/risk_simulator.py#L278-L279 in the first line,
self.y0.size
should be written instead oflen(...)
becauseIn the second line,
np.copy
can be removed for clarity, sinceflatten
returns a copy anyway.