ordeq_networkx
NetworkxGML
dataclass
¶
Bases: IO[Graph]
IO to load from and save graph data using NetworkX's GML support.
Calls networkx.read_gml and networkx.write_gml under the hood.
Example usage:
1 2 3 4 5 6 7 8 | |
load(**load_options)
¶
Load a graph from the GML file at the specified path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**load_options
|
Any
|
Additional keyword arguments passed to
|
{}
|
Returns:
| Type | Description |
|---|---|
Graph
|
The loaded NetworkX graph. |
save(graph, **save_options)
¶
Save a NetworkX graph to the GML file at the specified path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
graph
|
Graph
|
The NetworkX graph to save. |
required |
**save_options
|
Any
|
Additional keyword arguments passed to
|
{}
|
NetworkxGraphML
dataclass
¶
Bases: IO[Graph]
IO to load from and save graph data using NetworkX's GraphML support.
Calls networkx.read_graphml and networkx.write_graphml under the hood.
Example usage:
1 2 3 4 5 6 7 8 | |
load(**load_options)
¶
Load a graph from the GraphML file at the specified path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**load_options
|
Any
|
Additional keyword arguments passed to
|
{}
|
Returns:
| Type | Description |
|---|---|
Graph
|
The loaded NetworkX graph. |
save(graph, **save_options)
¶
Save a NetworkX graph to the GraphML file at the specified path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
graph
|
Graph
|
The NetworkX graph to save. |
required |
**save_options
|
Any
|
Additional keyword arguments passed to
|
{}
|
NetworkxJSON
dataclass
¶
Bases: IO[Graph]
IO to load from and save graph data using NetworkX's JSON support.
Calls networkx.node_link_graph and networkx.node_link_data
under the hood.
Example usage:
1 2 3 4 5 6 7 8 | |
load(**load_options)
¶
Load a NetworkX graph from a JSON file using node-link format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**load_options
|
Any
|
Additional keyword arguments passed to |
{}
|
Returns:
| Type | Description |
|---|---|
Graph
|
The loaded NetworkX graph. |
save(graph, **save_options)
¶
Save a NetworkX graph to a JSON file using node-link format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
graph
|
Graph
|
The NetworkX graph to save. |
required |
**save_options
|
Any
|
Additional keyword arguments passed to |
{}
|