pathpyG icon indicating copy to clipboard operation
pathpyG copied to clipboard

Use IndexMapping as node labels by default

Open IngoScholtes opened this issue 4 months ago • 1 comments

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.

IngoScholtes avatar Feb 22 '24 11:02 IngoScholtes

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.

M-Lampert avatar Apr 10 '24 10:04 M-Lampert