-
Notifications
You must be signed in to change notification settings - Fork 223
Description
Hello,
Please correct me if I'm wrong, but I think the wsa.fillna(0) in the following line and the one below it:
WNTR/examples/earthquake_tutorial.ipynb
Line 422 in e0791b7
| "people_impacted = wntr.metrics.population_impacted(population, wsa.fillna(0), np.less, 0.8)\n", |
... should instead be wsa.fillna(1). The reason is that water service availability is the ratio of demand to expected demand. If expected demand is 0, wsa is NaN (division by zero), which is fine. However, when calculating for population impacted, the NaNs should be replaced with 1 to indicate that the (zero) demand was met. Replacing with 0s instead of 1s means that 0% of the expected demand was met, i.e. 100% of the population was affected (which is incorrect since none of the population was impacted as there was no expected demand to begin with).
Let me know if this makes sense :)
Wael