-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
[MRG] API make load_* args in datasets kwarg only #16719
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
The keyword only syntax seems like it needs defaults values in general def hello(a, b, *, c):
print(a, b, c)
hello(1, 2)
# TypeError
hello(1, 2, c=10)
# Works
def hello2(a, b, *, c=10):
print(a, b, c)
hello2(10, 2)
# Works |
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.
This lgtm. What stops it being mrg?
This PR needs #16850 to get merge so it can work with: def make_sparse_coded_signal(n_samples, n_components, *, n_features,
n_nonzero_coefs, random_state=None):
... |
Looks like this one is ready for an update @adrinjalali ? |
all green. |
y, X, gamma = make_sparse_coded_signal(n_samples=n_targets, | ||
n_components=n_features, | ||
n_features=n_samples, |
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.
This one is a bit weird, was the test correct in the first place? Should we change the variables names?
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.
I'm not sure if it was correct, my gut feeling is that no. But this still passes the test.
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.
If it passes when re-ordering the args then we should rather do that
I can take over if you're busy with other release stuff, LMK
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.
I'd be happy if you take over :)
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.
Well, I tried. A few asserts fail in the test even after switching the values. Just gonna approve as is then
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.
One thought on make_sparse_coded_signal
Co-Authored-By: Thomas J Fan <thomasjpfan@gmail.com>
tagging #17010 |
* API male load_* args in datasets kwarg only * more loaders * pep8 * fix test_omp usage * fix some usages * Update sklearn/datasets/_samples_generator.py Co-Authored-By: Thomas J Fan <thomasjpfan@gmail.com> Co-authored-by: Nicolas Hug <contact@nicolas-hug.com> Co-authored-by: Thomas J Fan <thomasjpfan@gmail.com>
* API male load_* args in datasets kwarg only * more loaders * pep8 * fix test_omp usage * fix some usages * Update sklearn/datasets/_samples_generator.py Co-Authored-By: Thomas J Fan <thomasjpfan@gmail.com> Co-authored-by: Nicolas Hug <contact@nicolas-hug.com> Co-authored-by: Thomas J Fan <thomasjpfan@gmail.com>
* API male load_* args in datasets kwarg only * more loaders * pep8 * fix test_omp usage * fix some usages * Update sklearn/datasets/_samples_generator.py Co-Authored-By: Thomas J Fan <thomasjpfan@gmail.com> Co-authored-by: Nicolas Hug <contact@nicolas-hug.com> Co-authored-by: Thomas J Fan <thomasjpfan@gmail.com>
A part of #15005
This PR makes the dataset loader functions kwonly mostly.
I'm not quite certain about a few of them though.
TODO: fix the decorator for functions
ping @thomasjpfan