tsinfer icon indicating copy to clipboard operation
tsinfer copied to clipboard

Make lmdb optional

Open hyanwong opened this issue 7 months ago • 9 comments

It would be nice to remove complex dependencies from tsinfer. I think lmdb is one of those, and now only used for legacy support. Could we therefore make this an optional dependency?

hyanwong avatar Apr 30 '25 09:04 hyanwong

I don't see why not, but there would probably be some semi complex plumbing involved. It's only used in the SampleData, I guess? Or are we using it for storing AncestorData also?

jeromekelleher avatar Apr 30 '25 10:04 jeromekelleher

We're still using it for AncestorData as it uses the same superclass lmdb code as SampleData. Would be pretty straight forward to switch AncestorData over to a directory store. However we probably want to keep backwards compatibility which would add complexity.

benjeffery avatar Apr 30 '25 13:04 benjeffery

It would be nice to do, but it's not a priority. LMDB has served us well apart from a few install headaches.

jeromekelleher avatar Apr 30 '25 13:04 jeromekelleher

However we probably want to keep backwards compatibility which would add complexity.

Do we really want to keep backwards compatibility for AncestorData files? Personally I wouldn't bother. We are still only at 0.4, rather than a 1.0 release.

hyanwong avatar May 09 '25 16:05 hyanwong

I don't think the issue is backwards compatibility, more that we're still using lmbd for the current version of AncestorData. Do I understand this correctly @benjeffery?

jeromekelleher avatar May 12 '25 08:05 jeromekelleher

Yes, that's correct. We'd need to change AncestorData over to a different store.

benjeffery avatar May 12 '25 11:05 benjeffery

I think we have enough to do for now, let's leave it as it is.

jeromekelleher avatar May 12 '25 12:05 jeromekelleher

I'm getting this in the test suite:

tests/test_formats.py: 16 warnings
  /Users/yan/Documents/GitHub/tsinfer/tsinfer/formats.py:106: FutureWarning: The LMDBStore is deprecated and will be removed in a Zarr-Python version 3, see https://github.com/zarr-developers/zarr-python/issues/1274 for more information.
    store = zarr.LMDBStore(

Does this mean we need to remove the internal dependency on LMDB for future use anyway?

hyanwong avatar Jun 22 '25 10:06 hyanwong

It's not clear when or if we'll move to Zarr v3 so this isn't going to change much. Easy enough to make a store anyway.

jeromekelleher avatar Jun 22 '25 13:06 jeromekelleher