outline.md 1.99 KB
Newer Older
1
# Python lesson outline
Frank Hellmann's avatar
Frank Hellmann committed
2

3
## Targets for the course
Frank Hellmann's avatar
Frank Hellmann committed
4

5
6
7
8
- Structure your code (functions and modules, everything else is out of scope)
- Think about possible errors
- document, document, document
- use version control
Frank Hellmann's avatar
Frank Hellmann committed
9

10
## Assumptions
Frank Hellmann's avatar
Frank Hellmann committed
11

12
90 minute blocks
Frank Hellmann's avatar
Frank Hellmann committed
13

14
15
16
- 1 block shell
- 1 block git
- 4-5 blocks of python
Frank Hellmann's avatar
Frank Hellmann committed
17

18
## DAY 1
Frank Hellmann's avatar
Frank Hellmann committed
19

20
### Session AM1 Intro/Lightning talks
Frank Hellmann's avatar
Frank Hellmann committed
21

22
### Session AM2 Shell
Frank Hellmann's avatar
Frank Hellmann committed
23

24
### Session PM1 GIT
Frank Hellmann's avatar
Frank Hellmann committed
25

26
### Session PM2 Python Intro (basic overview)
Frank Hellmann's avatar
Frank Hellmann committed
27
28
29
30
31
32
33
34
- python+anaconda+conda+jupyter+history
- operators, data structures (tuples, lists, dicts, nparrays, panda.df, etc)
- object types (string, number, boolean, complex, etc)
- provided functions + methods, atrributes
- control flows: loops + conditions
- numpy
- read file, simple plot (or in session PM2)

35
36
37
## DAY 2 AM

### Session AM1 Python (structuring code, defensive programming, using prepared ts files)
Frank Hellmann's avatar
Frank Hellmann committed
38
39
40
41
42
43
44
45
46
- write function + module
- put under version control
- simple test (assert)
- documentation
- write script + call from bash
- traceback, errors

not covered: closures, argpars, numba

47
### Session AM2: Time series, functions, plotting
Frank Hellmann's avatar
Frank Hellmann committed
48
49
50
51
52
53
54
55
56
57
58
- reading + understanding documentation of functions

Global temperature average development 1750-2010
http://berkeleyearth.lbl.gov/auto/Global/Raw_TAVG_complete.txt

- download file (optional: call shell with wget from python/R)
- read, process
- moving average
- plot with uncertainty band
- write function (exercise!)

59
## DAY 2 PM
Frank Hellmann's avatar
Frank Hellmann committed
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76

### Session PM1: higher dimensional (spatial) data, advanced plotting + cartography, application of aquired knowledge
gridded data Europe: 

- read netcdf file
- plot map of one time slice 
- now compare plot with given cuteplot function by Joachim
- extract time series Potsdam
- compare with global average from Berkeley

### Session PM2: Git in practice (optional if we ran out of time)
- use git: final commit
- create github/gitlab account + create repos + add remote
- git push + inspect online
- github/gitlab release
- outro, feedback