nocad.io.read#
- nocad.io.read(path, format=None, **kwargs)[source]#
Read a network (and a stored configuration) from a file.
- Returns:
- net
Bunchwithadj,labels,n_states,node_data(attributesfoundin the file),
driversandsensors(fromdriver/sensorattributes or from B and C, else None); MATLAB files also giveA, B, C, D.
- net
Examples
>>> import tempfile, pathlib >>> from nocad.datasets import load_nocad_example >>> f = pathlib.Path(tempfile.mkdtemp()) / "example.graphml" >>> _ = write(load_nocad_example().adj, f) >>> net = read(f) >>> net.n_states, net.drivers.tolist(), net.sensors.tolist() (9, [7], [0, 8])