type and storage of `instance_key` issues
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 394
- Forks
- 95
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 7
Description
This is to keep track of issues that might arise on the relationship between instance_key and the indexes of regions.
Motivation
The link between a table and it's region object is specified by the tuple ("region", "region_key") saved in table.uns["spatialdata_attrs"]. The types are the following
region: Union[str, Sequence[str]]. It can contain a single region id or a sequence of region idsregion_key: Optional[str]. In case of a single region_id, then it can be None
To link the single region instance, e.g. the cell, an additional key is passed:
instance_key: Sequence[str, float, int]
Problems
- We don't check for the consistency of this mapping in spatial data, e.g.:
- are all regions present in the table, may/should/must be in the Spatialdata? we are not clear about this
- is the type of
instance_keymatching the type of the index/region in the respective element? e.g. for labels,, it should just beint32orint64, whereas for shapes, it could bestrornumeric.
- we are not clear nor consistent on the way we name the regions and elements in the
spatialdata_attrs
another thing to consider is that the instance_key can be just he index in a Shapes element, but it can never be an index in table.obs, because we can only have str and numeric indexes in anndata. This is also something we should be clearer about.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the spatialdata_attrs relationship between tables, regions, elements, and instance_key, including the region and element index types described here. Before implementation, resolve which mappings are required and how names and index types should be represented; done should include consistent validation and documented behavior for tables, labels, and shapes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100