Conversion function not applied to posterior
Whilst running nessai
for the O4 PE MDC I noticed that with the latest version of bilby
the conversion function specified in run_sampler
is not being applied to the posterior before it is saved.
It seems that this is caused by the changes introduced in !958 (merged), in particular the addition of the check for an existing posterior here which skips the conversion. Previously this check happened within samples_to_posterior
and the conversion function was always applied.
As far as I can tell this only affects samplers that manually convert their output to the posterior dataframe instead of letting conversion happen here. So cpnest
and nessai
.
I think the easiest fix is to just tweak the interface for both samplers and have them add result.samples
instead of result.posterior
but I'm keen to hear people's thoughts since there may be other cases where this issue comes up.