Skip to content

Commit

Permalink
Merge pull request #241 from calliope-project/fix-scenario-denfinitions
Browse files Browse the repository at this point in the history
Update docs and remove scenarios.yaml
  • Loading branch information
timtroendle authored Jun 16, 2023
2 parents e0fc14d + fa4b28f commit 57e67af
Show file tree
Hide file tree
Showing 12 changed files with 258 additions and 69 deletions.
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

### Added (models)

* **ADD** top level model configuration file `scenarios.yaml` which can act as the focal point to consolidate all available overrides in the model (#209).
* **ADD** nuclear power plant technology with capacity limits. Capacity limits can be equals to today or be bound by a minimum and maximum capacity to represent an available range in future. In either case, capacities are allocated at a subnational resolutions based on linear scaling from current capacity geolocations, using the JRC power plant database (#78).
* **ADD** nuclear power plant technology with capacity limits. Capacity limits can be equals to today or be bound by a minimum and maximum capacity to represent an available range in future. In either case, capacities are allocated at a subnational resolution based on linear scaling from current capacity geolocations, using the JRC power plant database (#78).

### Added (workflow)

Expand Down
3 changes: 1 addition & 2 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ rule no_params_model_template:
template = model_template_dir + "{template}",
output: "build/models/{resolution}/{template}"
wildcard_constraints:
template = "interest-rate.yaml|scenarios.yaml"
template = "interest-rate.yaml"
conda: "envs/shell.yaml"
shell: "cp {input.template} {output}"

Expand Down Expand Up @@ -151,7 +151,6 @@ rule model_template:
input_file=[
"interest-rate.yaml",
"locations.yaml",
"scenarios.yaml",
"techs/demand/electricity.yaml",
"techs/storage/electricity.yaml",
"techs/storage/hydro.yaml",
Expand Down
56 changes: 56 additions & 0 deletions docs/css/extras.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,59 @@
transform: translate(50%, 0%) scale(1.75);
transition: transform .4s;
}


/* Tab style starts here */
.tabbed-set {
position: relative;
display: flex;
flex-wrap: wrap;
margin: 1em 0;
border-radius: 0.1rem;
}

.tabbed-set>input {
display: none;
}

.tabbed-set label {
width: auto;
padding: 0.9375em 1.25em 0.78125em;
font-weight: 700;
font-size: 0.84em;
white-space: nowrap;
border-bottom: 0.15rem solid transparent;
border-top-left-radius: 0.1rem;
border-top-right-radius: 0.1rem;
cursor: pointer;
transition: background-color 250ms, color 250ms;
}

.tabbed-set .tabbed-content {
width: 100%;
display: none;
box-shadow: 0 -.05rem #ddd;
}

.tabbed-set input {
position: absolute;
opacity: 0;
}

.tabbed-set input:checked:nth-child(n+1)+label {
color: red;
border-color: red;
}

@media screen {
.tabbed-set input:nth-child(n+1):checked+label+.tabbed-content {
order: 99;
display: block;
}
}

@media print {
.tabbed-content {
display: contents;
}
}
239 changes: 187 additions & 52 deletions docs/model/customisation.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/model/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ While they may be unusual, these units lead to a numerical model that is well su
The units are tuned so as to work best for models with a time resolution of a few hours and a duration of one year.
For other types of problems, or other solution algorithms, the units may need to be changed to avoid numerical issues within the solver.

When you run the workflow, you can easily change the units and scale all values using the `scaling-factor` configuration parameters, see [Configuration](./customisation.md#configuration).
When you run the workflow, you can easily change the units and scale all values using the `scaling-factor` configuration parameters, see [Configuration](../workflow/customisation.md#configuration).
The base units on which the scaling factors are applied are `1 MW`, `1 MWh`, `EUR`, and `km2`.
So for example, the default unit for energy (100 GWh) is derived by scaling the base unit (1 MWh) with a scaling factor of `0.00001`.

Expand Down
2 changes: 1 addition & 1 deletion docs/model/pre-built.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ After going through these first steps, we advise you to head over to [Calliope's

1. Download the pre-built models: [![pre-built models DOI](https://img.shields.io/badge/prebuilts-10.5281%2Fzenodo.3949552-blue)](https://doi.org/10.5281/zenodo.3949552).

2. Install a Gurobi license on your computer ([academic license](https://www.gurobi.com/downloads/end-user-license-agreement-academic/) comes at no cost), or [choose a different solver](./customisation.md#manual).
2. Install a Gurobi license on your computer ([academic license](https://www.gurobi.com/downloads/end-user-license-agreement-academic/) comes at no cost), or [choose a different solver](./customisation.md#manual-changes).

3. Install Calliope and all required dependencies.
The easiest way to do so is using [conda](https://conda.io/) or [mamba](https://mamba.readthedocs.io/).
Expand Down
2 changes: 1 addition & 1 deletion docs/workflow/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Using either one, you can create the environment:
conda activate euro-calliope
snakemake --profile profiles/conda --list # test your installation

3. Install a Gurobi license on your computer ([academic license](https://www.gurobi.com/downloads/end-user-license-agreement-academic/) comes at no cost), or [choose a different solver](./customisation.md#manual).
3. Install a Gurobi license on your computer ([academic license](https://www.gurobi.com/downloads/end-user-license-agreement-academic/) comes at no cost), or [choose a different solver](../model/customisation.md#manual-changes).

4. Create an account at the Copernicus Climate Data Service and a `$HOME/.cdsapirc` file with your credentials; see their [How To](https://cds.climate.copernicus.eu/api-how-to) (you do not need to manually install the client).

Expand Down
2 changes: 1 addition & 1 deletion lib/eurocalliopelib/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def parametrise_template(path_to_template, path_to_output_yaml, **kwargs):
undefined=jinja2.StrictUndefined # This ensures that missing pandas index elements raise an exception instead of silently returning None
)
env.filters['unit'] = filters.unit
rendered =env.get_template(path_to_template.name).render(**kwargs)
rendered = env.get_template(path_to_template.name).render(**kwargs)

with open(path_to_output_yaml, "w") as result_file:
result_file.write(rendered)
Expand Down
3 changes: 3 additions & 0 deletions mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ site_dir: build/docs
markdown_extensions:
- admonition
- attr_list
- pymdownx.details
- pymdownx.tabbed
- toc:
permalink: "#"
plugins:
Expand All @@ -39,4 +41,5 @@ plugins:
- add-file:
path_to_file: ./CHANGELOG.md
path_to_src_dir: .

extra_css: [./css/extras.css]
1 change: 1 addition & 0 deletions requirements-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dependencies:
- graphviz=2.48.0
- pydot=1.4.2
- pycountry=18.12.8
- pymdown-extensions=9.9.2
- snakemake-minimal=7.26.0
- pip=21.0.1
- pip:
Expand Down
4 changes: 0 additions & 4 deletions templates/models/scenarios.yaml

This file was deleted.

10 changes: 5 additions & 5 deletions tests/resources/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ test-model:
default: []
directional-pv: ["directional-rooftop-pv"]
e-to-p-ratios: ["exclusive-energy-to-power-ratios"]
frozen-hydro: ["freeze-hydro-capacities", "no-hydro-fixed-cost"]
alternative-cost: ["dea-renewable-cost", "schroeder-hydro-cost"]
frozen-hydro: ["freeze-hydro-supply-capacities", "freeze-hydro-storage-capacities", "no-hydro-supply-fixed-cost", "no-hydro-storage-fixed-cost"]
alternative-cost: ["dea-renewable-cost-pv-open-field", "dea-renewable-cost-wind-onshore", "dea-renewable-cost-wind-offshore", "dea-renewable-cost-pv-roof-mounted", "schroeder-hydro-cost"]
shed-load: ["load-shedding"]
national:
default: []
connected_neighbours: ["connect_all_neighbours"]
connected_entsoe_tyndp: ["connect_entsoe_tyndp"]
directional-pv: ["directional-rooftop-pv"]
e-to-p-ratios: ["exclusive-energy-to-power-ratios"]
frozen-hydro: ["freeze-hydro-capacities", "no-hydro-fixed-cost"]
alternative-cost: ["dea-renewable-cost", "schroeder-hydro-cost"]
frozen-hydro: ["freeze-hydro-supply-capacities", "freeze-hydro-storage-capacities", "no-hydro-supply-fixed-cost", "no-hydro-storage-fixed-cost"]
alternative-cost: ["dea-renewable-cost-pv-open-field", "dea-renewable-cost-wind-onshore", "dea-renewable-cost-wind-offshore", "dea-renewable-cost-pv-roof-mounted", "schroeder-hydro-cost"]
shed-load: ["load-shedding"]
regional:
default: ["connect_all_neighbours", "run_barrier_no_crossover"]
all-overrides: ["connect_all_neighbours", "directional-rooftop-pv", "exclusive-energy-to-power-ratios",
"dea-renewable-cost", "schroeder-hydro-cost", "freeze-hydro-capacities", "load-shedding"]
"dea-renewable-cost-pv-open-field", "dea-renewable-cost-wind-onshore", "dea-renewable-cost-wind-offshore", "dea-renewable-cost-pv-roof-mounted", "schroeder-hydro-cost", "freeze-hydro-supply-capacities", "freeze-hydro-storage-capacities", "load-shedding"]
overrides:
continental: {}
national:
Expand Down

0 comments on commit 57e67af

Please sign in to comment.