question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

convolve_fft defaults and documentation

See original GitHub issue

I’ve just been trying to run some code that I haven’t used for a year or two, when I had an older version of astropy installed (I’m now running 2.0.10). It was giving very strange results and I eventually managed to track this done to convolve_fft. I found that if I change my convolve_fft(image,psf) to convolve_fft(image,psf,nan_treatment='fill',normalize_kernel=False) I could then reproduce the results I was getting previously. I take it the defaults were changed at some point, presumably related to #926. Can I suggest that it would make debugging old code much easier if changes that break backwards compatibility, such as this, are noted in the documentation? I’m thinking of something along the lines of http://docs.astropy.org/en/v2.0.x/io/fits/api/files.html#writeto where it clearly states ‘Changed in version 1.3: overwrite replaces the deprecated clobber argument.’

The examples also need to be completely rewritten as they were clearly written using the old defaults. For instance, the second one convolve_fft([1, np.nan, 3], [1, 1, 1]) now gives the result array([0.5, 2. , 1.5]).

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
astromarkcommented, Oct 12, 2022

As the person who originally reported this issue, I should probably chime in here. It’s great that the doctests were fixed. Still, I wonder if there could still be some improvements to the documentation. For instance, it doesn’t really make sense for there to be examples with keywords that are the defaults anyway since these all show the same result e.g.:

convolve_fft([1, np.nan, 3], [1, 1, 1])
convolve_fft([1, np.nan, 3], [1, 1, 1], nan_treatment='interpolate')
convolve_fft([1, np.nan, 3], [1, 1, 1], nan_treatment='interpolate', normalize_kernel=True)

all give the same result and so are redundant. Examples with the previous defaults of nan_treatment=‘fill’ and normalize_kernel=False would be more useful.

1reaction
aaryapatilcommented, Oct 6, 2022

Ah, I’ll find another one then. There don’t seem to be many first contributor issues…

Read more comments on GitHub >

github_iconTop Results From Across the Web

filter2: 2D Convolution Filter in EBImage - Rdrr.io
The default "circular" behaviour at boundaries is to wrap the image around borders. In the "replicate" mode pixels ... EBImage documentation built on...
Read more >
SciPy.signal.py - gists · GitHub
Compilation of convolution and correlation functions for Python. SciPy has functions built-in:.
Read more >
Convolution Filters - vigra - GitHub Pages
Detailed Description. The functions in this group implement separable convolutions (e.g. smoothing and sharpening, Gaussian derivatives) and related filters ...
Read more >
Package 'signal'
R topics documented: ... convolve, fft, ifft, fftfilt, poly ... By default, an order 8 Chebyshev type I filter is used or a...
Read more >
ZernikeWavefrontSensorOptics — HCIPy 0.3.1 documentation
The grid on which the input wavefront is defined. phase_stepscalar. The phase of the phase dot of the zernike wavefront sensor. The default...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found