Confusing sampler kwargs behaviour
The behaviour of sampler_kwargs
came up recently in the asimov review (tagging @daniel-williams, @patricia-schmidt), particularly in relation to which defaults are used for different values of sampler_kwargs
. It also came up before in #269
Taking dynesty
as an example, it is my understanding that the code behaves as follows
- If
sampler_kwargs=None
, then the kwargs are set todict()
and it therefore falls back to thebilby
defaults. - If
sampler_kwargs={'nlive': 50}
, then theDynestyDefault
dictionary (defined here) frombilby_pipe
is used and the kwargs will be set to the equivalent of :SAMPLER_SETTINGS['DynestyDefault'].update({'nlive': 50})
. - If
sampler_kwargs='DynestyDefault',
then theDynestyDefault
dictionary will be used directly.
I think it's the first option (1) that leads to confusion, because if a user does not specify anything they will get the bilby
defaults but then if they want to update a setting, e.g. increasing nlive
, other settings will change based on the defaults in DynestyDefault
.
If I haven't misunderstood the code, is this behaviour intentional? If not, what do we think the correct behaviour should be? I am happy to implement a fix myself, but thought we should discuss it first.