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
We just caught a bug in napari-spatialdata (described in this comment scverse/napari-spatialdata#175 (comment), but no need to read there, I will summarize here) and I just noticed that this a bug also of spatialdata-plot.
Currently, napari_spatialdata, when plotting labels, seems to match the table to the labels using the order of the rows instead than using the instance_key (this is handled correctly for circles btw). I verified this for spatialdata-plot and I noticed that the order of the table influences the plot. I am surprised that this happens because I would have bet that the tests added here https://github.com/scverse/spatialdata-plot/pull/163/files would have covered also this case, but apparently this is not the case.
The code to reproduce this (which makes the plots both with napari and spatialdata-plot and then one needs to check by eye) is the one posted in this comment here: scverse/napari-spatialdata#175 (comment).
Please notice that spatialdata-plot can't make the first two plots because of this bug with plotting continuous annotations to labels: #165.
Also please notice that I had to add
import matplotlib.pyplot as plt
plt.show()
in the end because for some reasons pl.show() was not working. This is something tracked elsewhere, I will report it separately by reopening that issue.
Anyway, the bug has a simple solution. Calling the function match_table_to_element()#178 returns a table with rows that match the element, even in the case of partial overlap between the instances in the element and the rows of the table.
A better solution is to drop region, region_key, instance_key (but this will take some time). CC @giovp@kevinyamauchi.
Activity
[-]Check: plotting after sorting a table[/-][+]Bug: plotting after sorting a table[/+]LucaMarconato commentedon Nov 5, 2023
Anyway, the bug has a simple solution. Calling the function
match_table_to_element()#178 returns a table with rows that match the element, even in the case of partial overlap between the instances in the element and the rows of the table.A better solution is to drop
region,region_key,instance_key(but this will take some time). CC @giovp @kevinyamauchi.LucaMarconato commentedon Nov 5, 2023
sdata3:sdata4: