iduedu.write_urban_graph¶
- iduedu.write_urban_graph(graph, path, *, include_adjacency=False)[source]¶
Write an
UrbanGraphto an.urbangrapharchive.The archive contains
metadata.json,nodes.parquetandedges.parquet. Ifinclude_adjacencyis true and the graph has a cached adjacency matrix, the cache is stored asadjacency.npztogether with its nodelist.- Parameters:
graph (
UrbanGraph) – Graph to serialize.path (
str|Path) – Destination path with the.urbangraphsuffix.include_adjacency (
bool) – Whether to persist the cached adjacency matrix.
- Return type:
- Returns:
Path to the written archive.
- Raises:
TypeError – If
graphis not anUrbanGraph.ValueError – If
pathdoes not use the.urbangraphsuffix.ImportError – If parquet support is not installed.