ctlab / GADMA

Genetic Algorithm for Demographic Model Analysis
Other
47 stars 14 forks source link

Fix ZeroDivisionError when Nanc is zero (Issue #23). #25

Closed noscode closed 4 years ago

noscode commented 4 years ago

Size of ancestral population was translated to integer and used for translation. But in case when it was very small after translation it became zero and cause errors in following translation of parameters. Now size is always float and is showed as integer in printing only. Also there is additional check and if Nanc is zero for some reason then GADMA does not translate parameters at all.

codecov-io commented 4 years ago

Codecov Report

Merging #25 (fad0895) into master (aadaa51) will increase coverage by 0.01%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #25      +/-   ##
==========================================
+ Coverage   90.27%   90.29%   +0.01%     
==========================================
  Files          44       44              
  Lines        5038     5037       -1     
  Branches     1073     1073              
==========================================
  Hits         4548     4548              
  Misses        280      280              
+ Partials      210      209       -1     
Impacted Files Coverage Δ
gadma/core/draw_and_generate_code.py 80.00% <100.00%> (-0.14%) :arrow_down:
gadma/cli/settings_storage.py 92.92% <0.00%> (-0.34%) :arrow_down:
gadma/optimizers/bayesian_optimization.py 84.54% <0.00%> (+2.72%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update aadaa51...fad0895. Read the comment docs.