From cbd22c2efd91341cddfb02f7a59073a74ded9aab Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Fri, 11 Sep 2020 15:26:43 +0200 Subject: [PATCH] execute pre-commit --- .github/ISSUE_TEMPLATE/bug_report.md | 4 +- .github/ISSUE_TEMPLATE/config.yml | 2 +- .github/pull_request_template.md | 4 +- .pre-commit-config.yaml | 8 ++++ .readthedocs.yml | 2 +- .reuse/dep5 | 2 +- .travis.yml | 5 ++- README.md | 2 +- Snakefile | 20 +++++----- data/links_tyndp.csv | 2 +- data/parameter_corrections.yaml | 12 +++--- doc/_static/theme_overrides.css | 4 +- doc/cloudcomputing.rst | 40 +++++++++---------- doc/configtables/atlite.csv | 2 +- doc/configtables/costs.csv | 2 +- doc/configtables/hydro.csv | 2 +- doc/configtables/lines.csv | 2 +- doc/configtables/links.csv | 2 +- doc/configtables/load.csv | 2 +- doc/configtables/offwind-ac.csv | 2 +- doc/configtables/offwind-dc.csv | 2 +- doc/configtables/onwind.csv | 2 +- doc/configtables/opts.csv | 2 +- doc/configtables/plotting.csv | 2 +- doc/configtables/scenario.csv | 2 +- doc/configtables/snapshots.csv | 2 +- doc/configtables/solar.csv | 2 +- doc/configtables/solving-options.csv | 2 +- doc/configtables/solving-solver.csv | 2 +- doc/configtables/toplevel.csv | 2 +- doc/configtables/transformers.csv | 2 +- doc/configuration.rst | 4 +- doc/costs.rst | 2 +- doc/index.rst | 10 ++--- doc/installation.rst | 16 ++++---- doc/introduction.rst | 4 +- doc/limitations.rst | 3 +- doc/plotting.rst | 2 +- doc/preparation/base_network.rst | 4 +- doc/preparation/build_bus_regions.rst | 2 +- doc/preparation/build_cutout.rst | 2 +- doc/release_notes.rst | 8 ++-- doc/simplification.rst | 2 +- doc/tutorial.rst | 16 ++++---- doc/wildcards.rst | 4 +- .../environment.docs.yaml | 29 ++++---------- .../environment.fixed.yaml | 0 environment.yaml => envs/environment.yaml | 0 scripts/add_electricity.py | 2 +- scripts/base_network.py | 16 ++++---- scripts/cluster_network.py | 2 +- scripts/make_summary.py | 2 +- scripts/prepare_network.py | 2 +- test/config.test1.yaml | 1 - 54 files changed, 135 insertions(+), 141 deletions(-) create mode 100644 .pre-commit-config.yaml rename environment.docs.yaml => envs/environment.docs.yaml (60%) rename environment.fixedversions.yaml => envs/environment.fixed.yaml (100%) rename environment.yaml => envs/environment.yaml (100%) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index a1671b69..2654595c 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -11,7 +11,7 @@ assignees: '' ## Checklist - [ ] I am using the current [`master`](https://github.com/PyPSA/pypsa-eur/tree/master) branch or the latest [release](https://github.com/PyPSA/pypsa-eur/releases). Please indicate. -- [ ] I am running on an up-to-date [`pypsa-eur` environment](https://github.com/PyPSA/pypsa-eur/blob/master/environment.yaml). Update via `conda env update -f environment.yaml`. +- [ ] I am running on an up-to-date [`pypsa-eur` environment](https://github.com/PyPSA/pypsa-eur/blob/master/envs/environment.yaml). Update via `conda env update -f envs/environment.yaml`. ## Describe the Bug @@ -24,4 +24,4 @@ assignees: '' ``` -``` \ No newline at end of file +``` diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index bb1951c0..5b64d242 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -2,4 +2,4 @@ blank_issues_enabled: false contact_links: - name: PyPSA Mailing List url: https://groups.google.com/forum/#!forum/pypsa - about: Please ask and answer general usage questions here. \ No newline at end of file + about: Please ask and answer general usage questions here. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index b431c08a..05601c58 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -7,7 +7,7 @@ Closes # (if applicable). - [ ] I tested my contribution locally and it seems to work fine. - [ ] Code and workflow changes are sufficiently documented. -- [ ] Newly introduced dependencies are added to `environment.yaml` and `environment.docs.yaml`. +- [ ] Newly introduced dependencies are added to `envs/environment.yaml` and `envs/environment.docs.yaml`. - [ ] Changes in configuration options are added in all of `config.default.yaml`, `config.tutorial.yaml`, and `test/config.test1.yaml`. - [ ] Changes in configuration options are also documented in `doc/configtables/*.csv` and line references are adjusted in `doc/configuration.rst` and `doc/tutorial.rst`. -- [ ] A note for the release notes `doc/release_notes.rst` is amended in the format of previous release notes. \ No newline at end of file +- [ ] A note for the release notes `doc/release_notes.rst` is amended in the format of previous release notes. diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..c5d05ee9 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,8 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.4.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files diff --git a/.readthedocs.yml b/.readthedocs.yml index 0ccb7def..173d21d7 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -5,4 +5,4 @@ version: 2 conda: - environment: environment.docs.yaml \ No newline at end of file + environment: envs/environment.docs.yaml diff --git a/.reuse/dep5 b/.reuse/dep5 index ef2e4f85..eb64a172 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -25,4 +25,4 @@ License: CC0-1.0 Files: borg-it Copyright: : 2017-2020 The PyPSA-Eur Authors -License: CC0-1.0 \ No newline at end of file +License: CC0-1.0 diff --git a/.travis.yml b/.travis.yml index a8e6e36e..75c5d524 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,11 +15,12 @@ before_install: - source conda4travis.sh # install conda environment - - conda env create -f ./environment.yaml + - conda install -c conda-forge mamba + - mamba env create -f ./envs/environment.yaml - conda activate pypsa-eur # install open-source solver - - conda install -c conda-forge ipopt glpk + - mamba install -c conda-forge ipopt glpk script: - cp ./test/config.test1.yaml ./config.yaml diff --git a/README.md b/README.md index dcc7c6fc..c281e589 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ and local grid bottlenecks may cause unrealistic load-shedding or generator curtailment. We recommend to cluster the network to a couple of hundred nodes to remove these local inconsistencies. See the -discussion in Section 3.4 "Model validation" of the paper. +discussion in Section 3.4 "Model validation" of the paper. ![PyPSA-Eur Grid Model](doc/img/base.png) diff --git a/Snakefile b/Snakefile index ce27174a..3eddad7c 100644 --- a/Snakefile +++ b/Snakefile @@ -46,11 +46,11 @@ if config['enable'].get('prepare_links_p_nom', False): script: 'scripts/prepare_links_p_nom.py' -datafiles = ['ch_cantons.csv', 'je-e-21.03.02.xls', - 'eez/World_EEZ_v8_2014.shp', 'EIA_hydro_generation_2000_2014.csv', - 'hydro_capacities.csv', 'naturalearth/ne_10m_admin_0_countries.shp', - 'NUTS_2013_60M_SH/data/NUTS_RG_60M_2013.shp', 'nama_10r_3popgdp.tsv.gz', - 'nama_10r_3gdp.tsv.gz', 'time_series_60min_singleindex_filtered.csv', +datafiles = ['ch_cantons.csv', 'je-e-21.03.02.xls', + 'eez/World_EEZ_v8_2014.shp', 'EIA_hydro_generation_2000_2014.csv', + 'hydro_capacities.csv', 'naturalearth/ne_10m_admin_0_countries.shp', + 'NUTS_2013_60M_SH/data/NUTS_RG_60M_2013.shp', 'nama_10r_3popgdp.tsv.gz', + 'nama_10r_3gdp.tsv.gz', 'time_series_60min_singleindex_filtered.csv', 'corine/g250_clc06_V18_5.tif'] @@ -131,7 +131,7 @@ rule build_bus_regions: script: "scripts/build_bus_regions.py" -if config['enable'].get('build_cutout', False): +if config['enable'].get('build_cutout', False): rule build_cutout: output: directory("cutouts/{cutout}") log: "logs/build_cutout/{cutout}.log" @@ -148,9 +148,9 @@ if config['enable'].get('retrieve_cutout', True): script: 'scripts/retrieve_cutout.py' -if config['enable'].get('build_natura_raster', False): +if config['enable'].get('build_natura_raster', False): rule build_natura_raster: - input: + input: natura="data/bundle/natura/Natura2000_end2015.shp", cutouts=expand("cutouts/{cutouts}", **config['atlite']) output: "resources/natura.tiff" @@ -179,7 +179,7 @@ rule build_renewable_profiles: if w.technology in ('onwind', 'solar') else "resources/regions_offshore.geojson"), cutout=lambda w: "cutouts/" + config["renewable"][w.technology]['cutout'] - output: + output: profile="resources/profile_{technology}.nc", log: "logs/build_renewable_profile_{technology}.log" benchmark: "benchmarks/build_renewable_profiles_{technology}" @@ -210,7 +210,7 @@ rule add_electricity: geth_hydro_capacities='data/geth2015_hydro_capacities.csv', opsd_load='data/bundle/time_series_60min_singleindex_filtered.csv', nuts3_shapes='resources/nuts3_shapes.geojson', - **{'profile_' + tech: "resources/profile_" + tech + ".nc" + **{f"profile_{tech}": f"resources/profile_{tech}.nc" for tech in config['renewable']} output: "networks/elec.nc" log: "logs/add_electricity.log" diff --git a/data/links_tyndp.csv b/data/links_tyndp.csv index 5d0aec28..ca977c27 100644 --- a/data/links_tyndp.csv +++ b/data/links_tyndp.csv @@ -23,4 +23,4 @@ HVDC Ultranet,Osterath (DE),Philippsburg (DE),,314,600,in permitting,,https://ty Gridlink,Kingsnorth (UK),Warande (FR),160,,1400,in permitting,,https://tyndp.entsoe.eu/tyndp2018/projects/projects/285,0.596111111111111,51.41972,2.376776,51.034368 NeuConnect,Grain (UK),Fedderwarden (DE),680,,1400,in permitting,,https://tyndp.entsoe.eu/tyndp2018/projects/projects/309,0.716666666666667,51.44,8.046524,53.562763 NordBalt,Klaipeda (LT),Nybro (SE),450,,700,built,,https://en.wikipedia.org/wiki/NordBalt,21.256667,55.681667,15.854167,56.767778 -Estlink 1,Harku (EE),Espoo (FI),105,,350,built,,https://en.wikipedia.org/wiki/Estlink,24.560278,59.384722,24.551667,60.203889 \ No newline at end of file +Estlink 1,Harku (EE),Espoo (FI),105,,350,built,,https://en.wikipedia.org/wiki/Estlink,24.560278,59.384722,24.551667,60.203889 diff --git a/data/parameter_corrections.yaml b/data/parameter_corrections.yaml index 83a17d51..0962b1b8 100644 --- a/data/parameter_corrections.yaml +++ b/data/parameter_corrections.yaml @@ -33,12 +33,12 @@ Link: "14559": "6240" # fix wrong bus allocation from 6241 "12998": "1333" # combine link 12998 + 12997 in 12998 "5627": '2309' # combine link 5627 + 5628 in 5627 - length: + length: index: - "12998": 409.0 + "12998": 409.0 "5627": 26.39 - bus0: - index: + bus0: + index: # set bus0 == bus1 for removing the link in remove_unconnected_components - "5628": "7276" - "12997": "7276" \ No newline at end of file + "5628": "7276" + "12997": "7276" diff --git a/doc/_static/theme_overrides.css b/doc/_static/theme_overrides.css index efbe909c..778756c1 100644 --- a/doc/_static/theme_overrides.css +++ b/doc/_static/theme_overrides.css @@ -11,7 +11,7 @@ white-space: normal !important; /* background: #eeeeee !important; */ } - + .wy-table-responsive { max-width: 100%; overflow: visible !important; @@ -20,4 +20,4 @@ .wy-nav-content { max-width: 910px !important; } - } \ No newline at end of file + } diff --git a/doc/cloudcomputing.rst b/doc/cloudcomputing.rst index 3da6b9c2..f91441a5 100644 --- a/doc/cloudcomputing.rst +++ b/doc/cloudcomputing.rst @@ -1,6 +1,6 @@ .. SPDX-FileCopyrightText: 2020 Maximilian Parzen and Emmanuel Paez - + SPDX-License-Identifier: CC-BY-4.0 @@ -18,7 +18,7 @@ Google Cloud Platform (GCP) We are happy to take pull requests explaining where the procedures deviate from the descriptions below for other operating systems. Likewise, tutorials for other cloud computing solutions are also highly welcome. -The Google Cloud Platform (GCP) is a cloud computing service you can use to run PyPSA-Eur calculations, especially if +The Google Cloud Platform (GCP) is a cloud computing service you can use to run PyPSA-Eur calculations, especially if - you do not have immediate access to high-performance computating facilities, - you have problems with the Windows operating system and want a quick run on a linux-based system, @@ -26,7 +26,7 @@ The Google Cloud Platform (GCP) is a cloud computing service you can use to run - you need quick results (trial version includes 32 vCPU cores and up to 800 GB of memory). With the Google Cloud Platform you set up a virtual machine in the cloud which can store and operate data. -Like on your local computer, you have to install all software and solvers, and create paths on the virtual machine to set up the required environment. +Like on your local computer, you have to install all software and solvers, and create paths on the virtual machine to set up the required environment. The 300$ free trial budget is offered which equals roughly 10-20 simulations with 180 nodes at hourly basis. The following steps are required: @@ -38,7 +38,7 @@ The following steps are required: Step 1 - Google Cloud Platform registration ------------------------------------------- -First, register at the `Google Cloud Platform `_ (GCP). +First, register at the `Google Cloud Platform `_ (GCP). Ann active bank account is required, which will not be charged unless you exceed the trial budget. Step 2 - Create your Virtual Machine instance @@ -73,26 +73,26 @@ Step 3 - Installation of Cloud SDK - Download Google Cloud SDK `SDK `_. Check that you are logged in in your Google account. The link should lead you to the Windows installation of Google Cloud SDK. - Follow the "Quickstart for Windows - Before you begin" steps. - After the successfull installation and initialization, close the Google Cloud SDK reopen it again. Type the following command into the "Google Cloud SDK Shell": - + .. code:: bash - + gcloud compute ssh -- -L 8888:localhost:8888 - + - This command above will open a PuTTy command window that is connected to your Virtual Machine. Time to celebrate if it works! -- Now install all necessary tools. As little help, the first steps: +- Now install all necessary tools. As little help, the first steps: .. code:: bash - + sudo apt-get update sudo apt-get install bzip2 libxml2-dev sudo apt-get install wget wget https://repo.anaconda.com/archive/Anaconda3-2020.07-Linux-x86_64.sh (Check the link. To be up to date with anaconda, check the Anaconda website https://www.anaconda.com/products/individual ) ls (to see what anaconda file to bash) - bash Anaconda3-2020.07-Linux-x86_64.sh - source ~/.bashrc - + bash Anaconda3-2020.07-Linux-x86_64.sh + source ~/.bashrc + - Close and reopen the PuTTy file (-> open Google Cloud SDK -> initialize again with the command above to open the PuTTY command window). Now ``conda`` can be listed with ``conda list``. Noq you can follow the standard installation instructions to finalize your machine (don't forget the solvers - for bigger simulations use commercial solvers such as Gurobi). - + Step 4 - Installation of WinSCP ------------------------------- @@ -102,22 +102,22 @@ Make sure that your instance is operating for the next steps. - Download `WinSCP `_ and follow the default installation steps. - Open WinSCP after the installation. A login window will open. - Keep SFTP as file protocol. -- As host name insert the External IP of your VM (click in your internet browser on your GCP VM instance to see the external IP) +- As host name insert the External IP of your VM (click in your internet browser on your GCP VM instance to see the external IP) - Set the User name in WinSCP to the name you see in your PuTTy window (check step 3 - for instance [username]@[VM-name]:~$) -- Click on the advanced setting. SSH -> Authentication. -- Option 1. Click on the Tools button and "Install Public Key into Server..". Somewhere in your folder structure must be a public key. I found it with the following folder syntax on my local windows computer -> :\Users\...\.ssh (there should be a PKK file). -- Option 2. Click on the Tools button and "Generate new key pair...". Save the private key at a folder you remember and add it to the "private key file" field in WinSCP. Upload the public key to the metadeta of your instance. +- Click on the advanced setting. SSH -> Authentication. +- Option 1. Click on the Tools button and "Install Public Key into Server..". Somewhere in your folder structure must be a public key. I found it with the following folder syntax on my local windows computer -> :\Users\...\.ssh (there should be a PKK file). +- Option 2. Click on the Tools button and "Generate new key pair...". Save the private key at a folder you remember and add it to the "private key file" field in WinSCP. Upload the public key to the metadeta of your instance. - Click ok and save. Then click Login. If successfull WinSCP will open on the left side your local computer folder structure and on the right side the folder strucutre of your VM. (If you followed Option 2 and its not initially working. Stop your instance, refresh the website, reopen the WinSCP field. Afterwards your your Login should be successfull) If you had struggle with the above steps, you could also try `this video `_. .. note:: Double check the External IP of your VM before you try to login with WinSCP. It's often a cause for an error. - + Step 5 - Extra. Copying your instance with all its data and paths included -------------------------------------------------------------------------- Especially if you think about operating several instance for quicker simulations, you can create a so called `"image" `_ of the virtual machine. -The "image" includes all the data and software set-ups from your VM. Afterwards you can create a VM from an image and avoid all the installation steps above. +The "image" includes all the data and software set-ups from your VM. Afterwards you can create a VM from an image and avoid all the installation steps above. Important points when to solve networks in PyPSA ------------------------------------------------ @@ -126,4 +126,4 @@ If you use the GCP with the default PyPSA-Eur settings, your budget will be used - Always test using low resolution networks; i.e. a single country at 5 nodes and 24h resolution for 2 month of weather data. - Adjust your solver in the ``config.yaml`` file. Set ``solving: skip_iterations: true``. - This will lead to a single solver iteration which is often precise enough. + This will lead to a single solver iteration which is often precise enough. diff --git a/doc/configtables/atlite.csv b/doc/configtables/atlite.csv index b60b15e5..5f21bb05 100644 --- a/doc/configtables/atlite.csv +++ b/doc/configtables/atlite.csv @@ -5,4 +5,4 @@ cutouts,,, -- -- module,--,"One of {'era5','sarah'}","Source of the reanalysis weather dataset (e.g. `ERA5 `_ or `SARAH-2 `_)" -- -- xs,°,"Float interval within [-180, 180]","Range of longitudes to download weather data for." -- -- ys,°,"Float interval within [-90, 90]","Range of latitudes to download weather data for." --- -- years,--,"Integer interval within [1979,2018]","Range of years to download weather data for." \ No newline at end of file +-- -- years,--,"Integer interval within [1979,2018]","Range of years to download weather data for." diff --git a/doc/configtables/costs.csv b/doc/configtables/costs.csv index 383a6423..ed2d56e4 100644 --- a/doc/configtables/costs.csv +++ b/doc/configtables/costs.csv @@ -5,4 +5,4 @@ USD2013_to_EUR2013,--,float,"Exchange rate from USD :math:`_{2013}` to EUR :math capital_cost,EUR/MW,"Keys should be in the 'technology' column of ``data/costs.csv``. Values can be any float.","For the given technologies, assumptions about their capital investment costs are set to the corresponding value. Optional; overwrites cost assumptions from ``data/costs.csv``." marginal_cost,EUR/MWh,"Keys should be in the 'technology' column of ``data/costs.csv``. Values can be any float.","For the given technologies, assumptions about their marginal operating costs are set to the corresponding value. Optional; overwrites cost assumptions from ``data/costs.csv``." emission_prices,,,"Specify exogenous prices for emission types listed in ``network.carriers`` to marginal costs." --- co2,EUR/t,float,"Exogenous price of carbon-dioxide added to the marginal costs of fossil-fuelled generators according to their carbon intensity. Added through the keyword ``Ep`` in the ``{opts}`` wildcard only in the rule :mod:`prepare_network``." \ No newline at end of file +-- co2,EUR/t,float,"Exogenous price of carbon-dioxide added to the marginal costs of fossil-fuelled generators according to their carbon intensity. Added through the keyword ``Ep`` in the ``{opts}`` wildcard only in the rule :mod:`prepare_network``." diff --git a/doc/configtables/hydro.csv b/doc/configtables/hydro.csv index 801b27ff..fc53334e 100644 --- a/doc/configtables/hydro.csv +++ b/doc/configtables/hydro.csv @@ -3,4 +3,4 @@ cutout,--,"Must be 'europe-2013-era5'","Specifies the directory where the releva carriers,--,"Any subset of {'ror', 'PHS', 'hydro'}","Specifies the types of hydro power plants to build per-unit availability time series for. 'ror' stands for run-of-river plants, 'PHS' represents pumped-hydro storage, and 'hydro' stands for hydroelectric dams." PHS_max_hours,h,float,"Maximum state of charge capacity of the pumped-hydro storage (PHS) in terms of hours at full output capacity ``p_nom``. Cf. `PyPSA documentation `_." hydro_max_hours,h,"Any of {float, 'energy_capacity_totals_by_country', 'estimate_by_large_installations'}","Maximum state of charge capacity of the pumped-hydro storage (PHS) in terms of hours at full output capacity ``p_nom`` or heuristically determined. Cf. `PyPSA documentation `_." -clip_min_inflow,MW,float,"To avoid too small values in the inflow time series, values below this threshold are set to zero." \ No newline at end of file +clip_min_inflow,MW,float,"To avoid too small values in the inflow time series, values below this threshold are set to zero." diff --git a/doc/configtables/lines.csv b/doc/configtables/lines.csv index e5067867..59cc4fa3 100644 --- a/doc/configtables/lines.csv +++ b/doc/configtables/lines.csv @@ -2,4 +2,4 @@ types,--,"Values should specify a `line type in PyPSA `_. Keys should specify the corresponding voltage level (e.g. 220., 300. and 380. kV)","Specifies line types to assume for the different voltage levels of the ENTSO-E grid extraction. Should normally handle voltage levels 220, 300, and 380 kV" s_max_pu,--,"Value in [0.,1.]","Correction factor for line capacities (``s_nom``) to approximate :math:`N-1` security and reserve capacity for reactive power flows" length_factor,--,float,"Correction factor to account for the fact that buses are *not* connected by lines through air-line distance." -under_construction,--,"One of {'zero': set capacity to zero, 'remove': remove completely, 'keep': keep with full capacity}","Specifies how to handle lines which are currently under construction." \ No newline at end of file +under_construction,--,"One of {'zero': set capacity to zero, 'remove': remove completely, 'keep': keep with full capacity}","Specifies how to handle lines which are currently under construction." diff --git a/doc/configtables/links.csv b/doc/configtables/links.csv index d77c9ddd..96f6c2f5 100644 --- a/doc/configtables/links.csv +++ b/doc/configtables/links.csv @@ -1,4 +1,4 @@ ,Unit,Values,Description p_max_pu,--,"Value in [0.,1.]","Correction factor for link capacities ``p_nom``." include_tyndp,bool,"{'true', 'false'}","Specifies whether to add HVDC link projects from the `TYNDP 2018 `_ which are at least in permitting." -under_construction,--,"One of {'zero': set capacity to zero, 'remove': remove completely, 'keep': keep with full capacity}","Specifies how to handle lines which are currently under construction." \ No newline at end of file +under_construction,--,"One of {'zero': set capacity to zero, 'remove': remove completely, 'keep': keep with full capacity}","Specifies how to handle lines which are currently under construction." diff --git a/doc/configtables/load.csv b/doc/configtables/load.csv index 035b27a1..760f912c 100644 --- a/doc/configtables/load.csv +++ b/doc/configtables/load.csv @@ -1,2 +1,2 @@ ,Unit,Values,Description -scaling_factor,--,float,"Global correction factor for the load time series." \ No newline at end of file +scaling_factor,--,float,"Global correction factor for the load time series." diff --git a/doc/configtables/offwind-ac.csv b/doc/configtables/offwind-ac.csv index 02544506..e5bbc847 100644 --- a/doc/configtables/offwind-ac.csv +++ b/doc/configtables/offwind-ac.csv @@ -10,4 +10,4 @@ max_depth,m,float,"Maximum sea water depth at which wind turbines can be build. min_shore_distance,m,float,"Minimum distance to the shore below which wind turbines cannot be build. Such areas close to the shore are excluded in the process of calculating the AC-connected offshore wind potential." potential,--,"One of {'simple', 'conservative'}","Method to compute the maximal installable potential for a node; confer :ref:`renewableprofiles`" clip_p_max_pu,p.u.,float,"To avoid too small values in the renewables` per-unit availability time series values below this threshold are set to zero." -keep_all_available_areas,bool,"{'true', 'false'}","Use all availabe weather cells for renewable profile and potential generation. The default ignores weather cells where only less than 1 MW can be installed." \ No newline at end of file +keep_all_available_areas,bool,"{'true', 'false'}","Use all availabe weather cells for renewable profile and potential generation. The default ignores weather cells where only less than 1 MW can be installed." diff --git a/doc/configtables/offwind-dc.csv b/doc/configtables/offwind-dc.csv index 02544506..e5bbc847 100644 --- a/doc/configtables/offwind-dc.csv +++ b/doc/configtables/offwind-dc.csv @@ -10,4 +10,4 @@ max_depth,m,float,"Maximum sea water depth at which wind turbines can be build. min_shore_distance,m,float,"Minimum distance to the shore below which wind turbines cannot be build. Such areas close to the shore are excluded in the process of calculating the AC-connected offshore wind potential." potential,--,"One of {'simple', 'conservative'}","Method to compute the maximal installable potential for a node; confer :ref:`renewableprofiles`" clip_p_max_pu,p.u.,float,"To avoid too small values in the renewables` per-unit availability time series values below this threshold are set to zero." -keep_all_available_areas,bool,"{'true', 'false'}","Use all availabe weather cells for renewable profile and potential generation. The default ignores weather cells where only less than 1 MW can be installed." \ No newline at end of file +keep_all_available_areas,bool,"{'true', 'false'}","Use all availabe weather cells for renewable profile and potential generation. The default ignores weather cells where only less than 1 MW can be installed." diff --git a/doc/configtables/onwind.csv b/doc/configtables/onwind.csv index 11f05cfa..149dc0c4 100644 --- a/doc/configtables/onwind.csv +++ b/doc/configtables/onwind.csv @@ -11,4 +11,4 @@ corine,,, natura,bool,"{true, false}","Switch to exclude `Natura 2000 `_ natural protection areas. Area is excluded if ``true``." potential,--,"One of {'simple', 'conservative'}","Method to compute the maximal installable potential for a node; confer :ref:`renewableprofiles`" clip_p_max_pu,p.u.,float,"To avoid too small values in the renewables` per-unit availability time series values below this threshold are set to zero." -keep_all_available_areas,bool,"{'true', 'false'}","Use all availabe weather cells for renewable profile and potential generation. The default ignores weather cells where only less than 1 MW can be installed." \ No newline at end of file +keep_all_available_areas,bool,"{'true', 'false'}","Use all availabe weather cells for renewable profile and potential generation. The default ignores weather cells where only less than 1 MW can be installed." diff --git a/doc/configtables/opts.csv b/doc/configtables/opts.csv index 4d699034..427951e5 100644 --- a/doc/configtables/opts.csv +++ b/doc/configtables/opts.csv @@ -5,4 +5,4 @@ Trigger, Description, Definition, Status ``CCL``, Add minimum and maximum levels of generator nominal capacity per carrier for individual countries. 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 ``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() `_, Untested ``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() `_, Untested -``carrier+factor``, "Alter the capital cost of a carrier by a factor. Example: ``solar+0.5`` reduces the capital cost of solar to 50\% of original values.", ``prepare_network``, In active use \ No newline at end of file +``carrier+factor``, "Alter the capital cost of a carrier by a factor. Example: ``solar+0.5`` reduces the capital cost of solar to 50\% of original values.", ``prepare_network``, In active use diff --git a/doc/configtables/plotting.csv b/doc/configtables/plotting.csv index 754f2e83..f5910e16 100644 --- a/doc/configtables/plotting.csv +++ b/doc/configtables/plotting.csv @@ -11,4 +11,4 @@ energy_max,TWh,float,"Upper y-axis limit in energy bar plots." energy_min,TWh,float,"Lower y-axis limit in energy bar plots." energy_threshold,TWh,float,"Threshold below which technologies will not be shown in energy bar plots." tech_colors,--,"carrier -> HEX colour code","Mapping from network ``carrier`` to a colour (`HEX colour code `_)." -nice_names,--,"str -> str","Mapping from network ``carrier`` to a more readable name." \ No newline at end of file +nice_names,--,"str -> str","Mapping from network ``carrier`` to a more readable name." diff --git a/doc/configtables/scenario.csv b/doc/configtables/scenario.csv index 7a2d3bcd..a82462e4 100644 --- a/doc/configtables/scenario.csv +++ b/doc/configtables/scenario.csv @@ -2,4 +2,4 @@ simpl,--,cf. :ref:`simpl`,"List of ``{simpl}`` wildcards to run." clusters,--,cf. :ref:`clusters`,"List of ``{clusters}`` wildcards to run." ll,--,cf. :ref:`ll`,"List of ``{ll}`` wildcards to run." -opts,--,cf. :ref:`opts`,"List of ``{opts}`` wildcards to run." \ No newline at end of file +opts,--,cf. :ref:`opts`,"List of ``{opts}`` wildcards to run." diff --git a/doc/configtables/snapshots.csv b/doc/configtables/snapshots.csv index 14fd8001..4d917f4d 100644 --- a/doc/configtables/snapshots.csv +++ b/doc/configtables/snapshots.csv @@ -1,4 +1,4 @@ ,Unit,Values,Description start,--,"str or datetime-like; e.g. YYYY-MM-DD","Left bound of date range" end,--,"str or datetime-like; e.g. YYYY-MM-DD","Right bound of date range" -closed,--,"One of {None, ‘left’, ‘right’}","Make the time interval closed to the ``left``, ``right``, or both sides ``None``." \ No newline at end of file +closed,--,"One of {None, ‘left’, ‘right’}","Make the time interval closed to the ``left``, ``right``, or both sides ``None``." diff --git a/doc/configtables/solar.csv b/doc/configtables/solar.csv index 93bfd04a..8e57e066 100644 --- a/doc/configtables/solar.csv +++ b/doc/configtables/solar.csv @@ -12,4 +12,4 @@ corine,--,"Any subset of the `CORINE Land Cover code list `_ natural protection areas. Area is excluded if ``true``." potential,--,"One of {'simple', 'conservative'}","Method to compute the maximal installable potential for a node; confer :ref:`renewableprofiles`" clip_p_max_pu,p.u.,float,"To avoid too small values in the renewables` per-unit availability time series values below this threshold are set to zero." -keep_all_available_areas,bool,"{'true', 'false'}","Use all availabe weather cells for renewable profile and potential generation. The default ignores weather cells where only less than 1 MW can be installed." \ No newline at end of file +keep_all_available_areas,bool,"{'true', 'false'}","Use all availabe weather cells for renewable profile and potential generation. The default ignores weather cells where only less than 1 MW can be installed." diff --git a/doc/configtables/solving-options.csv b/doc/configtables/solving-options.csv index 0c640684..f77eec24 100644 --- a/doc/configtables/solving-options.csv +++ b/doc/configtables/solving-options.csv @@ -7,4 +7,4 @@ max_iterations,--,int,"Maximum number of solving iterations in between which res nhours,--,int,"Specifies the :math:`n` first snapshots to take into account. Must be less than the total number of snapshots. Rather recommended only for debugging." clip_p_max_pu,p.u.,float,"To avoid too small values in the renewables` per-unit availability time series values below this threshold are set to zero." skip_iterations,bool,"{'true','false'}","Skip iterating, do not update impedances of branches." -track_iterations,bool,"{'true','false'}","Flag whether to store the intermediate branch capacities and objective function values are recorded for each iteration in ``network.lines['s_nom_opt_X']`` (where ``X`` labels the iteration)" \ No newline at end of file +track_iterations,bool,"{'true','false'}","Flag whether to store the intermediate branch capacities and objective function values are recorded for each iteration in ``network.lines['s_nom_opt_X']`` (where ``X`` labels the iteration)" diff --git a/doc/configtables/solving-solver.csv b/doc/configtables/solving-solver.csv index db16d867..3eae6310 100644 --- a/doc/configtables/solving-solver.csv +++ b/doc/configtables/solving-solver.csv @@ -1,3 +1,3 @@ ,Unit,Values,Description name,--,"One of {'gurobi', 'cplex', 'cbc', 'glpk', 'ipopt'}; potentially more possible","Solver to use for optimisation problems in the workflow; e.g. clustering and linear optimal power flow." -opts,--,"Parameter list for `Gurobi `_ and `CPLEX `_","Solver specific parameter settings." \ No newline at end of file +opts,--,"Parameter list for `Gurobi `_ and `CPLEX `_","Solver specific parameter settings." diff --git a/doc/configtables/toplevel.csv b/doc/configtables/toplevel.csv index 7eb7dd61..27df2344 100644 --- a/doc/configtables/toplevel.csv +++ b/doc/configtables/toplevel.csv @@ -13,4 +13,4 @@ enable,,, -- build_cutout,bool,"{true, false}","Switch to enable the building of cutouts via the rule :mod:`build_cutout`." -- retrieve_cutout,bool,"{true, false}","Switch to enable the retrieval of cutouts from zenodo with :mod:`retrieve_cutout`." -- build_natura_raster,bool,"{true, false}","Switch to enable the creation of the raster ``natura.tiff`` via the rule :mod:`build_natura_raster`." --- retrieve_natura_raster,bool,"{true, false}","Switch to enable the retrieval of ``natura.tiff`` from zenodo with :mod:`retrieve_natura_raster`." \ No newline at end of file +-- retrieve_natura_raster,bool,"{true, false}","Switch to enable the retrieval of ``natura.tiff`` from zenodo with :mod:`retrieve_natura_raster`." diff --git a/doc/configtables/transformers.csv b/doc/configtables/transformers.csv index b58ae8f3..0ccd8e87 100644 --- a/doc/configtables/transformers.csv +++ b/doc/configtables/transformers.csv @@ -1,4 +1,4 @@ ,Unit,Values,Description x,p.u.,float,"Series reactance (per unit, using ``s_nom`` as base power of the transformer. Overwritten if ``type`` is specified." s_nom,MVA,float,"Limit of apparent power which can pass through branch. Overwritten if ``type`` is specified." -type,--,"A `transformer type in PyPSA `_.","Specifies transformer types to assume for the transformers of the ENTSO-E grid extraction." \ No newline at end of file +type,--,"A `transformer type in PyPSA `_.","Specifies transformer types to assume for the transformers of the ENTSO-E grid extraction." diff --git a/doc/configuration.rst b/doc/configuration.rst index 265943e8..fa51b51a 100644 --- a/doc/configuration.rst +++ b/doc/configuration.rst @@ -36,10 +36,10 @@ investment changes as more ambitious greenhouse-gas emission reduction targets a The ``scenario`` section is an extraordinary section of the config file that is strongly connected to the :ref:`wildcards` and is designed to -facilitate running multiple scenarios through a single command +facilitate running multiple scenarios through a single command .. code:: bash - + snakemake -j 1 solve_all_elec_networks For each wildcard, a **list of values** is provided. The rule ``solve_all_elec_networks`` will trigger the rules for creating ``results/networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc`` for **all combinations** of the provided wildcard values as defined by Python's `itertools.product(...) `_ function that snakemake's `expand(...) function `_ uses. diff --git a/doc/costs.rst b/doc/costs.rst index a51acb85..70bd12b8 100644 --- a/doc/costs.rst +++ b/doc/costs.rst @@ -50,4 +50,4 @@ Default Cost Assumptions .. csv-table:: :header-rows: 1 :widths: 10,3,5,4,6,8 - :file: ../data/costs.csv \ No newline at end of file + :file: ../data/costs.csv diff --git a/doc/index.rst b/doc/index.rst index d375cfac..4c15ddf5 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -8,7 +8,7 @@ PyPSA-Eur: An Open Optimisation Model of the European Transmission System .. image:: https://img.shields.io/github/v/release/pypsa/pypsa-eur?include_prereleases :alt: GitHub release (latest by date including pre-releases) - + .. image:: https://travis-ci.org/PyPSA/pypsa-eur.svg?branch=master :target: https://travis-ci.org/PyPSA/pypsa-eur @@ -101,9 +101,9 @@ Documentation simplification solving plotting - + **References** - + * :doc:`release_notes` * :doc:`limitations` * :doc:`contributing` @@ -183,7 +183,7 @@ There are pre-built networks available as a dataset on Zenodo as well for every The included ``.nc`` files are PyPSA network files which can be imported with PyPSA via: .. code:: python - + import pypsa filename = "elec_s_1024_ec.nc" # example @@ -202,7 +202,7 @@ PyPSA-Eur work is released under multiple licenses: See the individual files and the `dep5 <.reuse/dep5>`_ file for license details. Additionally, different licenses and terms of use also apply to the various input data, which are summarised below. -More details are included in +More details are included in `the description of the data bundles on zenodo `_. .. csv-table:: diff --git a/doc/installation.rst b/doc/installation.rst index f50083d3..e1de3f4b 100644 --- a/doc/installation.rst +++ b/doc/installation.rst @@ -1,6 +1,6 @@ .. SPDX-FileCopyrightText: 2019-2020 The PyPSA-Eur Authors - + SPDX-License-Identifier: CC-BY-4.0 .. _installation: @@ -37,12 +37,12 @@ We recommend using the package manager and environment management system ``conda Install `miniconda `_, which is a mini version of `Anaconda `_ that includes only ``conda`` and its dependencies or make sure ``conda`` is already installed on your system. For instructions for your operating system follow the ``conda`` `installation guide `_. -The python package requirements are curated in the `environment.yaml `_ file. +The python package requirements are curated in the `envs/environment.yaml `_ file. The environment can be installed and activated using .. code:: bash - .../pypsa-eur % conda env create -f environment.yaml + .../pypsa-eur % conda env create -f envs/environment.yaml .../pypsa-eur % conda activate pypsa-eur @@ -55,14 +55,14 @@ The environment can be installed and activated using `mamba `_ as a fast drop-in replacement via .. code:: bash - + conda install -c conda-forge mamba and then install the environment with .. code:: bash - mamba env create -f environment.yaml + mamba env create -f envs/environment.yaml Install a Solver ================ @@ -102,10 +102,10 @@ For installation instructions of these solvers for your operating system, follow and on Windows .. code:: bash - + conda activate pypsa-eur conda install -c conda-forge ipopt glpk - + .. _defaultconfig: @@ -113,7 +113,7 @@ Set Up the Default Configuration ================================ PyPSA-Eur has several configuration options that must be specified in a ``config.yaml`` file located in the root directory. -An example configuration ``config.default.yaml`` is maintained in the repository. +An example configuration ``config.default.yaml`` is maintained in the repository. More details on the configuration options are in :ref:`config`. Before first use, create a ``config.yaml`` by copying the example. diff --git a/doc/introduction.rst b/doc/introduction.rst index 96094a9f..9ca049e7 100644 --- a/doc/introduction.rst +++ b/doc/introduction.rst @@ -1,6 +1,6 @@ .. SPDX-FileCopyrightText: 2019-2020 The PyPSA-Eur Authors - + SPDX-License-Identifier: CC-BY-4.0 .. _intro: @@ -64,4 +64,4 @@ Folder Structure System Requirements =================== -Building the model with the scripts in this repository uses up to 20 GB of memory. Computing optimal investment and operation scenarios requires a strong interior-point solver compatible with the modelling library `Pyomo `_ like `Gurobi `_ or `CPLEX `_ with up to 100 GB of memory. \ No newline at end of file +Building the model with the scripts in this repository uses up to 20 GB of memory. Computing optimal investment and operation scenarios requires a strong interior-point solver compatible with the modelling library `Pyomo `_ like `Gurobi `_ or `CPLEX `_ with up to 100 GB of memory. diff --git a/doc/limitations.rst b/doc/limitations.rst index 16c57ac9..3b6c03d7 100644 --- a/doc/limitations.rst +++ b/doc/limitations.rst @@ -37,7 +37,7 @@ improving the approximations. not spatially disaggregated; assuming, as we have done, that the load time series shape is the same at each node within each country ignores local differences. -- **Currently installed renewable capacities:** +- **Currently installed renewable capacities:** Information on existing wind, solar and small hydro, geothermal, marine and biomass power plants are excluded from the dataset because of a lack of data availability in many countries. Approximate distributions of wind and solar @@ -56,4 +56,3 @@ improving the approximations. Belarus, Ukraine, Turkey and Morocco have not been taken into account; islands which are not connected to the main European system, such as Malta, Crete and Cyprus, are also excluded from the model. - \ No newline at end of file diff --git a/doc/plotting.rst b/doc/plotting.rst index 641d3962..cd404226 100644 --- a/doc/plotting.rst +++ b/doc/plotting.rst @@ -173,4 +173,4 @@ Rule ``plot_network`` .. automodule:: plot_network .. image:: img/tech-colors.png - :align: center \ No newline at end of file + :align: center diff --git a/doc/preparation/base_network.rst b/doc/preparation/base_network.rst index 464b003d..1afc4e05 100644 --- a/doc/preparation/base_network.rst +++ b/doc/preparation/base_network.rst @@ -2,7 +2,7 @@ SPDX-FileCopyrightText: 2019-2020 The PyPSA-Eur Authors SPDX-License-Identifier: CC-BY-4.0 - + .. _base: Rule ``base_network`` @@ -51,4 +51,4 @@ Rule ``base_network`` | -.. automodule:: base_network \ No newline at end of file +.. automodule:: base_network diff --git a/doc/preparation/build_bus_regions.rst b/doc/preparation/build_bus_regions.rst index 6935832e..16aab725 100644 --- a/doc/preparation/build_bus_regions.rst +++ b/doc/preparation/build_bus_regions.rst @@ -48,4 +48,4 @@ Rule ``build_bus_regions`` | -.. automodule:: build_bus_regions \ No newline at end of file +.. automodule:: build_bus_regions diff --git a/doc/preparation/build_cutout.rst b/doc/preparation/build_cutout.rst index 5ad29a97..da2c04d1 100644 --- a/doc/preparation/build_cutout.rst +++ b/doc/preparation/build_cutout.rst @@ -39,4 +39,4 @@ Rule ``build_cutout`` | -.. automodule:: build_cutout \ No newline at end of file +.. automodule:: build_cutout diff --git a/doc/release_notes.rst b/doc/release_notes.rst index f5e3c377..1cae0807 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -23,7 +23,7 @@ Upcoming Release * Corrected setting of exogenous emission price (in config -> cost -> emission price). This was not weighted by the efficiency and effective emission of the generators. Fixed in `#171 `_. -* Don't remove capital costs from lines and links, when imposing a line volume limit (wildcard ``lv``) or a line cost limit (``lc``). Previously, these were removed to move the expansion in direction of the limit. +* Don't remove capital costs from lines and links, when imposing a line volume limit (wildcard ``lv``) or a line cost limit (``lc``). Previously, these were removed to move the expansion in direction of the limit. PyPSA-Eur 0.2.0 (8th June 2020) ================================== @@ -86,7 +86,7 @@ This is the first release of PyPSA-Eur, a model of the European power system at * Hydrogen pipelines (including cost assumptions) can now be added alongside clustered network connections in the rule :mod:`add_extra_components` . Set ``electricity: extendable_carriers: Link: [H2 pipeline]`` and ensure hydrogen storage is modelled as a ``Store``. This is a first simplified stage (`#108 `_). -* Logfiles for all rules of the ``snakemake`` workflow are now written in the folder ``log/`` (`#102 `_). +* Logfiles for all rules of the ``snakemake`` workflow are now written in the folder ``log/`` (`#102 `_). * The new function ``_helpers.mock_snakemake`` creates a ``snakemake`` object which mimics the actual ``snakemake`` object produced by workflow by parsing the ``Snakefile`` and setting all paths for inputs, outputs, and logs. This allows running all scripts within a (I)python terminal (or just by calling ``python ``) and thereby facilitates developing and debugging scripts significantly (`#107 `_). @@ -97,8 +97,8 @@ Release Process * Finalise release notes at ``doc/release_notes.rst``. -* Update ``environment.fixedversions.yaml`` via - ``conda env export -n pypsa-eur -f environment.fixedversions.yaml --no-builds`` +* Update ``envs/environment.fixed.yaml`` via + ``conda env export -n pypsa-eur -f envs/environment.fixed.yaml --no-builds`` from an up-to-date `pypsa-eur` environment. * Update version number in ``doc/conf.py`` and ``*config.*.yaml``. diff --git a/doc/simplification.rst b/doc/simplification.rst index 11d4867f..280b1da0 100644 --- a/doc/simplification.rst +++ b/doc/simplification.rst @@ -22,7 +22,7 @@ After simplification and clustering of the network, additional components may be .. toctree:: :caption: Overview - + simplification/simplify_network simplification/cluster_network simplification/add_extra_components diff --git a/doc/tutorial.rst b/doc/tutorial.rst index eca7dd05..2e96eb5c 100644 --- a/doc/tutorial.rst +++ b/doc/tutorial.rst @@ -1,6 +1,6 @@ .. SPDX-FileCopyrightText: 2019-2020 The PyPSA-Eur Authors - + SPDX-License-Identifier: CC-BY-4.0 .. _tutorial: @@ -48,7 +48,7 @@ The model can be adapted to only include selected countries (e.g. Germany) inste .. literalinclude:: ../config.tutorial.yaml :language: yaml :lines: 16 - + Likewise, the example's temporal scope can be restricted (e.g. to a single month). .. literalinclude:: ../config.tutorial.yaml @@ -132,7 +132,7 @@ orders ``snakemake`` to run the script ``solve_network`` that produces the solve Windows users should add the option ``--keep-target-files`` to the command or instead run ``snakemake -j 1 solve_all_elec_networks``. This triggers a workflow of multiple preceding jobs that depend on each rule's inputs and outputs: - + .. graphviz:: :align: center @@ -184,7 +184,7 @@ This triggers a workflow of multiple preceding jobs that depend on each rule's i 7 -> 11 5 -> 11 12 -> 11 - } + } | @@ -229,8 +229,8 @@ A job (here ``simplify_network``) will display its attributes and normally some INFO:__main__:Mapping all network lines onto a single 380kV layer INFO:__main__:Simplifying connected link components INFO:__main__:Removing stubs - INFO:__main__:Displacing offwind-ac generator(s) and adding connection costs to capital_costs: 20128 Eur/MW/a for `5718 offwind-ac` - INFO:__main__:Displacing offwind-dc generator(s) and adding connection costs to capital_costs: 14994 Eur/MW/a for `5718 offwind-dc`, 26939 Eur/MW/a for `5724 offwind-dc`, 29621 Eur/MW/a for `5725 offwind-dc` + INFO:__main__:Displacing offwind-ac generator(s) and adding connection costs to capital_costs: 20128 Eur/MW/a for `5718 offwind-ac` + INFO:__main__:Displacing offwind-dc generator(s) and adding connection costs to capital_costs: 14994 Eur/MW/a for `5718 offwind-dc`, 26939 Eur/MW/a for `5724 offwind-dc`, 29621 Eur/MW/a for `5725 offwind-dc` INFO:pypsa.io:Exported network elec_s.nc has lines, carriers, links, storage_units, loads, buses, generators [] Finished job 3. @@ -293,5 +293,5 @@ For inspiration, read the `examples section in the PyPSA documentation =0.17.1 - atlite=0.0.3 # Dependencies of the workflow itself - #- xlrd - scikit-learn - pycountry - seaborn - #- snakemake-minimal - memory_profiler - yaml - pytables @@ -25,28 +21,19 @@ dependencies: # Second order dependencies which should really be deps of atlite - xarray - #- netcdf4 - #- bottleneck - #- toolz - #- dask - progressbar2 - pyyaml>=5.1.0 - # Include ipython so that one does not inadvertently drop out of the conda - # environment by calling ipython - # - ipython - # GIS dependencies have to come all from conda-forge - - conda-forge::cartopy - - conda-forge::fiona - - conda-forge::proj - - conda-forge::pyshp - - conda-forge::geopandas - - conda-forge::rasterio - - conda-forge::shapely - - conda-forge::libgdal + - cartopy + - fiona + - proj + - pyshp + - geopandas + - rasterio + - shapely + - libgdal - # The FRESNA/KIT stuff is not packaged for conda yet - pip: - vresutils==0.3.1 - git+https://github.com/PyPSA/glaes.git#egg=glaes diff --git a/environment.fixedversions.yaml b/envs/environment.fixed.yaml similarity index 100% rename from environment.fixedversions.yaml rename to envs/environment.fixed.yaml diff --git a/environment.yaml b/envs/environment.yaml similarity index 100% rename from environment.yaml rename to envs/environment.yaml diff --git a/scripts/add_electricity.py b/scripts/add_electricity.py index 14667679..c11c27f5 100755 --- a/scripts/add_electricity.py +++ b/scripts/add_electricity.py @@ -373,7 +373,7 @@ def attach_hydro(n, costs, ppl): .where(lambda df: df<=1., other=1.))) if 'PHS' in carriers and not phs.empty: - # fill missing max hours to config value and + # fill missing max hours to config value and # assume no natural inflow due to lack of data phs = phs.replace({'max_hours': {0: c['PHS_max_hours']}}) n.madd('StorageUnit', phs.index, diff --git a/scripts/base_network.py b/scripts/base_network.py index 034eeb2f..d2ceccf1 100644 --- a/scripts/base_network.py +++ b/scripts/base_network.py @@ -312,18 +312,18 @@ def _set_electrical_parameters_links(links): links['p_min_pu'] = -p_max_pu links_p_nom = pd.read_csv(snakemake.input.links_p_nom) - - # filter links that are not in operation anymore + + # filter links that are not in operation anymore removed_b = links_p_nom.Remarks.str.contains('Shut down|Replaced', na=False) links_p_nom = links_p_nom[~removed_b] - - # find closest link for all links in links_p_nom + + # find closest link for all links in links_p_nom links_p_nom['j'] = _find_closest_links(links, links_p_nom) - - links_p_nom = links_p_nom.groupby(['j'],as_index=False).agg({'Power (MW)': 'sum'}) - + + links_p_nom = links_p_nom.groupby(['j'],as_index=False).agg({'Power (MW)': 'sum'}) + p_nom = links_p_nom.dropna(subset=["j"]).set_index("j")["Power (MW)"] - + # Don't update p_nom if it's already set p_nom_unset = p_nom.drop(links.index[links.p_nom.notnull()], errors='ignore') if "p_nom" in links else p_nom links.loc[p_nom_unset.index, "p_nom"] = p_nom_unset diff --git a/scripts/cluster_network.py b/scripts/cluster_network.py index 2c384926..fc054a10 100644 --- a/scripts/cluster_network.py +++ b/scripts/cluster_network.py @@ -115,7 +115,7 @@ Exemplary unsolved network clustered to 37 nodes: .. image:: ../img/elec_s_37.png :scale: 40 % - :align: center + :align: center """ diff --git a/scripts/make_summary.py b/scripts/make_summary.py index ac0119ab..ada3fa8a 100644 --- a/scripts/make_summary.py +++ b/scripts/make_summary.py @@ -307,7 +307,7 @@ def calculate_prices(n,label,prices): def calculate_weighted_prices(n,label,weighted_prices): - + logger.warning("Weighted prices don't include storage units as loads") weighted_prices = weighted_prices.reindex(pd.Index(["electricity","heat","space heat","urban heat","space urban heat","gas","H2"])) diff --git a/scripts/prepare_network.py b/scripts/prepare_network.py index bb7640be..f790db8f 100755 --- a/scripts/prepare_network.py +++ b/scripts/prepare_network.py @@ -131,7 +131,7 @@ def set_transmission_limit(n, ll_type, factor, Nyears=1): n.add('GlobalConstraint', f'l{ll_type}_limit', type=f'transmission_{con_type}_limit', sense='<=', constant=rhs, carrier_attribute='AC, DC') - + return n diff --git a/test/config.test1.yaml b/test/config.test1.yaml index 048b0ed3..5276adfb 100755 --- a/test/config.test1.yaml +++ b/test/config.test1.yaml @@ -186,4 +186,3 @@ solving: # solutiontype: 2 # non basic solution, ie no crossover # barrier_convergetol: 1.e-5 # feasopt_tolerance: 1.e-6 -