Skip to content

MAINT: Make numpy.fft.helper private#24945

Merged
ngoldbaum merged 2 commits intonumpy:mainfrom
mtsokol:fft-helper-private
Oct 19, 2023
Merged

MAINT: Make numpy.fft.helper private#24945
ngoldbaum merged 2 commits intonumpy:mainfrom
mtsokol:fft-helper-private

Conversation

@mtsokol
Copy link
Member

@mtsokol mtsokol commented Oct 18, 2023

Hi @rgommers @ngoldbaum,

I started working on post-core-rename items to finalize NEP 52 (one thing is making sure with a test that each function is available from one place only).

In this PR I make numpy.fft.helper private (now numpy.fft._helper) as it defines four public functions that are already available from numpy.fft.
I think that helper is used a bit, therefore I left a stub that raises a warning on access. If you would like a more strict approach here (only an AttributeError) let me know!

Copy link
Member

@ngoldbaum ngoldbaum left a comment

Choose a reason for hiding this comment

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

Just one super minor comment, other than that this looks good to me.


from .arrayterator import Arrayterator
from ._version import *
from .introspect import *
Copy link
Member

Choose a reason for hiding this comment

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

I just double-checked, there's no need to modify __getattr__ below since np.lib.opt_func_info hasn't made it into a release yet.


from . import _pocketfft, helper
from . import _pocketfft, _helper
from . import helper # TODO: to be deleted once people move to `np.fft`
Copy link
Member

Choose a reason for hiding this comment

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

This comment should say it's deprecated in Numpy 2.0, following similar comments in the codebase so it's greppable.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure! I updated the comment.

@mtsokol mtsokol force-pushed the fft-helper-private branch from 35c8d7e to 81c0c8b Compare October 19, 2023 10:19
@ngoldbaum
Copy link
Member

Thanks @mtsokol!

@ngoldbaum ngoldbaum merged commit acae28b into numpy:main Oct 19, 2023
@mtsokol mtsokol deleted the fft-helper-private branch October 19, 2023 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants