Skip to content

Dev two population vignette#1446

Draft
msupernaw wants to merge 4 commits into
mainfrom
dev-two-population-vignette
Draft

Dev two population vignette#1446
msupernaw wants to merge 4 commits into
mainfrom
dev-two-population-vignette

Conversation

@msupernaw

@msupernaw msupernaw commented May 5, 2026

Copy link
Copy Markdown
Contributor

What is the feature?

  • Adds a vignette that demonstrates how to configure a FIMS catch-at-age model with two population objects.

Instructions for code reviewer

👋Hello reviewer👋, thank you for taking the time to review this PR!

  • Please use this checklist during your review, checking off items that you have verified are complete but feel free to skip over items that are not relevant!
  • See the GitHub documentation for how to comment on a PR to indicate where you have questions or changes are needed before approving the PR.
  • Please use standard conventional messages for both commit messages and comments
  • PR reviews are a great way to learn so feel free to share your tips and tricks. However, when suggesting changes to the PR that are optional please include nit: (for nitpicking) as the comment type. For example, nit: I prefer using a data.frame() instead of a matrix because ...
  • Engage with the developer. Make it clear when the PR is approved by selecting the approved status, and potentially commenting on the PR with something like This PR is now ready to be merged.

Checklist

  • The PR requests the appropriate base branch (dev for features and main for hot fixes)
  • The code is well-designed
  • The code is designed well for both users and developers
  • Code coverage remains high- [ ] Comments are clear, useful, and explain why instead of what
  • Code is appropriately documented (doxygen and roxygen)

msupernaw added 2 commits May 5, 2026 07:21
This vignette introduces multi-population modeling in FIMS, detailing the setup, recruitment, growth, maturity, and catch-at-age models for two populations.
Updated the vignette to enhance clarity and structure, including detailed explanations of the workflow and model configurations for multi-population modeling in FIMS.
@codecov

codecov Bot commented May 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.46%. Comparing base (3d4e2d6) to head (cd4e150).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1446      +/-   ##
==========================================
+ Coverage   82.97%   89.46%   +6.49%     
==========================================
  Files          54       83      +29     
  Lines        2214     8478    +6264     
  Branches      579      582       +3     
==========================================
+ Hits         1837     7585    +5748     
- Misses        311      861     +550     
+ Partials       66       32      -34     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kellijohnson-NOAA kellijohnson-NOAA changed the base branch from main to dev May 5, 2026 13:19
Comment thread vignettes/fims-two-population.Rmd Outdated
Comment on lines +457 to +458
caa$AddPopulation(population1$get_id())
caa$AddPopulation(population2$get_id())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You set up 2 populations but the vignette should go deeper than that to actually make sure that they work, e.g., that you can make at least one parameter different and that the results show how to look at the results of the parameters. I need to be able to see that this could be used for sex and right now I do not see that.

@e-perl-NOAA

Copy link
Copy Markdown
Contributor

@kellijohnson-NOAA I wonder if there should be a section up at the top that defines/lists what vignettes should have been completed/reviewed before attempting to work through this one (this might be a good practice for most/all the vignettes?). I could just see people hopping straight into vignettes for the type of model that they need to build and skipping a lot of the fundamental info that is useful (such as what the heck using methods::new() is all about).

## Inspect results

```{r inspect-results}
# Gradient at the final parameter values. Values near zero indicate that the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe break this up into three chunks, one for the obj$gr(), one for the opt, and one for the head(sdr_report) and add some text before each small chunk about what you want to draw the user's attention to in each of the results that you are providing.

Comment thread vignettes/fims-two-population.Rmd Outdated

When adapting this example, check whether a module should be shared across
populations or instantiated separately. Sharing a module means the populations use
the same registered object and therefore the same parameterization.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You could insert something like

"(see the Defined shared recruitment section)"

at the end of this text so people can quickly refer to what it means to do that.

recruitment$log_rzero[1]$value <- log(om_input[["R0"]])
recruitment$log_rzero[1]$estimation_type$set("fixed_effects")

# Beverton-Holt steepness on the FIMS logit scale.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You started off with a lot of inline text throughout the code chunks that were super helpful, but it stops at some point throughout the vignette. If you could add more inline comments and/or text before broken up code chunks throughout the rest of the vignette, I think that would be helpful.

Updated the vignette to demonstrate a two-population FIMS model with distinct initial numbers at age for each population, interpreted as sexes. Adjusted workflow steps and added clarifications on population-specific parameters.
@kellijohnson-NOAA kellijohnson-NOAA marked this pull request as draft May 20, 2026 19:10
@kellijohnson-NOAA kellijohnson-NOAA deleted the branch main May 21, 2026 04:00
@kellijohnson-NOAA kellijohnson-NOAA changed the base branch from dev to main May 21, 2026 04:04
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.

3 participants