CythonΒΆ

For optimal performance, several parts of MISCore are compiled using Cython, which results in quicker code execution. The Pure Python mode is used. These .py files are compiled to .c files which are then further compiled into python-readable .so or .pyd files. When installing MISCore package, these compiled files are included.

All extensions are defined in setup.py. Use the following command to build and compile all extensions to .c and .so or .pyd files. Note that this requires Cython and a C-compiler to be installed.

python setup.py build_ext --inplace

Currently the following parts of MISCore are optimized using Cython:

For more information and options for compilation, you may study the Cython documentation, also containing information on how to best optimize for performance. Note that optimization without first profiling your current code may yield disappointing results, since it can be very difficult to predict which parts of your code are causing computation bottlenecks.