<commit_before>/*
Adjusts conventional power plant list including future scenarios for further use. 
__copyright__ 	= "Flensburg University of Applied Sciences, Centre for Sustainable Energy Systems"
__license__ 	= "GNU Affero General Public License Version 3 (AGPL-3.0)"
__url__ 	= "https://github.com/openego/data_processing/blob/master/LICENSE"
__author__ 	= "IlkaCu" 
*/


--- Create table for processed power plant data
DROP TABLE IF EXISTS model_draft.ego_supply_conv_powerplant_2035 CASCADE; 

CREATE TABLE model_draft.ego_supply_conv_powerplant_2035 AS 
	AS TABLE model_draft.nep_supply_conv_powerplant_nep2015; 

ALTER TABLE model_draft.ego_supply_conv_powerplant_2035
  	ADD COLUMN voltage_level smallint,
	ADD COLUMN subst_id bigint,
	ADD COLUMN otg_id bigint,
	ADD COLUMN un_id bigint; 

-- Update voltage level according to installed capacity in 2035

UPDATE model_draft.ego_supply_conv_powerplant_2035
SET voltage_level=1
WHERE rated_power_b2035 >=120.0   --Voltage_level =1 when capacity greater than 120 MW
;

UPDATE model_draft.ego_supply_conv_powerplant_2035
SET voltage_level=3
WHERE rated_power_b2035 BETWEEN 17.5 AND 119.99 
;

UPDATE model_draft.ego_supply_conv_powerplant_2035
SET voltage_level=4
WHERE rated_power_b2035 BETWEEN 4.5 AND 17.49  
;

UPDATE model_draft.ego_supply_conv_powerplant_2035
SET voltage_level=5
WHERE rated_power_b2035 BETWEEN 0.3 AND 4.49 
;
<commit_msg>Adjust create statement<commit_after>/*
Adjusts conventional power plant list including future scenarios for further use. 
__copyright__ 	= "Flensburg University of Applied Sciences, Centre for Sustainable Energy Systems"
__license__ 	= "GNU Affero General Public License Version 3 (AGPL-3.0)"
__url__ 	= "https://github.com/openego/data_processing/blob/master/LICENSE"
__author__ 	= "IlkaCu" 
*/


--- Create table for processed power plant data
DROP TABLE IF EXISTS model_draft.ego_supply_conv_powerplant_2035 CASCADE; 

CREATE TABLE model_draft.ego_supply_conv_powerplant_2035 AS 
	SELECT * FROM model_draft.nep_supply_conv_powerplant_nep2015 WHERE geom IS NOT NULL; 
	

ALTER TABLE model_draft.ego_supply_conv_powerplant_2035
  	ADD COLUMN voltage_level smallint,
	ADD COLUMN subst_id bigint,
	ADD COLUMN otg_id bigint,
	ADD COLUMN un_id bigint; 

-- Update voltage level according to installed capacity in 2035

UPDATE model_draft.ego_supply_conv_powerplant_2035
SET voltage_level=1
WHERE rated_power_b2035 >=120.0   --Voltage_level =1 when capacity greater than 120 MW
;

UPDATE model_draft.ego_supply_conv_powerplant_2035
SET voltage_level=3
WHERE rated_power_b2035 BETWEEN 17.5 AND 119.99 
;

UPDATE model_draft.ego_supply_conv_powerplant_2035
SET voltage_level=4
WHERE rated_power_b2035 BETWEEN 4.5 AND 17.49  
;

UPDATE model_draft.ego_supply_conv_powerplant_2035
SET voltage_level=5
WHERE rated_power_b2035 BETWEEN 0.3 AND 4.49 
;

{'fraction_non_alphanumeric': 0.05168776371308017, 'fraction_numerical': 0.06047819971870605, 'mean_word_length': 5.694117647058824, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2895367', 'n_tokens_mistral': 1094, 'n_tokens_neox': 969, 'n_words': 265}