human
I am working on the file "Notebooks/.ipynb_checkpoints/Unsaturated_Zone_Validation-checkpoint.ipynb".
The first task is:
Compare performance of Cythonized and Python Module
(Non-functioning 29/11/2015)
The computations in this script are computationally demanding and slows down the calibration of a non-linear time series model significantly. Therefore, the python script for the unsaturated zone was ported to the programming C-language using Cython. The Python-script to be cythonized (or in other words: compiled) is Unsat_Zone.pyx using the 
python script setup_unsat_zone.py. Compiling the script on Mac goes as follows:

Open Terminal
Move to the directory where the setup_unsat_zone.py and the Unsat_Zone.pyx files are located
In your terminal, type: 'python setup_unsat_zone.py build_ext --inplace' and press enter

The file will now be compiled to an Unsat_Zone.c and an Unsat_Zone.so file (Shared Object) that can be imported as usual in python. To show the speed-up that is gained by Cythonizing our script, some performance tests are done below. It is shown that the Cythonized file of the python script is approximatly 20-25 times faster than the python script, a significant time saving.
Can you write Python program for it?
assistant
#Here is Python program to compare performance of Cythonized and Python Module
.

#Create an variable to store the percolation functions as the wrapper does not work with function?
X1 = Unsat_Zone.perc
X2 = Unsat_Zone_Python.perc

# Write a wrapper for the Cython file and time it
def wrapper(X1, t, P, E, S_cap, K_sat, Beta, D, dt, solver=1):
    def wrapped():
        return X1(t, P, E, S_cap, K_sat, Beta, D, dt, solver=1)
    return wrapped

wrapped = wrapper(X1,t, P, E, S_cap, K_sat, Beta, D, dt, solver=1)

Cython = timeit.timeit(wrapped, number=1000)

print 'Time taken is', Cython

# Write a wrapper for the Python file and time it
def wrapper(X2, t, P, E, S_cap, K_sat, Beta, D, dt):
    def wrapped():
        return X2(t, P, E, S_cap, K_sat, Beta, D, dt)
    return wrapped

wrapped = wrapper(X2,t, P, E, S_cap, K_sat, Beta, D, dt)

Python = timeit.timeit(wrapped, number=1000)

print 'using Cython File is', (Python/Cython), 'times faster than python to solve the soil module'