Repository navigation
Fix Kernel normalization - #13299
Fix Kernel normalization#13299
Conversation
71d7d86 to
f3988f5
Compare
|
Seems like a pretty serious bug. You sure this don't need to go all the way to LTS (5.0.x)? |
f3988f5 to
0819ccd
Compare
|
@pllim I re-milestoned to v5.0.5 |
keflavich
left a comment
There was a problem hiding this comment.
This definitely strikes me as an important fix. I suspect I never encountered it b/c I always make kernels with sizes much larger than the shape being encompassed; a truncated Gaussian is not a good approximation of a Gaussian.
I'm surprised there is only one test hit by this, though.
Does this mean we need to add more tests to this PR? 😸 |
|
@larrybradley , for future reference, we need one backport label per backport branch, so I readded the label you removed. FYI. |
0819ccd to
4a01648
Compare
|
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
|
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
|
Ops, @larrybradley , maybe v5.0.x backport is impossible after all. If you do not want to manually backport this to v5.0.x, please change the milestone back. I apologize for any inconvenience caused. |
|
Oh wait... v5.1.x auto backport failed too. How? |
|
Auto backport failed, so I have moved the milestone to v5.2 for now. If you ever get around to manual backports, please update the milestone. Thanks! |
|
Revisiting this for a minute: the new way guarantees that |
Description
The documentation for kernels states that the "generated kernel is normalized so that it integrates to 1", but this is not true for many of the kernels. For example:
This PR ensures that the returned kernels are normalized.
This PR also fixes the Kernel
truncationattribute. Currently, its value is set in the kernel initializer and thus is not updated after subsequent modifications to the kernel array (e.g.,kernel.normalize(mode='peak')changes the normalization, but the truncation is not updated). This PR returns the correct truncation value for the kernel array.This PR also includes some docstring improvements and some style fixes.
Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
Extra CIlabel.no-changelog-entry-neededlabel. If this is a manual backport, use theskip-changelog-checkslabel unless special changelog handling is necessary.astropy-botcheck might be missing; do not let the green checkmark fool you.backport-X.Y.xlabel(s) before merge.