-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
ENH: signal: Add Gustafsson's method as an option for the filtfilt function #3442
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
Conversation
This looks promising at first glance. Could you rebase it? I'll attempt to finally review it soon. |
Thanks, Ralf. I'm on the road this week, so I probably won't get back to this until next week at the earliest. |
Here's a rebased branch: https://github.com/rgommers/scipy/tree/gust. It contains one extra commit with fixes for reST issues and for the plot in the example not rendering. Could you take that over? |
Main issue with reST was the difference between single and double backticks. You were consistently using single backticks for code fragments (as well as for referring to functions/variables of course). |
Why a new file for the tests? There are already |
If |
In the example, maybe it would help to show the differences at the edges graphically with something like:
|
@rgommers: Thanks. I'll grab your branch in a couple days. I originally developed this as utility outside of scipy, which is why there is a separate test file. I can merge the tests into I think I've been using single backticks for years as a styling markup to separate Python text from English text, and used it with names, code snippets, etc.. @rkern recently posted this in a comment on the differential evolution pull request:
I think that is just a summary of how Sphinx handles backticks. But in fact, the examples in the "Parameters" section of the guide to documentation (https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt) show single ticks around the variable names. So if single ticks are OK for names that we don't expect to be cross-referenced by Sphinx, why not use single ticks for small code snippets such as On the use of I guess I'll start working on a pull request for the documentation guide. :) |
|
IIRC the parameters that get referenced with single backticks were supposed to be linked by numpydoc, therefore we don't treat them as code. Support in numpydoc wasn't completed I think. It's clear though that code snippets should be treated as code (so double backticks) - grey background looks better than italics anyway. Re |
I removed the 0.15.0 milestone. There are other enhancements and bugs with a higher priority than this to work on in the short term. It can wait until 0.16. |
@WarrenWeckesser I've updated https://github.com/rgommers/scipy/tree/gust with a rebase on current master and moved the release notes additions to 0.16.0. I think this PR needs only a few tweaks to complete (move tests and extend example like I suggested above). So maybe good to do that sometime soon? |
220ce8c
to
1c88c5b
Compare
Rebased with @rgommers's suggested changes. |
thanks to the high commit rate in the holiday season, needs another rebase.... |
|
||
... and then a random input signal to filter: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These three little dots are invalid syntax in this section; interpreted as a doctest line continuation. Removing them makes the plot render.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice plot by the way
This is good to go after the |
Should there be a versionadded somewhere? Say in the description of the choices to |
@ewmoore good point |
Yes, thanks for the reminder. I like keeping "version added" notes in the "Notes" section, but I've seen them added in the parameter descriptions, too. We don't have a standard for this. |
1c88c5b
to
43be1b0
Compare
I added a Notes section to the filtfilt docstring with a comment about adding Gustafsson's method in 0.16.0. |
ENH: signal: Add Gustafsson's method as an option for the filtfilt function
Looks good, in it goes. Thanks Warren! |
The paper on which the enhancement is based is available here: http://users.isy.liu.se/en/rt/fredrik/pub.html