edisgo.io.electromobility_import
Functions
|
Import electromobility data from |
|
Reads all CSVs in a given path and returns a DataFrame with all |
|
Get SimBEV config data. |
|
Get GeoDataFrame with all |
|
Ensures a minimum number of potential charging parks per use case. |
|
Distribute charging demand from SimBEV onto potential charging parks from TracBEV. |
|
Get weights per potential charging point for a given set of grid connection indices. |
|
Normalize a given DataFrame so that its sum equals 1 and return a |
|
Add designated charging capacity weights into the initial weights and |
|
Weighted random choice of a potential charging park. Setting the chosen |
|
Distributes all private charging processes. Each car gets its own |
|
Distributes all public charging processes. For each process it is |
|
Scales the total charging-point capacity to a grid connection capacity. |
|
Integrates all designated charging parks into the grid. |
|
Gets electromobility data for specified scenario from oedb. |
|
Gets |
|
|
|
Gets |
Module Contents
- edisgo.io.electromobility_import.import_electromobility_from_dir(edisgo_obj, simbev_directory, tracbev_directory, **kwargs)
Import electromobility data from SimBEV and TracBEV from directory.
- Parameters:
edisgo_obj (
EDisGo)simbev_directory (str or pathlib.PurePath) – SimBEV directory holding SimBEV data.
tracbev_directory (str or pathlib.PurePath) – TracBEV directory holding TracBEV data.
kwargs –
Kwargs may contain any further attributes you want to specify.
- gc_to_car_rate_homefloat
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_workfloat
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_publicfloat
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_hpcfloat
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_timesstr
If the mode_parking_times is set to “frugal” only parking times with any charging demand are imported. Default “frugal”.
- charging_processes_dirstr
Charging processes sub-directory. Default None.
- simbev_config_filestr
Name of the simbev config file. Default “metadata_simbev_run.json”.
- edisgo.io.electromobility_import.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.
- Parameters:
- 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.
- Return type:
- edisgo.io.electromobility_import.read_simbev_config_df(path, edisgo_obj, simbev_config_file='metadata_simbev_run.json')
Get SimBEV config data.
- Parameters:
- 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.
- Return type:
- edisgo.io.electromobility_import.read_gpkg_potential_charging_parks(path, edisgo_obj)
Get GeoDataFrame with all TracBEV potential charging parks.
- Parameters:
- Returns:
GeoDataFrame with AGS, charging use case (home, work, public or hpc), user-centric weight and geometry.
- Return type:
- edisgo.io.electromobility_import.assure_minimum_potential_charging_parks(edisgo_obj, potential_charging_parks_gdf, **kwargs)
Ensures a minimum number of potential charging parks per use case.
For each use case the number of potential charging parks (grid connection points) must be at least
gc_to_car_ratetimes the number of cars. If too few are available, existing potential charging parks of the use case (or, if there are none, randomly drawn public ones) are duplicated until the ratio is met.- Parameters:
edisgo_obj (
EDisGo)potential_charging_parks_gdf (geopandas.GeoDataFrame) – Potential charging parks to check and, if necessary, extend.
gc_to_car_rate_home (float) – Minimum ratio of home charging parks to cars. Default: 0.5.
gc_to_car_rate_work (float) – Minimum ratio of work charging parks to cars. Default: 0.25.
gc_to_car_rate_public (float) – Minimum ratio of public charging parks to cars. Default: 0.1.
gc_to_car_rate_hpc (float) – Minimum ratio of high-power charging parks to cars. Default: 0.005.
- Returns:
Potential charging parks with the minimum number per use case assured, sorted and reprojected to the grid’s coordinate reference system.
- Return type:
- edisgo.io.electromobility_import.distribute_charging_demand(edisgo_obj, **kwargs)
Distribute charging demand from SimBEV onto potential charging parks from TracBEV.
- Parameters:
edisgo_obj (
EDisGo)kwargs –
Kwargs may contain any further attributes you want to specify.
- modestr
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_factorfloat
Weighting factor of the generators weight within an LV grid in comparison to the loads weight. Default 0.5.
- distance_weightfloat
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_weightfloat
Weighting factor of the user friendly weight in comparison to the grid friendly weight. Default 0.5.
- edisgo.io.electromobility_import.get_weights_df(edisgo_obj, potential_charging_park_indices, **kwargs)
Get weights per potential charging point for a given set of grid connection indices.
- Parameters:
edisgo_obj (
EDisGo)potential_charging_park_indices (list) – List of potential charging parks indices
mode (str) – Only use user friendly weights (“user_friendly”) or combine with grid friendly weights (“grid_friendly”). Default: “user_friendly”.
user_friendly_weight (float) – Weight of user friendly weight if mode “grid_friendly”. Default: 0.5.
distance_weight (float) – 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.
- Returns:
DataFrame with numeric weights
- Return type:
- edisgo.io.electromobility_import.normalize(weights_df)
Normalize a given DataFrame so that its sum equals 1 and return a flattened Array.
- Parameters:
weights_df (pandas.DataFrame) – DataFrame with single numeric column
- Returns:
Array with normalized weights
- Return type:
Numpy 1-D array
- edisgo.io.electromobility_import.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
- Parameters:
potential_charging_park_indices (list) – List of potential charging parks indices
designated_charging_point_capacity_df – pandas.DataFrame DataFrame with designated charging point capacity per potential charging park
weights_df (pandas.DataFrame) – DataFrame with initial user or combined weights
- Returns:
Array with normalized weights
- Return type:
Numpy 1-D array
- edisgo.io.electromobility_import.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
charging_processes_df- Parameters:
edisgo_obj (
EDisGo)potential_charging_park_indices (list) – List of potential charging parks indices
car_id (int) – Car ID
destination (str) – Trip destination
charging_point_id (int) – Charging Point ID
normalized_weights (Numpy 1-D array) – Array with normalized weights
rng (Numpy random generator) – If None a random generator with seed=charging_point_id is initialized
- Returns:
Chosen Charging Park ID
- Return type:
- edisgo.io.electromobility_import.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.
- Parameters:
edisgo_obj (
EDisGo)
- edisgo.io.electromobility_import.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.
- Parameters:
edisgo_obj (
EDisGo)
- edisgo.io.electromobility_import.determine_grid_connection_capacity(total_charging_point_capacity, lower_limit=0.3, upper_limit=1.0, minimum_factor=0.45)
Scales the total charging-point capacity to a grid connection capacity.
Applies a simultaneity (diversity) factor: capacities up to
lower_limitare connected in full, capacities ofupper_limitand above are scaled byminimum_factor, and in between the factor is interpolated linearly.- Parameters:
total_charging_point_capacity (float) – Summed nominal capacity of the charging points in MW.
lower_limit (float) – Capacity in MW below which no reduction is applied. Default: 0.3.
upper_limit (float) – Capacity in MW at and above which the full
minimum_factorreduction applies. Default: 1.0.minimum_factor (float) – Simultaneity factor applied at and above
upper_limit. Default: 0.45.
- Returns:
Required grid connection capacity in MW.
- Return type:
Notes
The factor is interpolated linearly but applied multiplicatively, so between
lower_limitandupper_limitthe returned capacity is quadratic intotal_charging_point_capacityand therefore not monotonic: with the default limits it peaks at an input of about0.79 MW(output ≈0.486 MW) before decreasing again tominimum_factor * upper_limit(0.45 MW) atupper_limit. A larger park can thus receive a slightly smaller connection rating in that narrow range, which is likely unintended (see issue #650).
- edisgo.io.electromobility_import.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.
- Parameters:
edisgo_obj (
EDisGo)
- edisgo.io.electromobility_import.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.
- Parameters:
edisgo_obj (
EDisGo)scenario (str) – Scenario for which to retrieve electromobility data. Possible options are ‘eGon2035’ and ‘eGon100RE’.
engine (sqlalchemy.Engine) – Database engine.
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
import_electromobilityfor more information.
- edisgo.io.electromobility_import.simbev_config_from_oedb(scenario, engine)
Gets
simbev_config_dffor specified scenario from oedb.- Parameters:
scenario (str) – Scenario for which to retrieve electromobility data. Possible options are ‘eGon2035’ and ‘eGon100RE’.
engine (sqlalchemy.Engine) – Database engine.
- Returns:
See
simbev_config_dffor more information.- Return type:
- edisgo.io.electromobility_import.potential_charging_parks_from_oedb(edisgo_obj, engine)
Gets
potential_charging_parks_gdfdata from oedb.- Parameters:
edisgo_obj (
EDisGo)engine (sqlalchemy.Engine) – Database engine.
- Returns:
See
potential_charging_parks_gdffor more information.- Return type:
- edisgo.io.electromobility_import.charging_processes_from_oedb(edisgo_obj, engine, scenario, **kwargs)
Gets
charging_processes_dfdata for specified scenario from oedb.- Parameters:
edisgo_obj (
EDisGo)engine (sqlalchemy.Engine) – Database engine.
scenario (str) – Scenario for which to retrieve data. Possible options are ‘eGon2035’ and ‘eGon100RE’.
kwargs – Possible option is mode_parking_times. See parameter documentation of import_electromobility_data_kwds parameter in
import_electromobilityfor more information.
- Returns:
See
charging_processes_dffor more information.- Return type: