wholecell.utils.build_ode
Utilities to compile functions, esp. from Sympy-constructed Matrix math.
- wholecell.utils.build_ode._matrix_to_array(matrix)[source]
Convert a sympy Matrix expression to a function body.
- Parameters:
matrix (sympy.Matrix)
- Return type:
- wholecell.utils.build_ode.build_functions(arguments, expression)[source]
Build a function from its arguments and source code expression. (This USED TO return a second function that had Numba set up to JIT-compile the code on demand, but the compiled code time savings don’t pay back the compilation time in Python 3.9+.)
This still returns two functions so the JIT compiler could be restored someday.
- wholecell.utils.build_ode.derivatives(matrix)[source]
Build an optimized derivatives ODE function(y, t).
- wholecell.utils.build_ode.derivatives_jacobian(jacobian_matrix)[source]
Build an optimized derivatives ODE Jacobian function(y, t).