Skip to content
New issue

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

fix "ValueError: max()" in LPA.get_max_neighbor_label() #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

javeme
Copy link

@javeme javeme commented Sep 28, 2018

max(m.itervalues()) will raise ValueError when calling LPA.get_max_neighbor_label()
with a parameter isolated vertex, which has no neighbors.
It is reasonable to return label of the vertex itself if it's an isolated vertex.

pass empty sequence parameter to max():

>>> m=dict()
>>> max(m.itervalues())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: max() arg is an empty sequence

fix #9

max(m.itervalues()) will raise ValueError when calling LPA.get_max_neighbor_label()
with a parameter isolated vertex, which has no neighbors.
It is reasonable to return label of the vertex itself if it's an isolated vertex.

fix zzz24512653#9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LPA: ValueError: max() arg is an empty sequence
1 participant