nocad.io.write#
- nocad.io.write(obj, path, format=None, *, labels=None, annotate=True, layout='hierarchy', **kwargs)[source]#
Write a network, a design or an annotated configuration to a file.
- Parameters:
- obj
network(adjacency,sparse,networkx,DataFrame),InputOutputDesignoraBunch with
adj(andlabels) such as the result ofread()- path
strorpathlib.Path Output file; the format follows the extension (see
FORMATS).- format
str,optional Override the format name (
"graphml","gexf","gml","cytoscape","node_link","dot","pajek","edgelist","csv","excel","matlab","npz").- annotatebool, default=True
Include the role annotations of
nocad.annotation.annotate().- layout
strorndarray, default=”hierarchy” Node positions stored in GEXF, Cytoscape and GraphML files (
Nonefor none).- **kwargs
Passed to
to_networkx()/nocad.annotation.annotate()(design,method,drivers,sensors,centrality,robustness).
- obj
- Returns:
- paths
listofpathlib.Path The files written (CSV writes a node file beside the edge file).
- paths