-
Notifications
You must be signed in to change notification settings - Fork 364
Fixes bug with filter.matchedfilter.optimized_match #5146
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
base: master
Are you sure you want to change the base?
Conversation
…zed_match >= match on known-tricky waveforms.
…zed_match_valid() and not clutter testing code
Thanks for the PR! You can see here why it's failing: you also need to change |
Thanks for the reminder, it should be updated now to reflect that. |
Seems it's failing the accuracy checks now by 1 decimal place each time. The scipy documentation states that the "Bounded" method uses the same underlying algorithm as "Brent" so I'm not sure why the resulting values would be different. |
Hm, interesting, I don't really know why that is the case. I'll note that the quantity failing the accuracy check is not It is possible to pass the Anyhow, the 4-decimal-figures accuracy requirement is arbitrary, and it's possible that the solver was previously achieving it "by chance". |
I don't exactly understand why the test is failing and don't really have the bandwidth to look into it at the moment. I think the way to go here could be to relax the requirement in the test suite to 3 decimal places and perhaps allow the user to pass |
This PR fixes a bug in filter.matchedfilter.optimized_match that causes the return of incorrect match values. The code originally did not respect the minimization bounds, causing local minima to be incorrectly returned in some rare instances.
Standard information about the request
This is a: bug fix
This change changes: scientific output
This change: has appropriate unit tests, follows style guidelines (See e.g. PEP8), has been proposed using the contribution guidelines
This change will: Fix a bug described in #5144
Motivation
Incorrect match values were encountered when calculating the match over different wave parameters. In these cases, the match discontinuously jumped as described in #5144.
Contents
optimized_match()
: Changes scipy minimize_scalar method to one that respects minimization boundstest_optimized_match_valid()
: Adds to existing automated tests by using a known-tricky waveform to ensureoptimized_match()
calculates the correct valueLinks to any issues or associated PRs
Fixes #5144
Testing performed
Extremely simple change, no testing required.
Additional notes