Skip to content

API: Update lib.twodim_base namespace #24577

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

Merged
merged 1 commit into from
Aug 29, 2023

Conversation

mtsokol
Copy link
Member

@mtsokol mtsokol commented Aug 29, 2023

Relevant issue #24507

Hi @rgommers @ngoldbaum,

This PR moves lib.twodim_base module to a private file and ensures that its public methods are only available through the main namespace. There are no additional functions available from a local namespace.

@ngoldbaum
Copy link
Member

This removes the following symbols from np.lib.__all__:

In [7]: diff = set(oldall) - set(np.lib.__all__)

In [8]: print(diff)
{'flipud', 'tril_indices', 'triu_indices_from', 'tri', 'fliplr', 'diagflat', 'triu', 'mask_indices', 'vander', 'tril', 'histogram2d', 'tril_indices_from', 'diag', 'triu_indices', 'eye'}

All of these are available in the main namespace:

In [18]: diff.issubset(np.__all__)
Out[18]: True

@ngoldbaum
Copy link
Member

I think this looks good, I'm going to go ahead and merge it. Please also update the module __getattr__ in #24567 to check for twodim_base.

@ngoldbaum ngoldbaum merged commit ff5dce9 into numpy:main Aug 29, 2023
@mtsokol mtsokol deleted the lib-twodimbase-namespace branch August 29, 2023 18:51
@rgommers rgommers added this to the 2.0.0 release milestone Aug 29, 2023
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.

3 participants