Skip to content
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

Reorganize test data #741

Merged
merged 5 commits into from
Feb 13, 2025
Merged

Reorganize test data #741

merged 5 commits into from
Feb 13, 2025

Conversation

Bai-Li-NOAA
Copy link
Contributor

What is the feature?

How have you implemented the solution?

  • Use test fixtures to properly generate multiple combinations of available data
  • Add integration tests to validate handling of missing values in the datasets

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

  • Other branches will need to be rebased with updated tests.

Copy link
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!
  • For PRs that don't make changes to code (e.g., changes to README.md or Github actions workflows), feel free to skip over items on the checklist that are not relevant. Remember it is still important to do a thorough review.
  • Then, comment on the pull request with your review indicating where you have questions or changes need to be made before merging.
  • Remember to review every line of code you’ve been asked to review, look at the context, make sure you’re improving code health, and compliment developers on good things that they do.
  • PR reviews are a great way to learn, so feel free to share your tips and tricks. However, for optional changes (i.e., not required for merging), please include nit: (for nitpicking) before making the suggestion. 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 this has been reached by commenting on the PR with something like This PR is now ready to be merged, no changes needed.

Checklist

  • The PR is requested to be merged into the appropriate branch (typically main)
  • The code is well-designed.
  • The functionality is good for the users of the code.
  • Any User Interface changes are sensible and look good.
  • The code isn’t more complex than it needs to be.
  • Code coverage remains high, indicating the new code is tested.
  • The developer used clear names for everything.
  • Comments are clear and useful, and mostly explain why instead of what.
  • Code is appropriately documented (doxygen and roxygen).

@Bai-Li-NOAA Bai-Li-NOAA changed the base branch from main to dev January 31, 2025 21:58
Copy link

codecov bot commented Jan 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.92%. Comparing base (586ab1c) to head (78532f8).
Report is 5 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #741      +/-   ##
==========================================
+ Coverage   68.71%   68.92%   +0.21%     
==========================================
  Files          44       44              
  Lines        4714     4714              
  Branches      197      197              
==========================================
+ Hits         3239     3249      +10     
+ Misses       1428     1418      -10     
  Partials       47       47              

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

@Bai-Li-NOAA Bai-Li-NOAA marked this pull request as draft February 3, 2025 13:13
@Bai-Li-NOAA Bai-Li-NOAA force-pushed the dev-reorganize-test-data branch from 85a2cc2 to 6b025eb Compare February 3, 2025 14:09
@Bai-Li-NOAA Bai-Li-NOAA marked this pull request as ready for review February 3, 2025 14:12
Copy link
Contributor

@kellijohnson-NOAA kellijohnson-NOAA left a comment

Choose a reason for hiding this comment

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

Thanks @Bai-Li-NOAA for these changes. I think this work is a great movement towards cleaning up the codebase as a whole and making things more consistent. I added two commits that should be squashed when you are ready. I do have a question about the sdr_report and the use of @.

validate_fims(
report = agecomp_fit@report,
sdr = agecomp_fit@estimates,
sdr_report = agecomp_fit@estimates,
Copy link
Contributor

Choose a reason for hiding this comment

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

How come the sdr_report is the estimates table?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I’ve updated the tests to use get_report() and get_estimates() when working with the wrapper functions.

k-doering-NOAA and others added 5 commits February 13, 2025 16:34
* use test fixtures to properly generate multiple combinations of available data
* add integration tests to validate handling of missing vlaues in the datasets
* clean helper function validate_fims() and remove duplicated code
* add TODO tasks to estimate recruitment log_devs later
@Bai-Li-NOAA Bai-Li-NOAA force-pushed the dev-reorganize-test-data branch from c980334 to 78532f8 Compare February 13, 2025 16:45
@Bai-Li-NOAA
Copy link
Contributor Author

@kellijohnson-NOAA, I have addressed the great suggestions! I wanted to note a few additional changes that may need further review:

  • I've updated .vscode/settings.json to include editor rulers at 80 characters. This will display a vertical line in VS Code automatically for developers.
  • I’ve refactored tests/testthat/helper-integration-tests-validation.R to reduce duplicate code, making it approximately half as long.
  • @Andrea-Havron-NOAA discovered that the tests aren’t estimating recruitment log_devs. A few tests will fail if we estimate log_devs, so I’ve added #TODO tasks in the code to remind us to estimate log_devs once the issue is resolved.

@kellijohnson-NOAA
Copy link
Contributor

@Bai-Li-NOAA great job. Please rebase and merge into dev whenever you see fit.

@Bai-Li-NOAA Bai-Li-NOAA merged commit bcd2839 into dev Feb 13, 2025
15 checks passed
@Bai-Li-NOAA Bai-Li-NOAA deleted the dev-reorganize-test-data branch February 13, 2025 19:49
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.

[Developer Issue]: reorganize tests and clean up hacky data modifications when prepare test data
3 participants