def compute_water_ingress_given_damage(damage_index, wind_speed,
                                       water_ingress):
    """
    compute percentage of water ingress given damage index and wind speed

    Args:
        damage_index: float
        wind_speed: float
        water_ingress: pd.DataFrame
                       index: damage index
                       columns: wi
    Returns:
        prop. of water ingress ranging between 0 and 1

    """
    assert 0.0 <= damage_index <= 1.0

    # Note that water_ingress index are upper threshold values of DI
    idx = water_ingress.index[(water_ingress.index < damage_index).sum()]
    return water_ingress.at[idx, 'wi'](wind_speed)