July brought with it the third annual ICCS summer school on software engineering and programming for climate modelling. The full programme of talks is now on YouTube including my talks/training on:

  1. Typing Python with mypy

Typing Python with mypy Many compiled languages include a ‘type checker’ as part of their compilation process which applies automated checks to source code to rule out potential runtime errors due to mismatches in the format of data (‘type errors’). The Python language does not include such a check: its types are ‘dynamic’, with type errors occurring only if encountered at runtime. Python however supports type annotations (since Python 3.0) which allows a programmer to insert optional type information into code which external tools can then use to type check a program. This session will teach how to use Python types alongside the mypy tool for ruling out program bugs and better documenting source code. We will also talk about some fundamental concepts in typing and program verification.

  1. What can abstract mathematics tell us about programming climate models

What can abstract mathematics tell us about programming climate models?

Category theory is a subfield of mathematics that seeks to expose common underlying structure in other areas of mathematics. It has since also became a foundational technique for understanding logic and programming, with its use both in semantics of formal languages and as a tool for structuring programs. Many concepts in computer programming can be explained from a category theoretic perspective, yielding new insights about how to reason about programs and generalise their definitions. In this session, I will give an overview of a few key ideas that have applications to numerical programming tasks familiar in earth systems modelling. This will provide some fresh perspectives about how to structure and reason about programs both for correctness and efficiency.

  1. And a contributed a bit to a training/tutorial session on Introduction to Computational Science in Julia .

I was particularly happy to deliver the second talk here which was a lot of fun, using ideas from category theory to think about how we specify the behaviour of key patterns in numerical modelling and also uses the ideas to motivate optimisations. This was all done in Python, including generating tests from categorical laws. The material is online.