Commodity.from_data

static Commodity.from_data(data, **kwargs)[source]

Construct commodity from data.

Parameters
datatuple or dict

(source, target, rate): a CommoditySingleSourceSink is constructed.

dict: a CommodityMultiSourceSink is constructed.

Returns
CommoditySingleSourceSink or CommodityMultiSourceSink