Skip to content
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

TST: improve signal.bsplines test coverage #9035

Merged
merged 10 commits into from
Jul 18, 2018
Merged

Conversation

vyasr
Copy link
Contributor

@vyasr vyasr commented Jul 14, 2018

This pull request is based on pull request #6846 and resolves the outstanding issues there.

@@ -133,6 +133,8 @@ def gauss_spline(x, n):
"""Gaussian approximation to B-spline basis function of order n.
"""
signsq = (n + 1) / 12.0
if signsq == 0:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can only happen when n = -1 and doesn't make sense anyways. And the error to raise is wrong input argument not zero by division anyways.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point, I wrote this to conform to the tests, but you are correct that that makes more sense. I'll fix this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still not quite right. Rather than doing input validation for n, I'd just remove these two lines again and instead just document that n needs to be an integer >= 0.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also put in a reference to https://pdfs.semanticscholar.org/360c/77005e0ac26fa0aecbea214f37609bb52414.pdf, that contains the math. It has sqrt(n/12) rather than sqrt((n+1)/12)), but I don't want to read the paper in enough detail to sort that out. Just throwing the link into the docstring under References would be helpful though.

data_array_complex = 0.1*data_array_complex
result_array_complex = array(
[[0.40882362, 0.41021151, 0.40886708, 0.40905103],
[0.40829477, 0.4102123, 0.40966097, 0.40939871],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PEP8 : One extra whitespace after second entry

@pv pv changed the title New bsplines New signal.bspline tests Jul 15, 2018
@pv
Copy link
Member

pv commented Jul 15, 2018

Quick comment for future PRs: please write a descriptive title --- there aren't actually "new bsplines" in this PR.

@pv pv changed the title New signal.bspline tests TST: new signal.bspline tests Jul 15, 2018
@vyasr
Copy link
Contributor Author

vyasr commented Jul 15, 2018

Will do, sorry about that. I focused on the description and forgot the title. I've addressed the comments.

@rgommers rgommers changed the title TST: new signal.bspline tests TST: improve signal.bsplines test coverage Jul 15, 2018
@rgommers rgommers added scipy.signal maintenance Items related to regular maintenance tasks labels Jul 15, 2018
@rgommers
Copy link
Member

The nose related test failures at https://travis-ci.org/scipy/scipy/jobs/404142927 are due to using the wrong assert_raises here. Can be fixed with from pytest import raises as assert_raises

@vyasr
Copy link
Contributor Author

vyasr commented Jul 16, 2018

Tests have been fixed, thanks for the tip.

@pv
Copy link
Member

pv commented Jul 16, 2018 via email

@pv
Copy link
Member

pv commented Jul 16, 2018 via email

@vyasr
Copy link
Contributor Author

vyasr commented Jul 16, 2018

I'm not sure how the changes I made could relate to these errors. They seem to come from a completely unrelated module, and those tests passed before my most recent commit.

@rgommers
Copy link
Member

I'm not sure how the changes I made could relate to these errors. They seem to come from a completely unrelated module, and those tests passed before my most recent commit.

Indeed unrelated, can be ignored for this PR.

There's something weird going on, those tests regularly keep failing. All LAPACK related it looks like. Furthermore we also need to tackle the ridiculously long pytest output - 2500 lines for 7 test failures is unhelpful (to put it mildly).

@rgommers rgommers added this to the 1.2.0 milestone Jul 17, 2018
@rgommers
Copy link
Member

LGTM aside for the if signsq == 0 related comment.

@rgommers
Copy link
Member

LGTM now. Test failure is unrelated. Merging. Thanks @vyasr!

@rgommers rgommers merged commit 2054951 into scipy:master Jul 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Items related to regular maintenance tasks scipy.signal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants