From 10829d56bba27d7f030da6d0e013ac836adb16b5 Mon Sep 17 00:00:00 2001 From: Siddharth Krishna Date: Fri, 12 Jan 2024 11:57:35 +0200 Subject: [PATCH] Fix some typos and formatting in the documentation (#957) * Fix some typos in tutorial.rst * Fix typos in how_to_docs.rst * Fix typos in data_workflow.rst * Fix formatting in structure.rst * Fix typo in solve_network.py * Fix spelling --- doc/data_workflow.rst | 6 +++--- doc/how_to_docs.rst | 6 +++--- doc/structure.rst | 17 +++++------------ doc/tutorial.rst | 12 +++++------- scripts/solve_network.py | 2 +- 5 files changed, 17 insertions(+), 26 deletions(-) diff --git a/doc/data_workflow.rst b/doc/data_workflow.rst index 26e197d79..a84f859b8 100644 --- a/doc/data_workflow.rst +++ b/doc/data_workflow.rst @@ -10,7 +10,7 @@ Data used by the model To properly model any region of the Earth, PyPSA-Earth downloads and fetches different data that are explained in detail in this section. Here we'll look into architecture of the data workflow while practical hand-ons are given in the :ref:`Tutorial ` section. -Two major parts of the energy modeling workflow are preparing of power grid layout and climate inputs. Apart of that, PyPSA-Earth is relying of a number of environmental, economical and technological datasets. +Two major parts of the energy modeling workflow are preparing of power grid layout and climate inputs. Apart from that, PyPSA-Earth is relying of a number of environmental, economical and technological datasets. 1. Grid topology data =================================== @@ -83,9 +83,9 @@ Technological 4. Pre-calculated datasets =================================== -There are some datasets which were prepared to ensure smooth run of the model. However, they may (and in some cases) must be replaced by custom ones. +There are some datasets which were prepared to ensure smooth run of the model. However, they may (and, in some cases, must) be replaced by custom ones. -* **natura.tiff** contains geo-spatial data on location of protected and reserved areas and may be used as mask the exclude such areas when calculating the renewable potential by `build_renewable_profiles` rule. The `natura` flag in the configuration file allows to switch-on this option while presence of the `natura.tiff` in the `resources` folder is needed to run the model. +* **natura.tiff** contains geo-spatial data on location of protected and reserved areas and may be used as a mask to exclude such areas when calculating the renewable potential by `build_renewable_profiles` rule. The `natura` flag in the configuration file allows to switch-on this option while presence of the `natura.tiff` in the `resources` folder is needed to run the model. Currently the pre-build file is calculated for Africa, global `natura.tiff` raster is under development. diff --git a/doc/how_to_docs.rst b/doc/how_to_docs.rst index c8f2fd5db..c1d10c8c3 100644 --- a/doc/how_to_docs.rst +++ b/doc/how_to_docs.rst @@ -10,12 +10,12 @@ How to docs? We add the code documentation along the way. You might think that cost a lot of time and is not efficient - but that's not really true anymore! Documenting with great tools makes life much easier for YOU and YOUR COLLABORATORS and speed up the overall process. -Using `Readthedocs `_ and its add -on `sphinx.ext.autodoc `_ we document in our +Using `Readthedocs `_ and its add-on +`sphinx.ext.autodoc `_ we document in our code scripts which then will automatically generate the documentation you might see here. Thank you Eric Holscher & team for your wonderful *Readthedocs* open source project. -You can find an emotional speak by Eric `here `_. +You can find an emotional speech by Eric `here `_. Structure and Syntax example ----------------------------- diff --git a/doc/structure.rst b/doc/structure.rst index e0138afd0..4427aa980 100644 --- a/doc/structure.rst +++ b/doc/structure.rst @@ -10,18 +10,11 @@ The structure The main workflow structure built within PyPSA-Earth is as follows: -**1. Download and filter data**: first raw input data shall be downloaded. PyPSA-Earth provides automated - procedures to successfully download all the needed data from scratch, such as OpenStreetMap data, - specific potential of renewable sources, population, GDP, etc. Moreover, raw data shall be filtered to remove non-valid data and normalize the data - gathered from multiple sources. - -**2. Populate data**: filtered data are then processed by means of specific methods to derive the - main input data of the optimization methods, such as renewable energy production, demand, etc. - Just to give an example, when the option is enabled, the renewable energy source potential - is transformed into time series for desired locations by using the tool `Atlite `_. - -**3. Create network model**: once the necessary model inputs are drawn, then the network model is - developed using `PyPSA `_ +**1. Download and filter data**: first raw input data shall be downloaded. PyPSA-Earth provides automated procedures to successfully download all the needed data from scratch, such as OpenStreetMap data, specific potential of renewable sources, population, GDP, etc. Moreover, raw data shall be filtered to remove non-valid data and normalize the data gathered from multiple sources. + +**2. Populate data**: filtered data are then processed by means of specific methods to derive the main input data of the optimization methods, such as renewable energy production, demand, etc. Just to give an example, when the option is enabled, the renewable energy source potential is transformed into time series for desired locations by using the tool `Atlite `_. + +**3. Create network model**: once the necessary model inputs are drawn, then the network model is developed using `PyPSA `_ **4. Solve network**: execute the optimization for the desired problem, e.g. dispatch, planning, etc. diff --git a/doc/tutorial.rst b/doc/tutorial.rst index 3ee79aaaf..e24be9501 100644 --- a/doc/tutorial.rst +++ b/doc/tutorial.rst @@ -128,7 +128,7 @@ The snakemake included in the conda environment pypsa-earth can be used to execu Starting with essential usability features, the implemented PyPSA-Earth `Snakemake procedure `_ that allows to flexibly execute the entire workflow with various options without writing a single line of python code. For instance, you can model the world energy system or any subset of countries only using the required data. Wildcards, which are special generic keys that can assume multiple values depending on the configuration options, help to execute large workflows with parameter sweeps and various options. -You can execute some parts of the workflow in case you are interested in some specific it's parts. +You can execute some parts of the workflow in case you are interested in some specific parts. E.g. power grid topology may be extracted and cleaned with the following command which refers to the script name: .. code:: bash @@ -160,7 +160,7 @@ Apart of that, it's worth to check that there is a proper match between the temp It could be helpful to keep in mind the following points: -1. the cutout name should be the same across the whole configuration file (there are several entries, one under under `atlite` and some under each of the `renewable` parameters); +1. the cutout name should be the same across the whole configuration file (there are several entries, one under `atlite` and some under each of the `renewable` parameters); 2. the countries of interest defined with `countries` list in the `config.yaml` should be covered by the cutout area; @@ -190,7 +190,7 @@ These steps are required to use CDS API which allows an automatic file download The `build_cutout` flag should be set `true` to generate the cutout. After the cutout is ready, it's recommended to set `build_cutout` to `false` to avoid overwriting the existing cutout by accident. The `snapshots` values set when generating the cutout, will determine the temporal parameters of the cutout. Accessible years which can be used to build a cutout depend on ERA5 data availability. `ERA5 page `_ explains that the data is available from 1950 and updated continuously with about 3 month delay while the data on 1950-1978 should be treated as preliminary as that is a rather recent development. -After the first run, if you don't change country and don't need to increase a considered time span wider than the one you created the cutout with, you may set to false both `retrieve_databundle` and `build_cutout`. +After the first run, if you don't change country and don't need to increase a considered time span wider than the one you created the cutout with, you may set both `retrieve_databundle` and `build_cutout` to false. Spatial extent ^^^^^^^^^^^^^^ @@ -202,7 +202,7 @@ There is also option to set the cutout extent specifying `x` and `y` values dire Temporal extent ^^^^^^^^^^^^^^^ -If you create the cutout for a certain year (let's say 2013) and want to run scenarios for a subset of this year, you don't need to rerun the `build_cutout` as the cutout still contains all the hours of 2013. The workflow will automatically subset the cutout archive to extract data for the particular timeframe of interest. If you instead you want to run the 2014 scenario, then rerun `build_cutout` is needed. +If you create the cutout for a certain year (let's say 2013) and want to run scenarios for a subset of this year, you don't need to rerun the `build_cutout` as the cutout still contains all the hours of 2013. The workflow will automatically subset the cutout archive to extract data for the particular timeframe of interest. If you instead you want to run the 2014 scenario, then it is needed to rerun `build_cutout`. In case you need model a number of years, a convenient approach may be to create the cutout for the whole period under interest (e.g. 2013-2015) so that you don't need to build any additional cutouts. Note, however, that the disk requirements increase in this case. @@ -227,7 +227,7 @@ To validate the data obtained with PyPSA-Earth, we recommend to go through the p Simulation procedure -------------------- -It may be recommended to check the following quantities the validation: +It may be recommended to check the following quantities in the validation: #. inputs used by the model: @@ -256,8 +256,6 @@ Data availability for many parts of the world is still quite limited. Usually th * `BP `_ Statistical Review of World Energy; -* International Energy Agency `IEA `_; - * `Ember `_ Data Explorer. diff --git a/scripts/solve_network.py b/scripts/solve_network.py index de68b6284..f9593e93a 100755 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -49,7 +49,7 @@ ----------- Total annual system costs are minimised with PyPSA. The full formulation of the -linear optimal power flow (plus investment planning +linear optimal power flow (plus investment planning) is provided in the `documentation of PyPSA `_. The optimization is based on the ``pyomo=False`` setting in the :func:`network.lopf` and :func:`pypsa.linopf.ilopf` function.