src.commonalities.CsvHandler module
This module is responsible for saving and loading informations via csv files.
It includes one parent class CsvHandler and several child classes for different framework blocks. See details in their respective documentations and the main documentation in the doc folder.
Contact person: Stefan Riedmaier Creation date: 12.06.2020 Python version: 3.8
- class src.commonalities.CsvHandler.AssessmentCsvHandler(config, domain, instance)
Bases:
CsvHandlerThis class handles the assessment informations in the csv files.
- load(responses_da)
This function reads kpis from a csv file.
It is aimed at the use case where operations have been performed in advanced and should be reloaded here in the same format to reproduce results or to save processing time.
- Parameters:
responses_da (xr.DataArray) – data array with the (possibly dummy) responses from the simulator
- Returns:
kpi array with kpis for each scenario
- Type:
np.ndarray
- save(kpi_da)
This function stores the kpis for each scenario parameter combination in a csv file.
- Parameters:
kpi_da (xr.DataArray) – kpi array with kpis for each scenario
- Returns:
- class src.commonalities.CsvHandler.CsvHandler(config, domain, instance)
Bases:
objectThis class is a parent class for csv handlers.
- class src.commonalities.CsvHandler.ScenarioCsvHandler(config, domain, instance)
Bases:
CsvHandlerThis class handles the scenario informations in the csv files.
- load()
This function reads scenarios from a csv file.
It is aimed at the use case where operations have been performed in advanced and should be reloaded here in the same format to reproduce results or to save processing time.
- Returns:
scenario array, ideal space scenario array
- Return type:
tuple(xr.DataArray, xr.DataArray)
- save(samples_da, space_samples_da)
This function stores the sample array to a csv file for archivation or for reloading it later.
- Parameters:
samples_da (xr.DataArray) – array with scenarios to be saved
space_samples_da (xr.DataArray) – array with ideal space samples to be saved
- Returns:
- class src.commonalities.CsvHandler.SimulatorCsvHandler(config, domain, instance)
Bases:
CsvHandlerThis class handles the simulator informations in the csv files.
- load()
This function reads result paths from a csv file.
It is aimed at the use case where operations have been performed in advanced and should be reloaded here in the same format to reproduce results or to save processing time.
- Returns:
a list containing the paths to the result files
- Type:
list[str]
- save(result_path_list)
This function stores the result paths for each scenario parameter combination in a csv file.
- Parameters:
result_path_list (list[str]) – list of (relative) file paths for each scenario
- Returns: