Hi, I would like to request a small customization option for spatialdata.concatenate() when passing a dictionary of SpatialData objects.
Currently, when a dictionary is passed, element names are made unique by appending the dictionary key as a suffix using - as the separator. For example:
concatenate({
"sample1": sdata1,
"sample2": sdata2,
})
renames spatial elements like:
cell_boundaries-sample1
cell_boundaries-sample2
The same -suffix convention is also applied to table region metadata, values in the region_key column, observation names, coordinate systems, and table names when applicable.
Would it be possible to add a parameter to control the separator used before the suffix?
For example:
concatenate(
{
"sample1": sdata1,
"sample2": sdata2,
},
suffix_separator="_",
)
would produce:
cell_boundaries_sample1
cell_boundaries_sample2
Motivation
In some workflows, element names are later parsed or matched according to project-specific naming conventions. In these cases, underscores may be preferred over hyphens, or hyphens may conflict with downstream tools and naming rules.
At the moment, changing this behavior requires copying and modifying the internal _fix_ensure_unique_element_names() helper. This is inconvenient because the suffixing logic appears in several places within that function, so even a simple change to the separator requires multiple coordinated edits.
Hi, I would like to request a small customization option for
spatialdata.concatenate()when passing a dictionary of SpatialData objects.Currently, when a dictionary is passed, element names are made unique by appending the dictionary key as a suffix using - as the separator. For example:
renames spatial elements like:
The same
-suffixconvention is also applied to table region metadata, values in the region_key column, observation names, coordinate systems, and table names when applicable.Would it be possible to add a parameter to control the separator used before the suffix?
For example:
would produce:
Motivation
In some workflows, element names are later parsed or matched according to project-specific naming conventions. In these cases, underscores may be preferred over hyphens, or hyphens may conflict with downstream tools and naming rules.
At the moment, changing this behavior requires copying and modifying the internal
_fix_ensure_unique_element_names()helper. This is inconvenient because the suffixing logic appears in several places within that function, so even a simple change to the separator requires multiple coordinated edits.