Skip to content

Add data_small dataset and associated test and documentation#958

Draft
iantaylor-NOAA wants to merge 15 commits into
mainfrom
dev-data-small
Draft

Add data_small dataset and associated test and documentation#958
iantaylor-NOAA wants to merge 15 commits into
mainfrom
dev-data-small

Conversation

@iantaylor-NOAA

Copy link
Copy Markdown
Contributor

What is the feature?

How have you implemented the solution?

  • Add R script data-raw/data_small.R which generates the dataset
  • Add data/data_small.rda created by the script above, which runs the usethis::use_data() command at the end.
  • Add test tests/testthat/test-data_small.R which confirms that the dataset can be converted to a FIMSFrame object and used in a model.
  • Rename R/data1.R to R/data.R and adds documentation of the second data set in the same file, following the {tidyr} example described in https://r-pkgs.org/data.html#sec-documenting-data (they could be documented in separate files, but that might make keeping them aligned harder)
  • Add man/data_small.Rd created by devtools::document() running on the R/data.R file noted above.

Does the PR impact any other area of the project, maybe another repo?

  • No, it should have zero impact on all other areas. In the future we could include data_small in testing if it proves helpful.

Bai-Li-NOAA and others added 15 commits August 13, 2025 11:53
* set verbosity to `quiet` in `tests/testthat.R` to suppress test output
  when running `devtools::test()` locally.
* set verbosity to `quiet` in `tests/testthat/helper-aaa-quiet-test-output.R`
  to suppress output when running `testthat::test_package()` locally.
  This mirrors the "Show testthat output" (`test_check()`) step in the
  `call-r-cmd-check` GitHub Action workflow.
* set `silent = TRUE` in `TMB::MakeADFun()` calls to
  suppress TMB output during tests.
* use `suppressMessages()` to silence output from fims_frame tests and
  testthat template tests.
* don't use `Rcerr` to print a message to the console when the ParameterVector
  index is out of range, since `throw` already handles the error output.
Bumps [actions/first-interaction](https://github.com/actions/first-interaction) from 1 to 2.
- [Release notes](https://github.com/actions/first-interaction/releases)
- [Commits](actions/first-interaction@v1...v2)

---
updated-dependencies:
- dependency-name: actions/first-interaction
  dependency-version: '2'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
* document(check_fims.R): Add examples of strings passed to ... in
  FIMS:::setup_and_run_gtest()
* refactor(fimsfit.R):
  * Remove is.FIMSFits() function
  * Remove "total" from number_of_parameters; only print it
    as the sum of fixed_effects + random_effects
* document(fimsfit.R): Add comment referencing sdmTMB issue #455 to
  evaluate whether report should always use last.par.best
* document(initialize_modules.R): Clarify that dims field is necessary
  to track dimensions for multivariate input (e.g., MVNORM) and may be
  needed for other distributions
* update(data1.R): Remove check for CSV readability in R
* update(helper-integration-tests-setup-function.R): Replace 1:x with
  seq_along() in for loop for safer indexing

Co-authored-by: Andrea-Havron-NOAA <Andrea-Havron-NOAA@users.noreply.github.com>
Co-authored-by: k-doering-NOAA <k-doering-NOAA@users.noreply.github.com>
Co-authored-by: kellijohnson-NOAA <kellijohnson-NOAA@users.noreply.github.com>
Co-authored-by: msupernaw <msupernaw@users.noreply.github.com>
Co-authored-by: nathanvaughan-NOAA <nathanvaughan-NOAA@users.noreply.github.com>
Co-authored-by: peterkuriyama-NOAA <peterkuriyama-NOAA@users.noreply.github.com>
* add README.md under the /tests directory as a quick reference for
  testing. It includes instructions on adding a new test, run tests, and
  debug tests.
* add a C++ test template to inst/templates.
* add a new R function `use_gtest_template()` to create a C++ test file
  using the template and register the test in
  `tests/gtest/CMakeLists.txt`.
* add R unit tests for `use_gtest_template()`.
* add a C++ test `tests/gtest/test_FIMSJson_JsonParser_WriteToFile.cpp`
  to verify error handling instructions outlined in the C++ test template.
* update LogisticSelectivity C++ test to use the new template.
* fix spelling errors and update WORDLIST.
* Place `Rcpp::loadModule(module = "fims", what = TRUE)` inside the
  `.onLoad` function has been observed to fix R session crashes when running
  `devtools::load_all()` followed by `devtools::test()` in the package
  development workflow.
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Instructions for code reviewer

Hello reviewer, thanks 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 conventions in the guidelines for conventional commit 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 when they respond to comments and check off additional boxes as they become complete so the PR can be merged in when all the tasks are fulfilled. Make it clear when the PR is approved by selecting the approved status, and potentially by commenting on the PR with something like This PR is now ready to be merged, no additional changes are needed.

Checklist

  • The PR is requested to be merged into the appropriate branch (typically dev).
  • The code is well-designed.
  • The functionality is good for the users of the code.
  • Code coverage remains high, indicating the new code is tested.
  • The code is commented and the comments are clear, useful, and mostly explain why instead of what.
  • Code is appropriately documented (doxygen and roxygen).

@codecov

codecov Bot commented Aug 16, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.53086% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.55%. Comparing base (bb9558f) to head (b23a4e5).
⚠️ Report is 208 commits behind head on dev.

Files with missing lines Patch % Lines
R/zzz.R 0.00% 1 Missing ⚠️
...nterface/rcpp/rcpp_objects/rcpp_interface_base.hpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #958      +/-   ##
==========================================
- Coverage   80.26%   74.55%   -5.72%     
==========================================
  Files          51       82      +31     
  Lines        1941     7982    +6041     
  Branches      469      308     -161     
==========================================
+ Hits         1558     5951    +4393     
- Misses        268     2025    +1757     
+ Partials      115        6     -109     

☔ 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

Copy link
Copy Markdown
Contributor

Thanks @iantaylor-NOAA for this PR. I plan on reviewing it today.

@kellijohnson-NOAA

Copy link
Copy Markdown
Contributor

@iantaylor-NOAA thank you for this PR and sorry that I have been so slow to review it. I am going to mark it as draft and I will come back to it after the CIE Review.

@iantaylor-NOAA

Copy link
Copy Markdown
Contributor Author

@kellijohnson-NOAA, the notifications about this PR reminded me that it's out of date relative to the current FIMS. I can commit further changes to update it. But it also looks like I should perhaps cherry pick the original commits related to data_small to separate them from other unrelated commits in August 2025.

@kellijohnson-NOAA

Copy link
Copy Markdown
Contributor

Sorry about those emails, they came from me deleting the dev branch before changing the base branch of this PR. I think we can just leave things as they are right now and maybe we can decide on a way forward after we get the comments back from the CIE Review?

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.

4 participants