(cls, *graphs: Graph)
| 638 | |
| 639 | @classmethod |
| 640 | def merge(cls, *graphs: Graph) -> HighLevelGraph: |
| 641 | layers: dict[str, Graph] = {} |
| 642 | dependencies: dict[str, set[str]] = {} |
| 643 | for g in graphs: |
| 644 | if isinstance(g, HighLevelGraph): |
| 645 | layers.update(g.layers) |
| 646 | dependencies.update(g.dependencies) |
| 647 | elif isinstance(g, Mapping): |
| 648 | layers[str(id(g))] = g |
| 649 | dependencies[str(id(g))] = set() |
| 650 | else: |
| 651 | raise TypeError(g) |
| 652 | return cls(layers, dependencies) |
| 653 | |
| 654 | def visualize(self, filename="dask-hlg.svg", format=None, **kwargs): |
| 655 | """ |
no test coverage detected