Skip to content
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

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

sognetic
Copy link
Contributor

@sognetic sognetic commented Dec 1, 2022

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.

@FelixMetzner
Copy link
Owner

Hey Moritz, thanks for this addition to the template fitter and the nice example! I will try to go through your changes today.

self._is_finalized = True

def disable_numba_after_finalizing(self):
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants