(self, path=None, string=None)
| 850 | self.edge_ids = {} # dict mapping (u,v) tuples to edge id attributes |
| 851 | |
| 852 | def __call__(self, path=None, string=None): |
| 853 | from xml.etree.ElementTree import ElementTree |
| 854 | from xml.etree.ElementTree import fromstring |
| 855 | |
| 856 | if path is not None: |
| 857 | self.xml = ElementTree(file=path) |
| 858 | elif string is not None: |
| 859 | self.xml = fromstring(string) |
| 860 | else: |
| 861 | raise ValueError("Must specify either 'path' or 'string' as kwarg") |
| 862 | (keys, defaults) = self.find_graphml_keys(self.xml) |
| 863 | for g in self.xml.findall(f"{{{self.NS_GRAPHML}}}graph"): |
| 864 | yield self.make_graph(g, keys, defaults) |
| 865 | |
| 866 | def make_graph(self, graph_xml, graphml_keys, defaults, G=None): |
| 867 | # set default graph type |
nothing calls this directly
no test coverage detected