We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Requesting the conductance (or bipartiteness) of an empty set should return a meaningful error message to the client.
>>> import sgtl.graph >>> graph = sgtl.graph.cycle_graph(10) >>> graph.conductance([]) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/peter/wc/py-sgtl/sgtl/graph.py", line 144, in conductance return 1 - (2 * self.weight(vertex_set_s, vertex_set_s, sets_are_equal=True)) / self.volume(vertex_set_s) ZeroDivisionError: division by zero
For the bipartiteness case:
>>> graph.bipartiteness([], []) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/peter/wc/py-sgtl/sgtl/graph.py", line 159, in bipartiteness return 1 - 2 * self.weight(vertex_set_l, vertex_set_r) / self.volume(vertex_set_l + vertex_set_r) ZeroDivisionError: division by zero
Something like:
>>> import sgtl.graph >>> graph = sgtl.graph.cycle_graph(10) >>> graph.conductance([]) <snip> ValueError: conductance of the empty set is undefined
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Requesting the conductance (or bipartiteness) of an empty set should return a meaningful error message to the client.
Minimal working example
For the bipartiteness case:
Desired Behaviour
Something like:
The text was updated successfully, but these errors were encountered: