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

253 feature request deprecatesupersede derive vars crit #254

Open
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

federicobaratin
Copy link
Collaborator

@federicobaratin federicobaratin commented Dec 12, 2024

Thank you for your Pull Request! We have developed this task checklist from the Development Process Guide to help with the final steps of the process. Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the admiral codebase remains robust and consistent.

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

  • Place Closes #<insert_issue_number> into the beginning of your Pull Request Title (Use Edit button in top-right if you need to update)
  • Code is formatted according to the tidyverse style guide. Run styler::style_file() to style R and Rmd files
  • Updated relevant unit tests or have written new unit tests - See Unit Test Guide
  • If you removed/replaced any function and/or function parameters, did you fully follow the deprecation guidance?
  • Update to all 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
  • Address any updates needed for vignettes and/or templates
  • 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)
  • Build admiral site pkgdown::build_site() and check that all affected examples are displayed correctly and that all new functions occur on the "Reference" page.
  • Address or fix all lintr warnings and errors - lintr::lint_package()
  • 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!

@federicobaratin federicobaratin added documentation Improvements or additions to documentation enhancement New feature or request final review Addressing comments from the final review of Admiral team labels Dec 12, 2024
@federicobaratin federicobaratin self-assigned this Dec 12, 2024
@federicobaratin federicobaratin linked an issue Dec 12, 2024 that may be closed by this pull request
@ahasoplakus ahasoplakus requested review from ahasoplakus and manciniedoardo and removed request for vikrams95 December 12, 2024 14:37
R/derive_vars_crit.R Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Dec 12, 2024

Code Coverage

Package Line Rate Health
admiralvaccine 96%
Summary 96% (373 / 387)

@ahasoplakus
Copy link
Collaborator

Hi @federicobaratin I made some changes to yours to align with the phase 1 deprecation strategy of derive_vars_crit().
@manciniedoardo Please review and merge.

Copy link

@manciniedoardo manciniedoardo left a comment

Choose a reason for hiding this comment

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

Please see my review comments, thanks

@@ -1,16 +1,5 @@
# This is a list of urls to ignore in the link checking action Check URLS /

Choose a reason for hiding this comment

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

Is it intended to remove all this stuff here?

@@ -2,11 +2,9 @@
#'
#'
#' @description
#' Derive analysis criterion evaluation result variable, paired with character

Choose a reason for hiding this comment

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

why delete this section? i think ok to keep, just need to add the badge.

#'
derive_vars_crit <- function(dataset, prefix, crit_label, condition, criterion) {
condition <- assert_filter_cond(enquo(condition))

Choose a reason for hiding this comment

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

This is not in line with our deprecation strategy.

Here you have deleted all the function code and just added a warning. So the function behaves completely differently to before, as it is essentially just a warning thrower. If I am using this function in any code and upversion admiralvaccine, now my code will error or at least not derive the variables. Instead, what we want is for the code to still work, but a warning to be thrown (at least for this 1st Phase of deprecation, see again here
for details).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi Edoardo, I can take it. Just one question: on the Phase 1 strategy is suggested to put a warning + replace the "old" function code with the new one. Is this also the case? Or, for the moment, a simple warning + "old" function code is needed?

Choose a reason for hiding this comment

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

as you are implementing phase 1, you should just add the warning at the top of the function and then keep all else the same. you should also not delete documentation.

Choose a reason for hiding this comment

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

just to add, in your case you don't have any actual new code to replace as you are just deprecating this function in favour of one from another package (admiral)

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not in line with our deprecation strategy.

Here you have deleted all the function code and just added a warning. So the function behaves completely differently to before, as it is essentially just a warning thrower. If I am using this function in any code and upversion admiralvaccine, now my code will error or at least not derive the variables. Instead, what we want is for the code to still work, but a warning to be thrown (at least for this 1st Phase of deprecation, see again here for details).

Hi @manciniedoardo Thanks for the review! We have removed the old code and replaced it with a deprecate_warn (maybe it should be replaced with deprecate_inform) and the new admiral::derive_vars_crit_flag. So, I guess the code will still work or am I missing something here?
image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, thanks! I have just updated the documentation as per suggestions. @ahasoplakus , I kept the warning you put at the top of the function.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ahasoplakus . I just seen that you are working on that. I made a couple of simple updates, so I would stop here just to avoid confusion. Please, let me know if any change is required from my side

Copy link
Collaborator

@ahasoplakus ahasoplakus Jan 15, 2025

Choose a reason for hiding this comment

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

@ahasoplakus . I just seen that you are working on that. I made a couple of simple updates, so I would stop here just to avoid confusion. Please, let me know if any change is required from my side

Thanks @federicobaratin Please feel free to go ahead with the changes @manciniedoardo suggested and fix the checks that are currently failing. I will do a final review and merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request final review Addressing comments from the final review of Admiral team
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Feature Request: deprecate/supersede derive_vars_crit()
3 participants