Skip to content

Commit

Permalink
Fix CI and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Margherita-Capitani committed May 22, 2024
1 parent dd4509d commit e3116d4
Show file tree
Hide file tree
Showing 15 changed files with 44 additions and 18,481 deletions.
8 changes: 4 additions & 4 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ if config.get("disable_subworkflow", False):
return PYPSAEARTH_FOLDER + "/" + path


rule clean:
run:
shell("snakemake -j 1 solve_network --delete-all-output")
# rule clean:
# run:
# shell("snakemake -j 1 solve_network --delete-all-output")


rule ramp_build_demand_profile:
Expand Down Expand Up @@ -151,7 +151,7 @@ rule create_network:
"scripts/create_network.py"


if config["enable"].get("download_osm_data", True):
if config["enable"].get("download_osm_buildings", True):

rule download_osm_data:
output:
Expand Down
11 changes: 11 additions & 0 deletions config.distribution.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ logging:
# option to disable the subworkflow to ease the analyses
disable_subworkflow: false

enable:
# prepare_links_p_nom: false
retrieve_databundle: true
retrieve_cost_data: true
download_osm_data: true
download_osm_buildings: false
# If "build_cutout" : true # requires cds API key https://cds.climate.copernicus.eu/api-how-to
# More information https://atlite.readthedocs.io/en/latest/introduction.html#datasets
build_cutout: false
build_natura_raster: false # If True, then build_natura_raster can be run

scenario:
simpl: ['']
ll: ['copt']
Expand Down
17 changes: 9 additions & 8 deletions doc/customization_basic1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.. _customization_basic1:

#######################
2. Basic customization
Basic customization
#######################

The goal of this section is to show you how to make basic settings to customize the configuration file and consequently the execution of the tool.
Expand Down Expand Up @@ -78,11 +78,12 @@ For a successful model run, ensure the download of essential open-source data, i
.. code:: yaml
enable:
retrieve_databundle: true # Recommended 'true', for the first run. Otherwise data might be missing.
retrieve_databundle: true # Recommended 'true', for the first run. Otherwise data might be missing.
retrieve_cost_data: true # If true, it retrieves cost data from technology data and saves in resources/costs.csv, if false uses cost data in data/costs.csv
download_osm_data: true # If true, OpenStreetMap data will be downloaded for the above given countries
download_osm_data: true # If true, OpenStreetMap data will be downloaded for the selected countries
download_osm_buildings: true # If true, OpenStreetMap buildings will be downloaded for the selected countries
build_cutout: false
build_natura_raster: false # If True, than an exclusion raster will be build
build_natura_raster: false # If True, than an exclusion raster will be build
# If "build_cutout" : true, then environmental data is extracted according to `snapshots` date range and `countries`
Expand Down Expand Up @@ -120,10 +121,10 @@ This section specifies some parameters needed to generate demand profiles.
.. code:: yaml
load_options:
ssp: "ssp2-2.6"
weather_year: 2013
prediction_year: 2030
scale: 1
ssp: "ssp2-2.6"
weather_year: 2013
prediction_year: 2030
scale: 1
The arguments you see are relative:
- Weather_year: sets the year referenced by the weather data for calculating electricity demand profiles for the selected area.
Expand Down
14 changes: 7 additions & 7 deletions doc/short_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,35 +33,35 @@ Follow the procedure shown in the prompt, and when finished, restart the device.

You may probably need to install conda and create the pypsa-earth environment in the WSL execution environment as well.
To do this you need to first download the linux version from https://docs.anaconda.com/free/miniconda/.
Once the download is done open the wsl terminal ( you can just type wsl in the search panel),place yourself in the folder where the file you just downloaded is located, and run the following commands.
Once the download is done open the wsl terminal ( you can just type wsl in the search panel),place yourself in the folder where the file you just downloaded is located, and run the following commands.

.. code:: bash
\your-path (base) $ bash <conda-installer-name>-latest-Linux-x86_64.sh
\your-path (base) % bash <conda-installer-name>-latest-Linux-x86_64.sh
Where conda-installer-name will be one of "Miniconda3", "Anaconda", or "Miniforge3".
Follow the prompts on the installer screens. If you are unsure about any setting, accept the defaults. You can change them later.

To check if the installation was successful you can run the following command:

.. code:: bash
\your-path (base) $ conda list
\your-path (base) % conda list
If you see a list of packages after execution, everything should be okay.

To create the environment, simply open the wsl terminal, open to the pypsa-earth folder and run the following commands:

.. code:: bash
\pypsa-earth $ conda activate base
\pypsa-earth % conda activate base
After that:

.. code:: bash
\pypsa-earth $ conda install -c conda-forge mamba
\pypsa-earth % conda install -c conda-forge mamba
Finally:

.. code:: bash
\pypsa-earth $ mamba env create -f envs/environment.yaml
\pypsa-earth % mamba env create -f envs/environment.yaml
Now everything should be ready to run the tutorial.

Expand Down Expand Up @@ -120,4 +120,4 @@ To run the whole modeling workflow you just need the following command:
.. TODO Explain settings of the tutorial case
This command will trigger loading of the whole dataset needed to build the model for a tutorial case if both tutorial and retrieve_databundle flags are on.
The tutorial model run simulation will take a while (about 20..50 minutes).
The tutorial model run simulation will take a while (about 20..50 minutes).
Loading

0 comments on commit e3116d4

Please sign in to comment.