Skip to content

Commit

Permalink
Changed names of scripts so they align with snakemake diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathias157 committed Sep 23, 2024
1 parent 8a2948f commit 364a9a8
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion RawDataProcessing/Analysis/dot_source.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ digraph snakemake_dag {
0[label = "all", color = "0.33 0.6 0.85", style="rounded"];
1[label = "exo_electricity_demand", color = "0.40 0.6 0.85", style="rounded"];
2[label = "create_conversion_dictionaries", color = "0.53 0.6 0.85", style="rounded"];
3[label = "format_energinet_electricity_data", color = "0.00 0.6 0.85", style="rounded,dashed"];
3[label = "format_format_energinet_data", color = "0.00 0.6 0.85", style="rounded,dashed"];
4[label = "get_grid_from_Balmorel", color = "0.07 0.6 0.85", style="rounded"];
5[label = "format_dkstat_transport_data", color = "0.47 0.6 0.85", style="rounded,dashed"];
6[label = "exo_heat_demand", color = "0.13 0.6 0.85", style="rounded"];
Expand Down
2 changes: 1 addition & 1 deletion RawDataProcessing/Modules/clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from Modules.Submodules.municipal_template import DataContainer
from Modules.createFLEXDEM import distribute_road_flex_electricity_demand
from Modules.createDH import DistrictHeatAAU
from Modules.Submodules.energinet_electricity import energinet_el
from Modules.Submodules.format_energinet import energinet_el
from sklearn.cluster import KMeans, AgglomerativeClustering
from sklearn.preprocessing import StandardScaler
from sklearn.neighbors import kneighbors_graph
Expand Down
4 changes: 2 additions & 2 deletions RawDataProcessing/Modules/createDH.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import matplotlib.pyplot as plt
import pandas as pd
import geopandas as gpd
from Modules.Submodules.aauvarmeplan2021 import VPDK21
from Modules.Submodules.danmarks_statistik import DKSTAT
from Modules.Submodules.format_vpdk21 import VPDK21
from Modules.Submodules.format_dkstat import DKSTAT
from Modules.Submodules.municipal_template import DataContainer
import xarray as xr
import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion RawDataProcessing/Modules/createFLEXDEM.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from pybalmorel.utils import read_lines
from Modules.geofiles import prepared_geofiles
from Modules.Submodules.municipal_template import DataContainer
from Modules.Submodules.danmarks_statistik import load_transport_demand
from Modules.Submodules.format_dkstat import load_transport_demand
import matplotlib.pyplot as plt

#%% ------------------------------- ###
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
"""
Processing data from Danmarks Statistik
Industriforbrug per Municipality:
https://www.statistikbanken.dk/statbank5a/SelectVarVal/saveselections.asp
Link:
https://www.statistikbanken.dk/
Search for:
- ENEGEO
- ENETYP
- ENE3H with choice H Transport
Created on 30.08.2024
@author: Mathias Berg Rosendal, PhD Student at DTU Management (Energy Economics & Modelling)
Expand Down
File renamed without changes.
18 changes: 9 additions & 9 deletions RawDataProcessing/snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ rule create_conversion_dictionaries:
f"{submod_path}exo_heat_dem_conversion_dictionaries.pkl"]
shell:
f"""
python {submod_path}create_name_conversion_dict.py
python {submod_path}create_conversion_dictionaries.py
"""

rule get_grid_from_Balmorel:
Expand All @@ -40,14 +40,14 @@ rule do_clustering:
"""

# 2. Exogenous Electricity Demands
rule format_energinet_electricity_data:
rule format_energinet_data:
input:
f"{data_path}Timeseries/ElConsumptionEnerginet2023.csv"
output:
f"{data_path}Timeseries/energinet_eldem.nc"
shell:
"""
python Modules/energinet_electricity.py
python Modules/format_energinet.py
"""

rule exo_electricity_demand:
Expand All @@ -57,19 +57,19 @@ rule exo_electricity_demand:
[f"{out_path}DE.inc", f"{out_path}DE_VAR_T.inc"]
shell:
"""
python Modules/createDE.py --conversion-file={input[0]} --el-dataset={input[1]} --show-difference=False
python Modules/exo_electricity_demand.py --conversion-file={input[0]} --el-dataset={input[1]} --show-difference=False
"""

# 3. Exogenous Heat Demands
rule format_vpdk21_data:
input:
directory(f"{data_path}AAU Kommuneplan")
expand(f"{data_path}AAU Kommuneplan")
output:
[f"{data_path}AAU Kommuneplan/districtheat_exo_heatdem.nc",
f"{data_path}AAU Kommuneplan/industry_exo_heatdem.nc"]
shell:
"""
python Modules/aauvarmeplan2021.py
python Modules/format_vpdk21.py
"""

rule format_dkstat_industry_data:
Expand All @@ -79,7 +79,7 @@ rule format_dkstat_industry_data:
f"{data_path}Danmarks Statistik/industry_demand.nc"
shell:
"""
python Modules/danmarks_statistik.py --get-industry-demand
python Modules/format_dkstat.py --get-industry-demand
"""

rule exo_heat_demand:
Expand All @@ -95,7 +95,7 @@ rule exo_heat_demand:
f'{out_path}INDIVUSERS_DH.inc', f'{out_path}INDIVUSERS_DH_VAR_T.inc']
shell:
"""
python Modules/createDH2.py
python Modules/exo_heat_demand.py
"""

# 4. Transport Demand
Expand All @@ -106,6 +106,6 @@ rule format_dkstat_transport_data:
f"{data_path}Danmarks Statistik/transport_demand.csv"
shell:
"""
python Modules/danmarks_statistik.py --get-transport-demand --include-bunkering=false
python Modules/format_dkstat.py --get-transport-demand --include-bunkering=false
"""

0 comments on commit 364a9a8

Please sign in to comment.