A NodeView class to act as G.nodes for a DistGraph.
| 338 | |
| 339 | |
| 340 | class HeteroNodeView(object): |
| 341 | """A NodeView class to act as G.nodes for a DistGraph.""" |
| 342 | |
| 343 | __slots__ = ["_graph"] |
| 344 | |
| 345 | def __init__(self, graph): |
| 346 | self._graph = graph |
| 347 | |
| 348 | def __getitem__(self, key): |
| 349 | assert isinstance(key, str) |
| 350 | return NodeSpace(data=NodeDataView(self._graph, key)) |
| 351 | |
| 352 | |
| 353 | class HeteroEdgeView(object): |