Cours 2022-2023

Scientific programming for chemists [SCHIM109]

  • 4 crédits
  • 12h
  • 2e quadrimestre
Langue d'enseignement: Anglais / English
Enseignant: Liégeois Vincent

Acquis d'apprentissage

Les étudiants seront inités à la programmation. Le langage de programmation choisi et le Python. Ils pouront comprendre et créer eux-même un programme Python pour lire différentes données provenant d'une mesure expérimentale (IR, cyclovoltamétrie, RMN, ...) ou d'un calcul de chimie quantique / mécanique moléculaire, de traiter si nécessaire ces données et de les resortir sous une nouvelle forme (tableau, graphique, ...).

Objectifs

Etre capable d'écrire un petit script Python afin de lire les données d'un fichier, les traiter et les resortir sous forme d'un tableau, d'un graphe, ...

Contenu

Les différents concepts lié à la programmation et plus particulièrement ceux lié au langage Python seront explicités dans ce cours:

 

1  Introduction

 

2  Introduction to Python language

2.1 Python interpreter

2.2 Python from a script

 

3  Numerical types and operators in Python

3.1 Numbers

3.2 Boolean

3.3 Comparison

 

4  Variables in Python

4.1 Define a variable

 

5  Reading and writing Data in Python

5.1 Reading data and conversion

5.2 Print out data

 

6  Strings in Python

6.1 String formatting

6.2 Operations on string

6.3 Comparison

6.4 Indexing and slicing string

 

7  Conditional Branching in Python

 

8  Loops in Python

 

9  Lists in Python

9.1 Operations on list

9.2 Comparison

9.3 Indexing and slicing list

 

10  Tuples in Python

10.1 Operations on tuple

10.2 Comparison

10.3 Indexing and slicing tuple

 

11  Function and methods with iterable

 

12  Lists are mutable

 

13  Dictionary in Python

13.1 Comparison

13.2 Dictionary indexing

13.3 Dictionary methods

 

14  Summary of Data Containers in Python

 

15  More on loops in Python

 

16  Read from and write to files in Python

16.1 Info on the files

16.2 Opening and closing files

16.3 Parsing files

 

17  Defining functions in Python

17.1 General aspects

17.2 Default argument values and keywords arguments

17.3 Copy of data when passing arguments

17.4 Lambda function

 

18  Modules in Python

 

19  Errors and Exceptions in Python

 

20  Module NumPy

20.1 Creation of array class

20.2 Attributes of an array

20.3 Indexing and slicing

20.4 Copy and Views

20.5 Arithmetic operations

20.6 Universal functions

20.7 Methods and functions

 

21  Module Scipy

 

22  Module Re for regular expressions

 

23  Defining a class in Python

23.1 General aspects

 

24  Other interesting modules

 

25  Miscellaneous

Table des matières

1  Introduction 

2  Introduction to Python language

3  Numerical types and operators in Python

4  Variables in Python

5  Reading and writing Data in Python

6  Strings in Python

7  Conditional Branching in Python

8  Loops in Python

9  Lists in Python

10  Tuples in Python

11  Function and methods with iterable

12  Lists are mutable

13  Dictionary in Python

14  Summary of Data Containers in Python

15  More on loops in Python

16  Read from and write to files in Python

17  Defining functions in Python

18  Modules in Python

19  Errors and Exceptions in Python

20  Module NumPy

21  Module Scipy

22  Module Re for regular expressions

23  Defining a class in Python

24  Other interesting modules

25  Miscellaneous

Description des exercices

Une liste d'exercices sera dévoilée au fur et à mesure de l'avancement du cours afin de consolider les différentes notions vues. Leurs solutions seront aussi fournies.

Disciplines

Sémantique des langages de programmation
Chimie générale

Méthodes d'enseignement

Les concepts du langage Python sont présentés et mis en application directement.

Les étudiants sont invités à prendre leur ordinateur au cours afin de mettre en application directement sur leur ordinateur les différentes notions.

Mode d'évaluation

Le mode d'évaluation consiste en un travail: écrire un programme Python en lien avec sa recherche durant le mémoire.

Ce programme aura pour but de lire différentes données, de les traiter et de les resortir sous forme d'un tableau, d'un graphique ou autre.

Les différents aspects recherchés dans ce programme seront explicités à la fin du cours.

Sources, références et supports éventuels

Le cours fera régulièrement référence à la documentation officielle de Python:

http://docs.python.org/3/

Langue d'enseignement

Anglais / English

Lieu de l'activité

NAMUR

Faculté organisatrice

Faculté des sciences
Rue de Bruxelles, 61
5000 NAMUR

Cycle

Etudes de 2ème cycle