-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get_element_instances
and get_centroids
should not (?) return zero element
#614
Comments
I think we also don't allow to have "0" as a value in the index of shapes, but I am not entirely sure about that @LucaMarconato ? ~~ If not, I think we should probably also enforce that in order to avoid misunderstanding between instances retrieved from labels or shapes, wdyt? ~~ EDIT: we don't enforce it, I wonder, should we? |
same here I think, what is the "centroid" value of an empty space in a label?
|
get_element_instances
should not (?) return zeroget_element_instances
and get_centroids
should not (?) return zero element
I agree, we should probably not return it for Labels, and for shapes it could indeed be confusing to have it. The problem is that for shapes there are some readers where we set I suggest the following:
In this way, the inconvenient case that we leave uncovered is when a user takes some shapes data that has instances named 0 (such as Visium), and rasterizes the shapes into labels. In this way in fact the shapes 0 will turn into the background. |
I suggest to open a separate issue to discuss a strategy to deal with 0 in shapes and points (we can add an intro to this coment and turn it into an issue):
This keeps the shapes<>tables consistent but create one problem: if the user parsed some data with an earlier version of |
spatialdata/src/spatialdata/_core/query/relational_query.py
Lines 112 to 114 in f94d0c7
I think that is counter-intuitive to return zero, since it's not an instance. I would maybe consider to add an optional argument
return_zero: bool = False
wdyt?The text was updated successfully, but these errors were encountered: