Wednesday, October 8, 2014

Optimization, calling Fortran

2014 Python Lecture. Part IX


In this latest lecture of this series, I'll present some tools to optimize your code by CPU and memory profiling. It also contains some tips on using the python debugger.
The notebook is there:
https://github.com/Morisset/Python-lectures-Notebooks/blob/master/Notebooks/Optimization.ipynb


I also give some indications on how one can call Fortran routines from within python, to accelerate the execution of some part the the code.
Here are small examples: https://github.com/Morisset/Python-lectures-Notebooks/blob/master/Notebooks/Calling%20Fortran.ipynb

Wednesday, October 1, 2014

Object Oriented Programing. Objects, classes, etc...

2014 Python Lecture. Part VIII

In this lecture I'll introduce the basic (and some not that basic) concepts of Object Oriented Programing. I'll use an example to show how to:
  • use functions to do simple jobs
  • but use objects when things start to be more complex
  • define classes, objects, attributes, methods, etc...
  • use *args and **kwargs in functions calls
  • use the class variables
  • add functionalities to classes and objects
  • use class inheritance
  • use attributes properties
The notebook is here:
https://github.com/Morisset/Python-lectures-Notebooks/blob/master/Notebooks/OOP.ipynb