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

Unit testing for data-process.R #76

Merged
merged 29 commits into from
Oct 29, 2024
Merged

Unit testing for data-process.R #76

merged 29 commits into from
Oct 29, 2024

Conversation

SaranjeetKaur
Copy link
Collaborator

@SaranjeetKaur SaranjeetKaur commented Oct 17, 2024

Use data_ps3_reformulation for unit testing of data-process.R and health-plots.R

This pull request includes several significant changes to the project's configuration files and R scripts to improve automation, code style, and data processing functionalities. The most important changes include adding a pre-commit configuration, enhancing GitHub Actions workflows, and refactoring data processing functions to be more efficient and maintainable.

Configuration and Automation Improvements:

  • Added a GitHub Actions workflow to run pre-commit hooks and automatically merge changes if no issues are found.
  • Added a pre-commit configuration file to enforce code style and other checks before commits.
  • Updated the .Rbuildignore file to include new configuration files and ensure they are ignored during the build process.
  • Updated the inst/config/config.yml file to include new grouping variables, weighted variables, and disease prevalence and incidence lists.

Data Processing Refactor:

  • Refactored the gen_data_weighted, gen_data_weighted_rf, gen_data_weighted_ds, gen_data_weighted_burden, gen_data_weighted_burden_spline functions to improve efficiency and readability by using dplyr and tidyr functions and incorporating configuration settings.

Dependency Updates:

  • Updated the Imports section to include rlang and stringr for improved data manipulation and string handling.

Documentation:

  • Updated the documentation for the gen_data_weighted_burden_spline function to reflect the new argument name data_weighted_burden_wide_collapse.

@SaranjeetKaur SaranjeetKaur linked an issue Oct 17, 2024 that may be closed by this pull request
This was linked to issues Oct 26, 2024
@SaranjeetKaur
Copy link
Collaborator Author

SaranjeetKaur commented Oct 28, 2024

When running devtools::check() it gave (for once):

checking for future file timestamps ... NOTE
  unable to verify current time

0 errors| 0 warnings| 1 note

This was resolved following the suggestions on the post:

  • Run usethis::edit_r_environ()
  • Add _R_CHECK_SYSTEM_CLOCK_=0 to the file
  • Save, close file, restart R

After which devtools::check() gives:

0 errors| 0 warnings| 0 notes

@SaranjeetKaur SaranjeetKaur requested a review from jzhu20 October 29, 2024 15:17
@SaranjeetKaur SaranjeetKaur merged commit 5f9f91b into main Oct 29, 2024
6 of 7 checks passed
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.

include unit test for data.process.R with CI Rename variables before processing Set up pre-commit yaml
1 participant