-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
MAINT: stats.moment: rename parameter moment
to order
#19689
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
Conversation
Seems reasonable although I would prefer to deprecate rather than have two ways of doing the same thing. Is there a specific reason for not? Will wait for the mailing list post before reviewing in detail |
Well, mostly because the keyword I'm not sure I can call for a deprecation right now, but I wouldn't oppose it. |
+1 for merging as is (is |
@rgommers Oops, I got carried away and changed the name everwhere. I added an explicit test. |
+1 for merging as is without deprecating. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update the example to use order
instead of moment
Thanks @j-bowhay. Did a search and replace this time; I think I got the last of the ones that are supposed to be changed. |
Mailing list post is here:
|
scipy/stats/_stats_py.py
Outdated
# returns it. | ||
# Currently this leads to a slight inconsistency: when the input array is | ||
# empty, there is no distinction between the `moment` function being called | ||
# with parameter `moments=1` and `moments=[1]`; the latter *should* produce |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry missed this last time around. Does this comment also need updating? It looks like there might have originally been a moments->moment typo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mdhaber, will leave a few days before merging in case there is anything from the mailing list
Thanks for the reminder @mdhaber, that was a long few days! |
Reference issue
What does this implement/fix?
stats.moment
has a parameter namedmoment
. Given that the description isand the name of the equivalent argument of
scipy.stats.rv_generic.moment
isorder
,I think the name
order
would be more appropriate.This PR renames the parameter in a way that maintains backward compatibility (i.e. use of keyword-argument 'moment' is still allowed as an alias).
Additional information
moment
instead of leaving it as an alias, but I am not necessarily pushing for it.order
instead ofmoment
, but I chose instead to letmoment = order
at the top to minimize the diff.