:py:mod:`eelib.data.csv_reader.csv_reader_model` ================================================ .. py:module:: eelib.data.csv_reader.csv_reader_model .. autoapi-nested-parse:: eElib csv-reader model for reading-in .csv-files to imitate different model types (e.g. PV, household or heatpump). | Author: elenia@TUBS | Copyright 2024 elenia | This file is part of eELib, which is free software under the terms of the GNU GPL Version 3. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: eelib.data.csv_reader.csv_reader_model.CSVReader eelib.data.csv_reader.csv_reader_model.GenericCSV eelib.data.csv_reader.csv_reader_model.RatedCSV eelib.data.csv_reader.csv_reader_model.PowerCSV eelib.data.csv_reader.csv_reader_model.HouseholdCSV eelib.data.csv_reader.csv_reader_model.PvCSV eelib.data.csv_reader.csv_reader_model.HeatpumpCSV eelib.data.csv_reader.csv_reader_model.ChargingStationCSV eelib.data.csv_reader.csv_reader_model.HouseholdThermalCSV eelib.data.csv_reader.csv_reader_model.MarketIntradayContinuousCSV .. py:class:: CSVReader(ename: str, datafile: str, header_rows: int, start_time: str, date_format: str = 'YYYY-MM-DD HH:mm:ss', delimiter: str = ',', step_size: int = 60 * 15) Parent class for reading-in .csv-files. :raises FileNotFoundError: when .csv-file cannot be opened (e.g. path or data corrupted) :raises ValueError: when start date is not in .csv-file :raises IndexError: when end of .csv-file is reached before simulation end .. py:attribute:: _VALID_PARAMETERS .. py:method:: get_valid_parameters() :classmethod: Returns dictionary containing valid parameter types and values. :returns: valid parameters for this model :rtype: dict .. py:method:: _open_csv() -> None Opens the .csv-file and loads data set. :raises FileNotFoundError: when .csv-file cannot be read .. py:method:: _check_data() -> None Checks if row in opened .csv-file contains the simulation start date. :raises ValueError: Start date is not in .csv-file .. py:method:: _resample_data() -> None .. py:method:: step(time) -> None Performs simulation step of eELib csv_reader model, which is returning the averaged read values in the .csv-file. :param time: Current simulation time in seconds. :type time: int .. py:class:: GenericCSV(ename: str, datafile: str, header_rows: int, start_time: str, date_format: str = 'YYYY-MM-DD HH:mm:ss', delimiter: str = ',', step_size: int = 60 * 15) Bases: :py:obj:`CSVReader` CSV-Data-Reader for profiles. Inherits from class csv_reader. Sets each column of the csv file as attribute. .. py:method:: get_valid_parameters() :classmethod: Returns dictionary containing valid parameter types and values. :returns: valid parameters for this model :rtype: dict .. py:method:: step(time) -> None Performs simulation step of generic csv reader model, which is setting the attr according to the columns in csv file. :param time: Current simulation time in seconds. :type time: int .. py:class:: RatedCSV(ename: str, datafile: str, header_rows: int, start_time: str, date_format: str = 'YYYY-MM-DD HH:mm:ss', delimiter: str = ',', step_size: int = 60 * 15, p_rated: int = 4500, p_rated_profile: int = 4500) Bases: :py:obj:`CSVReader` CSV-Data-Reader for profiles. Inherits from class csv_reader. Adds support for scaling to p_rated. .. py:method:: get_valid_parameters() :classmethod: Returns dictionary containing valid parameter types and values. :returns: valid parameters for this model :rtype: dict .. py:method:: _apply_p_rated() -> None Apply scaling factor (``p_rated``/``p_rated_profile``). .. py:class:: PowerCSV(ename: str, datafile: str, header_rows: int, start_time: str, date_format: str = 'YYYY-MM-DD HH:mm:ss', delimiter: str = ',', step_size: int = 60 * 15, p_rated: int = 4500, p_rated_profile: int = 4500, cos_phi: float = 1.0) Bases: :py:obj:`RatedCSV` CSV-Data-Reader for power profiles. Inherits from class csv_reader. | Adds support for calculating reactive power. | Assumptions: | - first column is p | - second column is q, if csv has more than one column .. py:method:: get_valid_parameters() :classmethod: Returns dictionary containing valid parameter types and values. :returns: valid parameters for this model :rtype: dict .. py:method:: _set_reactive_power() -> None Calculate reactive power if not given in csv file and if cos_phi is set. .. py:method:: step(time) Performs simulation step of eELib load model, which is returning the read active/reactive power value of the .csv-file. :param time: Current simulation time in seconds. :type time: int .. py:class:: HouseholdCSV(ename: str, datafile: str, header_rows: int, start_time: str, date_format: str = 'YYYY-MM-DD HH:mm:ss', delimiter: str = ',', step_size: int = 60 * 15, p_rated: int = 4500, p_rated_profile: int = 4500, cos_phi: float = 1.0) Bases: :py:obj:`PowerCSV` CSV-Data-Reader for household load profiles. Inherits from class csv_reader. .. py:method:: get_valid_parameters() :classmethod: Returns dictionary containing valid parameter types and values. :returns: valid parameters for this model :rtype: dict .. py:class:: PvCSV(ename: str, datafile: str, header_rows: int, start_time: str, date_format: str = 'YYYY-MM-DD HH:mm:ss', delimiter: str = ',', step_size: int = 60 * 15, p_rated: int = 4500, p_rated_profile: int = 4500, cos_phi: float = 1.0) Bases: :py:obj:`PowerCSV` CSV-Data-Reader for pv-generation profiles. Inherits from class CSVReader. .. py:method:: get_valid_parameters() :classmethod: Returns dictionary containing valid parameter types and values. :returns: valid parameters for this model :rtype: dict .. py:method:: step(time) Performs simulation step of eELib load model, which is returning the read active/reactive power value of the .csv-file. :param time: Current simulation time in seconds. :type time: int .. py:class:: HeatpumpCSV(ename: str, datafile: str, header_rows: int, start_time: str, date_format: str = 'YYYY-MM-DD HH:mm:ss', delimiter: str = ',', step_size: int = 60 * 15, p_rated: int = 4000, p_rated_profile: int = 4000, cos_phi: float = 0.95) Bases: :py:obj:`PowerCSV` CSV-Data-Reader for heatpump load profiles. .. py:method:: get_valid_parameters() :classmethod: Returns dictionary containing valid parameter types and values. :returns: valid parameters for this model :rtype: dict .. py:method:: step(time) Performs simulation step of eELib load model, which is returning the read active/reactive power value of the .csv-file. :param time: Current simulation time in seconds. :type time: int .. py:class:: ChargingStationCSV(ename: str, datafile: str, header_rows: int, start_time: str, date_format: str = 'YYYY-MM-DD HH:mm:ss', delimiter: str = ',', step_size: int = 60 * 15, p_rated: int = 4500, p_rated_profile: int = 4500, cos_phi: float = 1.0) Bases: :py:obj:`PowerCSV` CSV-Data-Reader for charging_station profiles. Inherits from class CSVReader. .. py:method:: get_valid_parameters() :classmethod: Returns dictionary containing valid parameter types and values. :returns: valid parameters for this model :rtype: dict .. py:class:: HouseholdThermalCSV(ename: str, datafile: str, header_rows: int, start_time: str, date_format: str = 'YYYY-MM-DD HH:mm:ss', delimiter: str = ',', step_size: int = 60 * 15, p_rated: int = 20000, p_rated_profile: int = 20000) Bases: :py:obj:`RatedCSV` CSV-Data-Reader for thermal demand profiles. Inherits from class RatedCSV. .. py:method:: get_valid_parameters() :classmethod: Returns dictionary containing valid parameter types and values. :returns: valid parameters for this model :rtype: dict .. py:method:: step(time) Performs simulation step of eELib charging_station model, which is returning the read active power value of the .csv-file. :param time: Current simulation time in seconds. :type time: int .. py:class:: MarketIntradayContinuousCSV(ename: str, datafile: str, header_rows: int, start_time: str, date_format: str = 'YYYY-MM-DD HH:mm:ss', delimiter: str = ',', step_size: int = 60 * 15) Bases: :py:obj:`CSVReader` CSV-Data-Reader for intraday continuous market data. Inherits from class CSVReader. Implementation as a price-taking market: The participants have no influence or impact on the market price and participants have to accept the prevailing market price. As decentralized power systems are investigated, this assumption is fine as the whole intraday market includes many sellers (with the identical product 'electricity'). See e.g. https://www.economicsonline.co.uk/definitions/price-taker.html/ for more information. The prices are given in the unit 'EUR/MWh'. .. py:method:: get_valid_parameters() :classmethod: Returns dictionary containing valid parameter types and values. :returns: valid parameters for this model :rtype: dict .. py:method:: step(time) Performs simulation step of model, which is returning the read value of the .csv-file. :param time: Current simulation time in seconds. :type time: int