I am seeing the following crash when creating a Node2Vec object on a graph with no weights attribute on its edges:
Traceback (most recent call last):
File "~/dev/pyiextract/graph.py", line 65, in <module>
node2vec = Node2Vec(G, dimensions=64, walk_length=30, num_walks=200, workers=4)
File "~/dev/pyiextract/venv/lib/python3.9/site-packages/node2vec/node2vec.py", line 73, in __init__
self._precompute_probabilities()
File "~/dev/pyiextract/venv/lib/python3.9/site-packages/node2vec/node2vec.py", line 125, in _precompute_probabilities
ss_weight = weight * 1 / q
TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'
If I initialise the edges with a weights attribute of 0.0, it seems to work. I can make a PR to assume 0.0 as a weight attribute if none exists however I want to understand what the intention is here, perhaps if this is expected an explicit error could be sent as an exception instead?
I am seeing the following crash when creating a
Node2Vecobject on a graph with no weights attribute on its edges:If I initialise the edges with a weights attribute of 0.0, it seems to work. I can make a PR to assume 0.0 as a weight attribute if none exists however I want to understand what the intention is here, perhaps if this is expected an explicit error could be sent as an exception instead?