stemp_abw.results package¶
Submodules¶
stemp_abw.results.io module¶
-
stemp_abw.results.io.
oemof_json_to_results
(results_json)[source]¶ Convert stored oemof results json back to result dicts
Parameters: results_json (JSON formatted str
) – Format seestemp_abw.results.tools.oemof_results_to_json()
Returns: dict
– Results from optimization as returned byoemof.outputlib.processing.results()
(sequences only without timestamps, no scalars)dict
– Parameters of optimization as returned byoemof.outputlib.processing.parameter_as_dict()
(scalars only, no sequences)
-
stemp_abw.results.io.
oemof_results_to_json
(results, param_results)[source]¶ Convert oemof raw results to json
Parameters: - results (
dict
) – Results from optimization as returned byoemof.outputlib.processing.results()
- param_results (
dict
) – Parameters of optimization as returned byoemof.outputlib.processing.parameter_as_dict()
Returns: Serialized results, format: {‘param_results’:
- {‘node_from_1’:
- {‘node_to_1’: {‘scalars’: {‘param_1’: val_1,
’param_2’: val_2}
}
}
},
- ’results’:
- {‘node_from_1’:
- {‘node_to_1’: {‘sequences’: [n values]
}
}
}
}
Return type: JSON formatted
str
Notes
- Node keys in results and para_results must be provided as strings using
oemof.outputlib.processing.convert_keys_to_strings()
- In the sequences, timestamps are not preserved (values only)
- results (
stemp_abw.results.result_charts module¶
stemp_abw.results.results module¶
-
class
stemp_abw.results.results.
ResultChart
(setup_labels, type=None, data=None)[source]¶ Bases:
object
Scenarios are loaded, analyzed and visualized within this class
-
class
stemp_abw.results.results.
Results
(simulation)[source]¶ Bases:
object
Results associated to Simulation
TODO: Complete docstring
-
aggregate_flow_results
(nodes_from, nodes_to, results_raw, resample_mode=None, agg_mode='sum')[source]¶ Aggregate raw data for each node in nodes_from to nodes_to.
Either nodes_from or nodes_to must contain a single node label, the other one can contain one or more labels.
Parameters: - nodes_from (
list
ofstr
) – Source node labels, e.g. [‘bus_el’] - nodes_to (
list
ofstr
) – Target node labels, e.g. [‘gen_el_wind’, ‘gen_el_pv_ground’] - results_raw (
dict
of pandas.DataFrame) – Raw result data from optimization as created by oemof - resample_mode (
str
or None) – Resampling option according to pandas.DataFrame.resample If None, no resampling takes place and agg_mode is not used. Examples: ‘A’ (year), ‘M’ (month) Default: None - agg_mode (
str
) – Aggregation mode for resampling given in resample_mode, possible values: ‘sum’, ‘mean’ Default: ‘sum’
Returns: * If resample_mode is None – pandas.DataFrame with raw timeseries
* If resample_mode is not None –
list
oftuple
Sum of annual flow by source or target node, format: [(‘name_1’, [value_11, …, value_1n]),
…,
(‘name_n’, [value_n1, …, value_nn])]
# TODO (Always return DF, move conversion to chart-usable format to other fct)
- nodes_from (
-
get_node_results_df
(node_label)[source]¶ Return DataFrame with optimization results (timeseries) for single node.
Parameters: node_label ( str
) – Label of node the data should be looked up forReturns: Node results (timeseries) Return type: pandas.DataFrame
-
static
get_raw_results_df
(results_raw)[source]¶ Return DataFrame with optimization results (timeseries) for all nodes for given raw results
Parameters: results_raw ( dict
of pandas.DataFrame) – Raw result data from optimization as created by oemofReturns: Node results (timeseries) Return type: pandas.DataFrame
-