Skip to content

Commit 09a88d6

Browse files
committed
fix problem with unique constraint
1 parent cabfa4e commit 09a88d6

3 files changed

Lines changed: 15 additions & 14 deletions

File tree

dataprocessing/eGo_data_processing.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def data_processing():
4444
# 'ego_dp_vacuum_full.sql',
4545

4646
## INPUT DATA CHECK eGoPP
47-
# 'ego_dp_structure_input_verification.sql', # Check input tables and versions from eGoPP
47+
# 'ego_dp_structure_input_verification.sql', # Check input tables and versions from eGoPP
4848

4949
## SUBSTATION
5050
# 'ego_dp_substation_hvmv.sql', # Abstract HVMV Substations of the high voltage level from OSM
@@ -54,8 +54,8 @@ def data_processing():
5454
# 'ego_dp_substation_ehv_voronoi.sql', # EHV Voronoi cells based on EHV substations
5555

5656
## GRIDDISTRICT
57-
# 'ego_dp_mv_griddistrict.sql', # MV Griddistricts from municipalities and Voronoi cells
58-
# 'ego_dp_substation_id_to_generator.sql', # Assign subst_id to pp lists
57+
# 'ego_dp_mv_griddistrict.sql', # MV Griddistricts from municipalities and Voronoi cells
58+
# 'ego_dp_substation_id_to_generator.sql', # Assign subst_id to pp lists
5959

6060
## LOADAREA
6161
# 'ego_dp_loadarea_landuse.sql', # OSM landuse sector
@@ -79,30 +79,29 @@ def data_processing():
7979

8080
## REA
8181
# 'rea/ego_dp_lattice_500m.sql', # lattice (point grid) 500m
82-
# 'rea/ego_dp_lattice_50m.sql', # lattice (point grid) 50m
83-
# 'rea/ego_dp_rea_wpa_per_mvgd.sql', # wind potential area
82+
# 'rea/ego_dp_lattice_50m.sql', # lattice (point grid) 50m
83+
# 'rea/ego_dp_rea_wpa_per_mvgd.sql', # wind potential area
8484

8585
# 'rea/ego_dp_rea_lattice_per_area_500m.sql', # prepare 500m lattice
8686
# 'rea/ego_dp_rea_lattice_per_area_50m.sql', # prepare 50m lattice
87-
88-
# 'rea/ego_dp_rea_setup.sql', # setup table for allocation
89-
# 'rea/ego_dp_rea_m1.sql', # M1 biomass and solar to farmyard
90-
# 'rea/ego_dp_rea_m2.sql', # M2 windfarms
91-
# 'rea/ego_dp_rea_m3.sql', # M3 wind turbines to wpa
92-
# 'rea/ego_dp_rea_m4.sql', # M4 other and rest
87+
# 'rea/ego_dp_rea_setup.sql', # setup table for allocation
88+
# 'rea/ego_dp_rea_m1.sql', # M1 biomass and solar to farmyard
89+
# 'rea/ego_dp_rea_m2.sql', # M2 windfarms
90+
# 'rea/ego_dp_rea_m3.sql', # M3 wind turbines to wpa
91+
# 'rea/ego_dp_rea_m4.sql', # M4 other and rest
9392
# 'rea/ego_dp_rea_m5.sql', # M5 LV to LA
9493
# 'rea/ego_dp_rea_results.sql', # results and statistics
9594

9695
## POWERFLOW
9796
# 'ego_dp_powerflow_assignment_otgid.sql', # assign otg_id to pp lists
9897
# 'ego_dp_powerflow_assignment_unid.sql', # create a unified_id over all pp (res and conv)
99-
'ego_dp_powerflow_create_pp_mview.sql', # create mviews to display power plants per scenario
98+
# 'ego_dp_powerflow_create_pp_mview.sql', # create mviews to display power plants per scenario
10099
'ego_dp_powerflow_voronoi_weatherpoint.sql', # Create voronoi cells based on weather points
101100
'ego_dp_powerflow_hv_setup.sql', # Set schema/tables for EHV/HV powerflow calculations up
102101
'ego_dp_powerflow_osmtgmod_to_pypsa.sql', # Include data from osmTGmod into EHV/HV powerflow schema
103102
'ego_dp_powerflow_electrical_neighbour.sql', # Create border crossing lines and buses in neighbouring countries
104103
'ego_dp_powerflow_grid_future_scenarios.sql', # Copy grid to future scenarios
105-
'ego_dp_powerflow_assignment_generator.sql', # Assign generators to corresponding substation (SQ, NEP2035, eGo100)
104+
'ego_dp_powerflow_assignment_generator.sql', # Assign generators to corresponding substation (SQ, NEP2035, eGo100)
106105
'ego_dp_powerflow_assignment_load.sql', # Assign loads to their corresponding substation (SQ, NEP2035, eGo100)
107106
'ego_dp_powerflow_assignment_storage.sql', # Assign storages to their corresponding substation (SQ, NEP 2035, eGo 100)
108107
'ego_dp_powerflow_timeseries_generator.sql', # Transfer renpassG!S results into the corresponding powerflow table

dataprocessing/sql_snippets/ego_dp_powerflow_assignment_unid.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ SELECT ego_scenario_log('v0.3.0','output','model_draft','ego_supply_generator','
4848

4949
-- Update power plant tables and add information on unified id of generators
5050

51+
UPDATE model_draft.ego_dp_supply_res_powerplant SET un_id = NULL;
52+
5153
-- Update un_id from generators_total
5254
UPDATE model_draft.ego_dp_supply_conv_powerplant a
5355
SET un_id = b.un_id

dataprocessing/sql_snippets/ego_dp_powerflow_create_pp_mview.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/*
22
SQL Script to create mviews diyplaying power plants by scenario.
33
44
__copyright__ = "Europa-Universität Flensburg - ZNES"

0 commit comments

Comments
 (0)