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

Fix the test for population.CalculateRecruitment() #508

Conversation

Bai-Li-NOAA
Copy link
Contributor

What is the feature?

This PR addresses issue #494 and fixes the test for population.CalculateRecruitment().

How have you implemented the solution?

  • update the C++ test here
  • register the test to CMakeLists.txt to execute the test when running GoogleTest

Does the PR impact any other area of the project?

No.

How to test this change

The C++ test can be found here.
All GHA checks have passed.

Developer pre-PR checklist

  • I relied on GitHub actions to 🧪 things for me while I sat on the 🛋️.

Copy link
Contributor

github-actions bot commented Nov 2, 2023

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 force-pushed the 494-questionhelp-why-is-populationspawning_biomass-indexed-by-age-in-test branch from 3dbecd3 to 6191649 Compare November 2, 2023 19:41
Copy link

codecov bot commented Nov 2, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Files Coverage Δ
...lude/population_dynamics/population/population.hpp 90.62% <0.00%> (-9.38%) ⬇️

... and 28 files with indirect coverage changes

📢 Thoughts on this report? Let us know!.

@Bai-Li-NOAA Bai-Li-NOAA changed the title Fix the test for population.CalculateRecruitment()t() Fix the test for population.CalculateRecruitment() Nov 2, 2023
Copy link
Contributor

@iantaylor-NOAA iantaylor-NOAA left a comment

Choose a reason for hiding this comment

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

Changes look good. Thanks @Bai-Li-NOAA for sorting all this so quickly.

inst/include/population_dynamics/population/population.hpp Outdated Show resolved Hide resolved
tests/gtest/test_population_Recruitment.cpp Outdated Show resolved Hide resolved
tests/gtest/test_population_Recruitment.cpp Show resolved Hide resolved
@iantaylor-NOAA
Copy link
Contributor

Note: based on conversation during yesterday's meeting, now that I've completed the review, I've unassigned myself and assigned @Bai-Li-NOAA so she can choose how/whether to address the minor comments in the unresolved conversations. If I didn't have any comments, I would have just merged since I was the assignee. Once @Bai-Li-NOAA has resolved the conversations, she could either merge the PR or re-assign me if further input is needed.

Please let me know if that workflow doesn't match how we're thinking of using PR assignments.

@Bai-Li-NOAA Bai-Li-NOAA force-pushed the 494-questionhelp-why-is-populationspawning_biomass-indexed-by-age-in-test branch 2 times, most recently from 42e66a2 to 9267058 Compare November 3, 2023 15:35
test: add a test for testing population.CalculateRecruitment()

fix: use EXPECTA_DOUBLE_EQ() to verifies that the two double values are approximately equal

fix: fix the test for population.CalculateRecruitment()
@Bai-Li-NOAA Bai-Li-NOAA force-pushed the 494-questionhelp-why-is-populationspawning_biomass-indexed-by-age-in-test branch from 9267058 to dd1acf7 Compare November 3, 2023 15:45
@Bai-Li-NOAA
Copy link
Contributor Author

Thank you, @iantaylor-NOAA, for your review. I've incorporated your suggestions and updated the code. Additionally, I've resolved the merge conflicts. The workflow makes sense to me and I have merged the changes into the main branch.

@Bai-Li-NOAA Bai-Li-NOAA merged commit 99bc5ae into main Nov 3, 2023
11 checks passed
@Bai-Li-NOAA Bai-Li-NOAA deleted the 494-questionhelp-why-is-populationspawning_biomass-indexed-by-age-in-test branch November 3, 2023 15:57
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.

[Question/help] Why is population.spawning_biomass indexed by age in test?
2 participants