edisgo.network.electromobility.Electromobility ============================================== .. py:class:: edisgo.network.electromobility.Electromobility(**kwargs) Data container for all electromobility data. This class holds data on charging processes (how long cars are parking at a charging station, how much they need to charge, etc.) necessary to apply different charging strategies, as well as information on potential charging sites and integrated charging parks. .. py:property:: charging_processes_df DataFrame with all charging processes. :returns: DataFrame with AGS, car ID, trip destination, charging use case, netto charging capacity, charging demand, charge start, charge end, grid connection point and charging point ID. The columns are: ags : int 8-digit AGS (Amtlicher Gemeindeschlüssel, eng. Community Identification Number). Leading zeros are missing. car_id : int Car ID to differentiate charging processes from different cars. destination : str SimBEV driving destination. use_case : str SimBEV use case. Can be "hpc", "home", "public" or "work". nominal_charging_capacity_kW : float Vehicle charging capacity in kW. grid_charging_capacity_kW : float Grid-sided charging capacity including charging infrastructure losses (nominal_charging_capacity_kW / eta_cp) in kW. chargingdemand_kWh : float Charging demand in kWh. park_time_timesteps : int Number of parking time steps. park_start_timesteps : int Time step the parking event starts. park_end_timesteps : int Time step the parking event ends. charging_park_id : int Designated charging park ID from potential_charging_parks_gdf. Is NaN if the charging demand is not yet distributed. charging_point_id : int Designated charging point ID. Is used to differentiate between multiple charging points at one charging park. :rtype: :pandas:`pandas.DataFrame` .. py:property:: potential_charging_parks_gdf GeoDataFrame with all potential charging parks. :returns: GeoDataFrame with ID as index, AGS, charging use case (home, work, public or hpc), user-centric weight and geometry. Columns are: index : int Charging park ID. use_case : str TracBEV use case. Can be "hpc", "home", "public" or "work". user_centric_weight : flaot User centric weight used in distribution of charging demand. Weight is determined by TracBEV but normalized from 0 .. 1. geometry : GeoSeries Geolocation of charging parks. :rtype: :geopandas:`geopandas.GeoDataFrame` .. py:property:: potential_charging_parks Potential charging parks within the AGS. :returns: List of potential charging parks within the AGS. :rtype: list(:class:`~.network.components.PotentialChargingParks`) .. py:property:: simbev_config_df Dictionary containing configuration data. :returns: DataFrame with used regio type, charging point efficiency, stepsize in minutes, start date, end date, minimum SoC for hpc, grid timeseries setting, grid timeseries by use case setting and the number of simulated days. Columns are: regio_type : str RegioStaR 7 ID used in SimBEV. eta_cp : float or int Charging point efficiency used in SimBEV. stepsize : int Stepsize in minutes the driving profile is simulated for in SimBEV. start_date : datetime64 Start date of the SimBEV simulation. end_date : datetime64 End date of the SimBEV simulation. soc_min : float Minimum SoC when an HPC event is initialized in SimBEV. grid_timeseries : bool Setting whether a grid timeseries is generated within the SimBEV simulation. grid_timeseries_by_usecase : bool Setting whether a grid timeseries by use case is generated within the SimBEV simulation. days : int Timedelta between the end_date and start_date in days. :rtype: :pandas:`pandas.DataFrame` .. py:property:: integrated_charging_parks_df Mapping DataFrame to map the charging park ID to the internal eDisGo ID. The eDisGo ID is determined when integrating components using :func:`~.EDisGo.add_component` or :func:`~.EDisGo.integrate_component_based_on_geolocation` method. :returns: Mapping DataFrame to map the charging park ID to the internal eDisGo ID. :rtype: :pandas:`pandas.DataFrame` .. py:property:: stepsize Stepsize in minutes used in `SimBEV `_. :returns: Stepsize in minutes :rtype: int .. py:property:: simulated_days Number of simulated days in `SimBEV `_. :returns: Number of simulated days :rtype: int .. py:property:: eta_charging_points Charging point efficiency. :returns: Charging point efficiency in p.u.. :rtype: float .. py:property:: flexibility_bands Dictionary with flexibility bands (lower and upper energy band as well as upper power band). :param flex_dict: Keys are 'upper_power', 'lower_energy' and 'upper_energy'. Values are dataframes containing the corresponding band per each charging point. Columns of the dataframe are the charging point names as in :attr:`~.network.topology.Topology.loads_df`. Index is a time index. :type flex_dict: dict(str, :pandas:`pandas.DataFrame`) :returns: See input parameter `flex_dict` for more information on the dictionary. :rtype: dict(str, :pandas:`pandas.DataFrame`) .. py:method:: get_flexibility_bands(edisgo_obj, use_case, resample=True, tol=1e-06) Method to determine flexibility bands (lower and upper energy band as well as upper power band). Besides being returned by this function, flexibility bands are written to :attr:`flexibility_bands`. :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :param use_case: Charging point use case(s) to determine flexibility bands for. :type use_case: str or list(str) :param resample: If True, flexibility bands are resampled to the same frequency as time series data in :class:`~.network.timeseries.TimeSeries` object. If False, original frequency is kept. Default: True. :type resample: bool (optional) :param tol: Tolerance to reduce or increase flexibility band values by to fix possible rounding errors that may lead to failing integrity checks and infeasibility when used to optimise charging. See :py:attr:`~fix_flexibility_bands_rounding_errors` for more information. To avoid this behaviour, set `tol` to 0.0. Default: 1e-6. :type tol: float :returns: Keys are 'upper_power', 'lower_energy' and 'upper_energy'. Values are dataframes containing the corresponding band for each charging point of the specified use case. Columns of the dataframe are the charging point names as in :attr:`~.network.topology.Topology.loads_df`. Index is a time index. :rtype: dict(str, :pandas:`pandas.DataFrame`) .. py:method:: fix_flexibility_bands_rounding_errors(tol=1e-06) Fixes possible rounding errors that may lead to failing integrity checks. Due to rounding errors it may occur, that e.g. the upper energy band is lower than the lower energy band. This does in some cases lead to infeasibilities when used to optimise charging processes. This function increases or reduces a flexibility band by the specified tolerance in case an integrity check fails as follows: * If there are cases where the upper power band is not sufficient to meet the charged upper energy, the upper power band is increased for all charging points and all time steps. * If there are cases where the lower energy band is larger than the upper energy band, the lower energy band is reduced for all charging points and all time steps. * If there are cases where upper power band is not sufficient to meet charged lower energy, the upper power band is increased for all charging points and all time steps. :param tol: Tolerance to reduce or increase values by to fix rounding errors. Default: 1e-6. :type tol: float .. py:method:: resample(freq = '15min') Resamples flexibility bands. :param freq: Frequency that time series is resampled to. Offset aliases can be found here: https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases. Default: '15min'. :type freq: str or :pandas:`pandas.Timedelta`, optional .. py:method:: check_integrity() Method to check the integrity of the Electromobility object. Raises an error in case any of the checks fails. Currently only checks integrity of flexibility bands. .. py:method:: to_csv(directory, attributes=None) Exports electromobility data to csv files. The following attributes can be exported: * 'charging_processes_df' : Attribute :py:attr:`~charging_processes_df` is saved to `charging_processes.csv`. * 'potential_charging_parks_gdf' : Attribute :py:attr:`~potential_charging_parks_gdf` is saved to `potential_charging_parks.csv`. * 'integrated_charging_parks_df' : Attribute :py:attr:`~integrated_charging_parks_df` is saved to `integrated_charging_parks.csv`. * 'simbev_config_df' : Attribute :py:attr:`~simbev_config_df` is saved to `simbev_config.csv`. * 'flexibility_bands' : The three flexibility bands in attribute :py:attr:`~flexibility_bands` are saved to `flexibility_band_upper_power.csv`, `flexibility_band_lower_energy.csv`, and `flexibility_band_upper_energy.csv`. :param directory: Path to save electromobility data to. :type directory: str :param attributes: List of attributes to export. See above for attributes that can be exported. If None, all specified attributes are exported. Default: None. :type attributes: list(str) or None .. py:method:: from_csv(data_path, edisgo_obj, from_zip_archive=False) Restores electromobility from csv files. :param data_path: Path to electromobility csv files. :type data_path: str :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :param from_zip_archive: Set True if data is archived in a zip archive. Default: False :type from_zip_archive: bool, optional