silx
silx copied to clipboard
Fit user supplied functions
Yuriy requested to be able to fit exponential decays within silx view for XPCS experiments.
I believe it would be interesting to allow users to provide formulae as strings and evaluate them with numexpr. I noticed that numexpr is generally 2-10x faster than numpy and provide much more flexibility compared to the static functions implemented in C we use currently.
In 4 years of usage of numexpr (pyFAI depends on numexpr) I had no issue on any of the platforms and it is a very lightweight extension (150kb)
AFAIK, I think there is a kind of plugin stuff in the fit so users can provide their own implementation, though I completely agree the numexpr approach sounds nice.
I quickly check, you can load a python function from the FitWidget, but I have no idea how this works.