Skip to content

TYP: deprecate ma.round_ #28917

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

dineshcsdev
Copy link

@dineshcsdev dineshcsdev commented May 7, 2025

@jorenham
Added @deprecated decorator to ma.round_ stub in core.pyi and imported deprecated from typing_extensions to fixed

@jorenham jorenham changed the title Fix deprecate ma round TYP: deprecate ma.round_ May 7, 2025
@jorenham jorenham self-requested a review May 7, 2025 12:11
Copy link
Member

@jorenham jorenham left a comment

Choose a reason for hiding this comment

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

because round aliases round_, you're also deprecating np.ma.round with this

@jorenham
Copy link
Member

jorenham commented May 7, 2025

for reference: #28899 (review)

@dineshcsdev
Copy link
Author

I’ve removed the @deprecated decorator from round_ as suggested since it also deprecates round. Added a note in the stub file to clarify. Please let me know if further changes are needed!

@dineshcsdev
Copy link
Author

I’ve removed the @deprecated decorator from round_ as suggested since it also deprecates round. Added a note in the stub file to clarify. Please let me know if further changes are needed!

@jorenham
Copy link
Member

jorenham commented May 7, 2025

I’ve removed the @deprecated decorator from round_ as suggested since it also deprecates round.

That's not what I meant actually: @deprecated should only be applied to round_. Therefore, round should no longer alias round_, and should instead have its own (identical) signature.

@ngoldbaum
Copy link
Member

why are there two PRs now? this makes more sense in the PR you already have open...

@dineshcsdev
Copy link
Author

Added @deprecated("np.ma.round_ is deprecated. Please use np.round instead.") above the round_ function.

Kept round function unchanged and added a comment noting it's retained for compatibility.

@dineshcsdev
Copy link
Author

@ngoldbaum You're right, and thanks for pointing that out. I initially opened this separate PR to isolate the deprecation change for ma.round_ and keep it focused based on the feedback. But I now realize it would have been better to update the existing PR instead of opening a new one

dineshcsdev and others added 2 commits May 8, 2025 14:29
Co-authored-by: Joren Hammudoglu <jhammudoglu@gmail.com>
Co-authored-by: Joren Hammudoglu <jhammudoglu@gmail.com>
@dineshcsdev
Copy link
Author

Remove redundant comments as per review

Co-authored-by: Joren Hammudoglu <jhammudoglu@gmail.com>
Copy link
Member

@jorenham jorenham left a comment

Choose a reason for hiding this comment

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

merging this should wait until after #28899

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs decision
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy