65094 - ADVANCED PROGRAMMING

Academic Year 2026/2027

  • Teaching Mode: In-person learning (entirely or partially)
  • Campus: Bologna
  • Corso: Second cycle degree programme (LM) in Science of Climate (cod. 6697)

Learning outcomes

This course will be devoted to complete the preparation by giving the student all elements of programming with modern languages: e.g. python, object-oriented programming.

Course contents

The course introduces the Python programming language as a tool for scientific computing, data analysis, and basic numerical modelling.

The first part of the course provides an overview of the fundamental elements of the language:

  • variables and data types;

  • operators;

  • control structures;

  • functions;

  • lists, tuples, and dictionaries;

  • file handling;

  • organization of simple scripts and notebooks.

The second part is devoted to the use of Python for scientific applications, with particular attention to the management, analysis, and visualization of physical datasets. Students will learn how to use essential libraries such as:

  • NumPy, for numerical computing and efficient handling of multidimensional arrays;

  • SciPy, for numerical methods, interpolation, integration, and the solution of scientific problems;

  • Pandas, for reading, organizing, and analysing tabular datasets;

  • Matplotlib, for graphical visualization of data and results, and for producing simple scientific animations;

  • CartoPy, for representing georeferenced data and producing scientific maps;

  • Scikit-Learn, for a first introduction to data analysis and machine learning methods.

The course will also introduce tools for the creation of animations and dynamic visual content, useful for representing the time evolution of a phenomenon, the behaviour of a numerical model, or the geometrical meaning of a physical problem. These tools will be used as support for scientific communication and for improving the understanding of simulated processes.

Basic resources based on artificial intelligence and generative artificial intelligence will also be introduced as tools to support code development. In particular, practical examples will be discussed on how AI can be used to:

  • interpret errors and debugging messages;

  • improve the structure of a script;

  • generate draft code to be critically checked;

  • document functions and workflows;

  • compare alternative solutions to a computational problem.

The objective is not to replace the student’s reasoning, but to provide tools that make the development process more efficient, while maintaining control over the physical, numerical, and logical correctness of the produced code.

Part of the course will be devoted to the construction of reproducible working environments, with an introduction to tools such as Conda environments and Python virtual environments. Students will learn how to create separate working profiles, install specific libraries, and manage different dependencies according to the scientific problem being addressed.

Particular attention will be given to the ability to read, organize, and analyse data from different formats, including text files, CSV files, tables, binary files, and formats commonly used in scientific applications. The goal is to develop a flexible workflow that can be adapted to heterogeneous datasets and different computational problems.

The acquired skills will be applied to simple but representative case studies, including:

  • numerical solution of basic physical equations, such as D’Alembert’s equation, the heat equation, and the transport equation;

  • extraction of the main statistical properties from physical datasets;

  • comparison between observed data, numerical models, and theoretical predictions;

  • visualization and graphical representation of datasets and their properties;

  • cartographic representation of georeferenced data;

  • production of simple animations and videos to describe the evolution of physical or numerical phenomena;

  • construction of reproducible and documented computational workflows.

Finally, the course will introduce basic notions of shell commands, useful for organizing files, automating repetitive procedures, and connecting different scripts within a more efficient workflow.

Readings/Bibliography

- Notes of the teacher.

- How to Think Like a Computer Scientist: Learning with Python, di Allen Downey, Jeff Elkner e Chris Meyers. Gree Tea Press (available at: https://media.readthedocs.org/pdf/howtothink/latest/howtothink.pdf )

- Python in Earth Science, a brief introduction by Sujan Koirala and Jake Nelson (Max Planck Institute for Biogeochemistry, Jena, Germany) (http://hydro.iis.u-tokyo.ac.jp/~sujan/docs/PythonInEarthScience.pdf )

Teaching methods

Classes will be delivered through frontal lectures, with practical examples proposed by the lecturer and discussed during the course.

Computer-based exercises will also be organized and assigned, with the aim of allowing students to progressively become familiar with the code, the scientific libraries, and the methodologies introduced during the lectures.

In addition to individual exercises, practical collective sessions will be carried out starting from the second half of the course, focusing on the guided solution of exercises and small computational problems.

Assessment methods

The assessment will be an oral interview focusing on the topics covered in the course.

During the interview, students will be asked to discuss a code they developed throughout the course, applying the methodologies and skills they have acquired. Additionally, they will be presented with practical problems and situations related to the course's themes, and they will be expected to provide solutions and insights based on their knowledge and understanding.

Office hours

See the website of Enrico Baglione