Energy Model Generation
To running a network model generation in DAVE full automated only the create_grid function is needed
Generate network model
- dave_core.create.create_grid(postalcode=None, town_name=None, federal_state=None, nuts_region=None, own_area=None, geodata=None, power_levels=None, gas_levels=None, convert_power=None, convert_gas=None, opt_model=False, combine_areas=None, transformers=True, renewable_powerplants=True, conventional_powerplants=True, loads=True, compressors=True, sinks=True, sources=True, storages_gas=True, valves=True, output_folder=PosixPath('/home/docs/Desktop/DAVE_output'), filename='dave_dataset', output_format='json', save_data=True)[source]
This is the main function of dave. This function generates automaticly grid models for power and gas networks in the defined target area
- INPUT:
One of these parameters must be set:
postalcode (List of strings) - numbers of the target postalcode areas. it could also be choose [‘ALL’] for all postalcode areas in germany
town_name (List of strings) - names of the target towns it could also be choose [‘ALL’] for all citys in germany
federal_state (List of strings) - names of the target federal states it could also be choose [‘ALL’] for all federal states in germany
nuts_region (tuple(List of strings, string)) - this tuple includes first a list of the target nuts regions codes (independent from nuts level). It could also be choose [‘ALL’] for all nuts regions in europe. The second tuple parameter defines the nuts year as string. The year options are 2013, 2016 and 2021.
own_area (string / Polygon) - First Option for this parameter is to hand over a string which could be the absolute path to a geographical file (.shp or .geojson) which includes own target area (e.g. “C:/Users/name/test/test.shp”) or a JSON string with the area information. The second option is to hand over a shapely Polygon which defines the area
- OPTIONAL:
geodata (list, default None) - this parameter defines which geodata should be considered. options: ‘roads’,’buildings’,’landuse’, ‘railways’, ‘waterways’, []. there could be choose: one/multiple geoobjects or ‘ALL’
power_levels (list, default None) - this parameter defines which power levels should be considered. options: ‘ehv’,’hv’,’mv’,’lv’, []. there could be choose: one/multiple level(s) or ‘ALL’
gas_levels (list, default None) - this parameter defines which gas levels should be considered. options: ‘hp’ and []. there could be choose: one/multiple level(s) or ‘ALL’
convert_power (list, default None) - this parameter defines in witch formats the power grid data should be converted. Available formats are currently: ‘pandapower’
convert_gas (list, default None) - this parameter defines in witch formats the gas grid data should be converted. Available formats are currently: ‘pandapipes’, ‘gaslib’, ‘mynts’
opt_model (boolean, default True) - if this value is true dave will be use the optimal power flow calculation to get no boundary violations. Currently a experimental feature and only available for pandapower
combine_areas (list, default None) - this parameter defines on which power levels not connected areas should combined. options: ‘EHV’,’HV’,’MV’,’LV’, []
transformers (boolean, default True) - if true, transformers are added to the grid model
renewable_powerplants (boolean, default True) - if true, renewable powerplans are added to the grid model
conventional_powerplants (boolean, default True) - if true, conventional powerplans are added to the grid model
loads (boolean, default True) - if true, loads are added to the grid model
compressors (boolean, default True) - if true, compressors are added to the grid model
sinks (boolean, default True) - if true, gas sinks are added to the grid model
sources (boolean, default True) - if true, gas sources are added to the grid model
output_folder (string, default user desktop) - absolute path to the folder where the generated data should be saved. if for this path no folder exists, dave will be create one
output_format (string, default ‘json’) - this parameter defines the output format. Available formats are currently: ‘json’, ‘hdf’ and ‘gpkg’
filename (string, default ‘dave_dataset’) - this parameter defines the name of the output file save_data (boolean, default True) - if true, the resulting data will stored in a local folder
- OUTPUT:
grid_data (attrdict) - grid_data as a attrdict in dave structure
net_power
net_pipes
Example
from dave.create import create_grid
- grid_data = create_grid(town_name=[‘Kassel’, ‘Baunatal’], power_levels=[‘hv’, ‘mv’],
gas_levels=[‘HP’], plot=False, convert = False)
Save dataset
- dave_core.create.save_dataset_to_user_folder(grid_data, output_format, output_folder, filename, save_data)[source]
This function saves the DAVE dataset to an output folder.
- Input:
grid_data (attrdict) - dave attrdict with empty tables output_format (string, default ‘json’) - this parameter defines the output format. Available formats are currently: ‘json’, ‘hdf’ and ‘gpkg’
output_folder (string, default user desktop) - absolute path to the folder where the generated data should be saved. if for this path no folder exists, dave will be create one
save_data (boolean, default True) - if true, the resulting data will stored in a local folder
- OUTPUT:
grid_data (attrdict) - grid_data as a attrdict in dave structure