Closed ffl096 closed 3 months ago
For context, NetworkX works as follows:
G[node]
gives a view of all neighbouring nodes.G[edge]
is invalid.G[node][neighbour]
gives access to the edge attributes of the edge between node
and neighbour
.G.nodes[node]
and G.edges[edge]
gives access to the attributes of node
and edge
, respectively.That being said, I am not sure we want to mirror that API exactly. For example, SC[node][neighbour]
is ill-defined, as there can be multiple connections between two nodes and it is not clear what attributes to return.
Similar to #266, the
__getitem__
method is not implemented consistently across different complex types:SC[simplex]
returns the user-defined attributes associated with that simplex.CC[cell]
returns the neighbours of that cell.CHG[node]
returns the attributes of that node, but it does not work for hyperedges.PC[path]
returns the attributes associated with that path.