output_data¶
This module contains functions to save solving results of models.
- prepshot.output_data.create_data_array(data, dims, unit, model, extractor=None)[源代码]¶
Create a xarray DataArray with specified data, dimensions, coordinates and units.
- 参数
data (dict) -- The data to be included in the DataArray.
dims (list) -- The list of dimentions of the data.
unit (str) -- The unit of the data.
model (object) -- The model object.
extractor (callable, optional) -- Function that turns a tupledict entry into a scalar. Defaults to
model.get_value(primal values for a variable tupledict). Passmodel.get_constraint_dualto extract shadow prices from a constraint tupledict.
- 返回
A DataArray with the specified data, dimensions, coordinates and units.
- 返回类型
xr.DataArray
- prepshot.output_data.extract_results_hydro(model)[源代码]¶
Extracts results for hydro models.
- 参数
model (object) -- Model solved already.
- 返回
A Dataset containing DataArrays for each attribute of the model.
- 返回类型
xr.Dataset
- prepshot.output_data.extract_results_non_hydro(model)[源代码]¶
Extracts results for non-hydro models.
- 参数
model (object) -- Model object sloved already.
- 返回
A Dataset containing DataArrays for each attribute of the model.
- 返回类型
xr.Dataset
- prepshot.output_data.save_result(model)[源代码]¶
Extracts results from the provided model.
- 参数
model (object) -- The model object to extract results from and save.
- 返回类型
None