test_topographic.py 文件源码

python
阅读 36 收藏 0 点赞 0 评论 0

项目:WNTR 作者: USEPA 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号