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

Improve runtime safety when building lookup tables #1330

Merged
merged 1 commit into from
Aug 5, 2024
Merged

Conversation

molpopgen
Copy link
Owner

The GSL discrete lookup table happily accepts all weights being 0.
When the weights are fitness, this behavior is a pathology: a zombie
population reverts to one that is happily all neutral.

This PR fixes that behavior and will also do more thorough checking
in other places where this type is used.

@molpopgen molpopgen force-pushed the cpp_gsl_tests branch 3 times, most recently from 01d54c7 to 8665904 Compare August 3, 2024 16:21
* Add internal API to disallow weight vectors
  of all zeros.
* Apply the new API to internal code.
* Use GlobalExtinction exception when all diploid
  fitness values are zero.
* Use new LocalExtinction exception when all fitnesses
  in a deme are zero.
* Add new Python and C++ tests.
@molpopgen molpopgen merged commit c60397f into dev Aug 5, 2024
34 checks passed
@molpopgen molpopgen deleted the cpp_gsl_tests branch August 5, 2024 19:34
@molpopgen molpopgen mentioned this pull request Aug 6, 2024
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.

1 participant