You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
render_shapes() with color argument fails on Merfish data #441
Hi,
I work with spatialdata 0.3.0, and spatialdata_plot 0.2.9.
When calling render_shapes() on Merfish data, with a color argument, plot fails with error: ValueError: cannot insert EntityID, already exists. This error is raised when calling reset_index() on table.obs, because columns EntityID already exists.
However, if I delete column EntityID in table.obs, render_shapes fails with error ValidationError: Cannot construct SpatialData object, input contains invalid elements. For renaming, please see the discussion here https://github.com/scverse/spatialdata/discussions/707. tables/table: EntityIDnot found inadata.obs. Please create the column.
Works fine: sdata.pl.render_shapes( element=shapes_key, ).pl.show( coordinate_systems='global' )
The same problem is caused by "EntityID" column in sdata["shapes"].
The easiest workaround is to rename table.obs index if table.obs.index.name == "EntityID", and to delete "EntityID" column in the shapes, or just to allow duplicates in reset_index()
Activity
Fix render_shapes crash when obs index name conflicts with column (#441)
timtreis commentedon Mar 29, 2026
Heyho, should be fixed in the newest release (through PR #558)