Skip to content

API make __init__ params in compose module kw-only#16542

Merged
amueller merged 4 commits intoscikit-learn:masterfrom
adrinjalali:kwonly/compose
Mar 13, 2020
Merged

API make __init__ params in compose module kw-only#16542
amueller merged 4 commits intoscikit-learn:masterfrom
adrinjalali:kwonly/compose

Conversation

@adrinjalali
Copy link
Copy Markdown
Member

this should be an easy one

ping @NicolasHug @rth

@adrinjalali adrinjalali added this to the 0.23 milestone Feb 25, 2020
Copy link
Copy Markdown
Member

@jnothman jnothman left a comment

Choose a reason for hiding this comment

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

Are we checking for warnings being raised in examples (and tests) by these changes?

"""
def __init__(self, regressor=None, transformer=None,
@_deprecate_positional_args
def __init__(self, *, regressor=None, transformer=None,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm. I think I'm okay with the regressor being specified positionally.

Copy link
Copy Markdown
Member Author

@adrinjalali adrinjalali Feb 28, 2020

Choose a reason for hiding this comment

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

First I thought so too, but then I realized there's a regressor and a transformer, and they kinda are of the same nature, and it'd be easy to confuse which one comes first. That's why I put it before regressor.

Copy link
Copy Markdown
Member

@amueller amueller Feb 28, 2020

Choose a reason for hiding this comment

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

hm I would also think after regressor is better. transformer is optional and I have actually never used it. The main application of this for me is the log transform and we don't have a LogTransformer right now.

Other than that looks good.

@adrinjalali
Copy link
Copy Markdown
Member Author

Are we checking for warnings being raised in examples (and tests) by these changes?

We fail on our FutureWarnings, so the CI should fail at least on master I guess.

@adrinjalali
Copy link
Copy Markdown
Member Author

@amueller happy with this one now?

@adrinjalali
Copy link
Copy Markdown
Member Author

gentle ping @amueller

@amueller
Copy link
Copy Markdown
Member

Thanks!

@amueller amueller merged commit 73813ea into scikit-learn:master Mar 13, 2020
ashutosh1919 pushed a commit to ashutosh1919/scikit-learn that referenced this pull request Mar 13, 2020
* API make __init__ params in compose module kw-only

* pep8

* move * to after
@adrinjalali adrinjalali deleted the kwonly/compose branch March 20, 2020 12:51
gio8tisu pushed a commit to gio8tisu/scikit-learn that referenced this pull request May 15, 2020
* API make __init__ params in compose module kw-only

* pep8

* move * to after
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.

3 participants