Skip to content

Allow `z_at_value` return a single float

Currently if you try to convert 1 dL sample to a redshift, the following error occurs:

../bilby/gw/conversion.py", line 35, in luminosity_distance_to_redshift
    return z_at_value(cosmology.luminosity_distance, distance * units.Mpc)

../bilby/gw/cosmology.py", line 93, in z_at_value
    return z_at_value(func=func, fval=fval, **kwargs).value

AttributeError: 'numpy.float64' object has no attribute 'value'

This MR allows the conversion of a single float

Edited by Avi Vajpeyi

Merge request reports