def test_characteristic_path_length():
"""
Pandit, Arka, and John C. Crittenden. "Index of network resilience
(INR) for urban water distribution systems." Nature (2012).
"""
raise SkipTest
inp_file = join(datadir,'Anytown.inp')
# Create a water network model for results object
wn = wntr.network.WaterNetworkModel(inp_file)
G = wn.get_graph_deep_copy()
udG = G.to_undirected()
CPL = nx.average_shortest_path_length(udG)
print('CPL = ',CPL)
print('expected CPL = ',1.24)
error = abs(1.24-CPL)
assert_less(error, 0.01)
评论列表
文章目录