-
Notifications
You must be signed in to change notification settings - Fork 186
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
Add matrix_apply_linter()
#1869
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1869 +/- ##
==========================================
+ Coverage 98.86% 98.88% +0.01%
==========================================
Files 112 113 +1
Lines 4841 4915 +74
==========================================
+ Hits 4786 4860 +74
Misses 55 55
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Regarding passing |
Good point! I'm not sure to address that. Since I'm doing operations on l1 and l2 to generate the custom error message, I can only think of solutions like |
You an use |
Done. The |
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, we're almost there.
|
Future expansion of this linter would probably go towards adding more functions to the list of detected things (the Maybe |
I like |
Hi @AshesITR @IndrajeetPatil @MichaelChirico, is there anything left for me to do in this PR or are features freezed until the new release gets out? #1476 |
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 for the delay in reviewing, I haven't had much spare time lately.
@MichaelChirico do we want to leave the name as matrix_apply_linter()
?
If so, LGTM after fixing the news.
NEWS.md
Outdated
@@ -100,6 +100,8 @@ | |||
|
|||
### New linters | |||
|
|||
* `colsums_rowsums_linter()` recommends use of dedicated `rowSums()`, `colSums()`, `colMeans()`, `rowMeans()` over `apply(., MARGIN, sum)` or `apply(., MARGIN, mean)`. The recommended alternative is much more efficient and more readable (#1869, @Bisaloo). |
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.
The name is wrong here.
works for me! Thanks @Bisaloo for all the work on this & for your patience! |
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.
Thank you for your effort!
Fix #1764
To do:
l2 = length(dim(x))
na.rm
arg in reco if present in original callOpen questions for input:
colSums()
/rowSums()
andcolMeans()
/rowMeans()
. The function should maybe have a more generic name but I'm not sure whatThe case whenMARGIN
is passed as an integer is not covered but I believe this is not correct syntax anyways (should there be a linter for this?)x
,MARGIN
andFUN
is purely based on position. I don't believe it should be common to see deviation from this but I'm open to counterpoints