-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Constraints with arbitrary callables #11
base: master
Are you sure you want to change the base?
Constraints with arbitrary callables #11
Conversation
…tput of ParameterHandler.get_parameter_names_for_type into ParameterHandler.get_parameters_by_name to get both name and value
Hey Moritz, thanks for this addition to the template fitter and the nice example! I will try to go through your changes today. |
…he model so the model can be pickled.
self._is_finalized = True | ||
|
||
def disable_numba_after_finalizing(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added this option to remove numba objects from the model and replace them with python variants. Everything still works but is just a bit slower if you do that. This allows the model to be pickled. Since the finalization of the constraints is the last step in the model setup this shouldn't cause any issues.
…by the pickling process.
…l. As an alternative, the constraint can be saved using the built-in marshal.
Hi, in this PR I have implemented Gaussian constraints between arbitrary yield parameters. The constraint is passed as a simple lambda function to the model builder which then numba-fies it to get some speedups. I have tested this quite a bit already and it works as expected. I have also added a simple example to demonstrate this capability. The PR already includes PR#10 (as otherwise the fit can take quite a while) so that one should be merged in first.