src.helpers.parsers.DataFileReader module

This module is responsible for reading data files.

It includes one parent class for data file readers. See details in its own documentation.

Contact person: Stefan Riedmaier Creation date: 22.06.2020 Python version: 3.8

class src.helpers.parsers.DataFileReader.DataFileReader

Bases: object

This class is a parent class for data file readers.

It includes basic functions for reading files and functions that must be overwritten (abstract methods).

abstract get_quantity_array()

Abstract method that must be overwritten by the child class.

abstract get_units()

Abstract method that must be overwritten by the child class.

abstract read_data_file(filepath)

Abstract method that must be overwritten by the child class.

read_multiple_files(filepath_list, quantity_name_list, scenarios_da)

This function reads multiple erg result files and return them as a multi-dimensional xarray.

Parameters:
  • filepath_list (list[str]) – list of absolute erg file paths for each scenario

  • quantity_name_list (list[str]) – list of quantity names

  • scenarios_da (xr.DataArray) – data array of scenarios

Returns:

result data array

Return type:

xr.DataArray

abstract select_quantities(quantity_name_list=None)

Abstract method that must be overwritten by the child class.