Repository navigation
convolve_fft - counterpart to convolve. NaN-friendly and mask-friendly, N-dimensional convolution - #182
convolve_fft - counterpart to convolve. NaN-friendly and mask-friendly, N-dimensional convolution#182keflavich wants to merge 48 commits into
Conversation
There was a problem hiding this comment.
Add types to all of the parameter docs.
There was a problem hiding this comment.
Also - no "-" and a blank line between each entry. This isn't to be overly pedantic, but numpydoc chokes on this.
There was a problem hiding this comment.
There hasn't been complete consensus, and the logging stuff isn't ready, so I think just using warnings.warn for now is the easiest/best and can always be updated later.
np.ma.is_masked now used
|
One general comment at first glance: run this through the pep8 tool for whitespace compliance, if you wouldn't mind. |
line that really just got ugly if you shortened it more, and I don't believe in having spaces around a**x - it's one term! well, perhaps I'll do that later...
syntax error. How do you split a for loop's arguments onto two lines? am I going to have to declare the iterators separately?
…n't build right on my machine...
|
I haven't read this in much detail yet, but two quick notes:
|
|
I'm not sure there will be any build problem on astropy, but the Which brings me to a question I should perhaps post somewhere else, Also, I started running test_convolve's tests with convolve_fft, and On Thu, Mar 22, 2012 at 3:31 PM, Erik Tollerud
Adam |
|
I'm in the middle of cleaning up the documentation and implementing a standard (mostly automatic) way of doing the API pages. I just pushed a change to master that now makes the documentation for nddata autogenerate appropriately, so if you |
There was a problem hiding this comment.
There's no "options" section in the documentation spec - you include these as parameters, but you say "optional" along with the type - e.g., the first one should be:
fft_pad: bool, optional
Default on. Zero-pad image to the nearest 2^n
|
I just tried building the docs after adding |
test_convolve_fft (needs to be added) but NOT consistent with convolve! (for good reason - there are some things I don't think should be implemented in fft... or maybe I'm just too lazy to think up how they can be done)
commit to merge, I guess?)
Conflicts: astropy/nddata/convolution/convolve_fft.py astropy/nddata/convolution/tests/test_convolve_fft.py
There was a problem hiding this comment.
Why are all these import statements commented out?
There was a problem hiding this comment.
A mistaken git commit -a; I was running tests within the tests/ directory and it was giving me import errors from convolve.py even though convolve_fft was the only thing being tested, I think because of the init.py. How do you run the individual tests? i.e., do you do something other than py.test test_convolve.py? (also, the comments have been undone in the latest commit)
|
Here are the latest test results: https://jenkins.shiningpanda.com/astropy/job/astropy-staging-astrofrog-debian-multiconfig/10/ On Windows, for some reason, the tests from the unmerged comology branch are being included and that is what is making things fail, but otherwise convolve_fft has the same issue with Numpy 1.4.1 as Mac and Linux. So precision-wise, it seems all the tests now pass. |
|
I just realized that If you just want to merge this in as-is, I'm happy to do some more work on this routine to try and implement my own suggestions. |
|
FWIW, all tests are now passing for me @astrofrog - I'm not having any problem merging this into master... if I just reset my staging branch to master and merge this one, it does so without complaint... @keflavich - I agree with @astrofrog that the choice of which FFT to use should be a single option/configuration item that can either be 'scipy','numpy', or 'fftw'. It's very confusing to have three conflicting boolean options... Note that you can specify enum-like configuration options by giving a list of strings as the 'default' value: |
|
Oh, and as for what to do about numpy vs. scipy, I'm fine with either way (merging only the scipy stuff now and working later on numpy, or merging this now and cleaning it up later). Is there any significant performance difference between the numpy and scipy implementations? |
|
@astrofrog I don't think numpy's fft is machine-dependent after all; it was just poorly implemented tests misleading me. So there's no reason not to include it. @astrofrog, @eteq: I agree completely, ffttype should be an option as you've described. I'll work that in shortly. I don't know if there's a performance difference between numpy and scipy... I'll change the fft speed tests to find out. |
|
@keflavich - when you implement for information about how to do this. If you have at the top of each test (I think you have to call pytest.skip rather than using the decorator since you only want to skip some of the parametrized tests). |
|
@astrofrog: Apparently numpy's FFT has some very small performance benefits in some cases. But I'd say my speed tests are rather inconclusive. |
|
I'm going to be picky, but can you use skip rather than not including the options? (which was my first instinct too). We need to know that being skipped due to a missing dependency with the automated testing systems. |
There was a problem hiding this comment.
I like "pretty strongly inconclusive" :)
|
And I agree with @astrofrog that it would be better to skip the tests that aren't relevant because of missing dependencies. But if this is going to be very difficult to do, it's also not absolutely necessary. Also, @astrofrog - I think maybe you're right that one of us should to try to manually merge this after a rebase instead of using the merge button, given the various merge/pull oddities. It may be more trouble than its worth, but whoever does the merging should at least try that first. |
|
@eteq Would it hurt if I tried to rebase from astropy:master at this point? Not sure that it will work, but I may as well try to learn if the exercise is harmless. |
|
@keflavich - well, I would definitely make a copy of the repository and try on that if you want to experiment. I wouldn't call it harmless ;-) @eteq - I'm happy to seeing to the merging, and I can try a rebase. I can also try and see if I can sort out the skips. |
|
It took a little while, but I managed to rebase. Just one question - I'm getting a one line difference with your code (because I had to resolve merges), and I can't remember if the right version is to have: or: which one is the correct one to use? (@eteq?) Shall I merge? (I'll open a pull request so I can check and merge it via GitHub) |
|
Ok, I opened a pull request (#253) with the rebased convolve_fft code, and have implemented the test skipping and also have made sure that if |
There was a problem hiding this comment.
I see that this is done here, but then the final cast in the return statement is never done (although it is in convolve) - is this intentional? Right now nothing seems to use array_dtype...
|
So shall we close this in favor of #253, then? |
Rebased convolve_fft from #182
|
@keflavich - #253 (the rebased version of this PR) has been merged, so I'm closing this one. Thanks for your contribution! |
Rebased convolve_fft from astropy#182
…er_version (which as far as I know wasn't used outside this module) to return a string instead of bytes.
Crash in adjust_compiler when usable compiler isn't found
Update constants maintainers
As stated in pull request 155, this is an N-dimensional FFT-based convolution code. I've done my best to ensure astropy compliance, but I probably missed some key components. Getting the unit tests in place and checking for agreement with convolve.py is probably essential before this request can be accepted.
However, it has some nice features: