_DV.add_to_etree

_DV.add_to_etree(root: xml.etree.ElementTree.Element, name=None) None[source]

Add demand data to xml.etree.ElementTree.Element.

Data will be added based on self.value(param=1). Note that only LinearDemandFunctions can be properly saved to xml.

Parameters
rootxml.etree.ElementTree.Element

Element to which ‘commodities’ will be appended to.

namestr, optional

Attribute name of ‘commodities’ element. If None, no attribute will be set.