Skip to content

Commit 6a7e52f

Browse files
authored
Merge pull request #210 from ktehranchi/master
Update Docs for Opts
2 parents 13f9906 + 5e4bb67 commit 6a7e52f

26 files changed

+363
-223
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,4 +268,3 @@ connect.sh
268268
config/config.cluster.yaml
269269
/workflow/repo_data/dag.png
270270
!.pre-commit-config.yaml
271-

.test_sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: : 2021-2024 The PyPSA-Eur Authors
1+
# SPDX-FileCopyrightText: : 2021-2024 The PyPSA-Eur Authors
22
# ADAPTED FOR PyPSA-USA
33
# SPDX-License-Identifier: CC0-1.0
44

docs/source/config-wildcards.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,6 @@ A visual representation of each `{interconnect}` is shown below:
2626
:scale: 100 %
2727
```
2828

29-
(cutout_wc)=
30-
## The `{cutout}` wildcard
31-
32-
The `{cutout}` wildcard facilitates running the rule :mod:`build_cutout`
33-
for all cutout configurations specified under `atlite: cutouts:`. Each cutout
34-
is descibed in the form `{dataset}_{year}`. These cutouts will be stored in a
35-
folder specified by `{cutout}`.
36-
37-
Valid dataset names include: `era5`
38-
Valid years can be from `1940` to `2022`
39-
40-
```{note}
41-
Data for `era5_2019` has been pre-pared for the user and will be automatically downloaded
42-
during the workflow. If other years are needed, the user will need to prepaer the
43-
cutout themself.
44-
```
45-
46-
4729
<!-- (simpl)=
4830
## The ``{simpl}`` wildcard -->
4931

@@ -104,6 +86,7 @@ currently:
10486
:file: configtables/opts.csv
10587
```
10688

89+
10790
(sector)=
10891
## The `{sector}` wildcard
10992

@@ -127,3 +110,21 @@ Used in the following rules:
127110
- `build_heat_demands`
128111
- `build_temperature_profiles`
129112
- `build_solar_thermal_profiles`
113+
114+
115+
(cutout_wc)=
116+
## The `{cutout}` wildcard
117+
118+
The `{cutout}` wildcard facilitates running the rule :mod:`build_cutout`
119+
for all cutout configurations specified under `atlite: cutouts:`. Each cutout
120+
is descibed in the form `{dataset}_{year}`. These cutouts will be stored in a
121+
folder specified by `{cutout}`.
122+
123+
Valid dataset names include: `era5`
124+
Valid years can be from `1940` to `2022`
125+
126+
```{note}
127+
Data for `era5_2019` has been pre-pared for the user and will be automatically downloaded
128+
during the workflow. If other years are needed, the user will need to prepaer the
129+
cutout themself.
130+
```

docs/source/configtables/opts.csv

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
Trigger, Description, Definition, Status,
2-
``nH``; i.e. ``2H``-``6H``, Resample the time-resolution by averaging over every ``n`` snapshots, ``prepare_network``: `average_every_nhours() <https://github.com/PyPSA/pypsa-eur/blob/6b964540ed39d44079cdabddee8333f486d0cd63/scripts/prepare_network.py#L110>`_ and its `caller <https://github.com/PyPSA/pypsa-eur/blob/6b964540ed39d44079cdabddee8333f486d0cd63/scripts/prepare_network.py#L146>`__), In active use,
3-
``nSEG``; e.g. ``4380SEG``," ""Apply time series segmentation with `tsam <https://tsam.readthedocs.io/en/latest/index.html>`_ package to ``n`` adjacent snapshots of varying lengths based on capacity factors of varying renewables"," hydro inflow and load.""", ``prepare_network``: apply_time_segmentation(), In active use
4-
``Co2L``, Add an overall absolute carbon-dioxide emissions limit configured in ``electricity: co2limit``. If a float is appended an overall emission limit relative to the emission level given in ``electricity: co2base`` is added (e.g. ``Co2L0.05`` limits emissisions to 5% of what is given in ``electricity: co2base``), ``prepare_network``: `add_co2limit() <https://github.com/PyPSA/pypsa-eur/blob/6b964540ed39d44079cdabddee8333f486d0cd63/scripts/prepare_network.py#L19>`_ and its `caller <https://github.com/PyPSA/pypsa-eur/blob/6b964540ed39d44079cdabddee8333f486d0cd63/scripts/prepare_network.py#L154>`__, In active use,
5-
``RCo2L``, Add regional carbon-dioxide emissions limits configured in ``electricity: regional_Co2_limits``. These can be specified in the file linked at ``electricity: regional_Co2_limits`` in the configuration. File defaults to ``repo_data/regional_co2_limits.csv``., ``prepare_network``: `add_co2limit() <https://github.com/PyPSA/pypsa-eur/blob/6b964540ed39d44079cdabddee8333f486d0cd63/scripts/prepare_network.py#L19>`_ and its `caller <https://github.com/PyPSA/pypsa-eur/blob/6b964540ed39d44079cdabddee8333f486d0cd63/scripts/prepare_network.py#L154>`__, In active use,
6-
``RPS``,"Add Renewable Portfolio Standard (RPS) constraints to shares of generator production (MWh) per carrier for individual countries. Standards can be set for single carriers or groups of carriers. Each constraint can be designated for a specified planning horizon in multi-period models. Opts and path for portfolio_standards.csv must be defined", ``solve_network``, In active use,
7-
``Ep``, Add cost for a carbon-dioxide price configured in ``costs: emission_prices: co2`` to ``marginal_cost`` of generators (other emission types listed in ``network.carriers`` possible as well), ``prepare_network``: `add_emission_prices() <https://github.com/PyPSA/pypsa-eur/blob/6b964540ed39d44079cdabddee8333f486d0cd63/scripts/prepare_network.py#L24>`_ and its `caller <https://github.com/PyPSA/pypsa-eur/blob/6b964540ed39d44079cdabddee8333f486d0cd63/scripts/prepare_network.py#L158>`__, In active use,
8-
``CCL``,"Add minimum or maximum levels of generator nominal capacity per carrier for individual countries. Each constraint can be designated for a specified planning horizon in multi-period models. Opts and path for agg_p_nom_minmax.csv must be defined", ``solve_network``, In active use,
9-
``EQ``," ""Require each country or node to on average produce a minimal share of its total consumption itself. Example: ``EQ0.5c`` demands each country to produce on average at least 50% of its consumption; ``EQ0.5`` demands each node to produce on average at least 50% of its consumption.""", ``solve_network``, In active use,
10-
``ATK``," ""Require each node to be autarkic. Example: ``ATK`` removes all lines and links. ``ATKc`` removes all cross-border lines and links.""", ``prepare_network``, In active use,
11-
``BAU``, Add a per-``carrier`` minimal overall capacity; i.e. at least ``40GW`` of ``OCGT`` in Europe; configured in ``electricity: BAU_mincapacities``, ``solve_network``: `add_opts_constraints() <https://github.com/PyPSA/pypsa-eur/blob/6b964540ed39d44079cdabddee8333f486d0cd63/scripts/solve_network.py#L66>`__, Untested,
12-
``SAFE``, Add a capacity reserve margin of a certain fraction above the peak demand to which renewable generators and storage do *not* contribute. Ignores network., ``solve_network`` `add_opts_constraints() <https://github.com/PyPSA/pypsa-eur/blob/6b964540ed39d44079cdabddee8333f486d0cd63/scripts/solve_network.py#L73>`__, Untested,
13-
``carrier+{c|p|m}factor``,"Alter the capital cost (``c``), installable potential (``p``) or marginal costs (``m``) of a carrier by a factor. Example: ``solar+c0.5`` reduces the capital cost of solar to 50\% of original values.", ``prepare_network``, In active use,
14-
``CH4L``,"Add an overall absolute gas limit. If configured in ``electricity: gaslimit`` it is given in MWh thermal, if a float is appended, the overall gaslimit is assumed to be given in TWh thermal (e.g. ``CH4L200`` limits gas dispatch to 200 TWh termal)", ``prepare_network``: ``add_gaslimit()``, In active use,
1+
Trigger, Description, Definition, Status
2+
``nH``; i.e. ``2H``-``6H``, Resample the time-resolution by averaging over every ``n`` snapshots, ``prepare_network``: `average_every_nhours() <https://github.com/PyPSA/pypsa-eur/blob/6b964540ed39d44079cdabddee8333f486d0cd63/scripts/prepare_network.py#L110>`_ and its `caller <https://github.com/PyPSA/pypsa-eur/blob/6b964540ed39d44079cdabddee8333f486d0cd63/scripts/prepare_network.py#L146>`__), In active use
3+
``nSEG``; e.g. ``4380SEG``, Apply time series segmentation with `tsam <https://tsam.readthedocs.io/en/latest/index.html>`_ package to ``n`` adjacent snapshots of varying lengths based on capacity factors of varying renewables hydro inflow and load., ``prepare_network``: apply_time_segmentation(),In active use
4+
``Co2L``, Add an overall absolute carbon-dioxide emissions limit configured in ``electricity: co2limit``. If a float is appended an overall emission limit relative to the emission level given in ``electricity: co2base`` is added (e.g. ``Co2L0.05`` limits emissisions to 5% of what is given in ``electricity: co2base``), ``prepare_network``: `add_co2limit() <https://github.com/PyPSA/pypsa-eur/blob/6b964540ed39d44079cdabddee8333f486d0cd63/scripts/prepare_network.py#L19>`_ and its `caller <https://github.com/PyPSA/pypsa-eur/blob/6b964540ed39d44079cdabddee8333f486d0cd63/scripts/prepare_network.py#L154>`__, In active use
5+
``RCo2L``, Add regional carbon-dioxide emissions limits configured in ``electricity: regional_Co2_limits``. These can be specified in the file linked at ``electricity: regional_Co2_limits`` in the configuration. File defaults to ``repo_data/regional_co2_limits.csv``., ``prepare_network``: `add_co2limit() <https://github.com/PyPSA/pypsa-eur/blob/6b964540ed39d44079cdabddee8333f486d0cd63/scripts/prepare_network.py#L19>`_ and its `caller <https://github.com/PyPSA/pypsa-eur/blob/6b964540ed39d44079cdabddee8333f486d0cd63/scripts/prepare_network.py#L154>`__, In active use
6+
``RPS``,Add Renewable Portfolio Standard (RPS) constraints to shares of generator production (MWh) per carrier for individual countries. Standards can be set for single carriers or groups of carriers. Each constraint can be designated for a specified planning horizon in multi-period models. Opts and path for portfolio_standards.csv must be defined, ``solve_network``, In active use
7+
``SAFE``, Add a capacity reserve margin of a certain fraction above the peak demand to which renewable generators and storage do *not* contribute. Ignores network., ``solve_network`` `add_opts_constraints() <https://github.com/PyPSA/pypsa-eur/blob/6b964540ed39d44079cdabddee8333f486d0cd63/scripts/solve_network.py#L73>`__,In active use
8+
``SAFER``,Adds Regional Capacity Reserve Margin (SAFE) Constraints for defined region- set to a percentage above peak demand level for which renewables and storage do not contribute to. , ``solve_network``,In active use
9+
``Ep``, Add cost for a carbon-dioxide price configured in ``costs: emission_prices: co2`` to ``marginal_cost`` of generators (other emission types listed in ``network.carriers`` possible as well), ``prepare_network``: `add_emission_prices() <https://github.com/PyPSA/pypsa-eur/blob/6b964540ed39d44079cdabddee8333f486d0cd63/scripts/prepare_network.py#L24>`_ and its `caller <https://github.com/PyPSA/pypsa-eur/blob/6b964540ed39d44079cdabddee8333f486d0cd63/scripts/prepare_network.py#L158>`__, In active use
10+
``CCL``,Add minimum or maximum levels of generator nominal capacity per carrier for individual countries. Each constraint can be designated for a specified planning horizon in multi-period models. Opts and path for agg_p_nom_minmax.csv must be defined, ``solve_network``, In active use
11+
``EQ``," ""Require each country or node to on average produce a minimal share of its total consumption itself. Example: ``EQ0.5c`` demands each country to produce on average at least 50% of its consumption; ``EQ0.5`` demands each node to produce on average at least 50% of its consumption.""", ``solve_network``, In active use
12+
``ATK``," ""Require each node to be autarkic. Example: ``ATK`` removes all lines and links. ``ATKc`` removes all cross-border lines and links.""", ``prepare_network``, In active use
13+
``BAU``, Add a per-``carrier`` minimal overall capacity; i.e. at least ``40GW`` of ``OCGT`` in Europe; configured in ``electricity: BAU_mincapacities``, ``solve_network``: `add_opts_constraints() <https://github.com/PyPSA/pypsa-eur/blob/6b964540ed39d44079cdabddee8333f486d0cd63/scripts/solve_network.py#L66>`__, Untested
14+
``carrier+{c|p|m}factor``,"Alter the capital cost (``c``), installable potential (``p``) or marginal costs (``m``) of a carrier by a factor. Example: ``solar+c0.5`` reduces the capital cost of solar to 50\% of original values.", ``prepare_network``, In active use
15+
``CH4L``,"Add an overall absolute gas limit. If configured in ``electricity: gaslimit`` it is given in MWh thermal, if a float is appended, the overall gaslimit is assumed to be given in TWh thermal (e.g. ``CH4L200`` limits gas dispatch to 200 TWh termal)", ``prepare_network``: ``add_gaslimit()``, In active use

docs/source/rules-retrieving-data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,4 @@ Documentation of the configuration file ``config/config.yaml`` at
158158
## Rule `retrieve_caiso_data`
159159
```{eval-rst}
160160
.. automodule:: retrieve_caiso_data
161-
```
161+
```

workflow/Snakefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ wildcard_constraints:
6464

6565
# Merge subworkflow configs and main config
6666
# configfile: "config/tests/config.validation.yaml"
67-
configfile: "config/tests/config.test_simple.yaml"
68-
# configfile: "config/config.default.yaml"
67+
# configfile: "config/tests/config.test_simple.yaml"
68+
configfile: "config/config.default.yaml"
6969
configfile: "config/config.cluster.yaml"
7070
configfile: "config/config.osw.yaml"
7171
configfile: "config/config.plotting.yaml"
@@ -92,6 +92,7 @@ include: "rules/solve_electricity.smk"
9292
include: "rules/postprocess.smk"
9393
include: "rules/validate.smk"
9494

95+
9596
if "E" not in config["scenario"]["sector"]:
9697
if not config["scenario"]["sector"]:
9798
config["scenario"]["sector"] = "E"

workflow/config/config.default.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ run:
1212
scenario:
1313
interconnect: western #"usa|texas|western|eastern"
1414
clusters: [100]
15-
opts: [RCo2L-SAFER-CCL]
16-
ll: [v1.15]
15+
opts: [RCo2L-SAFER-RPS]
16+
ll: [v1.0, v1.05]
1717
scope: "total" # "urban", "rural", or "total"
1818
sector: "" # G
1919
planning_horizons:
@@ -75,7 +75,7 @@ electricity:
7575
retirement: economic # "economic" or "technical"
7676
SAFE_reservemargin: 0.14
7777
regional_Co2_limits: 'config/policy_constraints/regional_Co2_limits.csv'
78-
agg_p_nom_limits: 'config/policy_constraints/agg_p_nom_minmax.csv'
78+
agg_p_nom_limits: 'config/policy_constraints/agg_p_nom_minmax.csv'
7979
portfolio_standards: 'config/policy_constraints/portfolio_standards.csv'
8080
SAFE_regional_reservemargins: 'config/policy_constraints/SAFE_regional_prm.csv'
8181

@@ -263,7 +263,7 @@ clustering:
263263
algorithm: kmeans # choose from: [hac, kmeans]
264264
feature: solar+onwind-time # only for hac. choose from: [solar+onwind-time, solar+onwind-cap, solar-time, solar-cap, solar+offwind-cap] etc.
265265
cluster_network:
266-
algorithm: kmeans
266+
algorithm: hac # choose from: [hac, kmeans]
267267
feature: solar+onwind-time
268268
aggregation_zones: 'state' # [balancing_area, state]
269269
exclude_carriers: []
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
region, prm
2-
California, 0.14
3-
Oregon, 0.14
4-
Washington, 0.14
5-
Colorado, 0.10
6-
New Mexico, 0.14
7-
Arizona, 0.14
8-
Utah, 0.19
9-
Wyoming, 0.14
10-
Idaho, 0.14
11-
Texas, 0.14
12-
Montana, 0.14
1+
region, prm
2+
California, 0.14
3+
Oregon, 0.14
4+
Washington, 0.14
5+
Colorado, 0.10
6+
New Mexico, 0.14
7+
Arizona, 0.14
8+
Utah, 0.19
9+
Wyoming, 0.14
10+
Idaho, 0.14
11+
Texas, 0.14
12+
Montana, 0.14
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
planning_horizon,region,carrier,min,max
2-
2030,California,onwind,0,
1+
planning_horizon,region,carrier,min,max
2+
2030,California,onwind,0,

workflow/config/policy_constraints/portfolio_standards.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ planning_horizon,region,carrier,pct
1212
2040,New Mexico,"onwind, solar, offwind_floating, geothermal, offwind, hydro",0.5
1313
2040,Nevada,"onwind, solar, offwind_floating, geothermal, offwind, hydro",0.5
1414
2040,Oregon,"onwind, solar, offwind_floating, geothermal, offwind, hydro",0.93
15-
2040,Washington,"onwind, solar, offwind_floating, geothermal, offwind, hydro",1
15+
2040,Washington,"onwind, solar, offwind_floating, geothermal, offwind, hydro",1

0 commit comments

Comments
 (0)