Add comprehensive guide for adding C++ modules to FIMS#1115
Add comprehensive guide for adding C++ modules to FIMS#1115kellijohnson-NOAA merged 2 commits intodevfrom
Conversation
|
@kellijohnson-NOAA, @awilnoaa, and @grantdadams, take a look at the result of our breakout session issue assigned to copilot. On first glance, it's all pretty impressive, and the new vignette it created (vignettes/adding-new-module.Rmd) is complex enough that it's clear why we need something like this. Unfortunately I'm not qualified to judge the accuracy of the instructions. One other thing that I'm curious about is what our process for updating the guide would look like. We could periodically ask copilot to update the guide, but I'm not sure if there would be a way to automatically trigger a check for whether the guide is out of date and/or propose updates. I'll ask copilot. |
|
@copilot, do you have suggestions for how to keep the documentation in this pull request up to date throughout future changes to the software architecture? |
Here are several strategies to keep this documentation up to date: 1. Link-based Approach (Already Used) 2. CI Validation Check
3. PR Template Addition - [ ] If this PR adds/modifies module structure, update `vignettes/adding-new-module.Rmd`4. Automated Reminder
The action posts a comment reminding reviewers to check if documentation needs updates. 5. Periodic Review Most Effective Combination: Use strategies 1, 3, and 4 together - the link-based approach catches breaking changes, PR template reminds developers, and automation flags architectural changes. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #1115 +/- ##
==========================================
+ Coverage 81.07% 88.99% +7.92%
==========================================
Files 53 80 +27
Lines 2087 8008 +5921
Branches 536 539 +3
==========================================
+ Hits 1692 7127 +5435
- Misses 303 857 +554
+ Partials 92 24 -68 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@copilot can you switch this PR to merge into |
I don't have the ability to change the base branch of a PR through git commands - this requires GitHub UI access or API permissions that I don't have. To change the base branch from
Alternatively, a repository maintainer with appropriate permissions can make this change, or you can use the GitHub CLI: gh pr edit <PR_NUMBER> --base dev |
|
@copilot can you please update inst/WORDLIST to include instantiation and lifecycle |
|
Wow, that is super slick and helpful @iantaylor-NOAA for R&D work! |
|
A lot of relevant information also now exists in two vignettes that will be brought in with #1089 |
3bf9e4f to
de9a41e
Compare
|
Hi @kellijohnson-NOAA , @iantaylor-NOAA , @grantdadams. I was reviewing the guide and as someone currently developing a new module, I found it really useful. I have a few suggestions to consider. 1. Step 1: C++ Implementation Section
2. Make “Key elements” formatting consistent
3. Step 5: Testing Section
4. Step 6: Documentation Section
5. Checklist Section
If Copilot can make these updates, great, otherwise I am happy to update things. Let me know what you think. I am not sure if some of this material is already available elsewhere. |
|
@awilnoaa do you have time to review this PR this week? I asked copilot to integrate your suggestions but I also asked it to remove the additional file of MODULE_CHECKLIST.md in favor of putting this information in CONTRIBUTING.md to reduce the locations where information is stored. I made some manual edits as well. Lastly, I asked copilot to update the instructions based on the current code in dev because we have changed a few things since the PR was made. |
|
@kellijohnson-NOAA will do |
| "i" = "Model will run but check that data types are correct." | ||
| )) | ||
| } | ||
|
|
There was a problem hiding this comment.
I think this check might not be returning errors anymore. I tested it locally using
FIMSFrame(dplyr::filter(data_big, type != "weight_at_age"))
and it runs without producing an error. It looks like the final return(TRUE) / return(errors) section after the loop was removed and might need to be added back?
Example output:
r$> FIMSFrame(dplyr::filter(data_big, type != "weight_at_age"))
tbl_df of class 'FIMSFrame'
with the following 'types': age_comp, age_to_length_conversion, landings, length_comp, index
# A tibble: 6 × 8
# A tibble: 6 × 8
type name age length timing value unit
<chr> <chr> <int> <dbl> <int> <dbl> <chr>
1 age_co… flee… 1 NA 1 0.07 prop…
2 age_co… flee… 2 NA 1 0.1 prop…
3 age_co… flee… 3 NA 1 0.115 prop…
4 age_co… flee… 4 NA 1 0.15 prop…
5 age_co… flee… 5 NA 1 0.1 prop…
6 age_co… flee… 6 NA 1 0.05 prop…
# ℹ 1 more variable: uncertainty <dbl>
| ) | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
| if (length(errors) == 0) { | |
| return(TRUE) | |
| } else { | |
| return(errors) | |
| } |
There was a problem hiding this comment.
For this, it looks like if two separate PRs both target dev, one formatting run could cancel the other. Compared to the other workflow files, this seems like a new behavior, so I just wanted to double-check that it’s intentional.
|
@awilnoaa I need to rebase this PR. I am so sorry that I asked you to review this without realizing that it needed to be rebased. |
6a16323 to
5ad395a
Compare
|
I made your comments into separate issues, and have since rebased the PR so it is actually manageable. So sorry for that oversite. |
awilnoaa
left a comment
There was a problem hiding this comment.
Everything else looks good to me
No worries, lol I was wondering why there were so many files in this 😆 |
bd10a45 to
bf0133c
Compare
8ffb3ec to
31e7278
Compare
Co-authored-by: iantaylor-NOAA <4992918+iantaylor-NOAA@users.noreply.github.com>
Apply suggestion from @awilnoaa Co-authored-by: Dr. Wilson <167116769+awilnoaa@users.noreply.github.com>
31e7278 to
7ac4937
Compare
Adds and refines developer documentation for creating new C++ modules in FIMS, with the guide updated to match the current
devbranch architecture.Changes Made
Documentation
vignettes/adding-new-module.Rmd: Comprehensive guide for adding new modules, revised to reflect the currentdevbranch workflow and architectureCONTRIBUTING.md: Expanded the “Adding a new module” section to incorporate the practical checklist content directly and added a dedicated Standard contributor checks section for routine contributor tasksREADME.md: Added developer-resource links to the module guideGuide Improvements Based on Review Feedback
CONTRIBUTING.mdfor standard contributor tasks such as building Doxygen, running the Google test suite, running testthat, formatting, spell-checking, and package checks, rather than duplicating that guidanceUpdated for Current
devBranch ArchitectureThe guide now reflects the current setup path and object lifecycle in
dev, including:R/create_default_configurations.RR/create_default_parameters.RR/initialize_modules.Rinitialize_fims()add_to_fims_tmb_internal()info->variable_map[...]finalize()src/fims_modules.hppR/FIMS-package.RSpell-check Support
instantiationandlifecycletoinst/WORDLISTSummary
This PR now provides both:
CONTRIBUTING.mdso the workflow is easier to maintain in one placeThe updated documentation addresses the original request for:
It also incorporates reviewer suggestions and removes outdated or duplicated guidance so contributors are following the current
dev-branch structure rather than an older FIMS architecture.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.