austinorr / swmmnetwork

SWMMNetwork helps users of EPA SWMM 5.1 perform water quality and load reduction calculations.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Catch cycles in network and report offenders to stdout

austinorr opened this issue · comments

networks topological_sort fails when it encounters a cycle in a network, but the traceback is unhelpful in locating the offending links/nodes.

Add a try/except to catch the error (or find_cycle) and return the list of edges that are causing it.

Apparently SWMM5 doesn't care that the flow network is invalid.