Skip to content

Commit 13f9906

Browse files
authored
Merge pull request #209 from ktehranchi/master
Add Regional Policy Constraints, OASIS Natural Gas Data, Fix Validation Plots
2 parents 03bc8bb + 76e99ee commit 13f9906

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1901
-285
lines changed

.gitignore

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

docs/source/config-configuration.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ Most users will leave this as `pypsa-usa`.
1919
| Renewable Time-Series | Atlite | WECC-ADS |
2020
| Hydro Time-Series | Breakthrough (temp) | WECC-ADS |
2121
| Demand | EIA930 | WECC-ADS |
22-
| Years Supported | 2019 (soon 2017-2023) | 2032 |
23-
| Interconnections Supported | WECC (soon US) | WECC |
24-
| Cost Projections | NREL-ATB | NREL-ATB |
22+
| Historical Demand | 2019-2023 | - |
23+
| Future Demand | NREL EFS | WECC ADS 2032 |
24+
| Interconnections Supported | WECC + ERCOT | WECC |
25+
| Capital Costs | NREL-ATB | NREL-ATB |
26+
| Fuel Costs | CAISO/EIA | CAISO/EIA |
2527
| Purpose[^+] | CEM, PCS | PCS |
2628

2729
[^+]: CEM = Capacity Expansion Model, PCS = Production Cost Simulation

docs/source/config-wildcards.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
(wildcards)=
22
# Wildcards
33

4-
For more detailed definitions of wildcards, please reference [pypsa-eur](https://pypsa-eur.readthedocs.io/en/latest/wildcards.html).
5-
Not all wildcards implemented in [pypsa-eur](https://pypsa-eur.readthedocs.io/en/latest/wildcards.html) are available
6-
yet in pypsa-usa.
7-
84
It is easy to run PyPSA-USA for multiple scenarios using the wildcards feature of `snakemake`.
95
Wildcards generalise a rule to produce all files that follow a regular expression pattern
106
which e.g. defines one particular scenario. One can think of a wildcard as a parameter that shows
@@ -47,13 +43,6 @@ during the workflow. If other years are needed, the user will need to prepaer th
4743
cutout themself.
4844
```
4945

50-
<!-- (technology)=
51-
## The ``{technology}`` wildcard -->
52-
53-
<!-- The ``{technology}`` wildcard specifies for which renewable energy technology to produce availability time
54-
series and potentials using the rule :mod:`build_renewable_profiles`.
55-
It can take the values ``onwind``, ``offwind-ac``, ``offwind-dc``, and ``solar`` but **not** ``hydro``
56-
(since hydroelectric plant profiles are created by a different rule). -->
5746

5847
<!-- (simpl)=
5948
## The ``{simpl}`` wildcard -->

docs/source/configtables/opts.csv

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ Trigger, Description, Definition, Status,
22
``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,
33
``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
44
``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,
57
``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,
6-
``CCL``, Add minimum and maximum levels of generator nominal capacity per carrier for individual regions. These can be specified in the file linked at ``electricity: agg_p_nom_limits`` in the configuration. File defaults to ``data/agg_p_nom_minmax.csv``., ``solve_network``, In active use,
7-
``EQ``," ""Require each region or node to on average produce a minimal share of its total consumption itself. Example: ``EQ0.5c`` demands each region 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,
8-
``BAU``, Add a per-``carrier`` minimal overall capacity; i.e. at least ``40GW`` of ``OCGT`` in a given Interconnect; configured in ``electricity: BAU_mincapacities``, ``solve_network``: `add_opts_constraints() <https://github.com/PyPSA/pypsa-eur/blob/6b964540ed39d44079cdabddee8333f486d0cd63/scripts/solve_network.py#L66>`__, Untested,
9-
``SAFE``, Add a capacity reserve margin (a.k.a Planning Reserve Margin) of a certain fraction above the peak demand to which renewable generators and storage do *not* contribute. Ignores network constraints., ``solve_network`` `add_opts_constraints() <https://github.com/PyPSA/pypsa-eur/blob/6b964540ed39d44079cdabddee8333f486d0cd63/scripts/solve_network.py#L73>`__, Untested,
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,
1013
``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,
1114
``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,
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,

docs/source/rules-build-network.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,36 @@
11
(build-rules)=
22
# Build Network
33

4-
(shapes)=
5-
## Rule `build_shapes`
6-
```{eval-rst}
7-
.. automodule:: build_shapes
8-
```
9-
104
(base)=
115
## Rule `build_base_network`
126
```{eval-rst}
137
.. automodule:: build_base_network
148
```
159

10+
(shapes)=
11+
## Rule `build_shapes`
12+
```{eval-rst}
13+
.. automodule:: build_shapes
14+
```
15+
1616
(busregions)=
1717
## Rule `build_bus_regions`
1818
```{eval-rst}
1919
.. automodule:: build_bus_regions
2020
```
2121

22+
(demand)=
23+
## Rule `build_demand`
24+
```{eval-rst}
25+
.. automodule:: build_demand
26+
```
27+
28+
(fuel_prices)=
29+
## Rule `build_fuel_prices`
30+
```{eval-rst}
31+
.. automodule:: build_fuel_prices
32+
```
33+
2234
(cutout)=
2335
## Rule `build_cutout`
2436
```{eval-rst}

docs/source/rules-retrieving-data.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ Natural Gas infrastructure includes:
7575

7676
(retrieve-eia)=
7777
## Rule `retrieve_eia_data`
78-
79-
Historical electrical load data from 2015 till the last present month are retrieved from the [US Energy Information Agency](https://www.eia.gov/) (EIA). Data is downloaded at hourly temporal resolution and at a spatial resolution of balancing authority region.
78+
```{eval-rst}
79+
.. automodule:: retrieve_eia_data
80+
```
8081

8182
(retrieve-wecc)=
8283
## Rule `retrieve_WECC_forcast_data`
@@ -151,3 +152,10 @@ Documentation of the configuration file ``config/config.yaml`` at
151152
**Outputs**
152153

153154
- ``resources/costs.csv``
155+
156+
157+
(retrieve-caiso-data)=
158+
## Rule `retrieve_caiso_data`
159+
```{eval-rst}
160+
.. automodule:: retrieve_caiso_data
161+
```

docs/source/rules-solve.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
(prepare)=
55
## Rule `prepare_network`
6-
**Directly uses PyPSA-Eur Implementation**
7-
86
```{eval-rst}
97
Prepare PyPSA network for solving according to :ref:`opts` and :ref:`ll`, such
108
as.

workflow/Snakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ include: "rules/build_electricity.smk"
9090
include: "rules/build_sector.smk"
9191
include: "rules/solve_electricity.smk"
9292
include: "rules/postprocess.smk"
93-
93+
include: "rules/validate.smk"
9494

9595
if "E" not in config["scenario"]["sector"]:
9696
if not config["scenario"]["sector"]:

workflow/config/config.default.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ run:
1111
# docs :
1212
scenario:
1313
interconnect: western #"usa|texas|western|eastern"
14-
clusters: [30]
15-
opts: [Co2L0.75-4H]
14+
clusters: [100]
15+
opts: [RCo2L-SAFER-CCL]
1616
ll: [v1.15]
1717
scope: "total" # "urban", "rural", or "total"
1818
sector: "" # G
@@ -73,7 +73,11 @@ electricity:
7373
co2base: 226.86e+6 #base_from_2020 Locations of the 250 MMmt of CO2 emissions from the WECC 2021.
7474
gaslimit: false # global gas usage limit of X MWh_th
7575
retirement: economic # "economic" or "technical"
76-
SAFE_reservemargin: 0.15
76+
SAFE_reservemargin: 0.14
77+
regional_Co2_limits: 'config/policy_constraints/regional_Co2_limits.csv'
78+
agg_p_nom_limits: 'config/policy_constraints/agg_p_nom_minmax.csv'
79+
portfolio_standards: 'config/policy_constraints/portfolio_standards.csv'
80+
SAFE_regional_reservemargins: 'config/policy_constraints/SAFE_regional_prm.csv'
7781

7882
operational_reserve:
7983
activate: false
@@ -219,7 +223,8 @@ load:
219223
costs: # based on the potentials, assuming (0.1 kW/m2 and 10 m2/person)
220224
year: 2030
221225
version: v0.6.0
222-
rooftop_share: 0.14
226+
rooftop_share: 0.0
227+
ng_fuel_year: 2019 # year of the natural gas price from CAISO [2019- 2023]
223228
fill_values:
224229
FOM: 0
225230
VOM: 0
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +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

0 commit comments

Comments
 (0)