Skip to content

Fixes persistent warning messaged when using the alligned-spin prior

Gregory Ashton requested to merge set-min-val-for-alligned-spin-prior into master

Example of the warning message

In [1]: import bilby                                                            

In [2]: bilby.gw.prior.BNSPriorDict()                                           
15:33 bilby INFO    : No prior given, using default BNS priors in /home/user1/anaconda3/envs/bilby/lib/python3.6/site-packages/bilby-0.5.9-py3.6.egg/bilby/gw/prior_files/binary_neutron_stars.prior.
/home/user1/anaconda3/envs/bilby/lib/python3.6/site-packages/bilby-0.5.9-py3.6.egg/bilby/gw/prior.py:234: RuntimeWarning: divide by zero encountered in true_divide
  z_prior.prob(x / aas)), aas) for x in xx]
/home/user1/anaconda3/envs/bilby/lib/python3.6/site-packages/bilby-0.5.9-py3.6.egg/bilby/gw/prior.py:234: RuntimeWarning: invalid value encountered in multiply
  z_prior.prob(x / aas)), aas) for x in xx]

This just adds a small number if the minimum is zero to avoid the message.

Merge request reports

Loading