You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Issues with NaN treatment and normalisation in convolve_fft #8114
normalize_kernel=someFunc() and nan_treatment='interpolate'
Note: I'm not yet sure if this is a bug because I'm not yet 100% sure about how the interpolation works.
The following exception should be raised regardless of the state of normalize_kernel, i.e. it should be pulled out and checked after the normalization block.
...
kernel_scale=kernel.sum()
ifnp.abs(kernel_scale) <normalization_zero_tol:
ifnan_treatment=='interpolate':
raiseValueError('Cannot interpolate NaNs with an unnormalizable kernel')
...
Furthermore, if normalize_kernel=someFunc() and nan_treatment='interpolate' then the exception should not be conditional on kernel.sum() but someFunc(kernel). Also, any normalization used for the interpolation should use someFunc.
I have assumed that it is and refactored it accordingly whilst working on this issue. If it turns out to really be a bug, I'll open an issue and link in the commit message, I'll remove otherwise.
changed the title [-]convolve_fft(nan_treatment='fill') doesn't normalize when passed normalization function[/-][+]Issues with NaN treatment and normalisation in convolve_fft[/+]on Nov 16, 2018
Activity
jamienoss commentedon Nov 15, 2018
normalize_kernel=someFunc() and nan_treatment='interpolate'
Note: I'm not yet sure if this is a bug because I'm not yet 100% sure about how the interpolation works.
The following exception should be raised regardless of the state of
normalize_kernel, i.e. it should be pulled out and checked after the normalization block.[src]
... kernel_scale = kernel.sum() if np.abs(kernel_scale) < normalization_zero_tol: if nan_treatment == 'interpolate': raise ValueError('Cannot interpolate NaNs with an unnormalizable kernel') ...Furthermore, if
normalize_kernel=someFunc()andnan_treatment='interpolate'then the exception should not be conditional onkernel.sum()butsomeFunc(kernel). Also, any normalization used for the interpolation should usesomeFunc.I have assumed that it is and refactored it accordingly whilst working on this issue. If it turns out to really be a bug, I'll open an issue and link in the commit message, I'll remove otherwise.
jamienoss commentedon Nov 15, 2018
Working branch: master...jamienoss:fft-ker-norm-issue
[-]convolve_fft(nan_treatment='fill') doesn't normalize when passed normalization function[/-][+]Issues with NaN treatment and normalisation in convolve_fft[/+]