Crash course: a class in which a lot of information is taught in a short period of time [merriam-webster]
This is a Python elementary course for scientists (physicists or engineers and eventually students) who already know how to use Matlab.
Much of the content of this course is very inspired from the book Effective Computation in Physics from Anthony Scopatz and Kathryn D.Huff (which I really recommand!).
The goal of this course is to empower the audience for typical control room work: retrieving, manipulating and plotting data. The duration is expected to be one or two days at max.
This objective is certainly somewhat limited with respect to the potential of Python for science, and thus criticable. This choice is motivated mainly for time and utility purpose, as the audience will be faced to a crude problem during WEST restart: a reduced number of Matlab licences. They will be busy beside on other projects and won't have few days available for a complete (and proper) Python course.
Because this solution does not please me (but rather circunstance imposed), the first part of the course is dedicated to carefully explain what is Python and to show how broad its usage can be (i.e.: Python is not only a cheap Matlab-replacement).
Moreover, each course sections include a where could I find more information?, in order to insist on the fact that the online ressources concerning Python are significant (numerous but scattered!), which is a change in habits over Matlab for which the documentation is very well centralized.
The course topics slides are the following:
- Whats is Python?
- Why should I care?
- Python at IRFM
- Python terminal
- IPython
- Jupyter (ex-IPython notebook)
- Spyder
- Need help?
2.Répéter des actions 3.Introduction à NumPy, la librairie Python pour manipuler des tableaux numériques 4.Réaliser des graphiques, avec la librairie Matplotlib 5.Accéder aux données des bases de données Fusion, avec la TSlib (WEST) et MDSplus (JET) 6.Lire et écrire des fichiers, texte ou Matlab
- Python Files
- Comments
- Variables
- Dealing with Errors
- (Some) Python Operators
- Strings
- String Manipulations
- Blocks :
if/else
,for
,while
- Functions
- Exceptions
- List comprehension
- Numpy arrays
- Opérations et manipulation des arrays, slicing
- Ouvrir des fichiers de données (
.csv
,.mat
) - Où trouver de l’aide ?
- Simple plot
- Changer les options graphiques, depuis l'interface ou en commandes (
axes
,set_
, etc.) - Exporter une figure depuis l'interface ou en commandes
- Subplots
pcolor
ou assimilé- Figures en 3D (
projection=3D
) - Où trouver de l’aide ?
- Le module PyWed : tsbase. Scalaires, Signaux, Groupes de signaux
- Accessing data via MDSplus: Tore Supra, JET