JohannesBuchner / UltraNest

Fit and compare complex models reliably and rapidly. Advanced nested sampling.
https://johannesbuchner.github.io/UltraNest/
Other
143 stars 30 forks source link

add option to set hdf5 store group #10

Closed ahnitz closed 3 years ago

ahnitz commented 4 years ago

This adds an option 'group' to the HDF store so that the file can optionally store points a non-root location.

JohannesBuchner commented 4 years ago

I don't see a major issue with this PR.

However, I wonder if you have considered using a hdf5 symlink?

Would you require a custom storage backend that can read and write? Should we allow the user to provide a backend?

ahnitz commented 4 years ago

What we'd need is really only a small change from the existing HDF store class, primarily this change here, plus a hook which we'd add from our side by sub-classing this as it didn't seem very generic. This change seemed rather generic, so I'd thought I'd kick it upstream. Allowing the user to provide a backend (or maybe just a pointstore sub-class instance directly?) sounds reasonable. At the moment, even without an explicit interface for that yet, I'd thought to just set the pointstore manually.

JohannesBuchner commented 4 years ago

I think I would like an additional parameter for setting the backend, so that also the text-based one can be used. I think it should allow either an object, or a string in which case it selects the right object automatically ("hdf5", "tsv", "csv" with TextPointStore.delimiter=',').

JohannesBuchner commented 3 years ago

Hi @ahnitz, based on the discussions here I implemented that custom backends can be passed to the sampler, and I would recommend that solution. Please reopen if this remains a problem.