anesthetic icon indicating copy to clipboard operation
anesthetic copied to clipboard

NestedSamples object, root kwarg ignored

Open andrewfowlie opened this issue 2 years ago • 1 comments

Describe the bug I'm working on master and I wanted to use the NestedSamples class with the root keyword argument.

To Reproduce

from anesthetic import NestedSamples
NestedSamples(root="whatever/your/root/is")

Expected behavior Load samples from disk. But instead I get an empty NestedSamples dataframe object. Looking at the code on master

https://github.com/williamjameshandley/anesthetic/blob/37362c778fc1d399c2564fdf0672b3e2db3ba221/anesthetic/samples.py#L503-L505

it seems as though a big chunk of code that uses the root argument has gone compared to 2.0.0-beta.11

https://github.com/williamjameshandley/anesthetic/blob/2351380d1fbced4f03b2c7a2af0665d8714a732b/anesthetic/samples.py#L437-L445

Not sure if this is truly a bug or a WIP, as I am not working on an actual release (I stumbled across this as I wanted to pip install a v2 and was lazy and just did pip install git+https://github.com/williamjameshandley/anesthetic)

andrewfowlie avatar Nov 09 '22 04:11 andrewfowlie

This is more or less answered by #241 - that the root keyword argument is being dropped here. I think this is a very good change.

I still find it a bit confusing that the NestedSamples and MCMCSamples objects take a root kwarg parameter, which if I understand correctly is just stored as a kind of metadata about the samples. Maybe it can be called something else, e.g., metadata and use of the original root kwarg can trigger a DeprecationWarning or error?

andrewfowlie avatar Nov 10 '22 01:11 andrewfowlie