-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from calliope-project/fix-timeseries-naming
Fix heat and hydropower timeseries v0.7 incompatibility
- Loading branch information
Showing
21 changed files
with
307 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Authors | ||
|
||
This is the list of contributors to the 'heat' module for copyright purposes. | ||
|
||
- Meijun Chen, TU Delft <[email protected]> | ||
- Ivan Ruiz Manuel, TU Delft <[email protected]> | ||
- Stefan Pfenninger-Lee, TU Delft <[email protected]> | ||
|
||
This does not necessarily list everyone who has contributed to the 'heat' module code or documentation. | ||
For a full contributor list, see: | ||
|
||
<https://github.com/calliope-project/ec_modules/commits/main/modules/heat> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 3 additions & 4 deletions
7
modules/heat/config/config.yaml → modules/heat/config/default.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,29 @@ | ||
"""Generate heat demand and heat pump COP time series.""" | ||
|
||
import yaml | ||
|
||
from pathlib import Path | ||
from snakemake.utils import min_version | ||
from snakemake.utils import min_version, validate | ||
|
||
# Limit the snakemake version to a modern one. | ||
min_version("8.10") | ||
|
||
configfile: "config/config.yaml" | ||
with open(workflow.source_path("resources/internal.yaml"), "r") as f: | ||
# Load the default configuration. This will be overridden by users. | ||
configfile: "config/default.yaml" | ||
# Validate the configuration using the schema file. | ||
# validate(config, workflow.source_path("schemas/config.schema.yaml")) | ||
|
||
# Load internal settings separately so users cannot modify them. | ||
with open(workflow.source_path("internal/internal_config.yaml"), "r") as f: | ||
internal = yaml.safe_load(f) | ||
|
||
# Add all your includes here. | ||
include: "rules/downloads.smk" | ||
include: "rules/aggregated_heat_demand.smk" | ||
include: "rules/heat_timeseries.smk" | ||
include: "rules/hp_cop.smk" | ||
|
||
rule download_shapes: | ||
message: "Download {wildcards.shapes} resolution shapefile." | ||
params: | ||
uri = lambda wc: config["resolution"][f"{wc.shapes}"]["uri"], | ||
output: "results/{shapes}/shapes.geojson" | ||
conda: "envs/shell.yaml" | ||
localrule: True | ||
shell: "curl -sSLo {output} '{params.uri}'" | ||
|
||
rule heat_demand_final_timeseries: | ||
message: "Generate heat demand timeseries data from gridded data for '{wildcards.shapes}' resolution." | ||
input: | ||
timeseries_data = "results/{shapes}/hourly_unscaled_heat_demand.nc", | ||
annual_demand = "results/{shapes}/annual-heat-demand-twh.csv", | ||
conda: "envs/default.yaml" | ||
params: | ||
sfh_mfh_shares = config["parameters"]["heat"]["sfh-mfh-shares"], | ||
scaling_factor = internal["scaling-factors"]["power"] | ||
output: "results/{shapes}/final_outputs/heat_demand.csv" | ||
script: "scripts/heat_demand_final_timeseries.py" | ||
|
||
|
||
rule heat_pump_final_timeseries: | ||
message: "Combine hot water and space heating characteristics to generate a weighted average national heat pump cop `heat` carrier timeseries." | ||
input: | ||
timeseries_data = "results/{shapes}/heat-pump-cop.nc", | ||
annual_demand = "results/{shapes}/annual-heat-demand-twh.csv" | ||
conda: "envs/default.yaml" | ||
output: "results/{shapes}/final_outputs/heat-pump-cop.csv" | ||
script: "scripts/heat_pump_final_timeseries.py" | ||
|
||
|
||
rule all: | ||
message: "Produce all files for the heat module." | ||
default_target: True | ||
input: | ||
expand("results/{shapes}/final_outputs/heat-pump-cop.csv", shapes=config["resolution"].keys()), | ||
expand("results/{shapes}/final_outputs/heat_demand.csv", shapes=config["resolution"].keys()) | ||
# Only activates if users request the default example in their configuration. | ||
if config["use_default_user_resources"]: | ||
rule all: | ||
message: "Generate default user input example output for 'heat'." | ||
input: | ||
expand("results/{shapes}/timeseries/heat_pump_cop.csv", shapes="national"), | ||
expand("results/{shapes}/timeseries/heat_demand.csv", shapes="national") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: shell | ||
channels: | ||
- conda-forge | ||
- conda-forge | ||
- nodefaults | ||
dependencies: | ||
- curl=8.6.0 | ||
- unzip=6.0 | ||
- rsync=3.2.3 | ||
- curl=8.9.1 | ||
- unzip=6.0 |
File renamed without changes.
File renamed without changes.
5 changes: 4 additions & 1 deletion
5
...les/heat/workflow/resources/internal.yaml → ...at/workflow/internal/internal_config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# DO NOT MODIFY THESE VALUES! | ||
# They enable our wrappers to work. | ||
software-deployment-method: conda | ||
use-conda: True | ||
wrapper-prefix: https://github.com/calliope-project/ec_modules/raw/ |
Oops, something went wrong.