From 534b3a6f21c141a7f2882193546a94226929d1b0 Mon Sep 17 00:00:00 2001 From: Sven Eggimann Date: Wed, 7 Nov 2018 15:05:01 +0000 Subject: [PATCH] ready for release --- energy_demand/main.py | 58 +++---------------------------------------- 1 file changed, 3 insertions(+), 55 deletions(-) diff --git a/energy_demand/main.py b/energy_demand/main.py index def52108..7df7d26e 100644 --- a/energy_demand/main.py +++ b/energy_demand/main.py @@ -22,10 +22,8 @@ import time import logging from collections import defaultdict -import numpy as np from energy_demand.basic import basic_functions -from energy_demand.charts import resilience_project from energy_demand.basic import date_prop from energy_demand import model from energy_demand.basic import testing_functions @@ -40,7 +38,6 @@ from energy_demand.basic import demand_supply_interaction from energy_demand.scripts import s_scenario_param from energy_demand.scripts import init_scripts -from energy_demand.basic import logger_setup from energy_demand.plotting import fig_enduse_yh from energy_demand.geography import weather_region @@ -133,8 +130,6 @@ def energy_demand_model( # ------------------- # Other configuration # ------------------- - RESILIENCEPAPERPOUTPUT = False # Output data for resilience paper - # If the smif configuration files what to be written, set this to true. The program will abort after they are written to YAML files data['criterias']['writeYAML'] = False data['criterias']['reg_selection'] = False @@ -168,10 +163,9 @@ def energy_demand_model( print("weather_station_count_nr: " + str(weather_station_count_nr)) # --- Region definition configuration - name_region_set = os.path.join(local_data_path, 'region_definitions', "lad_2016_uk_simplified.shp") # LAD + name_region_set = os.path.join(local_data_path, 'region_definitions', "lad_2016_uk_simplified.shp") - local_scenario = 'dummy_scenario' #'pop-a_econ-c_fuel-c' - local_scenario = 'pop-a_econ-c_fuel-c' #'pop-a_econ-c_fuel-c' + local_scenario = 'dummy_scenario' name_population_dataset = os.path.join(local_data_path, 'scenarios', 'MISTRAL_pop_gva', 'data', '{}/population__lad.csv'.format(local_scenario)) # Constant scenario @@ -243,7 +237,7 @@ def energy_demand_model( fueltypes=data['lookups']['fueltypes'], fueltypes_nr=data['lookups']['fueltypes_nr']) - # SCRAP REMOVE + # TODO IMPROVE setattr(data['assumptions'], 'flat_heat_pump_profile_both', 0) setattr(data['assumptions'], 'flat_heat_pump_profile_only_water', 0) @@ -526,27 +520,6 @@ def energy_demand_model( data['assumptions'].model_yeardays_daytype, data['criterias']['plot_crit']) - # ------------------------- - # Write for resilience paper - # ------------------------- - if RESILIENCEPAPERPOUTPUT: - - if round(np.sum(sim_obj.ed_fueltype_national_yh), 2) != round(np.sum(sim_obj.results_unconstrained), 2): - print(round(np.sum(sim_obj.ed_fueltype_national_yh), 2)) - print(round(np.sum(sim_obj.results_unconstrained), 2)) - raise Exception("Should be the same") - - resilience_project.resilience_paper( - sim_yr, - data['result_paths']['data_results_model_runs'], - "resilience_paper", - "result_risk_paper_{}_".format(sim_yr), - sim_obj.results_unconstrained, - ['residential', 'service', 'industry'], - data['regions'], - data['lookups']['fueltypes'], - fueltype_str='electricity') - # ------------------------------------- # # Generate YAML file with keynames for `sector_model` # ------------------------------------- @@ -601,7 +574,6 @@ def energy_demand_model( plot_only_selection = False if plot_only_selection: # PLot only residential total regional annual demand and - # region_fueltype_reg_yh_8760 write_data.write_residential_tot_demands( sim_yr, path_runs, @@ -642,30 +614,6 @@ def energy_demand_model( [sim_yr], sim_obj.reg_load_factor_yd, 'reg_load_factor_yd') - '''write_data.write_lf( - path_runs, - "result_reg_load_factor_winter", - [sim_yr], - sim_obj.reg_seasons_lf['winter'], - 'reg_load_factor_winter') - write_data.write_lf( - path_runs, - "result_reg_load_factor_spring", - [sim_yr], - sim_obj.reg_seasons_lf['spring'], - 'reg_load_factor_spring') - write_data.write_lf( - path_runs, - "result_reg_load_factor_summer", - [sim_yr], - sim_obj.reg_seasons_lf['summer'], - 'reg_load_factor_summer') - write_data.write_lf( - path_runs, - "result_reg_load_factor_autumn", - [sim_yr], - sim_obj.reg_seasons_lf['autumn'], - 'reg_load_factor_autumn')''' print("... Finished writing results to file")