Skip to content

wsa.fillna(0) incorrect in earthquake example #549

@wael-mahlous

Description

@wael-mahlous

Hello,

Please correct me if I'm wrong, but I think the wsa.fillna(0) in the following line and the one below it:

"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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions