Python Short Course
Lecture 5: Extending Python

Extending Python

Profiling Python

Example, Electrostatic Calculation

Box of Charge (Random Module)

calcESEnergy function

Python distance function

Results

C Module for Distance (Speedtest.c)

C module, cont.

Compiling and Using Speedtest

Comparison of Python and C distance functions

Results

Converting Rest of the function to C

Converting NumPy Arrays to C

Converting NumPy Arrays, cont.

cCalcESEnergy Wrapper

Final Results

SWIG

References