Skip to content
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

Closes #218 modified row merge #219

Conversation

nicholas-masel
Copy link
Collaborator

@nicholas-masel nicholas-masel commented Mar 27, 2024

Thank you for your Pull Request!

We have developed a Pull Request template to aid you and our reviewers. Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the logrx codebase remains robust and consistent.

The spirit of logrx

While many packages to facilitate the logging of code already exist in the R ecosystem, it is hard to find a solution that works well for clinical programming applications. Many logging implementations are more implicit and rely on user input to create the log for the execution of a script. While this is useful for logging specific events of an application, in clinical programming a log has a set purpose.

logrx is built around the concept of creating a log for the execution of an R script that provides an overview of what happened as well as the environment that it happened in. We set out to create a flexible logging utility that could provide the necessary information to anyone reviewing the code execution so they can recreate the execution environment and run the code for themselves. Please make sure your Pull Request meets this spirit of logrx.

Please check off each taskbox as an acknowledgment that you completed the task. This checklist is part of the Github Action workflows and the Pull Request will not be merged into the dev branch until you have checked off each task.

  • The spirit of logrx is met in your Pull Request
  • Check that your Pull Request is targeting the dev branch, Pull Requests to master should use the Release Pull Request Template
  • Code is formatted according to the tidyverse style guide
  • Updated relevant unit tests or have written new unit tests. Remember to remove any configured log objects at the end of every test using log_remove().
  • Creation/updates to relevant roxygen headers and examples.
  • Run devtools::document() so all .Rd files in the man folder and the NAMESPACE file in the project root are updated appropriately
  • Run pkgdown::build_site() and check that all affected examples are displayed correctly and that all new functions occur on the "Reference" page.
  • Update NEWS.md if the changes pertain to a user-facing function (i.e. it has an @export tag) or documentation aimed at users (rather than developers)
  • Address any updates needed for vignettes and/or templates
  • Run R CMD check locally and address all errors and warnings - devtools::check()
  • Link the issue so that it closes after successful merging.
  • Address all merge conflicts and resolve appropriately
  • Pat yourself on the back for a job well done! Much love to your accomplishment!

@nicholas-masel nicholas-masel changed the title modified row merge Closes #218 modified row merge Mar 27, 2024
Copy link
Collaborator

@bms63 bms63 left a comment

Choose a reason for hiding this comment

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

Looking nice!! Is there anyway to get a test written for this scenario?

@bms63
Copy link
Collaborator

bms63 commented Mar 27, 2024

@evgenia-gem any chance you want to test this out from this branch - just to see if it is working for you?

@nicholas-masel
Copy link
Collaborator Author

Thanks @bms63

Looking nice!! Is there anyway to get a test written for this scenario?

The expected structure was not being met using aggregate() for this scenario. I completely swapped out the code so this is will always be consistent with 2 variables (library, function_name) and one row per package.

Since we no longer use aggregate, my thought was the existing tests cover this.

Copy link
Collaborator

@bms63 bms63 left a comment

Choose a reason for hiding this comment

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

Awesome thanks @nicholas-masel !!

@bms63
Copy link
Collaborator

bms63 commented Mar 27, 2024

@kodesiba do you have bandwidth to submit to CRAN?

@kodesiba
Copy link
Collaborator

@bms63 @nicholas-masel I should be able to build and submit to CRAN. Any clue why Windows CMD check is failing? It's always something annoying with the non-linux ones

@bms63
Copy link
Collaborator

bms63 commented Mar 27, 2024

I think it is github issue - happening in other repos im involved in

@@ -153,7 +154,9 @@ write_masked_functions <- function(){
write_used_functions <- function(){
used_functions_list <- get_log_element("used_packages_functions")

combined <- aggregate(function_name~library, used_functions_list, paste)
combined <- used_functions_list %>%
group_by(library) %>%
Copy link
Collaborator

Choose a reason for hiding this comment

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

@nicholas-masel I'm not sure what's downstream but does this dataframe need to be ungrouped for any reason down the line? Not sure if an ungroup() is needed after the summarize() or not

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@kodesiba Good comment and I checked into the documentation to be sure. Since I am using summarize() after group() and I only have one group, the resulting df is ungrouped as the last grouping is dropped by default.

From summarize():

When .groups is not specified, it is chosen based on the number of rows of the results:
If all the results have 1 row, you get "drop_last".

.groups - Grouping structure of the result.
"drop_last": dropping the last level of grouping. This was the only supported option before version 1.0.0.

@nicholas-masel nicholas-masel merged commit f618f59 into dev Mar 29, 2024
6 of 7 checks passed
@nicholas-masel nicholas-masel deleted the 218-bug-axecute-returns-error-when-same-number-of-unapproved-functions-within-multiple-packages-are-used branch March 29, 2024 12:28
@evgenia-gem
Copy link

evgenia-gem commented Apr 3, 2024

@evgenia-gem any chance you want to test this out from this branch - just to see if it is working for you?

Can see this has already been merged in. Do you still require testing from me?

kodesiba added a commit that referenced this pull request Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants