Scientific Programming

LV 707716

Fabien Maussion

How to use these slides

  • <space> : go to the next slide
  • <shift+space>: go back
  • <left right up down arrows>: navigate through the presentation structure
  • <esc>: toggle overview mode



These lecture notes and exercises are licensed under a Creative Commons Attribution 4.0 International (CC BY 4.0) license.

Feel free to use / adapt them, but don't sell them, and share them under the same licence.

About me

  • 2008: master of aerospace engineering in F-Toulouse
  • 2008-2014: PhD and post-doc in Climatology, TU Berlin
  • 2014-2015: post-doc at UIBK
  • 2015-2021: assistant prof. at UIBK
  • since Oct. 2021: associate prof. at UIBK
  • Research:
    • Regional climatology (Tibetan Plateau, Tropical Andes)
    • Climate controls on glacier mass-balance
    • Global glacier models
    • Open source and open science

Organisational

Lectures:

Practicals:

  • Tuesdays 08:15-10:00 (might end on 09:45, depending on if we take a break) - half in class, half online
  • Weekly homework (at home or in computer room). Groups to be formed until next week.
  • Each Monday (11:00-11:45), one group present their solution to the rest of the class (online)

Grading:

  • mid-term group project (the visclim package): 40%
  • oral examination at the end of the semester: 60%

Positive evaluation of each element mandatory to pass the class!

There will be bonus points for pointing me to typos / mistakes / broken links / incomprehensible or difficult passages in the lecture notes!

HOWTO #thiscourse

Lecture notes: http://fabienmaussion.info/scientific_programming

This course is of the #doityourself kind. Get your questions ready for the upcoming week:

more questions $\rightarrow$ more explanations!

In preparation for the lectures I might ask you to read some chapter(s) of the lecture notes. On Tuesdays, we recap the content together.

Contact: via email (available on OLAT) or OLAT forum

Attendance: your choice

Agenda: we meet weekly - if classes are canceled I will let you know and update the OLAT online meetings

Your partitipation: highly encouraged. Interrupt any time, ask questions!

HOWTO #onlinelectures

Asking questions is either easier or harder, depending on your character. How to ask questions in 2021?

  • in the BigBlueButton chat
  • by raising your hand and wait me to call you (don't forget to unmute!)
  • for a more personal / specific question during the lectures, wait for your in-presence time or ask for a breakout room

Homework

I form the groups based on questionnaire until next week.

Each week, one group volunteers (or is selected randomly) to present their solution for next week.

Programming is hard: the semester begins NOW, and we will gain speed quickly (so that we can slow down towards the end).

If you have not programmed much before, working along the lectures is the only way to keep the pace. My task is to try to make it fun enough for you to actually want to do that. But it will cost you time, I can guarantee you that.

Scientific programming?

Scientific programming targets to solve scientific problems with the help of computers.

$\rightarrow$ Programming as a tool to do science

Why should we learn programming?

  • Data $\rightarrow$ "Big Data"
  • Science is rarely done with a "piece of paper and a pen" anymore
  • Programs = automated = reproducible (almost)
  • Good programming skills are a strong asset for your career and to better understand our digital world

Adapted from xkcd

Why Python?

  • general purpose programming language
  • well suited to learn programming
  • Free and open-source

But: this lecture is not a course about the python syntax. We are using python as a tool to learn general programming concepts, not the other way around.

Your turn:

What would YOU like to learn from this course?

My objective:

Help you to master your future p̶r̶o̶g̶r̶a̶m̶m̶i̶n̶g̶ googling tasks as efficiently and correctly as possible.

Tentative program

  • Introduction to Linux
  • General programming concepts, differences between compiled and interpreted languages
  • Revisiting and formalizing basic programming structures and learn more advanced ones
  • Semantics: precise vocabulary in order to ask questions “the right way”
  • Numerics: floating point numbers, N-dimensional arrays
  • Software structure: packages, modules, functions, scripts
  • Object oriented programming: fundamentals, usage, and basic design patterns
  • Code testing with pytest
  • Short overview of major scientific python packages
  • Real world applications!

Program for today

  • questions?
  • questionnaires

Program for tomorrow

  • a very short introduction to Linux (please read the introduction of section 1 until tomorrow)
  • installing Python