scverse / scverse/spatialdata

The SpatialData object is not self-contained

Open
#710 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
394
Forks
95
Avg merge
4d 3h
Merged PRs (30d)
7

Description

Hello,

I am contacting you about the “not self-contained” message when saving sdata to a new location.
Here is the example:

import spatialdata as sd
from spatialdata.datasets import blobs

sdata = blobs()
sdata.write("/Volumes/One Touch/MICS/data_HE2CellType/CT_DS/test_blobs.zarr")

sdata = sd.read_zarr("/Volumes/One Touch/MICS/data_HE2CellType/CT_DS/test_blobs.zarr")

sdata.table.obs['test'] = 'test'
sdata.table.obs.head()

sdata.write("/Volumes/One Touch/MICS/data_HE2CellType/CT_DS/test_2_blobs.zarr")

And it outputs :

INFO     The SpatialData object is not self-contained (i.e. it contains some elements that are Dask-backed from    
         locations outside [/Volumes/](https://file+.vscode-resource.vscode-cdn.net/Volumes/)One Touch/MICS/data_HE2CellType/CT_DS/test_2_blobs.zarr). Please see the       
         documentation of `is_self_contained()` to understand the implications of working with SpatialData objects 
         that are not self-contained.                                                                              
INFO     The Zarr backing store has been changed from [/Volumes/](https://file+.vscode-resource.vscode-cdn.net/Volumes/)One                                                 
         Touch/MICS/data_HE2CellType/CT_DS/test_blobs.zarr the new file path: [/Volumes/](https://file+.vscode-resource.vscode-cdn.net/Volumes/)One                         
         Touch/MICS/data_HE2CellType/CT_DS/test_2_blobs.zarr

I was wondering if in this case, if I completely delete test_blobs.zarr from my disk, can I lose information in test_2_blobs.zarr or have a problem afterwards? I am having trouble understanding the implications of being “not self-contained”.

Thanks in advance for your help!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the documentation and implementation of is_self_contained(), then trace the write() and read_zarr() entry points used in the example. Clarify what the warning means after writing to a new Zarr path, whether the original store is still required, and document how users can verify that the new object is self-contained.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.