:py:mod:`eelib.data.csv_reader.csv_bulk_reader_model` ===================================================== .. py:module:: eelib.data.csv_reader.csv_bulk_reader_model .. autoapi-nested-parse:: eElib csv-bulk-reader model for reading-in .csv-files for different purposes. Reads a values for a certain horizon. | Author: elenia@TUBS | Copyright 2025 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_bulk_reader_model.CSVBulkReader eelib.data.csv_reader.csv_bulk_reader_model.GenericBulkCSV eelib.data.csv_reader.csv_bulk_reader_model.RatedBulkCSV eelib.data.csv_reader.csv_bulk_reader_model.PowerBulkCSV eelib.data.csv_reader.csv_bulk_reader_model.HouseholdBulkCSV eelib.data.csv_reader.csv_bulk_reader_model.PvBulkCSV eelib.data.csv_reader.csv_bulk_reader_model.HeatpumpBulkCSV eelib.data.csv_reader.csv_bulk_reader_model.ChargingStationBulkCSV eelib.data.csv_reader.csv_bulk_reader_model.HouseholdThermalBulkCSV eelib.data.csv_reader.csv_bulk_reader_model.MarketBulkCSV .. py:class:: CSVBulkReader(eid: 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, send_period: str = '00:15:00', bulk_resolution: str = '00:15:00', bulk_horizon: str = '24:00:00', cyclic: bool = False) Parent class for bulk-reading-in .csv-files. .. py:attribute:: _VALID_PARAMETERS .. py:attribute:: eid .. py:attribute:: datafile .. py:attribute:: date_format :value: "'YYYY-MM-DD HH:mm:ss'" .. py:attribute:: start_date .. py:attribute:: delimiter :value: "','" .. py:attribute:: header_rows .. py:attribute:: step_size :value: '900' .. py:attribute:: send_period .. py:attribute:: send_period_sim_steps .. py:attribute:: bulk_resolution .. py:attribute:: bulk_horizon .. py:attribute:: cyclic :value: 'False' .. py:attribute:: data :value: 'None' .. py:attribute:: time :value: 'None' .. py:attribute:: attrs :value: '[]' .. py:attribute:: values .. py:attribute:: index :value: '0' .. py:attribute:: last_update_step :value: 'None' .. py:method:: get_valid_parameters() -> dict :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() Resamples the data to the target resolution specified in `self.bulk_resolution`. .. py:method:: _ready(timestep: int) -> bool Checks if the data is ready to be sent. :param timestep: Current simulation step. :type timestep: int :returns: True if the data is ready to be sent. :rtype: bool .. py:method:: step(timestep: int) -> None Performs simulation step of eELib csv_bulk_reader model, which is returning the averaged read values in the .csv-file. The bulked csv reader sets the values to a list of values for the predefined bulk horizon, starting from the current time slot (request_time). :param timestep: Current simulation step. :type timestep: int :raises IndexError: Raises an error if the index of the data is out of bound, most likely due to differences between start date in scenario and in 'model_data'. .. py:class:: GenericBulkCSV(eid: 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, send_period: str = '00:15:00', bulk_resolution: str = '00:15:00', bulk_horizon: str = '24:00:00', cyclic: bool = False) Bases: :py:obj:`CSVBulkReader` CSV-Data-Reader for profiles. Inherits from class csv_reader. Sets each column of the csv file as attribute. .. py:method:: get_valid_parameters() -> dict :classmethod: Returns dictionary containing valid parameter types and values. :returns: valid parameters for this model :rtype: dict .. py:method:: step(timestep: int) -> None Performs simulation step of generic csv reader model, which is setting the attr according to the columns in csv file. :param timestep: Current simulation step. :type timestep: int .. py:class:: RatedBulkCSV(eid: 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, send_period: str = '00:15:00', bulk_resolution: str = '00:15:00', bulk_horizon: str = '24:00:00', cyclic: bool = False, p_rated: int = 4500, p_rated_profile: int = 4500) Bases: :py:obj:`CSVBulkReader` CSV-Data-Reader for profiles. Inherits from class csv_reader. Adds support for scaling to p_rated. .. py:attribute:: p_rated :value: '4500' .. py:attribute:: p_rated_profile :value: '4500' .. py:attribute:: scaling_factor .. py:method:: get_valid_parameters() -> dict :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:: PowerBulkCSV(eid: 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, send_period: str = '00:15:00', bulk_resolution: str = '00:15:00', bulk_horizon: str = '24:00:00', cyclic: bool = False, p_rated: int = 4500, p_rated_profile: int = 4500, cos_phi: float = 1.0, calc_e_demand_annual: bool = False) Bases: :py:obj:`RatedBulkCSV` 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:attribute:: p :value: 'None' .. py:attribute:: q :value: 'None' .. py:attribute:: voltage_control .. py:attribute:: e_annual :value: 'None' .. py:method:: get_valid_parameters() -> dict :classmethod: Returns dictionary containing valid parameter types and values. :returns: valid parameters for this model :rtype: dict .. py:method:: _calc_e_demand_annual() Calculate the annual energy from the sum of power values, scaling up/down to 1 year. .. py:method:: _set_reactive_power() -> None Calculate reactive power if not given in csv file and if cos_phi is set. .. py:method:: step(timestep: int) Performs simulation step of eELib load model, which is returning the read active/reactive power value of the .csv-file. :param timestep: Current simulation step. :type timestep: int .. py:class:: HouseholdBulkCSV(eid: 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, send_period: str = '00:15:00', bulk_resolution: str = '00:15:00', bulk_horizon: str = '24:00:00', cyclic: bool = False, p_rated: int = 4500, p_rated_profile: int = 4500, cos_phi: float = 1.0, calc_e_demand_annual: bool = False) Bases: :py:obj:`PowerBulkCSV` CSV-Data-Reader for household load profiles. Inherits from class csv_reader. .. py:method:: get_valid_parameters() -> dict :classmethod: Returns dictionary containing valid parameter types and values. :returns: valid parameters for this model :rtype: dict .. py:class:: PvBulkCSV(eid: 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, send_period: str = '00:15:00', bulk_resolution: str = '00:15:00', bulk_horizon: str = '24:00:00', cyclic: bool = False, p_rated: int = 4500, p_rated_profile: int = 4500, cos_phi: float = 1.0, calc_e_demand_annual: bool = False) Bases: :py:obj:`PowerBulkCSV` CSV-Data-Reader for pv-generation profiles. Inherits from class CSVReader. .. py:method:: get_valid_parameters() -> dict :classmethod: Returns dictionary containing valid parameter types and values. :returns: valid parameters for this model :rtype: dict .. py:method:: step(timestep: int) Performs simulation step of eELib load model, which is returning the read active/reactive power value of the .csv-file. :param timestep: Current simulation step. :type timestep: int .. py:class:: HeatpumpBulkCSV(eid: 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, send_period: str = '00:15:00', bulk_resolution: str = '00:15:00', bulk_horizon: str = '24:00:00', cyclic: bool = False, p_rated: int = 4500, p_rated_profile: int = 4500, cos_phi: float = 1.0, calc_e_demand_annual: bool = False) Bases: :py:obj:`PowerBulkCSV` CSV-Data-Reader for heatpump load profiles. Expected input data is the **electrical** power. **No thermal** power is calculated and exposed. .. py:class:: ChargingStationBulkCSV(eid: 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, send_period: str = '00:15:00', bulk_resolution: str = '00:15:00', bulk_horizon: str = '24:00:00', cyclic: bool = False, p_rated: int = 4500, p_rated_profile: int = 4500, cos_phi: float = 1.0, calc_e_demand_annual: bool = False) Bases: :py:obj:`PowerBulkCSV` CSV-Data-Reader for charging_station profiles. Inherits from class CSVReader. .. py:method:: get_valid_parameters() -> dict :classmethod: Returns dictionary containing valid parameter types and values. :returns: valid parameters for this model :rtype: dict .. py:class:: HouseholdThermalBulkCSV(eid: 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, send_period: str = '00:15:00', bulk_resolution: str = '00:15:00', bulk_horizon: str = '24:00:00', cyclic: bool = False, p_rated: int = 20000, p_rated_profile: int = 20000) Bases: :py:obj:`RatedBulkCSV` CSV-Data-Reader for thermal demand profiles. Inherits from class RatedCSV. .. py:attribute:: p_th_room :value: 'None' .. py:attribute:: p_th_water :value: 'None' .. py:method:: get_valid_parameters() -> dict :classmethod: Returns dictionary containing valid parameter types and values. :returns: valid parameters for this model :rtype: dict .. py:method:: step(timestep: int) Performs simulation step of eELib charging_station model, which is returning the read active power value of the .csv-file. :param timestep: Current simulation step. :type timestep: int .. py:class:: MarketBulkCSV(eid: 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, bulk_resolution: str = '00:15:00', bulk_horizon: str = '24:00:00', cyclic: bool = False, send_time: str = '12:00:00') Bases: :py:obj:`CSVBulkReader` CSV-Data-Reader for day-ahead or intraday auction market data. Inherits from CSVBulkReader. 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:attribute:: send_time .. py:attribute:: send_time_sim_steps .. py:attribute:: market_data :value: 'None' .. py:method:: get_valid_parameters() -> dict :classmethod: Returns dictionary containing valid parameter types and values. :returns: valid parameters for this model :rtype: dict .. py:method:: _ready(timestep: int) -> bool Checks if the data is ready to be sent. TODO: Not working for simulations not starting at 00:00:00. :param timestep: Current simulation step. :type timestep: int :returns: True if the data is ready to be sent. :rtype: bool .. py:method:: step(timestep: int) Performs simulation step of model, which is returning the read value of the .csv-file. If the request time is reached, the market data is set to the values of the .csv-file for the next day. The start time of the market data is the start time of the next day in seconds. :param timestep: Current simulation step. :type timestep: int