Skip to content

Discussion: unique names for elements, pro and cons #124

@LucaMarconato

Description

@LucaMarconato

I propose to enforce unique names among the elements of one SpatailData object. Here I explore the implications.

Cons:

  • The user has less freedom since different types can't have the same name. Still, when merging/concatenating different SpatialData objects (say 1 sdata = 1 sample), one could have exactly the same name for the same element types (like all the Labels are called cells), so the user is already limited in this regard.

Neutral:

  • The file storage can be kept as it is (because we can infer types when we read), or we can choose to make it completely flat.

Pro:

  • In transformations, see discussion in the comment below this one, we can have function calls like this
points = sd.transform(sdata, element_name='cells', tgt="tgt_space")

instead of this

points = sd.transform(sdata, element_type='labels', element_name='cells', tgt="tgt_space")
  • (big pro): the tables, the column "instance_key" can be a simple string like "cell_segmentation", now it needs to be "/labels/cell_segmentation" and this feels super weird.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions