Skip to content

Commit 1ff2ef0

Browse files
Merge branch 'UPPMAX:main' into main
2 parents 924a7de + 79f9dee commit 1ff2ef0

9 files changed

Lines changed: 38 additions & 40 deletions

File tree

.wordlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,3 +1127,4 @@ pola
11271127
initializations
11281128
numprocesses
11291129
undersubscribed
1130+
StackOverflow

docs/day2/basic_batch_slurm.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.. _basic-slurm:
12
Basic batch and Slurm
23
=====================
34

docs/day2/install_packages.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.. _install-packages:
2-
Install packages
2+
Installing packages
33
================
44

55
.. objectives::

docs/day2/interactive.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _interactive:
2+
13
Interactive work on the compute nodes
24
=====================================
35

docs/day2/ondemand-desktop.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _ides-ondemand:
2+
13
Desktop On Demand
24
=================
35

docs/day2/use_isolated_environments.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _use-isolated-environments:
22

3-
Use isolated environments
4-
=========================
3+
Using isolated environments
4+
===========================
55

66
.. admonition:: Learning objectives
77

docs/day3/matplotlib/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Tetralith |?`module load Python/3.10.4-env-hpc1-gcc-2022a-eb`
7979

8080
:::
8181

82-
## Exercises
82+
- Create a script with the following code:
8383

8484
```python
8585
import matplotlib as mpl
@@ -92,9 +92,11 @@ plt.plot(x, np.cos(x))
9292

9393
# plt.show()
9494
plt.figure().savefig('my_figure.png') # Unsure if this works
95-
9695
```
9796

97+
- Run the script
98+
- Check that the figure is created
99+
98100
## External links
99101

100102
- [Python Data Science Handbook](https://jakevdp.github.io/PythonDataScienceHandbook/)

docs/day3/seaborn/README.md

Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -86,44 +86,34 @@ Tetralith |`module load buildtool-easybuild/4.8.0-hpce082752a2 GCC/13.2.0 Pytho
8686

8787
## Exercises
8888

89-
```python
90-
import matplotlib.pyplot as plt
91-
plt.style.use('classic')
92-
%matplotlib inline
93-
import numpy as np
94-
import seaborn as pd
95-
96-
# Create some data
97-
rng = np.random.RandomState(0)
98-
x = np.linspace(0, 10, 500)
99-
y = np.cumsum(rng.randn(500, 6), 0)
100-
101-
# Plot the data with Matplotlib defaults
102-
plt.plot(x, y)
103-
plt.legend('ABCDEF', ncol=2, loc='upper left');
104-
89+
Run the following code, that is copied from
90+
[the `seaborn` page 'An introduction to `seaborn`'](https://seaborn.pydata.org/tutorial/introduction.html)
91+
and combined with
92+
[this StackOverflow post to save it to a file](https://stackoverflow.com/a/39482402/3364162)
10593

94+
```python
95+
# Import seaborn
10696
import seaborn as sns
107-
sns.set()
10897

98+
# Apply the default theme
99+
sns.set_theme()
109100

110-
# same plotting code as above!
111-
plt.plot(x, y)
112-
plt.legend('ABCDEF', ncol=2, loc='upper left');
113-
```
114-
115-
```python
116-
data = np.random.multivariate_normal([0, 0], [[5, 2], [2, 2]], size=2000)
117-
data = pd.DataFrame(data, columns=['x', 'y'])
101+
# Load an example dataset
102+
tips = sns.load_dataset("tips")
118103

119-
# Two overlaid density plots
120-
for col in 'xy':
121-
sns.kdeplot(data[col], shade=True)
122-
123-
# Density plot
124-
sns.kdeplot(data);
104+
# Create a visualization and save it to file
105+
my_plot = sns.relplot(
106+
data = tips,
107+
x = "total_bill", y = "tip", col = "time",
108+
hue = "smoker", style = "smoker", size = "size",
109+
)
110+
fig = my_plot.get_figure()
111+
fig.savefig("out.png")
125112
```
126113

114+
- Run the script
115+
- Check that the figure is created
116+
127117
## External links
128118

129119
- [Python Data Science Handbook](https://jakevdp.github.io/PythonDataScienceHandbook/)

docs/schedule.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,23 +76,23 @@ Day 2: Packages, environments and using compute nodes
7676
+------------+---------------------------------+--------------------------------+
7777
|11:10-11:30 | :ref:`use-isolated-environments`| Björn |
7878
+------------+---------------------------------+--------------------------------+
79-
|11:30-12:00 | Basic batch/Slurm | Birgitte |
79+
|11:30-12:00 | :ref:`basic-slurm` | Birgitte |
8080
+------------+---------------------------------+--------------------------------+
8181
|12:00-13:00 | Break |. |
8282
+------------+---------------------------------+--------------------------------+
83-
|13:00-13:20 | Interactive (terminal/onDemand) | Birgitte |
83+
|13:00-13:20 | :ref:`interactive` | Birgitte |
8484
+------------+---------------------------------+--------------------------------+
8585
|13:20-13:50 | :ref:`ides-cmd` | Bjorn |
8686
+------------+---------------------------------+--------------------------------+
8787
|13:50-14:05 | Break |. |
8888
+------------+---------------------------------+--------------------------------+
89-
|14:05-14:40 | Starting IDEs from onDemand | Rebecca |
89+
|14:05-14:40 | :ref:`ides-ondemand` | Birgitte |
9090
+------------+---------------------------------+--------------------------------+
9191
|14:40-14:55 | :ref:`use_ides` | Jayant |
9292
+------------+---------------------------------+--------------------------------+
9393
|14:55-15:10 | Break |. |
9494
+------------+---------------------------------+--------------------------------+
95-
|15:10-15:45 | Using IDEs | Jayant |
95+
|15:10-15:45 | :ref:`use_ides` | Jayant |
9696
+------------+---------------------------------+--------------------------------+
9797
|15:45-16:00 | :ref:`evaluation_day_2` | Björn |
9898
+------------+---------------------------------+--------------------------------+

0 commit comments

Comments
 (0)