pathpyG
pathpyG copied to clipboard
Use IndexMapping as node labels by default
I think it would be a good idea if the plot function used the ID-Index mapping stored in Graph.mapping
as node labels by default (if such a mapping is defined). If no such mapping is defined, the plot function should use the node indices as labels by default.
This would allow users to omit passing the plot argument node_label=g.mapping.node_id
.
On that note, currently you get some kind of JSON error when you try to assign a numpy.array
or a torch.Tensor
to node_label
because it is not hashable. It would be great if the conversion to a Python list
happens internally for a more seamless integration with torch
and numpy
.