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

#92 Create function to derive reference dates in DM domain #98

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

Conversation

muzzama-1990
Copy link
Collaborator

@muzzama-1990 muzzama-1990 commented Sep 20, 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 oak 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 Create function to derive the reference dates #92 into the beginning of your Pull z
    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, which should
    consider realistic data scenarios and edge cases, e.g. empty datasets, errors,
    boundary cases etc. - 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, including keywords
    and families. Refer to the
    categorization of functions to tag appropriate keyword/family.
  • 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 oak 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 in the Development Section on the right hand side.
  • Address all merge conflicts and resolve appropriately
  • Pat yourself on the back for a job well done! Much love to your accomplishment!

@muzzama-1990 muzzama-1990 linked an issue Sep 20, 2024 that may be closed by this pull request
Copy link

github-actions bot commented Sep 20, 2024

Code Coverage

Package Line Rate Health
sdtm.oak 94%
Summary 94% (1038 / 1105)

@muzzama-1990 muzzama-1990 marked this pull request as draft September 20, 2024 01:34
@muzzama-1990 muzzama-1990 changed the title 92 Create function to derive reference dates to be used in DM domain #92 Create function to derive reference dates to be used in DM domain Sep 20, 2024
@muzzama-1990 muzzama-1990 self-assigned this Sep 20, 2024
@muzzama-1990 muzzama-1990 added the enhancement New feature or request label Sep 20, 2024
@muzzama-1990 muzzama-1990 changed the title #92 Create function to derive reference dates to be used in DM domain #92 Create function to derive reference dates in DM domain Sep 20, 2024
@muzzama-1990 muzzama-1990 marked this pull request as ready for review September 20, 2024 02:24
Copy link
Collaborator

@ShiyuC ShiyuC left a comment

Choose a reason for hiding this comment

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

@muzzama-1990 Thanks for your great work on these functions! I left some comments for your consideration.

@@ -0,0 +1,127 @@
#' Calculate minimum and maximum date and time in the dataframe
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
#' Calculate minimum and maximum date and time in the dataframe
#' Calculate minimum and maximum date and time in the data frame

R/cal_min_max_date.R Outdated Show resolved Hide resolved
R/cal_min_max_date.R Outdated Show resolved Hide resolved
R/cal_min_max_date.R Show resolved Hide resolved
.format = date_format
)
} else {
# If both date and time variables are presen use both date and time
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# If both date and time variables are presen use both date and time
# If both date and time variables are present use both date and time

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated

R/cal_min_max_date.R Show resolved Hide resolved
R/oak_cal_ref_dates.R Outdated Show resolved Hide resolved
R/oak_cal_ref_dates.R Show resolved Hide resolved
val_type = "min",
date_format,
time_format) {
# Check if date is present in the raw data frame
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we need to check if date_variable, time_variable are a string of single character, in case users input a vector of variable names.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This function is called by the oak_cal_ref_dates and parameters are read from the dataframe hence feel that this assertion is not required.

@muzzama-1990
Copy link
Collaborator Author

@ShiyuC I have addressed your review comments but it looks like the pipelines are failing because of some issue and I see you are working on fixing that in another PR. Once that PR is merged I will rerun the pipelines and the PR will be ready for review.

Copy link
Collaborator

@ShiyuC ShiyuC left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks Mohsin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Product Backlog
Development

Successfully merging this pull request may close these issues.

Create function to derive the reference dates
2 participants