Skip to content

DEP: Deprecate the normed argument to histogramdd to match histogram - #11397

Closed
eric-wieser wants to merge 1 commit into
numpy:masterfrom
eric-wieser:histogramdd-density
Closed

eric-wieser wants to merge 1 commit into
numpy:masterfrom
eric-wieser:histogramdd-density

Conversation

@eric-wieser

@eric-wieser eric-wieser commented Jun 21, 2018 •

Copy link
Copy Markdown
Member

Only emit pending deprecation warnings, to give people a few releases to switch over, rather than making them have to pick a numpy version to squash warnings.

Fixes gh-4371

Leaving this as PendingDeprecationWarning since we're late in the release cycle - the important thing is to get the new argument name in, not to make noise about the old one.

@charris

charris commented Jun 21, 2018

Copy link
Copy Markdown
Member

The main problem with deprecating old keywords is that there is no way for folks who want to maintain compatibility with old numpy to use the new keywords. I like having a compatible set, but I think it will be a long time before we can remove any old arguments.

@eric-wieser

eric-wieser commented Jun 21, 2018 •

Copy link
Copy Markdown
Member Author

Yep, I don't expect histogramdd::normed to be remove in a long time, if ever. There's probably an argument to removing histogram::normed though, since that's actively broken.

I'm thinking that in a couple releases we promote the PendingDeprecationWarning here to DeprecationWarning, and then probably leave it alone for a very long time

@eric-wieser

Copy link
Copy Markdown
Member Author

@charris: Too late for 1.15 now that the rc is out?

@charris

charris commented Jul 4, 2018

Copy link
Copy Markdown
Member

I'm skeptical of deprecating normed, it has likely been used by many people over the years and this will just lead to code churn. Would it not serve as well to simply leave it as an alias for density. That would not be quite as clean as removing it at some point, but would avoid annoying people for small reason.

@eric-wieser

Copy link
Copy Markdown
Member Author

Will PendingDeprecationWarning even create any noise for people?

@charris

charris commented Jul 4, 2018

Copy link
Copy Markdown
Member

Probably not.

@charris

charris commented Jul 4, 2018

Copy link
Copy Markdown
Member

@rgommers Thoughts?

@rgommers

rgommers commented Jul 4, 2018

Copy link
Copy Markdown
Member

@charris I agree that deprecating normed isn't a good idea. Just document it as an alias, and leave it as is.

This would anyway be my opinion I think, since we preferably shouldn't deprecate things for mostly cosmetic reasons. But in this case, there's a long history of us messing in bad ways with histogram (the normed, density and new keywords), which is an extra reason not to do that again.

@charris

charris commented Jul 7, 2018

Copy link
Copy Markdown
Member

@eric-wieser Let's just remove the deprecation. If we are never going to remove the keyword there is no point in deprecating it.

@eric-wieser

Copy link
Copy Markdown
Member Author

If we are never going to remove the keyword there is no point in deprecating it.

I don't agree with this - it's still a method to dictate the "one obvious way to do it" upon users writing new code, without breaking those maintaining old code.

Either way, I think introducing the density argument is a net positive however we handle normed, so I'll spin off a separate PR without the deprecation, and leave this one up in case we want it in future

@rgommers

rgommers commented Jul 8, 2018

Copy link
Copy Markdown
Member

I don't agree with this - it's still a method to dictate the "one obvious way to do it" upon users writing new code, without breaking those maintaining old code.

We have a long-standing policy of deprecating for two releases, then removing. There is nothing wrong with a doc-only deprecation, and it also clearly signal what the one correct way is.

@charris

charris commented Jul 8, 2018

Copy link
Copy Markdown
Member

Closing in favor of #11529, which has been merged.

@eric-wieser

Copy link
Copy Markdown
Member Author

We have a long-standing policy of deprecating for two releases, then removing.

Is this formalized anywhere? If not, perhaps it should be.

@charris

charris commented Jul 8, 2018

Copy link
Copy Markdown
Member

We should probably have a deprecation NEP.

@rgommers

rgommers commented Jul 8, 2018

Copy link
Copy Markdown
Member

There was a policy on the old Trac somewhere, written originally by @rkern IIRC. Our current docs don't have it.

We should probably have a deprecation NEP.

I can volunteer to (co-)write such a NEP. It should be broader than the old text I think; also what are and aren't good reasons for deprecation, etc.

The existence of aliases violates OOWTDI, and histogramdd::normed suggests false similarity with histogram::normed.
@eric-wieser

eric-wieser commented Jul 8, 2018 •

Copy link
Copy Markdown
Member Author

Reopening with an incremental diff (which can't be pushed when it's closed), in case we come back to this as an example after writing the NEP. I'd like a stronger way to check that I'm not using inadvisable-but-non-deprecated features/apis without having to read the docs for every function. Perhaps DeprecationWarning is a poor way to indicate that, and we should introduce some internal warning type.

@eric-wieser eric-wieser reopened this Jul 8, 2018
@eric-wieser
eric-wieser force-pushed the histogramdd-density branch from 081050a to e5db683 Compare July 8, 2018 21:24
@eric-wieser eric-wieser closed this Jul 8, 2018
@eric-wieser
eric-wieser changed the base branch from master to maintenance/1.15.x July 8, 2018 22:18
@eric-wieser eric-wieser reopened this Jul 8, 2018
@eric-wieser
eric-wieser changed the base branch from maintenance/1.15.x to master July 8, 2018 22:18
@charris charris removed this from the 1.15.0 release milestone Jul 16, 2018
@charris charris changed the title DEP: Rename histogramdd's normed argument to density, to match histogram WIP, DEP: Rename histogramdd's normed argument to density, to match histogram Jul 16, 2018
@eric-wieser eric-wieser changed the title WIP, DEP: Rename histogramdd's normed argument to density, to match histogram DEP: Deprecate the normed argument to histogramdd to match histogram Aug 1, 2018
@mattip

mattip commented Oct 12, 2018

Copy link
Copy Markdown
Member

Can we close this?

@eric-wieser

Copy link
Copy Markdown
Member Author

Sure, not worth arguing about this

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.

4 participants