Skip to content

Commit

Permalink
releasing version
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Eggimann committed Mar 26, 2018
1 parent f0a4aac commit 96e7b24
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
16 changes: 10 additions & 6 deletions energy_demand/scripts/s_post_installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ def post_install_setup(args):
print("... start running initialisation scripts")

# Paths
path_main = resource_filename(Requirement.parse("energy_demand"), "")
local_data_path = args.data_energy_demand
path_main = resource_filename(Requirement.parse("energy_demand"), "config_data")

local_data_path = args.local_data

# Initialise logger
logger_setup.set_up_logger(
Expand All @@ -42,6 +43,7 @@ def post_install_setup(args):
base_yr = 2015

data = {}

data['paths'] = data_loader.load_paths(path_main)
data['local_paths'] = data_loader.load_local_paths(local_data_path)
data['lookups'] = lookup_tables.basic_lookups()
Expand Down Expand Up @@ -75,20 +77,22 @@ def post_install_setup(args):
s_raw_weather_data.run(
data['local_paths'])

# Read in service submodel shapes
# Read in service submodel load profiles
print("... creating service load profiles")
s_ss_raw_shapes.run(
data['paths'],
data['local_paths'],
data['lookups'])

# Read in residential submodel shapes
# Read in residential submodel load profiles
print("... creating residential load profiles")
s_rs_raw_shapes.run(
data['paths'],
data['local_paths'],
base_yr)

logging.info("... finished post_install_setup")
print("... finished post_install_setup")
logging.info("... finished setup")
print("... successfully finished setup")
return

# ------run locally
Expand Down
7 changes: 3 additions & 4 deletions energy_demand/scripts/s_write_dummy_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def post_install_setup_minimum(args):
path_energy_demand : str
Path to energy demand python files
"""
path_energy_demand = resource_filename(Requirement.parse("energy_demand"), "")
path_energy_demand = resource_filename(Requirement.parse("energy_demand"), "config_data")
path_local_data = args.local_data

# ==========================================
Expand Down Expand Up @@ -155,6 +155,7 @@ def post_install_setup_minimum(args):
# Load data
base_yr = 2015
data = {}

data['paths'] = data_loader.load_paths(path_energy_demand)
data['lookups'] = lookup_tables.basic_lookups()
data['enduses'], data['sectors'], data['fuels'] = data_loader.load_fuels(
Expand Down Expand Up @@ -191,6 +192,4 @@ def post_install_setup_minimum(args):
# --------
dummy_sectoral_load_profiles(local_paths, path_energy_demand)

print("Finished post installation setup with non-access to full data")

#post_install_setup_minimum("C:/_DUMMY", "C:/Users/cenv0553/nismod/models/energy_demand")
print("Successfully finished post installation setup with open source data")
8 changes: 4 additions & 4 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from energy_demand.geography import spatial_diffusion

# must match smif project name for Local Authority Districts
WRITEOUTSMIFRESULTS = False
WRITEOUTSMIFRESULTS = True
NR_OF_MODELLEd_REGIONS = 391 # uk: 391 (including ireland), england.: 380

class EDWrapper(SectorModel):
Expand Down Expand Up @@ -61,9 +61,9 @@ def before_model_run(self, data_handle):
data['criterias']['virtual_building_stock_criteria'] = True # True: Run virtual building stock model
data['criterias']['spatial_exliclit_diffusion'] = False # True: Spatial explicit calculations

fast_smif_run = False
fast_smif_run = True

if fast_smif_run == True:
if fast_smif_run:
data['criterias']['write_to_txt'] = False
data['criterias']['beyond_supply_outputs'] = False
data['criterias']['validation_criteria'] = False
Expand All @@ -72,7 +72,7 @@ def before_model_run(self, data_handle):
data['criterias']['crit_plot_enduse_lp'] = False
data['criterias']['plot_HDD_chart'] = False
data['criterias']['writeYAML'] = False
elif fast_smif_run == False:
elif fast_smif_run:
data['criterias']['write_to_txt'] = True
data['criterias']['beyond_supply_outputs'] = True
data['criterias']['validation_criteria'] = True
Expand Down

0 comments on commit 96e7b24

Please sign in to comment.