edisgo.io.electromobility_import ================================ .. py:module:: edisgo.io.electromobility_import Functions --------- .. autoapisummary:: edisgo.io.electromobility_import.import_electromobility_from_dir edisgo.io.electromobility_import.read_csvs_charging_processes edisgo.io.electromobility_import.read_simbev_config_df edisgo.io.electromobility_import.read_gpkg_potential_charging_parks edisgo.io.electromobility_import.assure_minimum_potential_charging_parks edisgo.io.electromobility_import.distribute_charging_demand edisgo.io.electromobility_import.get_weights_df edisgo.io.electromobility_import.normalize edisgo.io.electromobility_import.combine_weights edisgo.io.electromobility_import.weighted_random_choice edisgo.io.electromobility_import.distribute_private_charging_demand edisgo.io.electromobility_import.distribute_public_charging_demand edisgo.io.electromobility_import.determine_grid_connection_capacity edisgo.io.electromobility_import.integrate_charging_parks edisgo.io.electromobility_import.import_electromobility_from_oedb edisgo.io.electromobility_import.simbev_config_from_oedb edisgo.io.electromobility_import.potential_charging_parks_from_oedb edisgo.io.electromobility_import.charging_processes_from_oedb Module Contents --------------- .. py:function:: import_electromobility_from_dir(edisgo_obj, simbev_directory, tracbev_directory, **kwargs) Import electromobility data from `SimBEV `_ and `TracBEV `_ from directory. :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :param simbev_directory: SimBEV directory holding SimBEV data. :type simbev_directory: str or pathlib.PurePath :param tracbev_directory: TracBEV directory holding TracBEV data. :type tracbev_directory: str or pathlib.PurePath :param kwargs: Kwargs may contain any further attributes you want to specify. gc_to_car_rate_home : float Specifies the minimum rate between potential charging parks points for the use case "home" and the total number of cars. Default 0.5 . gc_to_car_rate_work : float Specifies the minimum rate between potential charging parks points for the use case "work" and the total number of cars. Default 0.25 . gc_to_car_rate_public : float Specifies the minimum rate between potential charging parks points for the use case "public" and the total number of cars. Default 0.1 . gc_to_car_rate_hpc : float Specifies the minimum rate between potential charging parks points for the use case "hpc" and the total number of cars. Default 0.005 . mode_parking_times : str If the mode_parking_times is set to "frugal" only parking times with any charging demand are imported. Default "frugal". charging_processes_dir : str Charging processes sub-directory. Default None. simbev_config_file : str Name of the simbev config file. Default "metadata_simbev_run.json". .. py:function:: read_csvs_charging_processes(csv_path, mode='frugal', csv_dir=None) Reads all CSVs in a given path and returns a DataFrame with all `SimBEV `_ charging processes. :param csv_path: Main path holding SimBEV output data :type csv_path: str :param mode: Returns all information if None. Returns only rows with charging demand greater than 0 if "frugal". Default: "frugal". :type mode: str :param csv_dir: Optional sub-directory holding charging processes CSVs under path. Default: None. :type csv_dir: str :returns: DataFrame with AGS, car ID, trip destination, charging use case (private or public), netto charging capacity, charging demand, charge start, charge end, potential charging park ID and charging point ID. :rtype: :pandas:`pandas.DataFrame` .. py:function:: read_simbev_config_df(path, edisgo_obj, simbev_config_file='metadata_simbev_run.json') Get `SimBEV `_ config data. :param path: Main path holding SimBEV output data. :type path: str :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :param simbev_config_file: SimBEV config file name. Default: "metadata_simbev_run.json". :type simbev_config_file: str :returns: DataFrame with used random seed, used threads, stepsize in minutes, year, scenarette, simulated days, maximum number of cars per AGS, completed standing times and time series per AGS and used ramp up data CSV. :rtype: :pandas:`pandas.DataFrame` .. py:function:: read_gpkg_potential_charging_parks(path, edisgo_obj) Get GeoDataFrame with all `TracBEV `_ potential charging parks. :param path: Main path holding TracBEV data. :type path: str :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :returns: GeoDataFrame with AGS, charging use case (home, work, public or hpc), user-centric weight and geometry. :rtype: :geopandas:`GeoDataFrame` .. py:function:: assure_minimum_potential_charging_parks(edisgo_obj, potential_charging_parks_gdf, **kwargs) .. py:function:: distribute_charging_demand(edisgo_obj, **kwargs) Distribute charging demand from SimBEV onto potential charging parks from TracBEV. :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :param kwargs: Kwargs may contain any further attributes you want to specify. mode : str Distribution mode. If the mode is set to "user_friendly" only the simbev weights are used for the distribution. If the mode is "grid_friendly" also grid conditions are respected. Default "user_friendly". generators_weight_factor : float Weighting factor of the generators weight within an LV grid in comparison to the loads weight. Default 0.5. distance_weight : float Weighting factor for the distance between a potential charging park and its nearest substation in comparison to the combination of the generators and load factors of the LV grids. Default 1 / 3. user_friendly_weight : float Weighting factor of the user friendly weight in comparison to the grid friendly weight. Default 0.5. .. py:function:: get_weights_df(edisgo_obj, potential_charging_park_indices, **kwargs) Get weights per potential charging point for a given set of grid connection indices. :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :param potential_charging_park_indices: List of potential charging parks indices :type potential_charging_park_indices: list :param mode: Only use user friendly weights ("user_friendly") or combine with grid friendly weights ("grid_friendly"). Default: "user_friendly". :type mode: str :param user_friendly_weight: Weight of user friendly weight if mode "grid_friendly". Default: 0.5. :type user_friendly_weight: float :param distance_weight: Grid friendly weight is a combination of the installed capacity of generators and loads within a LV grid and the distance towards the nearest substation. This parameter sets the weight for the distance parameter. Default: 1/3. :type distance_weight: float :returns: DataFrame with numeric weights :rtype: :pandas:`pandas.DataFrame` .. py:function:: normalize(weights_df) Normalize a given DataFrame so that its sum equals 1 and return a flattened Array. :param weights_df: DataFrame with single numeric column :type weights_df: :pandas:`pandas.DataFrame` :returns: Array with normalized weights :rtype: Numpy 1-D array .. py:function:: combine_weights(potential_charging_park_indices, designated_charging_point_capacity_df, weights_df) Add designated charging capacity weights into the initial weights and normalize weights :param potential_charging_park_indices: List of potential charging parks indices :type potential_charging_park_indices: list :param designated_charging_point_capacity_df: :pandas:`pandas.DataFrame` DataFrame with designated charging point capacity per potential charging park :param weights_df: DataFrame with initial user or combined weights :type weights_df: :pandas:`pandas.DataFrame` :returns: Array with normalized weights :rtype: Numpy 1-D array .. py:function:: weighted_random_choice(edisgo_obj, potential_charging_park_indices, car_id, destination, charging_point_id, normalized_weights, rng=None) Weighted random choice of a potential charging park. Setting the chosen values into :obj:`~.network.electromobility.Electromobility.charging_processes_df` :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :param potential_charging_park_indices: List of potential charging parks indices :type potential_charging_park_indices: list :param car_id: Car ID :type car_id: int :param destination: Trip destination :type destination: str :param charging_point_id: Charging Point ID :type charging_point_id: int :param normalized_weights: Array with normalized weights :type normalized_weights: Numpy 1-D array :param rng: If None a random generator with seed=charging_point_id is initialized :type rng: Numpy random generator :returns: Chosen Charging Park ID :rtype: :obj:`int` .. py:function:: distribute_private_charging_demand(edisgo_obj) Distributes all private charging processes. Each car gets its own private charging point if a charging process takes place. :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` .. py:function:: distribute_public_charging_demand(edisgo_obj, **kwargs) Distributes all public charging processes. For each process it is checked if a matching charging point exists to minimize the number of charging points. :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` .. py:function:: determine_grid_connection_capacity(total_charging_point_capacity, lower_limit=0.3, upper_limit=1.0, minimum_factor=0.45) .. py:function:: integrate_charging_parks(edisgo_obj) Integrates all designated charging parks into the grid. The charging time series at each charging park are not set in this function. :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` .. py:function:: import_electromobility_from_oedb(edisgo_obj, scenario, engine, **kwargs) Gets electromobility data for specified scenario from oedb. Electromobility data includes data on standing times, charging demand, etc. per vehicle, as well as information on potential charging point locations. :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :param scenario: Scenario for which to retrieve electromobility data. Possible options are 'eGon2035' and 'eGon100RE'. :type scenario: str :param engine: Database engine. :type engine: :sqlalchemy:`sqlalchemy.Engine` :param kwargs: Possible options are `gc_to_car_rate_home`, `gc_to_car_rate_work`, `gc_to_car_rate_public`, `gc_to_car_rate_hpc`, and `mode_parking_times`. See parameter documentation of `import_electromobility_data_kwds` parameter in :attr:`~.EDisGo.import_electromobility` for more information. .. py:function:: simbev_config_from_oedb(scenario, engine) Gets :attr:`~.network.electromobility.Electromobility.simbev_config_df` for specified scenario from oedb. :param scenario: Scenario for which to retrieve electromobility data. Possible options are 'eGon2035' and 'eGon100RE'. :type scenario: str :param engine: Database engine. :type engine: :sqlalchemy:`sqlalchemy.Engine` :returns: See :attr:`~.network.electromobility.Electromobility.simbev_config_df` for more information. :rtype: :pandas:`pandas.DataFrame` .. py:function:: potential_charging_parks_from_oedb(edisgo_obj, engine) Gets :attr:`~.network.electromobility.Electromobility.potential_charging_parks_gdf` data from oedb. :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :param engine: Database engine. :type engine: :sqlalchemy:`sqlalchemy.Engine` :returns: See :attr:`~.network.electromobility.Electromobility.potential_charging_parks_gdf` for more information. :rtype: :geopandas:`geopandas.GeoDataFrame` .. py:function:: charging_processes_from_oedb(edisgo_obj, engine, scenario, **kwargs) Gets :attr:`~.network.electromobility.Electromobility.charging_processes_df` data for specified scenario from oedb. :param edisgo_obj: :type edisgo_obj: :class:`~.EDisGo` :param engine: Database engine. :type engine: :sqlalchemy:`sqlalchemy.Engine` :param scenario: Scenario for which to retrieve data. Possible options are 'eGon2035' and 'eGon100RE'. :type scenario: str :param kwargs: Possible option is `mode_parking_times`. See parameter documentation of `import_electromobility_data_kwds` parameter in :attr:`~.EDisGo.import_electromobility` for more information. :returns: See :attr:`~.network.electromobility.Electromobility.charging_processes_df` for more information. :rtype: :pandas:`pandas.DataFrame`