Skip to content

Switch to using .size instead of len

This addresses the issues related to 0d-arrays in #563 (closed) as discussed on this call: https://wiki.ligo.org/CBC/ParamEst/BilbyDevCall210419

The only change is to replace calls to len with calls to .size which will work for both 0d and 1d numpy arrays. For 2d arrays or greater len(x)!=x.size however from what I can tell, the current version of the priors in master fails anyway for 2d arrays.

There are a few places where I have not replaced len with size since numpy.atleast_1d is called beforehand and it was agreed on the call that the minimal number of changes is prefered.

Merge request reports