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

DEPR: deprecate re-exports of numpy.testing functions in yt.testing #4433

Closed
neutrinoceros opened this issue May 3, 2023 · 3 comments · Fixed by #4434
Closed

DEPR: deprecate re-exports of numpy.testing functions in yt.testing #4433

neutrinoceros opened this issue May 3, 2023 · 3 comments · Fixed by #4434
Assignees
Labels
deprecation deprecate features or remove deprecated ones
Milestone

Comments

@neutrinoceros
Copy link
Member

neutrinoceros commented May 3, 2023

Report

Currently 7 functions from the numpy.testing namespace are re-exported in yt.testing. The code currently looks like this:

# we import this in a weird way from numpy.testing to avoid triggering
# flake8 errors from the unused imports. These test functions are imported
# elsewhere in yt from here so we want them to be imported here.
from numpy.testing import assert_array_equal, assert_almost_equal  # NOQA isort:skip
from numpy.testing import assert_equal, assert_array_less  # NOQA isort:skip
from numpy.testing import assert_string_equal  # NOQA isort:skip
from numpy.testing import assert_array_almost_equal_nulp  # isort:skip
from numpy.testing import assert_allclose, assert_raises  # NOQA isort:skip
from numpy.testing import assert_approx_equal  # NOQA isort:skip
from numpy.testing import assert_array_almost_equal  # NOQA isort:skip

Last time this was updated (~3yrs ago, when isort was first enabled), we didn't attempt to get rid of that, but there is no actual gain to doing that excepts for backward compatibility, but we can actually go through a deprecation cycle if we wrap these functions instead of directly re-exporting them.

This is probably a reasonable goal to set for the next feature release so I'll triage this into the 4.2 milestone for now

@neutrinoceros neutrinoceros added the deprecation deprecate features or remove deprecated ones label May 3, 2023
@neutrinoceros neutrinoceros added this to the 4.2.0 milestone May 3, 2023
@neutrinoceros neutrinoceros self-assigned this May 3, 2023
@matthewturk
Copy link
Member

This just doesn't seem like a huge priority to me.

@neutrinoceros
Copy link
Member Author

clearly it's not, otherwise it would have been done years ago. I still think it's worth 30min of my time.

@neutrinoceros
Copy link
Member Author

If I haven't opened a PR for it by tomorrow (or if it turns out to be large), I'll postpone it to post-4.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecation deprecate features or remove deprecated ones
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants