Skip to content

Commit

Permalink
Merge branch 'master' into complete-carrier-set
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianHofmann committed Jun 21, 2023
2 parents e431a96 + cfa99cb commit ab09635
Show file tree
Hide file tree
Showing 51 changed files with 571 additions and 431 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ repos:

# Find common spelling mistakes in comments and docstrings
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
rev: v2.2.5
hooks:
- id: codespell
args: ['--ignore-regex="(\b[A-Z]+\b)"', '--ignore-words-list=fom,appartment,bage,ore,setis,tabacco,berfore'] # Ignore capital case words, e.g. country codes
Expand All @@ -39,7 +39,7 @@ repos:

# Make docstrings PEP 257 compliant
- repo: https://github.com/PyCQA/docformatter
rev: v1.6.5
rev: v1.7.2
hooks:
- id: docformatter
args: ["--in-place", "--make-summary-multi-line", "--pre-summary-newline"]
Expand Down Expand Up @@ -67,7 +67,7 @@ repos:

# Do YAML formatting (before the linter checks it for misses)
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.8.0
rev: v2.9.0
hooks:
- id: pretty-format-yaml
args: [--autofix, --indent, "2", --preserve-quotes]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ repository](https://doi.org/10.5281/zenodo.3601881).
We strongly welcome anyone interested in contributing to this project. If you have any ideas, suggestions or encounter problems, feel invited to file issues or make pull requests on GitHub.
- In case of code-related **questions**, please post on [stack overflow](https://stackoverflow.com/questions/tagged/pypsa).
- For non-programming related and more general questions please refer to the [mailing list](https://groups.google.com/group/pypsa).
- To **discuss** with other PyPSA users, organise projects, share news, and get in touch with the community you can use the [discord server](https://discord.gg/JTdvaEBb).
- To **discuss** with other PyPSA users, organise projects, share news, and get in touch with the community you can use the [discord server](https://discord.com/invite/AnuJBk23FU).
- For **bugs and feature requests**, please use the [PyPSA-Eur Github Issues page](https://github.com/PyPSA/pypsa-eur/issues).

# Licence
Expand Down
8 changes: 8 additions & 0 deletions config/test/config.myopic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ snapshots:
end: "2013-03-08"

electricity:
co2limit: 100.e+6

extendable_carriers:
Generator: [OCGT]
StorageUnit: [battery]
Store: [H2]
Link: [H2 pipeline]

renewable_carriers: [solar, onwind, offwind-ac, offwind-dc]

atlite:
Expand Down
8 changes: 8 additions & 0 deletions config/test/config.overnight.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ snapshots:
end: "2013-03-08"

electricity:
co2limit: 100.e+6

extendable_carriers:
Generator: [OCGT]
StorageUnit: [battery]
Store: [H2]
Link: [H2 pipeline]

renewable_carriers: [solar, onwind, offwind-ac, offwind-dc]

atlite:
Expand Down
1 change: 1 addition & 0 deletions doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Release Notes
Upcoming Release
================

* ``param:`` section in rule definition are added to track changed settings in ``config.yaml``. The goal is to automatically re-execute rules whose parameters have changed. See `Non-file parameters for rules <https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#non-file-parameters-for-rules>`_ in the snakemake documentation.

* **Important:** The configuration files are now located in the ``config`` directory. This counts for ``config.default.yaml``, ``config.yaml`` as well as the test configuration files which are now located in ``config/test``. Config files that are still in the root directory will be ignored.

Expand Down
4 changes: 2 additions & 2 deletions doc/supply_demand.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@ The coefficient of performance (COP) of air- and ground-sourced heat pumps depen
For the sink water temperature Tsink we assume 55 °C [`Config <https://github.com/PyPSA/pypsa-eur-sec/blob/3daff49c9999ba7ca7534df4e587e1d516044fc3/config.default.yaml#L207>`_ file]. For the time- and location-dependent source temperatures Tsource, we rely on the `ERA5 <https://doi.org/10.1002/qj.3803>`_ reanalysis weather data. The temperature differences are converted into COP time series using results from a regression analysis performed in the study by `Stafell et al. <https://pubs.rsc.org/en/content/articlelanding/2012/EE/c2ee22653g>`_. For air-sourced heat pumps (ASHP), we use the function:

.. math::
COP (\Delta T) = 6.81 + 0.121\Delta T + 0.000630\Delta T^2
COP (\Delta T) = 6.81 - 0.121\Delta T + 0.000630\Delta T^2
for ground-sourced heat pumps (GSHP), we use the function:

.. math::
COP(\Delta T) = 8.77 + 0.150\Delta T + 0.000734\Delta T^2
COP(\Delta T) = 8.77 - 0.150\Delta T + 0.000734\Delta T^2
**Resistive heaters**

Expand Down
2 changes: 1 addition & 1 deletion doc/support.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ Support

* In case of code-related **questions**, please post on `stack overflow <https://stackoverflow.com/questions/tagged/pypsa>`_.
* For non-programming related and more general questions please refer to the `mailing list <https://groups.google.com/group/pypsa>`_.
* To **discuss** with other PyPSA users, organise projects, share news, and get in touch with the community you can use the [discord server](https://discord.gg/JTdvaEBb).
* To **discuss** with other PyPSA users, organise projects, share news, and get in touch with the community you can use the `discord server <https://discord.gg/AnuJBk23FU>`_.
* For **bugs and feature requests**, please use the `issue tracker <https://github.com/PyPSA/pypsa-eur/issues>`_.
* We strongly welcome anyone interested in providing **contributions** to this project. If you have any ideas, suggestions or encounter problems, feel invited to file issues or make pull requests on `Github <https://github.com/PyPSA/PyPSA>`_. For further information on how to contribute, please refer to :ref:`contributing`.
59 changes: 59 additions & 0 deletions rules/build_electricity.smk
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ if config["enable"].get("prepare_links_p_nom", False):


rule build_electricity_demand:
params:
snapshots=config["snapshots"],
countries=config["countries"],
load=config["load"],
input:
ancient("data/load_raw.csv"),
output:
Expand All @@ -34,6 +38,10 @@ rule build_electricity_demand:


rule build_powerplants:
params:
powerplants_filter=config["electricity"]["powerplants_filter"],
custom_powerplants=config["electricity"]["custom_powerplants"],
countries=config["countries"],
input:
base_network=RESOURCES + "networks/base.nc",
custom_powerplants="data/custom_powerplants.csv",
Expand Down Expand Up @@ -79,6 +87,8 @@ rule base_network:


rule build_shapes:
params:
countries=config["countries"],
input:
naturalearth=ancient("data/bundle/naturalearth/ne_10m_admin_0_countries.shp"),
eez=ancient("data/bundle/eez/World_EEZ_v8_2014.shp"),
Expand All @@ -104,6 +114,8 @@ rule build_shapes:


rule build_bus_regions:
params:
countries=config["countries"],
input:
country_shapes=RESOURCES + "country_shapes.geojson",
offshore_shapes=RESOURCES + "offshore_shapes.geojson",
Expand All @@ -125,6 +137,9 @@ rule build_bus_regions:
if config["enable"].get("build_cutout", False):

rule build_cutout:
params:
snapshots=config["snapshots"],
cutouts=config["atlite"]["cutouts"],
input:
regions_onshore=RESOURCES + "regions_onshore.geojson",
regions_offshore=RESOURCES + "regions_offshore.geojson",
Expand Down Expand Up @@ -186,6 +201,8 @@ rule build_ship_raster:


rule build_renewable_profiles:
params:
renewable=config["renewable"],
input:
base_network=RESOURCES + "networks/base.nc",
corine=ancient("data/bundle/corine/g250_clc06_V18_5.tif"),
Expand Down Expand Up @@ -235,6 +252,9 @@ rule build_renewable_profiles:


rule build_hydro_profile:
params:
hydro=config["renewable"]["hydro"],
countries=config["countries"],
input:
country_shapes=RESOURCES + "country_shapes.geojson",
eia_hydro_generation="data/eia_hydro_annual_generation.csv",
Expand All @@ -252,6 +272,14 @@ rule build_hydro_profile:


rule add_electricity:
params:
length_factor=config["lines"]["length_factor"],
scaling_factor=config["load"]["scaling_factor"],
countries=config["countries"],
renewable=config["renewable"],
electricity=config["electricity"],
conventional=config.get("conventional", {}),
costs=config["costs"],
input:
**{
f"profile_{tech}": RESOURCES + f"profile_{tech}.nc"
Expand Down Expand Up @@ -287,6 +315,15 @@ rule add_electricity:


rule simplify_network:
params:
simplify_network=config["clustering"]["simplify_network"],
aggregation_strategies=config["clustering"].get("aggregation_strategies", {}),
focus_weights=config.get("focus_weights", None),
renewable_carriers=config["electricity"]["renewable_carriers"],
max_hours=config["electricity"]["max_hours"],
length_factor=config["lines"]["length_factor"],
p_max_pu=config["links"].get("p_max_pu", 1.0),
costs=config["costs"],
input:
network=RESOURCES + "networks/elec.nc",
tech_costs=COSTS,
Expand All @@ -312,6 +349,16 @@ rule simplify_network:


rule cluster_network:
params:
cluster_network=config["clustering"]["cluster_network"],
aggregation_strategies=config["clustering"].get("aggregation_strategies", {}),
custom_busmap=config["enable"].get("custom_busmap", False),
focus_weights=config.get("focus_weights", None),
renewable_carriers=config["electricity"]["renewable_carriers"],
conventional_carriers=config["electricity"].get("conventional_carriers", []),
max_hours=config["electricity"]["max_hours"],
length_factor=config["lines"]["length_factor"],
costs=config["costs"],
input:
network=RESOURCES + "networks/elec_s{simpl}.nc",
regions_onshore=RESOURCES + "regions_onshore_elec_s{simpl}.geojson",
Expand Down Expand Up @@ -343,6 +390,10 @@ rule cluster_network:


rule add_extra_components:
params:
extendable_carriers=config["electricity"]["extendable_carriers"],
max_hours=config["electricity"]["max_hours"],
costs=config["costs"],
input:
network=RESOURCES + "networks/elec_s{simpl}_{clusters}.nc",
tech_costs=COSTS,
Expand All @@ -362,6 +413,14 @@ rule add_extra_components:


rule prepare_network:
params:
links=config["links"],
lines=config["lines"],
co2base=config["electricity"]["co2base"],
co2limit=config["electricity"]["co2limit"],
gaslimit=config["electricity"].get("gaslimit"),
max_hours=config["electricity"]["max_hours"],
costs=config["costs"],
input:
RESOURCES + "networks/elec_s{simpl}_{clusters}_ec.nc",
tech_costs=COSTS,
Expand Down
Loading

0 comments on commit ab09635

Please sign in to comment.