Vote on SLEP009: keyword only arguments
As per our Governance <http://scikit-learn.org/stable/governance.html> document, changes to API principles are to be established through an Enhancement Proposal (SLEP) from which any core developer can call for a vote on its acceptance. *SLEP009 Keyword Only Arguments is the first SLEP up for a vote. Please see* *https://scikit-learn-enhancement-proposals.readthedocs.io/en/latest/slep009/... <https://scikit-learn-enhancement-proposals.readthedocs.io/en/latest/slep009/proposal.html>* *This proposal discusses the path to gradually forcing users to pass arguments, or most of them, as keyword arguments only.* Core developers are invited to vote on this change until 11 October 2019 by replying to this email thread. All members of the community are welcome to comment on the proposal on this mailing list, or to propose minor changes through Issues and Pull Requests at https://github.com/scikit-learn/enhancement_proposals/.
It's a yes for me. On Wed, Sep 11, 2019 at 3:20 AM Joel Nothman <joel.nothman@gmail.com> wrote:
As per our Governance <http://scikit-learn.org/stable/governance.html> document, changes to API principles are to be established through an Enhancement Proposal (SLEP) from which any core developer can call for a vote on its acceptance.
*SLEP009 Keyword Only Arguments is the first SLEP up for a vote. Please see*
*https://scikit-learn-enhancement-proposals.readthedocs.io/en/latest/slep009/... <https://scikit-learn-enhancement-proposals.readthedocs.io/en/latest/slep009/proposal.html>*
*This proposal discusses the path to gradually forcing users to pass arguments, or most of them, as keyword arguments only.*
Core developers are invited to vote on this change until 11 October 2019 by replying to this email thread.
All members of the community are welcome to comment on the proposal on this mailing list, or to propose minor changes through Issues and Pull Requests at https://github.com/scikit-learn/enhancement_proposals/.
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
I'm strongly supportive of moving to keyword only arguments. Andrew <~~~~~~~~~~~~~~~~~~~~~~~~~~~> J. Andrew Howe, PhD LinkedIn Profile <http://www.linkedin.com/in/ahowe42> ResearchGate Profile <http://www.researchgate.net/profile/John_Howe12/> Open Researcher and Contributor ID (ORCID) <http://orcid.org/0000-0002-3553-1990> Github Profile <http://github.com/ahowe42> Personal Website <http://www.andrewhowe.com> I live to learn, so I can learn to live. - me <~~~~~~~~~~~~~~~~~~~~~~~~~~~> On Wed, Sep 11, 2019 at 2:21 AM Joel Nothman <joel.nothman@gmail.com> wrote:
As per our Governance <http://scikit-learn.org/stable/governance.html> document, changes to API principles are to be established through an Enhancement Proposal (SLEP) from which any core developer can call for a vote on its acceptance.
*SLEP009 Keyword Only Arguments is the first SLEP up for a vote. Please see*
*https://scikit-learn-enhancement-proposals.readthedocs.io/en/latest/slep009/... <https://scikit-learn-enhancement-proposals.readthedocs.io/en/latest/slep009/proposal.html>*
*This proposal discusses the path to gradually forcing users to pass arguments, or most of them, as keyword arguments only.*
Core developers are invited to vote on this change until 11 October 2019 by replying to this email thread.
All members of the community are welcome to comment on the proposal on this mailing list, or to propose minor changes through Issues and Pull Requests at https://github.com/scikit-learn/enhancement_proposals/.
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
hi, Adrin do you suggest this for everything or maybe just for __init__ params of estimators and stuff that can come after X, y in fit eg sample_weights? would: clf.fit(X, y) still be allowed? Alex
Hi, I'm (mostly) the messenger, don't shoot me :P It may help to summarize the SLEP: 1. This can be applied to all methods, not just __init__. 2. The SLEP doesn't say we have to apply it everywhere. It's mostly that it lets us do that. 3. It doesn't make ALL inputs a keywords only argument. The common ones such as X and y in fit(X, y) will stay as they are. Therefore clf.fit(X, y) will definitely be allowed. 4. Whether or not sample_weight should be keyword only or not in fit, requires its own discussion, and the route of the discussion is defined in the SLEP. In other words, if an input parameter is used as a positional argument less frequently than X% of the time, then it can/should be a keyword only argument. But the SLEP better defines these conditions. I hope that clarifies it a little bit. Adrin/ On Wed, Sep 11, 2019 at 3:23 PM Alexandre Gramfort < alexandre.gramfort@inria.fr> wrote:
hi,
Adrin do you suggest this for everything or maybe just for __init__ params of estimators and stuff that can come after X, y in fit eg sample_weights?
would:
clf.fit(X, y)
still be allowed?
Alex _______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
Since there is no explicit proposal in the SLEP it's not very clear what we need to vote for / against? But overall I'm + 1 on forcing kwargs for all __init__ methods. Nicolas On 9/11/19 9:38 AM, Adrin wrote:
Hi,
I'm (mostly) the messenger, don't shoot me :P
It may help to summarize the SLEP: 1. This can be applied to all methods, not just __init__. 2. The SLEP doesn't say we have to apply it everywhere. It's mostly that it lets us do that. 3. It doesn't make ALL inputs a keywords only argument. The common ones such as X and y in fit(X, y) will stay as they are. Therefore clf.fit(X, y) will definitely be allowed. 4. Whether or not sample_weight should be keyword only or not in fit, requires its own discussion, and the route of the discussion is defined in the SLEP.
In other words, if an input parameter is used as a positional argument less frequently than X% of the time, then it can/should be a keyword only argument. But the SLEP better defines these conditions.
I hope that clarifies it a little bit.
Adrin/
On Wed, Sep 11, 2019 at 3:23 PM Alexandre Gramfort <alexandre.gramfort@inria.fr <mailto:alexandre.gramfort@inria.fr>> wrote:
hi,
Adrin do you suggest this for everything or maybe just for __init__ params of estimators and stuff that can come after X, y in fit eg sample_weights?
would:
clf.fit(X, y)
still be allowed?
Alex _______________________________________________ scikit-learn mailing list scikit-learn@python.org <mailto:scikit-learn@python.org> https://mail.python.org/mailman/listinfo/scikit-learn
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
The SLEP says: This proposal suggests making only/most commonly/used parameters positional. The/most commonly/used parameters are defined per method or function, to be defined as either of the following two ways: * The set defined and agreed upon by the core developers, which should cover the/easy/cases. * A set identified as being in the top 95% of the use cases, using some automated analysis such asthis one <https://odyssey.readthedocs.io/en/latest/tutorial.html>orthis one <https://github.com/Quansight-Labs/python-api-inspect>. And describes a clear deprecation path. So that seems pretty actionable? Also, I vote +1 on the SLEP. Nicolas: Do you think this is not actionable? I had suggested that we define a clear rule but doing a case-by-case seems better than bikeshedding now. Alexandre: did you read the SLEP before asking? I thought the point of the SLEP was to summarize the discussion. If your question is not answered we should amend the SLEP. On 9/11/19 2:21 PM, Nicolas Hug wrote:
Since there is no explicit proposal in the SLEP it's not very clear what we need to vote for / against?
But overall I'm + 1 on forcing kwargs for all __init__ methods.
Nicolas
On 9/11/19 9:38 AM, Adrin wrote:
Hi,
I'm (mostly) the messenger, don't shoot me :P
It may help to summarize the SLEP: 1. This can be applied to all methods, not just __init__. 2. The SLEP doesn't say we have to apply it everywhere. It's mostly that it lets us do that. 3. It doesn't make ALL inputs a keywords only argument. The common ones such as X and y in fit(X, y) will stay as they are. Therefore clf.fit(X, y) will definitely be allowed. 4. Whether or not sample_weight should be keyword only or not in fit, requires its own discussion, and the route of the discussion is defined in the SLEP.
In other words, if an input parameter is used as a positional argument less frequently than X% of the time, then it can/should be a keyword only argument. But the SLEP better defines these conditions.
I hope that clarifies it a little bit.
Adrin/
On Wed, Sep 11, 2019 at 3:23 PM Alexandre Gramfort <alexandre.gramfort@inria.fr <mailto:alexandre.gramfort@inria.fr>> wrote:
hi,
Adrin do you suggest this for everything or maybe just for __init__ params of estimators and stuff that can come after X, y in fit eg sample_weights?
would:
clf.fit(X, y)
still be allowed?
Alex _______________________________________________ scikit-learn mailing list scikit-learn@python.org <mailto:scikit-learn@python.org> https://mail.python.org/mailman/listinfo/scikit-learn
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
I think Alex's and my concerns are legit. The SLEP is asking "are you OK with forcing some parameters to be kwords only? We still don't know which ones though". I understand why you don't want to bike shed now, but that's a surprisingly mild SLEP, hence the questions. The only response I can give to the SLEP is right now is "sure, depends". Nicolas On 9/18/19 11:24 AM, Andreas Mueller wrote:
The SLEP says:
This proposal suggests making only/most commonly/used parameters positional. The/most commonly/used parameters are defined per method or function, to be defined as either of the following two ways:
* The set defined and agreed upon by the core developers, which should cover the/easy/cases. * A set identified as being in the top 95% of the use cases, using some automated analysis such asthis one <https://odyssey.readthedocs.io/en/latest/tutorial.html>orthis one <https://github.com/Quansight-Labs/python-api-inspect>.
And describes a clear deprecation path.
So that seems pretty actionable?
Also, I vote +1 on the SLEP.
Nicolas: Do you think this is not actionable? I had suggested that we define a clear rule but doing a case-by-case seems better than bikeshedding now.
Alexandre: did you read the SLEP before asking? I thought the point of the SLEP was to summarize the discussion. If your question is not answered we should amend the SLEP.
On 9/11/19 2:21 PM, Nicolas Hug wrote:
Since there is no explicit proposal in the SLEP it's not very clear what we need to vote for / against?
But overall I'm + 1 on forcing kwargs for all __init__ methods.
Nicolas
On 9/11/19 9:38 AM, Adrin wrote:
Hi,
I'm (mostly) the messenger, don't shoot me :P
It may help to summarize the SLEP: 1. This can be applied to all methods, not just __init__. 2. The SLEP doesn't say we have to apply it everywhere. It's mostly that it lets us do that. 3. It doesn't make ALL inputs a keywords only argument. The common ones such as X and y in fit(X, y) will stay as they are. Therefore clf.fit(X, y) will definitely be allowed. 4. Whether or not sample_weight should be keyword only or not in fit, requires its own discussion, and the route of the discussion is defined in the SLEP.
In other words, if an input parameter is used as a positional argument less frequently than X% of the time, then it can/should be a keyword only argument. But the SLEP better defines these conditions.
I hope that clarifies it a little bit.
Adrin/
On Wed, Sep 11, 2019 at 3:23 PM Alexandre Gramfort <alexandre.gramfort@inria.fr <mailto:alexandre.gramfort@inria.fr>> wrote:
hi,
Adrin do you suggest this for everything or maybe just for __init__ params of estimators and stuff that can come after X, y in fit eg sample_weights?
would:
clf.fit(X, y)
still be allowed?
Alex _______________________________________________ scikit-learn mailing list scikit-learn@python.org <mailto:scikit-learn@python.org> https://mail.python.org/mailman/listinfo/scikit-learn
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
_______________________________________________ scikit-learn mailing list scikit-learn@python.org https://mail.python.org/mailman/listinfo/scikit-learn
participants (6)
-
Adrin -
Alexandre Gramfort -
Andreas Mueller -
Andrew Howe -
Joel Nothman -
Nicolas Hug