joshspeagle / dynesty

Dynamic Nested Sampling package for computing Bayesian posteriors and evidences
https://dynesty.readthedocs.io/
MIT License
357 stars 77 forks source link

Merging results - `samples_n AttributeError` #118

Closed GregoryAshton closed 5 years ago

GregoryAshton commented 5 years ago

Hi Josh.

The new work looks really great! I was playing with the merge_runs feature and have come across a potential bug.

I ran several jobs (using the standard NestedSampler, i.e. not-dynamic) and dumped the Result object to a pickle. Then loaded in the dumped objects and put them in a list. When I fed this into utils.merge_runs I received an AttributeError for samples_n sourced from this line.

I hacked around it by using the way it is calculated earlier on in the code. Is this a reasonable fix?

joshspeagle commented 5 years ago

Oh dear, that does look like a bug. Your fix looks correct to me, so I'll see if I can patch it in at some point in the near future.

GregoryAshton commented 5 years ago

I can push a MR if you like?

joshspeagle commented 5 years ago

That'd be great! Happy to accept it.