Skip to content

Commit

Permalink
Update datasets.yml for heat_demand_europe
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaraBuettner committed Dec 10, 2021
1 parent e001cc9 commit b52ec92
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 25 deletions.
5 changes: 2 additions & 3 deletions src/egon/data/datasets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,9 @@ peta5_0_1_ser_heat_demands:
table: # 2015 heat demand data not stored in database

hotmaps_current_policy_scenario_heat_demands_buildings:
original_data:
source:
sources:
url: "https://gitlab.com/hotmaps/scen_current_building_demand/-/raw/master/data/scen_current_building_demand.csv?inline=false"
target:
targets:
path: "scen_current_building_demand.csv"

power_plants:
Expand Down
29 changes: 7 additions & 22 deletions src/egon/data/datasets/heat_demand_europe.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,14 @@ class HeatDemandEurope(Dataset):
data_config = egon.data.config.datasets()

hotmapsheatdemands_config = data_config[
"hotmaps_current_policy_scenario_heat_demands_buildings"][
"original_data"
]

target_file = hotmapsheatdemands_config["target"]["path"]
"hotmaps_current_policy_scenario_heat_demands_buildings"]

target_file = hotmapsheatdemands_config["targets"]["path"]

def __init__(self, dependencies):
super().__init__(
name="heat-demands-europe",
version=self.target_file + "_hotmaps.0.0",
version=self.target_file + "_hotmaps.0.1",
dependencies=dependencies,
tasks=(download))

Expand All @@ -55,32 +53,19 @@ def download():
-------
None
ToDo
-------
Check version numbering method. See also class definition!
Notes
-----
(For the version management we can assume that the dataset
will not change, unless the code is changed.)
Create a folder to save the downloaded csv in?
"""

data_config = egon.data.config.datasets()

# heat demands
hotmapsheatdemands_config = data_config[
"hotmaps_current_policy_scenario_heat_demands_buildings"][
"original_data"
]
"hotmaps_current_policy_scenario_heat_demands_buildings"]

target_file = hotmapsheatdemands_config["target"]["path"]
target_file = hotmapsheatdemands_config["targets"]["path"]

if not os.path.isfile(target_file):
subprocess.run(
f"curl { hotmapsheatdemands_config['source']['url']} > {target_file}",
f"curl { hotmapsheatdemands_config['sources']['url']} > {target_file}",
shell=True,
)
return None

0 comments on commit b52ec92

Please sign in to comment.