Network.from_xml¶
- classmethod Network.from_xml(file: str, return_dict: bool = False, **kwargs) paminco.net.network.Network[source]¶
Read network from
XML.- Parameters
- datastr, file, ElementTree or Element
- Initialize object from xml file by passing
filename as str,
file object that contains XML data,
the XML ElementTree,
or the root Element of the ElementTree.
- return_dictbool, default=False,
If
True, the data is returned as a dict with entriesedge_data,node_data,demand_dataandcost_data. IfFalse(default), aNetworkobject created from this data is returned
- Returns
- netNetwork or dict
The network read from the data. If
return_dictis True, a dict with the raw data is returned.
See also
xml.etree.ElementTreefrom_xml()from_xmlmethod of Edges classfrom_xml()from_xmlmethod of Nodes classfrom_xml()from_xmlmethod of NetworkCost class