Skip to content

Commit

Permalink
removed MISTRAL1 data prearation from setup step
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Eggimann committed Apr 5, 2019
1 parent e97f23e commit f925132
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 33 deletions.
12 changes: 4 additions & 8 deletions energy_demand/scripts/s_greate_NISMOD1_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,24 @@
import os
import zipfile

from energy_demand.read_write import data_loader
from energy_demand.scripts.smif_data_related import script_data_preparation_MISTRAL_pop_gva


def create_NISMOD1_data(path_to_zip_file, path_out):
def create_NISMOD1_data(path_to_zip_file, path_out, path_geography):
"""
Arguments
----------
"""
print("... start running initialisation scripts", flush=True)
config = data_loader.read_config_file(path_config_file)

# Extract NISMOD population data
path_to_zip_file = os.path.join(path_data, "population-economic-smif-csv-from-nismod-db.zip")
path_extraction = os.path.join(path_out, "MISTRAL_pop_gva")
zip_ref = zipfile.ZipFile(path_to_zip_file, 'r')
zip_ref.extractall(path_extraction)
zip_ref.close()

# Complete gva and pop data for every sector
path_pop = os.path.join(local_data_path, "scenarios", "MISTRAL_pop_gva", "data")
path_geography = os.path.join(local_data_path, "scenarios", "uk_pop_principal_2015_2050_MSOA_england.csv")
path_pop = os.path.join(path_extraction, "data")
geography_name = "lad_uk_2016"

# All MISTRAL scenarios to prepare with correct config
Expand All @@ -52,4 +47,5 @@ def create_NISMOD1_data(path_to_zip_file, path_out):
"""
create_NISMOD1_data(
path_to_zip_file="C:/Users/cenv0553/nismod2/data/energy_demand/population-economic-smif-csv-from-nismod-db.zip",
path_out="C:/_NISMODI_DATA")
path_out="C:/_NISMODI_DATA",
path_geography="C:/Users/cenv0553/nismod2/data/energy_demand/_raw_data/J-population_disagg_by/uk_pop_principal_2015_2050_MSOA_england.csv")
25 changes: 0 additions & 25 deletions energy_demand/scripts/s_post_installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,30 +79,5 @@ def post_install_setup(args):
data['local_paths'],
data['lookups'])

# Input data preparation
print("Generate additional data", flush=True)

# Extract NISMOD population data
path_to_zip_file = os.path.join(local_data_path,"population-economic-smif-csv-from-nismod-db.zip")
path_extraction = os.path.join(local_data_path, 'scenarios', "MISTRAL_pop_gva")
zip_ref = zipfile.ZipFile(path_to_zip_file, 'r')
zip_ref.extractall(path_extraction)
zip_ref.close()

# Complete gva and pop data for every sector
path_pop = os.path.join(local_data_path, "scenarios", "MISTRAL_pop_gva", "data")
path_geography = os.path.join(local_data_path, "scenarios", "uk_pop_principal_2015_2050_MSOA_england.csv")
geography_name = "lad_uk_2016"

# All MISTRAL scenarios to prepare with correct config
scenarios_to_generate = [] #'pop-baseline16_econ-c16_fuel-c16', 'pop-f_econ-c_fuel-c', 'pop-d_econ-c_fuel-c',]

script_data_preparation_MISTRAL_pop_gva.run(
path_to_folder=path_pop,
path_MSOA_baseline=path_geography,
MSOA_calculations=False,
geography_name=geography_name,
scenarios_to_generate=scenarios_to_generate)

print("... successfully finished setup")
return

0 comments on commit f925132

Please sign in to comment.