-
Notifications
You must be signed in to change notification settings - Fork 0
Add comprehensive roxygen2 docstrings to all R package functions #591
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
base: main
Are you sure you want to change the base?
Conversation
- Added docstrings to all functions in ZZZ.R (10 functions) - Added docstrings to fct_*.R files (3 functions) - Added docstrings to golem_utils_server.R (3 functions) - Added docstrings to golem_utils_ui.R (6 functions) - Added docstrings to mod_*_utils.R files (6 functions) - Added docstrings to mod_run_model_*.R files (4 functions) - Added docstrings to plot/visualization functions (2 functions) Co-authored-by: tomjemmett <[email protected]>
Co-authored-by: tomjemmett <[email protected]>
|
I'm taking ownership of this branch to make some changes and make sure it passes checks. |
|
Made updates and fixed issues, so marking as ready for review. I think we just want to be sure there's nothing utterly wrong. I've decided to leave the internal-function docs but as vanilla comments ( |
tomjemmett
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comments, whether we want to address these or not. I'm not sure if roxygen might get confused by seeing documentation for internal functions.
another thing to note, almost all functions have @noRd tags - might be worth addressing this in a separate PR.
|
Moved to draft status. @matt-dray to assess in week of 5 Jan how best to approach this. Options include splitting it up or closing. |
Close #53.
Overview
This PR adds comprehensive roxygen2 documentation to all previously undocumented functions in the nhp_inputs R package. All utility functions, helper functions, and nested internal functions now have proper docstrings following roxygen2 conventions.
Changes
Added roxygen2 docstrings to 40+ functions across 18 files (~400 lines of documentation), including:
Core Utilities (R/ZZZ.R)
params_path,params_filename,load_params)rtt_specialties,md_file_to_html)encrypt_filename)get_params_schema_text,create_params_schema)is_local)sanitize_input_name)Feature Functions (R/fct_*.R)
age_pyramid)get_population_growth_options)reduce_valuesand nested helper)Golem Utilities (R/golem_utils_*.R)
rv,rvtl,drop_nulls)list_to_li,list_to_p,named_to_li,tag_remove_attributes,display,undisplay)Module Utilities (R/mod_*_utils.R)
mod_expat_repat_trend_plot,mod_expat_repat_local_split_plot,mod_expat_repat_nonlocal_n,mod_expat_repat_nonlocal_icb_map)mod_non_demographic_adjustment_table,mod_waiting_list_imbalances_table)Model Run Functions (R/mod_run_model_*.R)
mod_run_model_submit,mod_run_model_check_container_status)mod_run_model_fix_params,mod_run_model_remove_invalid_mitigators)recursive_nullify,remove_item)Visualization Functions
rates_boxplot,rates_trend_plot)Nested Module Helpers
create_table,generate_param_controls)extract_expat_repat_data)get_default,convert_number)Documentation Standards
All docstrings follow roxygen2 conventions and include:
@paramtags: Documentation for each parameter with type information@returntags: Description of return values@noRdtags: Marks internal functions not exported in package documentationExample:
Impact
.Rdfiles viadevtools::document()Testing
The existing CI workflow (
.github/workflows/check.yaml) will:devtools::document()to generate documentation filesThis ensures documentation stays synchronized with code changes going forward.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
cloud.r-project.org/usr/lib/R/bin/exec/R --quiet --no-save -e install.packages(c('roxygen2',~+~'devtools'),~+~repos='REDACTED',~+~dependencies=TRUE)(dns block)esm.ubuntu.com/usr/lib/apt/methods/https(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.