Data Readers

class flodym.DataReader

Template for creating a data reader, showing required methods and data formats needed for use in the MFASystem model.

class flodym.CompoundDataReader(dimension_reader, parameter_reader)

Combines a DimensionReader and a ParameterReader to create a DataReader, reading both dimensions and parameters.

Parameters:
class flodym.DimensionReader

Template for creating a dimension reader, showing required methods and data formats needed

class flodym.ParameterReader

Template for creating a parameter reader, showing required methods and data formats needed

class flodym.CSVDimensionReader(dimension_files=None, **read_csv_kwargs)

Read dimensions from a CSV file. Expects a single row or single columns csv file with no header containing the dimension items.

Parameters:
  • dimension_files (dict) – {dimension_name: file_path, …}

  • read_csv_kwargs – Additional keyword arguments passed to pandas.read_csv. The default is {“header”: None}. Not encouraged to use, since it may not lead to the intended DataFrame format. Sticking to recommended csv file format is preferred.

class flodym.CSVParameterReader(parameter_files=None, **read_csv_kwargs)

Reads a csv file to a pandas data frame and calls flodym.Parameter.from_df(). Expects comma separation and no header, apart from optional column names. For further detail on expected format, see flodym.FlodymArray.from_df().

Parameters:
  • parameter_files (dict) – {parameter_name: file_path, …}

  • read_csv_kwargs – Additional keyword arguments passed to pandas.read_csv. Not encouraged to use, since it may not lead to the intended DataFrame format. Sticking to recommended csv file format is preferred

class flodym.ExcelDimensionReader(dimension_files=None, dimension_sheets=None, **read_excel_kwargs)

Read dimensions from Excel file(s). Expects a single row or single columns excel sheet with no header containing the dimension items.

Parameters:
  • dimension_files (dict) – {dimension_name: file_path, …}

  • dimension_sheets (dict) – {dimension_name: sheet_name, …}

  • ead_excel_kwargs – Additional keyword arguments passed to pandas.read_excel. The default is {“header”: None}. Not encouraged to use, since it may not lead to the intended DataFrame format. Sticking to recommended excel file format is preferred.

class flodym.ExcelParameterReader(parameter_files=None, parameter_sheets=None, **read_excel_kwargs)

Reads an excel file to a pandas data frame and calls flodym.Parameter.from_df(). Expects contiguous data starting in the upper left cell A1. For further detail on expected format, see flodym.FlodymArray.from_df().

Parameters:
  • parameter_files (dict) – {parameter_name: file_path, …}

  • parameter_sheets (dict) – {parameter_name: sheet_name, …}

  • read_excel_kwargs – Additional keyword arguments passed to pandas.read_excel. Not encouraged to use, since it may not lead to the intended DataFrame format. Sticking to recommended excel file format is preferred