spatialdata icon indicating copy to clipboard operation
spatialdata copied to clipboard

Detach SpatialData object from its Zarr store

Open Marius1311 opened this issue 1 year ago • 3 comments

Is there an easy way to detach a SpatialData object from its Zarr store? Say I have a smallish object that fits into memory and I want to make some experimental changes without possibly changing the data on disk, what is the recommended workflow? Thanks in advance!

Marius1311 avatar Oct 17 '24 23:10 Marius1311

hmm could do something like this:

#sdata here is your backed sdata
sdata = sd.SpatialData(
            images=sdata.images,
            labels=sdata.labels ,
            points=sdata.points,
            shapes=sdata.shapes,
            tables=sdata.tables,
        )

melonora avatar Oct 25 '24 14:10 melonora

Unfortunately this will not work. The code above would still lead to a Dask-backed object, and now the object would stop being "self-contained". What you would need is what is described in this comment, which is not currently implemented. We could work on this in the end of November, after some deadlines are past. https://github.com/scverse/spatialdata/issues/293#issuecomment-1657290681

LucaMarconato avatar Oct 25 '24 15:10 LucaMarconato

Unfortunately this will not work. The code above would still lead to a Dask-backed object, and now the object would stop being "self-contained". What you would need is what is described in this comment, which is not currently implemented. We could work on this in the end of November, after some deadlines are past. #293 (comment)

Something like this would be really cool. Looking forward! :)

Marius1311 avatar Oct 25 '24 15:10 Marius1311