-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
[R-package] use keyword arguments for all internal function calls #3390
Comments
can I claim callback.R please? |
see #3390. Also added isTRUE for some of the logical checks, please advise if this is okay
Hi @jameslamb , I'm working on |
thanks @iadi7ya ! I appreciate you taking the time to contribute to |
@jameslamb I am working on |
can i claim lgb.Booster.R? |
yes please! |
Hi, @jameslamb , I am working on |
Thanks! Now that Hacktoberfest is over we'd like to finish this task, so feel free to take several files if you'd like. |
Hi, Mr. @jameslamb, I am working on |
Since Hacktoberfest is over, I want to claim all of the rest of files. |
they're yours, thanks! Please bunch the contributions into one or two pull requests. |
This comment has been minimized.
This comment has been minimized.
@georgiazoller that does not look related to LigtGBM. If it is, please open a new issue instead of commenting on this one. |
This issue has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this. |
Summary
Today in the R package, there are a lot of internal function calls which use only positional arguments. Change them to use keyword arguments for extra safety.
I've added this issue to provide a small, focused contribution opportunity for Hacktoberfest 2020 participants. If you are an experienced open source contributor, please leave this for beginners and consider contributing on a different backlog item.
Motivation
Using positional arguments in internal code is dangerous, because it can allow mistakes to slip through or can lead to confusing errors.
This is especially dangerous for cases where the values you'd pass to two parameters take on similar values. For example, in
lightgbm()
,eval_freq
andearly_stopping_rounds
are both positive integers and can take on similar values. You might not known, unless you're very careful, that you accidentally specified them in the wrong order.How to Contribute
To help with this issue, propose a pull request which replaces uses of positional arguments in the R package with keyword arguments.
That means changing calls like this:
R-package/R/
{roxygen2}
7.1.1 installed. If you have any issues with this, just ask when you submit your PR and I can regenerate the docs for youlgb.call()
print()
,length()
,is.character()
, etc.)Refer to #3391 as an example. If you have any questions, tag me on this issue and I can help.
Assignments
If you are interested, please comment on this issue and indicate which file inR-package/R/
you'd like to help on. PLEASE ONLY TAKE ONE FILE, so that multiple people can use this as a learning experience.This issue is not urgent, so you can claim a file now and not contribute until Hacktoberfest begins on October 1st.The list below tracks the assignments and completions so far.
aliases.Rcallback.R- @philip-khor ([R-package] Update callback.R with keyword arguments #3430)lgb.Booster.R- @Pey-crypto ([R-package] Updated lgb.Booster.R with keyword arguments #3496)lgb.Predictor.R- @AnshuTrivedi ([R-package] Updated lgb.Predictor.R with keyword arguments #3464)lgb.model.dt.tree.R- @zenggyu ([R-package] Update lgb.model.dt.tree.R to use keyword arguments #3605)lgb.train.R- @iadi7ya ([R-package] Updated lgb.train.R with keyword arguments #3452)lightgbm.Rremoved.Rutils.R- @mfrasco6 ([R-package] use keyword arguments for internal functions in utils.R #3604)Thanks for contributing to
LightGBM
!The text was updated successfully, but these errors were encountered: