diff --git a/data-science-for-esm/02-workshop-numpy.ipynb b/data-science-for-esm/02-workshop-numpy.ipynb
index 667bc7ab..89588d8a 100644
--- a/data-science-for-esm/02-workshop-numpy.ipynb
+++ b/data-science-for-esm/02-workshop-numpy.ipynb
@@ -39,7 +39,7 @@
"Documentation for this package is available at https://numpy.org/doc/stable/index.html.\n",
":::\n",
"\n",
- "\n",
+ "\n",
"\n",
"**Matplotlib**: _Matplotlib is a comprehensive library for creating static and animated visualizations in Python._\n",
"\n",
diff --git a/data-science-for-esm/06-workshop-atlite.ipynb b/data-science-for-esm/06-workshop-atlite.ipynb
index acdb28de..e610018c 100644
--- a/data-science-for-esm/06-workshop-atlite.ipynb
+++ b/data-science-for-esm/06-workshop-atlite.ipynb
@@ -574,7 +574,7 @@
"outputs": [],
"source": [
"shape = countries.to_crs(excluder.crs).loc[[\"PT\"]].geometry\n",
- "shape[0]"
+ "shape.iloc[0]"
]
},
{
@@ -691,7 +691,7 @@
"metadata": {},
"outputs": [],
"source": [
- "country_area = shape.geometry.area[0]"
+ "country_area = shape.geometry.area.iloc[0]"
]
},
{
diff --git a/data-science-for-esm/09-workshop-pypsa.ipynb b/data-science-for-esm/09-workshop-pypsa.ipynb
index 24c84021..79ed9c23 100644
--- a/data-science-for-esm/09-workshop-pypsa.ipynb
+++ b/data-science-for-esm/09-workshop-pypsa.ipynb
@@ -1309,7 +1309,7 @@
"metadata": {},
"outputs": [],
"source": [
- "n.generators_t.p_max_pu.groupby(n.generators.carrier, axis=1).mean().plot(ylabel=\"p.u.\")"
+ "n.generators_t.p_max_pu.T.groupby(n.generators.carrier).mean().T.plot(ylabel=\"p.u.\")"
]
},
{
diff --git a/data-science-for-esm/10-workshop-pypsa-cem.ipynb b/data-science-for-esm/10-workshop-pypsa-cem.ipynb
index 9a4211d6..04c3078e 100644
--- a/data-science-for-esm/10-workshop-pypsa-cem.ipynb
+++ b/data-science-for-esm/10-workshop-pypsa-cem.ipynb
@@ -304,7 +304,7 @@
"outputs": [],
"source": [
"resolution = 4\n",
- "ts = ts.resample(f\"{resolution}H\").first()"
+ "ts = ts.resample(f\"{resolution}h\").first()"
]
},
{
@@ -719,9 +719,7 @@
" p_by_carrier = n.generators_t.p.groupby(n.generators.carrier, axis=1).sum().div(1e3)\n",
"\n",
" if not n.storage_units.empty:\n",
- " sto = (\n",
- " n.storage_units_t.p.groupby(n.storage_units.carrier, axis=1).sum().div(1e3)\n",
- " )\n",
+ " sto = n.storage_units_t.p.T.groupby(n.storage_units.carrier).sum().T.div(1e3)\n",
" p_by_carrier = pd.concat([p_by_carrier, sto], axis=1)\n",
"\n",
" fig, ax = plt.subplots(figsize=(6, 3))\n",
diff --git a/data-science-for-esm/intro.md b/data-science-for-esm/intro.md
index 286f582b..38b8ac16 100644
--- a/data-science-for-esm/intro.md
+++ b/data-science-for-esm/intro.md
@@ -2,7 +2,7 @@
Welcome to the website accompanying the course [Data Science for Energy System Modelling](https://moseskonto.tu-berlin.de/moses/modultransfersystem/bolognamodule/beschreibung/anzeigen.html;jsessionid=DQfixqzzpn1XIg5N1GG7S9um4EDykZn99AHmH6Fj.moseskonto?number=31027&version=1&sprache=2). This course is being developed by [Dr. Fabian Neumann](https://neumann.fyi) and offered as part of the curriculum of the [Department of Digital Transformation of Energy Systems at TU Berlin](https://www.tu.berlin/ensys).
-On this website you will find practical introductions to many Python packages that are useful for dealing with energy data and building energy system models. Course materials other than practical introductions to Python packages for students at TU Berlin are provided on [ISIS](https://isis.tu-berlin.de/course/view.php?id=35495).
+On this website you will find practical introductions to many Python packages that are useful for dealing with energy data and building energy system models. Course materials other than practical introductions to Python packages for students at TU Berlin are provided on [ISIS](https://isis.tu-berlin.de/course/view.php?id=38042).
The course covers tutorials and examples for getting started with Python, `numpy`, `matplotlib`, `pandas`, `geopandas`, `cartopy`, `rasterio`, `pysheds`, `atlite`, `networkx`, `linopy`, `pypsa`, `plotly`, `hvplot`, and `streamlit`. Topics covered include:
@@ -19,11 +19,7 @@ The course covers tutorials and examples for getting started with Python, `numpy
- sector-coupling
- interactive visualisation and dashboarding
-## Python
-
-:::{note}
-This section is adapted from another course called [Earth and Environmental Data Science: Python Environments](https://earth-env-data-science.github.io/lectures/environment/python_environments.html)
-:::
+## Installing the package manager `conda`
Python and nearly all of the software packages in the scientific python
ecosystem are [open-source](https://opensource.org/). Coordinating the
@@ -31,9 +27,7 @@ compatibility between these different packages and their multiple versions used
to be a nightmare! Fortunately, the problem is solved by using a Python
_distribution_ and/or _package manager_. You should use a package manager!
-## Installing the package manager `conda`
-
-### Anaconda Python distribution
+### Anaconda
The easiest way to set up a full-stack scientific Python deployment is to use a
Python distribution. This is an installation of Python with a set of curated
@@ -49,14 +43,14 @@ For **Windows users**, you should first install Anaconda (described above) or mi
From the Anaconda Prompt, you should be able to run `conda` and other shell commands.
-### Lightweight alternative: `miniconda`
+### Lightweight `miniconda`
If you don't want to download a large file like the Anaconda Python Distribution (ca. 800 MB), there is a
lightweight alternative installation called `miniconda`.
- [Miniconda Installation](https://docs.conda.io/en/latest/miniconda.html)
-### Using Python without a local installation
+### Google Colab
You can even start the course without a local Python installation using online services like [Google Colab (colab.google)](https://colab.google) which provide an online Python version
in a [Jupyter Notebook](jupyter.org/) environment.
@@ -116,9 +110,9 @@ configuration can be installed by executing
For extensive documentation on using environments, please see
[the conda documentation](https://conda.io/docs/using/envs.html).
-## Python environment for this course: `esm-2024`
+## Environment for this course: `esm-2024`
-## With `conda`
+### ... with `conda`
The latest environment specification for this course can be downloaded under the following link as a [`YAML`-file](https://en.wikipedia.org/wiki/YAML):
@@ -142,7 +136,7 @@ The environment has to be activated whenever you open a new terminal,
jupyter lab
-### With `pip`
+### ... with `pip`
If you want to use `pip` for managing your environment, download
@@ -159,7 +153,7 @@ This should allow you to start a new Jupyter window:
jupyter lab
-## JupyterLab and Jupyter Notebooks
+## JupyterLab
[JupyterLab](https://jupyterlab.readthedocs.io) will be our primary method for
interacting with the computer. JupyterLab contains a complete environment for
@@ -175,7 +169,7 @@ here, we point you to their docs. The following pages are particularly relevant:
- [Terminals](https://jupyterlab.readthedocs.io/en/stable/user/terminal.html)
- [Managing Kernels and Terminals](https://jupyterlab.readthedocs.io/en/stable/user/running.html)
-## Markdown Syntax
+## Markdown
Throughout the course, you might want to write rich text documents using Markdown.
This is also very common in Jupyter Notebooks.
diff --git a/environment.yaml b/environment.yaml
index 30cc900e..bba2bda6 100644
--- a/environment.yaml
+++ b/environment.yaml
@@ -20,6 +20,8 @@ dependencies:
- powerplantmatching>=0.5.12
- rasterio>=1.3.2
- pysheds
+- pyarrow
+- numba
# interactive python
- ipython
@@ -50,6 +52,7 @@ dependencies:
# publishing
- jupyter-book
- ghp-import
+- pre-commit
- pip:
- highspy
diff --git a/requirements.txt b/requirements.txt
index 2cdd5601..c8ccc9d7 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -36,3 +36,6 @@ highspy>=1.5.3
folium
mapclassify
numexpr<2.8.5 # until https://github.com/pandas-dev/pandas/issues/54449 resolved
+pyarrow
+numba
+pre-commit