Once you have a model defined and correct, there is no reason to recompile it. Thus, it would be nice if the Cython compiled libraries are somehow cached. Opty can already write the files to disk, so we need some kind of check to know if the compiled library is the same as the one generated prior. We could do something like hash the sympy object that corresponds to the inputs to ufuncify_matrix and then store that string in the generated cython file. Once that is stored you could check for a match and skip the call to ufuncify_matrix.
Once you have a model defined and correct, there is no reason to recompile it. Thus, it would be nice if the Cython compiled libraries are somehow cached. Opty can already write the files to disk, so we need some kind of check to know if the compiled library is the same as the one generated prior. We could do something like hash the sympy object that corresponds to the inputs to ufuncify_matrix and then store that string in the generated cython file. Once that is stored you could check for a match and skip the call to ufuncify_matrix.
I've seen this feature in Bjorn's https://github.com/bjodah/pycompilation.