Skip to content

DOC: Improve migration instructions for maximum_sctype #25074

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
bersbersbers opened this issue Nov 6, 2023 · 4 comments
Closed

DOC: Improve migration instructions for maximum_sctype #25074

bersbersbers opened this issue Nov 6, 2023 · 4 comments

Comments

@bersbersbers
Copy link
Contributor

Issue with current documentation:

It seems that maximum_sctype is now deprecated, compare https://numpy.org/neps/nep-0052-python-api-cleanup.html#cleaning-up-the-main-namespace:

All *sctype functions can be deprecated and removed, they (see gh-17325, gh-12334, and other issues for maximum_sctype and related functions).

Unfortunately,

In summary, when documented functions are deprecated, I'd expect some assistance in migration.

Idea or request for content:

No response

@bersbersbers
Copy link
Contributor Author

Particularly, it would be good to know how to get the maximum supported unsigned integer type other than using np.maximum_sctype(np.uint8).

By the way, I find it surprising that min_scalar_type shall remain while maximum_sctype shall be removed.

@rgommers
Copy link
Member

rgommers commented Nov 6, 2023

Thanks @bersbersbers, some migration guidance would be good to add here indeed. Cc @mtsokol can you please look into doing this?

Re np.maximum_sctype(np.uint8), this is obscure code for no reason, I'd just write np.uint64 instead. This is always the correct answer, and that won't change. And if we ever, for example, would add np.uint128, (not going to happen, but just as an example) you really want to make an explicit change to your code there if you want to use it, rather than a silent one, because it can break a lot of things to silently switch over.

@bersbersbers
Copy link
Contributor Author

and that won't change

Good to know, thanks!

@ngoldbaum ngoldbaum changed the title DOC: maximum_sctype migration DOC: Improve migration instructions for maximum_sctype Nov 6, 2023
@rgommers
Copy link
Member

This issue was addressed by gh-25081, so closing. Thanks @bersbersbers and @mtsokol.

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

No branches or pull requests

3 participants