Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MCMCSamples cannot read nested sampling output files correctly. #37

Closed
xichenamoy opened this issue Jul 17, 2019 · 5 comments
Closed

MCMCSamples cannot read nested sampling output files correctly. #37

xichenamoy opened this issue Jul 17, 2019 · 5 comments
Labels
bug Something isn't working

Comments

@xichenamoy
Copy link

Happened when execute this line:

sample = MCMCSamples(root=fileName)

Then get this error message:

ValueError: DataFrame constructor not properly called!

One thing worth to note is that 1.1.0 works well with the provided lensing example. So the error only happens when I change the 'root' equals to my own file name in the chains folder.

I also tried the standard PolyChord output file using the default gaussian example, it would report:

ValueError: Wrong number of items passed 5, placement implies 1

Previously when I used it with anesthetic 1.03, it can read the file ok. Now I upgraded it to version 1.1.0, run the same code it would report this. The output files are the standard MultiNest/PolyChord output files.

@williamjameshandley
Copy link
Collaborator

Hi @xichenamoy . Many thanks for spotting this.

Can you confirm that this only occurs if you try to use read nested sampling chains with MCMCSamples, and that reading them with NestedSamples does not have this issue?

@lukashergt, I think this was introduced in #14 when we restructured in terms of SampleReader. It might be worth just raising a more informative ValueError if one tries to read ns chains with MCMCSamples

@williamjameshandley williamjameshandley added the bug Something isn't working label Jul 17, 2019
@williamjameshandley williamjameshandley changed the title Version 1.1.0 MCMCSample() function cannot read MultiNest/PolyChord output files correctly. MCMCSamples cannot read nested sampling output files correctly. Jul 17, 2019
@xichenamoy
Copy link
Author

@williamjameshandley
Yes, I forgot to mention this. It works well with NestedSamples(), only occurs in MCMCSamples().

@lukashergt
Copy link
Collaborator

I think this was introduced in #14 when we restructured in terms of SampleReader

Probably, I never checked for the option of reading nested sampling files with MCMCSamples. Is that what we want?

@williamjameshandley
Copy link
Collaborator

I'm not sure. In theory NS files should be readable as MCMCSamples, but I don't know why you'd want to/if we should encourage it. Given that NestedSamples is a subclass of MCMCSamples you would get no benefit from loading them as MCMCSamples, so at the very least if we want to allow people to do this we should throw a warning. For now, the easiest solution would be to not support reading MN/PC files with MCMCSamples, but to throw a more informative error.

@lukashergt lukashergt mentioned this issue Nov 22, 2019
5 tasks
@lukashergt
Copy link
Collaborator

Fixed in #64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants