Material in this repository is created for the purpose of teaching the concepts of object orientation using Python. It forms the material of a short course delivered at the University of Southampton's Doctoral Festival, and is also used in the NGCM Summer Academy Basics B Material.
The concepts of OOP are often covered lightly in undergraduate and basics courses, however large amounts of scientific Python packages are written in an object oriented manner. The skills learned in this workshop should therefore enable scientists to write (and more importantly, read) the packages they are using, and also serve as a starting platform for those wanting to learn more advanced OOP languages such as C++ or Java.
The following topics will be covered in the context of OOP in Python:
- Classes
- Python 2.X vs 3.X
- Initialization and init
- self
- Encapsulation
- Inheritance
- Magic operators
Prior knowledge of programming in Python is assumed, including e.g. lists, for loops, conditionals, numpy and matplotlib. See here for useful reference.
Teaching material is largely in Jupyter Notebook format, and can be followed by either:
- Cloning this repository with
git clone https://github.com/p-chambers/Python_OOP_Workshop.git
and viewing the 'index.ipynb' as a jupyter notebook with
jupyter notebook index.ipynb
You should also remove output with
Kernel > Restart > Clear all outputs and restart
- Viewing static material at nbviewer
Paul Chambers
Ioannis Begleris, Jonathon Waters