Skip to content

DOC: mark np.testing.dec functions as not recommended for future use #17566

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

Closed
eric-wieser opened this issue Oct 14, 2020 · 7 comments · Fixed by #18051
Closed

DOC: mark np.testing.dec functions as not recommended for future use #17566

eric-wieser opened this issue Oct 14, 2020 · 7 comments · Fixed by #18051

Comments

@eric-wieser
Copy link
Member

eric-wieser commented Oct 14, 2020

Given that

... the [np.testing.dec] decorators are only retained for folks using the old nose framework and will be removed as some point, nose doesn't work with recent Python without modification. Most distros no longer provide nose, but rather nose2.

@charris in #16370 (comment)

I think we should update the docs at https://numpy.org/devdocs/reference/routines.testing.html#decorators to make this clear.

We might also want to consider deprecating them fully with DeprecationWarnings

@rpolley
Copy link
Contributor

rpolley commented Dec 17, 2020

Going to take a stab at this.

@rpolley
Copy link
Contributor

rpolley commented Dec 19, 2020

From what it looks like the docstrings from submodules don't actually get pulled in anywhere. Should I just deprecate the entire np.testing module, since it looks mostly nose based? Or is there some other way I should document submodules of np.testing?

@mattip
Copy link
Member

mattip commented Dec 19, 2020

The rendered documentation does included the public functions from that module. that.This issue is about deprecating only the np.testing.dec functions, not the whole module. With that, the module structure could be simplified (but that is a different issue).

@rpolley
Copy link
Contributor

rpolley commented Dec 20, 2020

Ah, I see. So put it on the individual functions then?

@mattip
Copy link
Member

mattip commented Dec 20, 2020

The original ask was just to add a blurb in the docstring of the module to discourage the use of these functions. Deprecation warnings will be noisy, since the warning will be emitted during test collection. If you want to add the deprecations, please follow the pattern of

# Numpy 1.21.0, 2020-12-20
warnings.warn("msg" DeprecationWarning, stacklevel=2)

and make sure tests pass cleanly. The relevant tests of the deprecated functions should move to numpy/core/tests/test_deprecations

@mattip
Copy link
Member

mattip commented Dec 29, 2020

Now that the decorators are deprected we need to update the docs at https://numpy.org/devdocs/reference/routines.testing.html#decorators to make this clear.

@mattip mattip reopened this Dec 29, 2020
@melissawm
Copy link
Member

Closing as the warnings are visible now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants