Skip to content

Function names rename for R/combine_analysis.R, R/combine_files.R, R/create_lineage_lookup.R, R/assign_job_queue.R#95

Merged
the-mayer merged 22 commits into
JRaviLab:mainfrom
Seyi007:function_names_rename
Oct 22, 2024
Merged

Function names rename for R/combine_analysis.R, R/combine_files.R, R/create_lineage_lookup.R, R/assign_job_queue.R#95
the-mayer merged 22 commits into
JRaviLab:mainfrom
Seyi007:function_names_rename

Conversation

@Seyi007
Copy link
Copy Markdown
Collaborator

@Seyi007 Seyi007 commented Oct 10, 2024

Description

Due to the last conversation on the Zoom meeting, I decided to separate the function names rename from the error handling PR I opened in #76. This makes it easier for the continuous topic-based merging currently being done by @the-mayer.

What kind of change(s) are included?

  • Feature (adds or updates new capabilities)
  • Bug fix (fixes an issue).
  • Enhancement (adds functionality).
  • Breaking change (these changes would cause existing functionality to not work as expected).

Checklist

Please ensure that all boxes are checked before indicating that this pull request is ready for review.

  • I have read and followed the CONTRIBUTING.md guidelines.
  • I have searched for existing content to ensure this is not a duplicate.
  • I have performed a self-review of these additions (including spelling, grammar, and related).
  • I have added comments to my code to help provide understanding.
  • I have added a test which covers the code changes found within this PR.
  • I have deleted all non-relevant text in this pull request template.
  • Reviewer assignment: @the-mayer @jananiravi

Seyi007 and others added 12 commits October 5, 2024 12:29
- Added validation checks for input parameters (accessions, ipg_file, assembly_path, lineagelookup_path).
- Included error messages for missing or invalid inputs and file existence checks.
- Wrapped main logic in tryCatch for graceful error handling during execution.
")
- Implement error handling for mapOption2Process, get_proc_medians, write_proc_medians_table, get_proc_weights, advanced_opts2est_walltime, assign_job_queue, and plot_estimated_walltimes .
- Validate input arguments for each function to ensure they meet expected criteria.
- Use tryCatch blocks to gracefully handle errors and warnings.
- Provide informative error messages and detailed logging where appropriate.
- Ensure functions fail gracefully and provide useful feedback.

Also renamed the functions to the following;
assign_job_queue -> assignJobQueue
make_opts2procs	-> mapOption2Process
map_advanced_opts2procs	-> mapAdvOption2Process
get_proc_medians - calculateProcessRuntime
write_proc_medians_table -> writeProcessRuntime2TSV
write_proc_medians_yml -> writeProcessRuntime2YML
get_proc_weights -> getProcessRuntimeWeights
advanced_opts2est_walltime -> calculateEstimatedWallTimeFromOpts
plot_estimated_walltimes -> plotEstimatedWallTimes
…blast functions. This includes arguments check before wrapping code logic in a tryCatch block.
… a separate pr for their updates and on a different branch: R/combine_analysis.R

combine_full
combine_ipr

R/combine_files.R
combine_files

R/create_lineage_lookup.R
create_lineage_lookup
shorten_NA
R/combine_analysis.R
combine_full
combine_ipr

R/combine_files.R
combine_files

R/create_lineage_lookup.R
create_lineage_lookup
shorten_NA with approved names from JRaviLab#44
…rocs, get_proc_medians, write_proc_medians_table, write_proc_medians_yml, get_proc_weights, advanced_opts2est_walltime in R/assign_job_queue.R to be updated in a separate full request
Merge branch 'rename_functions' into function_names_rename
| Original                        | Modified                         | User Facing                      |
|---------------------------------|----------------------------------|----------------------------------|
| assign_job_queue                | assignJobQueue                   | ✔️                               |
| make_opts2procs                 | mapOption2Process                | ✔️                               |
| map_advanced_opts2procs         | mapAdvOption2Process             | ✔️                               |
| get_proc_medians                | calculateProcessRuntime          | ✔️                               |
| write_proc_medians_table        | writeProcessRuntime2TSV          | ✔️                               |
| write_proc_medians_yml          | writeProcessRuntime2YML          | ✔️                               |
| get_proc_weights                | getProcessRuntimeWeights         | ✔️                               |
| advanced_opts2est_walltime      | calculateEstimatedWallTimeFromOpts| ✔️                               |
| plot_estimated_walltimes        | plotEstimatedWallTimes           | ✔️                               |
@Seyi007 Seyi007 changed the title Function names rename for R/combine_analysis.R, R/combine_files.R, R/create_lineage_lookup.R Function names rename for R/combine_analysis.R, R/combine_files.R, R/create_lineage_lookup.R, R/assign_job_queue.R Oct 10, 2024
@Seyi007 Seyi007 requested a review from the-mayer October 10, 2024 10:05
@the-mayer the-mayer self-assigned this Oct 12, 2024
@the-mayer the-mayer added the bug Something isn't working label Oct 12, 2024
Copy link
Copy Markdown
Member

@jananiravi jananiravi left a comment

Choose a reason for hiding this comment

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

@Seyi007 (@the-mayer) does this carry a combination of function renames, styler, and tryCatch error handling commits? Should we separate them out in the future into separate PRs, even if it's easier to go ahead with the combined one this time?

Copy link
Copy Markdown
Collaborator

@the-mayer the-mayer left a comment

Choose a reason for hiding this comment

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

@jananiravi / @Seyi007 , I believe I have removed all code not relevant to the rename PR. This combined with a rebase to pull in additional PRs and I think we are ready to merge.

@Seyi007
Copy link
Copy Markdown
Collaborator Author

Seyi007 commented Oct 14, 2024

Yes as @the-mayer said, this pr is solely for renaming functions. The other pr #76 is for error handling @jananiravi. This would make it easy for David to merge them on the basis of a specific issue.

Copy link
Copy Markdown
Contributor

@falquaddoomi falquaddoomi left a comment

Choose a reason for hiding this comment

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

Generally, it looks good, and the new names are IMO much more readable. I left a few comments.

Comment thread R/acc2lin.R Outdated
Comment thread R/assign_job_queue.R
@jananiravi jananiravi added outreachy for outreachy interns documentation Improvements or additions to documentation, incl. R docstring/roxygen2 labels Oct 20, 2024
@the-mayer the-mayer merged commit 4c3d0b4 into JRaviLab:main Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation, incl. R docstring/roxygen2 outreachy for outreachy interns

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants