-
Notifications
You must be signed in to change notification settings - Fork 30
Conversation
Hi @andreas01060 and @HDembinski, I just bumped into this old PR. Any hope to get it sorted and merged soon? It's a nice addition. |
Hi @eduardo-rodrigues, I couldn't get it past the tests, so in the end I just cloned my probfit version and added it to my python packages (and it works). I didn't really understand why the tests failed, that's why I abandoned on the PR. When I have some time, I will try again though. |
Tests fail because ProbFit does not work with iMinuit > 1.2, I believe. I think we probably should pin the iMinuit version, then try to fix this (and then unpin the version). |
Thanks for your reply @andreas01060. Seems @henryiii has found the source of the problem and PR #89 aims at sorting it out. Fingers crossed ... |
Hi @marinang, you said on the PyHEP Gitter channel that "I am using probfit, also with python 3.7". Maybe you have useful input to this discussion? |
Hi @eduardo-rodrigues. I have a fork of profit and I modified some stuffs, like in #84, and some additions for future PR (johnsonSU pdf, add constraints to likelihood), but nothing crucial or I don't recall. As you said I have python 3.7 and iminuit 1.3.2. |
Hi @andreas01060, can you rebase this PR to resolve the conflicts, now that #91 |
Hi @eduardo-rodrigues , I resolved the conflicts, but the check is still failing.. |
The plotting test are failing, because you replaced all the plotting test with gaussian with double crystal ball right, in test_plotting.py? I think you let those tests as they were with the gaussian. |
Hi @marinang, yes true , but now it's back to how how it first was: I deleted those changes and put back in the original ones. |
@andreas01060 did you already make the changes? I don’t see a new commit. |
That's right, you seem to have replaced tests whereas you should be adding new tests for the double CB. I believe the replacement of tests was in since the first commit. |
Hi sorry for the delay, Is it okay now? I was confused, I thought the various plotting tests should also be applied on any new functions implemented.. |
Whoever merges this should make sure it's a squash and merge... |
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.
Looks pretty good to me. Adds a bit of unneeded whitespace, but otherwise seems to be nicely done.
Just curious though, can't you just add two crystal ball functions? I believe this even happens at the compiled code level due to Cython's cpdef. >>> dg = probfit.AddPdf(probfit.crystalball, probfit.crystalball, prefix=['f_','g_'], skip_prefix=['mean', 'sigma'])
>>> probfit.describe(dg)
['x', 'f_alpha', 'f_n', 'mean', 'sigma', 'g_alpha', 'g_n']
>>> dg(10, 1, 2, 10, 2, 1, 1) / 2
1.0
>>> dg(11, 1, 2, 10, 2, 1, 1) / 2
0.8824969025845955 I'd rather have a small set of core elements that can be composed, I think. |
I think this might be just the case from the particular example you give. If you take x such that it's in the tails, I don't think it will work. Also when the alpha and n differ for the two tails, this complicates it more. |
With all the examples you've provided, I get identical results to floating point precision. Can you add an example with different values in the two tails to the test? |
Henry's suggestion for extra tests is a good one. On the doc side I would suggest that you add this is a double CB of common mean and core resolution (OK, obvious from the signature, but still good to add for clarity). Otherwise this seems ready to go. Nice. |
Thumbs up from me. |
Just pinging you @HDembinski, for when you have the time, as this seems ready to go. |
The original plots were symmetric double crystal balls not showing the full extend of the double crystal ball.
@andreas01060 Thank you for contributing this! |
Thank you all for helping me out! (This was my first time using github, so sometimes it was a bit cryptic for me. ) |
Hi, I need to fit a double crystal ball for a project. Hence, this pull request. I think I have added all necessary
lines of codes to accommodate this.
Thank you