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 #10 add function create_iso8601() #21

Merged
merged 56 commits into from
Nov 29, 2023
Merged

Conversation

ramiromagno
Copy link
Collaborator

@ramiromagno ramiromagno commented Nov 15, 2023

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 #<insert_issue_number> 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
  • 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()

There is this NOTE:

❯ checking package subdirectories ... NOTE
  Problems with news in ‘NEWS.md’:
  No news entries found.
  • Link the issue in the Development Section on the right hand side.
  • Address all merge conflicts and resolve appropriately

@ramiromagno ramiromagno linked an issue Nov 15, 2023 that may be closed by this pull request
Copy link

github-actions bot commented Nov 15, 2023

Code Coverage

Package Line Rate Health
sdtm.oak 88%
Summary 88% (241 / 273)

Copy link
Collaborator

@edgar-manukyan edgar-manukyan left a comment

Choose a reason for hiding this comment

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

Thanks so much @ramiromagno, this is a great job 💠 💠 💠
So far I only had a chance to look at create_iso8601() and run the Roche tests. I added my comments along the lines.

I also did a time check with 310K records and it was slightly faster than the function we have in Roche. I run both on the same machine:

# 310K records

# sdtm.oak::create_iso8601()
# user  system elapsed 
# 7.20    0.34    8.58

# roak::calc_iso_date_time()
# user  system elapsed 
# 7.51    0.79    9.22 

To be fair, the above estimate was based on when I supplied all the known formats dtc_formats$fmt. If I supply only one format then sdtm.oak is the champion 🚀:

   user  system elapsed 
   2.43    0.18    2.76 

I will continue reviewing the internal functions 👍

R/dtc_create_iso8601.R Outdated Show resolved Hide resolved
R/dtc_create_iso8601.R Show resolved Hide resolved
R/dtc_create_iso8601.R Show resolved Hide resolved
tests/testthat/test-create_iso8601.R Show resolved Hide resolved
R/dtc_utils.R Outdated Show resolved Hide resolved
R/dtc_create_iso8601.R Show resolved Hide resolved
tests/testthat/test-create_iso8601.R Show resolved Hide resolved
R/dtc_utils.R Show resolved Hide resolved
R/dtc_utils.R Show resolved Hide resolved
R/dtc_create_iso8601.R Outdated Show resolved Hide resolved
R/dtc_utils.R Show resolved Hide resolved
R/package.R Outdated Show resolved Hide resolved
R/dtc_utils.R Outdated Show resolved Hide resolved
R/parse_dttm_fmt.R Outdated Show resolved Hide resolved
ramiromagno and others added 14 commits November 16, 2023 15:42
Co-authored-by: edgar-manukyan <edgar.manukyan@roche.com>
This function was likely added as part of an automatic setup of the R package as a whole but I guess we should add the `.onLoad()` if really needed.
Initially I thought of calling this function from within `assert_dtc_fmt()` but I think now that the current usage of `rlang::arg_match()` leads to more concise code, so this is preferred.
Import `.data` from rlang globally by using the R package level documentation (https://roxygen2.r-lib.org/articles/rd-other.html?q=_PACKAGE#packages).
galachad and others added 7 commits November 20, 2023 17:48
* Add staged_dependencies for admiraldev

* Add new line

* Fix admiraldev links.

* Fix admiraldev articles links.

* Remove R 4.1 a it causing dependencies issues. We want to use purrr >= 1.0.0

* Test latest lintr

* Test lintr with install package locally

* Add install pacakge variable for lintr

* Skip multi version pkgdown workflow.

* R build ignore staged_dependencies.yaml
@edgar-manukyan
Copy link
Collaborator

edgar-manukyan commented Nov 21, 2023

@ramiromagno, thanks so much for addressing Adam's and my comments 🙏

Everything looks awesome! I know that after the second approval you can merge, just wanted to make sure that at least one of our subject matter experts had a chance to try this awesomeness out. @rammprasad, will you have time?

@rammprasad
Copy link
Collaborator

Yes, I am reviewing it today. Lets merge it tomorrow.

@ramiromagno
Copy link
Collaborator Author

Thank you so much for your feedback so far. I think we can still improve quite a bit the article about the create_iso8601() function and add more units tests to get a good coverage. But perhaps getting some user feedback already would be useful too. Note that, as @rammprasad had suggested in one of our meetings, I changed the default value of .check_format from TRUE to FALSE.

Copy link
Collaborator

@rammprasad rammprasad left a comment

Choose a reason for hiding this comment

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

Great work, @ramiromagno . it is actually mindblowing. I have added some comments. Please take a look.

R/dtc_create_iso8601.R Show resolved Hide resolved
R/dtc_create_iso8601.R Show resolved Hide resolved
data-raw/dtc_formats.R Show resolved Hide resolved
R/dtc_create_iso8601.R Show resolved Hide resolved
R/dtc_create_iso8601.R Show resolved Hide resolved
@ramiromagno
Copy link
Collaborator Author

Hello @rammprasad: Just to be sure, I am only waiting for this pull request to be reviewed by you and then merged before I tackle these other two issues: #28 and #29. Is that okay?

@galachad galachad merged commit 9d4944e into main Nov 29, 2023
14 of 16 checks passed
@galachad galachad deleted the 0010_calculate_isodate branch November 29, 2023 15:41
@rammprasad
Copy link
Collaborator

Thank you, @ramiromagno, for merging this to the main. We can work on other issues (maybe #18 ) before #28 and #29

@ramiromagno
Copy link
Collaborator Author

Hi @rammprasad : I was not the one to perform the merging :) It was Adam. But I am happy to address those three issues :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Develop a function to create ISO8601 date
4 participants