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

API: Soft deprecate signal.* windows #7900

Merged
merged 2 commits into from Sep 23, 2017
Merged

Conversation

larsoner
Copy link
Member

Ready for review/merge from my end. Would be nice to have for 1.0.0.

Closes #7898.

@larsoner larsoner added the backport-candidate This fix should be ported by a maintainer to previous SciPy versions. label Sep 19, 2017
@larsoner larsoner added this to the 1.0.0 milestone Sep 19, 2017
@larsoner larsoner modified the milestones: 1.0.0, 1.1.0 Sep 19, 2017
@larsoner larsoner mentioned this pull request Sep 19, 2017
9 tasks
@larsoner
Copy link
Member Author

@larsoner
Copy link
Member Author

The CI failure is about the deprecated functions not being in the refguide. The way it checks for deprecation is to actually try using the function to see if a DeprecationWarning is emitted. So I think I'll either need to change the refguide check to have some other thing it looks for, or we'll want to actually emit the warning. @rgommers thoughts?

@rgommers
Copy link
Member

Add it to one of the skiplist's here: https://github.com/scipy/scipy/blob/master/tools/refguide_check.py#L118

@larsoner
Copy link
Member Author

larsoner commented Sep 20, 2017 via email

@larsoner
Copy link
Member Author

larsoner commented Sep 20, 2017 via email

@larsoner
Copy link
Member Author

Nope, adding them to REFGUIDE_ALL_SKIPLIST or REFGUIDE_AUTOSUMMARY_SKIPLIST didn't help. So we are doing something new, which makes me think we might want to emit the warning. Then I think it will work without having to change the testing mechanics.

@larsoner
Copy link
Member Author

Travis is happy (other than OSX delays) so this is ready for review/merge from my end

@rgommers
Copy link
Member

Definitely don't want that deprecation for 1.0, and preferably not at all - way too much code is affected, for a minor benefit. I'll be happy to look at modifying the checker this weekend if needed.

@rgommers rgommers added the maintenance Items related to regular maintenance tasks label Sep 21, 2017
@rgommers
Copy link
Member

Could you also add windows to doc/API.rst.txt?

@larsoner
Copy link
Member Author

I'll modify the checker today and remove the DeprecationWarning (at least it was good for finding the other cases I needed to fix!). I was just wary of doing so because it seemed to indicate a break from standard practice, given there was no standard way to deprecate in the manner suggested. But I agree it could break a lot of code for minimal benefit so probably isn't worth it.

@larsoner
Copy link
Member Author

I didn't need to modify the testing framework, I was just using the skip-list RegEx incorrectly :(

I've now added scipy.signal.windows as a proper submodule, hopefully in all of the correct places by a bit of trial and error. CircleCI (docs) and Travis (except for delayed OSX and unrelated errors reported in #7907) are happy. Updated API Pages: signal, signal.windows

Ready for review/merge from my end.

@rgommers
Copy link
Member

Mostly looks good, two comments:

  1. Any use of __doc__ needs to be wrapped in if __doc__ is not None:. This will now break:

    $ python -OO -c "import scipy.signal as s; s.test()"

  2. I don't think signal.windows deserves to be listed in the top-level page (http://docs.scipy.org/doc/scipy/reference/). We have multiple other public submodules that are more interesting than windows and are also not listed there. So I suggest to just remove that.

@larsoner
Copy link
Member Author

@rgommers done



def test_deprecation():
assert 'signal.hann is deprecated' in dep_hann.__doc__
Copy link
Member

Choose a reason for hiding this comment

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

Odd, this test should not be passing on TravisCI with OPTIMIZE=-OO. That is run under Python 3.4, and I've checked that it picks up -OO, because it says at the top of the test output

WARNING: assertions not in test modules or plugins will be ignored because assert 
statements are not executed by the underlying Python interpreter (are you using python -O?)

It does fail as expected for me on Python 2.7. I'll push a commit moving the -OO run to 2.7

Copy link
Member

Choose a reason for hiding this comment

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

Note that there are 2 issues here, use of assert and use of __doc__

Copy link
Member Author

Choose a reason for hiding this comment

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

Good points, should be fixed now (your commit broke Travis as intended)

Copy link
Member

Choose a reason for hiding this comment

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

No it didn't break, that's the special failures with numpy master. I added -OO to the wrong build matrix entry.

Copy link
Member

Choose a reason for hiding this comment

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

I'll remove my commit and then merge. Will figure out -OO some other time, opening a new issue for it.

Copy link
Member

Choose a reason for hiding this comment

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

Here's the link to the TravisCI run (the link to it will disappear from this PR once I force-push): https://travis-ci.org/scipy/scipy/builds/278796885?utm_source=github_status&utm_medium=notification

Copy link
Member

Choose a reason for hiding this comment

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

Issue opened: gh-7914

@rgommers
Copy link
Member

Merged, thanks Eric.

@rgommers
Copy link
Member

I'm tending towards not backporting this to 1.0.x. There's no urgent need for this, and we're close to rc1.

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

2 participants