Skip to content

Commit

Permalink
setup intro page
Browse files Browse the repository at this point in the history
  • Loading branch information
Irieo committed Jan 24, 2025
1 parent 2dd4824 commit 183d18a
Showing 1 changed file with 25 additions and 60 deletions.
85 changes: 25 additions & 60 deletions workshop-pypsa-transnetbw/intro.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
# Welcome to the PyPSA workshop at TransnetBW
# Welcome to the PyPSA workshop

## Using Python for Energy System Modelling
Hosted by TransnetBW, January 2025

### Acknowledgements

We acknowledge support from the German Federal Ministry for Economic Affairs and Climate Action (BMWK) under Grant No. 03EI4083A (RESILIENT) jointly with the [CETPartnership](https://cetpartnership.eu/) through the Joint Call 2022.

More about the RESILIENT project: https://resilient-project.github.io/


## Google Colab

You can work with the workshop materials without a local Python installation using online service [Google Colab](https://colab.google) which provides an online Python environment. This requires a Google account.

Open any jupyter notebook and click on the rocket 🚀 in the top right corner. It will launch a Colab workspace in your browser and automatically installs [the python environment for this course](
https://github.com/Irieo/workshop-pypsa-transnetbw/blob/main/requirements.txt).

If that does not work download the `.ipynb` file and import it in [Google Colab](https://colab.research.google.com/)


## Setting up your Python environment locally

### Anaconda

Expand All @@ -20,71 +39,19 @@ desktop application. Instructions for this are given on the [Anaconda
Website](https://docs.anaconda.com/anaconda/user-guide/getting-started/#write-a-python-program-using-anaconda-prompt-or-terminal).
From the Anaconda Prompt, you should be able to run `conda`.

### Lightweight `miniconda`

If you don't want the full Anaconda Python Distribution, there is a lightweight
alternative installation called
[`miniconda`](https://docs.conda.io/en/latest/miniconda.html).

### Google Colab

You can even do the course without a local Python installation using online
services like [Google Colab (colab.google)](https://colab.google) which provide
an online Python environment. This requires a Google account.

## Managing environments with `conda`

Python coupled with a package manager provides a way to make isolated,
reproducible _environments_ where you have control over all installed packages
and configurations.

First, check that you have access to `conda` in your _terminal_ or _Anaconda Prompt_ application by typing:

conda --version

To create a conda environment, you execute the following command:

conda create --name my_environment python=3.11 numpy
Here is [a great short article](https://towardsdatascience.com/conda-essential-concepts-and-tricks-e478ed53b5b) that contains all the essential concepts and tips about using `conda`.

To use this environment, simply _activate_ it by executing:
### Tip: use lightweight `miniconda`

conda activate my_environment
Do yourself a favor --- use a lightweight installation called
[`miniconda`](https://docs.conda.io/en/latest/miniconda.html). It is very likely that you don't want the full Anaconda Python Distribution.

You should now see the string `(my_environment)` prepended to your prompt.
Now, any execution of Python will use the packages installed in your _environment_ "my_environment".

To install additional packages into your environment:

conda install <package-name>

Some packages are community-maintained (e.g. `conda-forge`) and require you to specify a different "channel", i.e. a different source:

conda install -c conda-forge <package-name>

You can deactivate your environment by typing:

conda deactivate

To see all the environments on your system:

conda env list

To get a complete summary of all the packages installed in your environment, run

conda list

If you want to permanently remove an environment and delete all the data
associated with it:

conda env remove --name my_environment --all

A conda environment can also be defined through an `environment.yaml` file. With that file, a new environment with the exact
configuration can be installed by executing

conda env create -f my_environment.yml

For extensive documentation on using environments, please see
[the conda documentation](https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/environments.html).

## Environment for this course: `workshop`

Expand All @@ -105,8 +72,6 @@ Activate this environment

conda activate workshop

This environment should be sufficient for all of your work in this course.

The environment has to be activated whenever you open a new terminal,
*before* starting a new Jupyter window with

Expand Down

0 comments on commit 183d18a

Please sign in to comment.