Skip to content
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

allow filtering by ids #627

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

allow filtering by ids #627

wants to merge 1 commit into from

Conversation

melonora
Copy link
Collaborator

@melonora melonora commented Jul 9, 2024

closes #556

This PR allows for filtering elements (points, shapes, tables) on instance IDs. For labels I decided just as with the joins to not support it as it is potentially an expensive operation, where I am not certain what the usecase would be (one can adjust the color to a background color in any case for particular labels or even set it transparent).

The PR is related to #626, however I think it is better to separate out filtering on instance IDs. The function here can ultimately still be used in his function.

The PR will not cause an error in case of filtering on instance IDs that are not there. Furthermore it is not a problem to filter on instances in a table that is annotating more than 1 element. If instances for both annotated elements need to be filtered in the table this will be retrieved. If region_names is defined, a view of the table with rows annotating elements in region_names is first created before filtering on instance IDs.

After filtering of the table, the metadata for annotation of regions is checked and updated after which the table is validated.

Copy link

codecov bot commented Jul 9, 2024

Codecov Report

Attention: Patch coverage is 8.00000% with 23 lines in your changes missing coverage. Please review.

Project coverage is 91.62%. Comparing base (cf7a84d) to head (fc09cc0).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #627      +/-   ##
==========================================
- Coverage   91.93%   91.62%   -0.32%     
==========================================
  Files          44       44              
  Lines        6661     6685      +24     
==========================================
+ Hits         6124     6125       +1     
- Misses        537      560      +23     
Files Coverage Δ
src/spatialdata/_core/spatialdata.py 88.69% <8.00%> (-2.29%) ⬇️

This was referenced Jul 9, 2024
@LucaMarconato LucaMarconato marked this pull request as draft July 12, 2024 17:52
@LucaMarconato
Copy link
Member

LucaMarconato commented Jul 12, 2024

@melonora converting to draft, what's missing for the moment, just

  • the tests?

@LucaMarconato
Copy link
Member

  • ah also the function should be private so it can be used internally by a single "entry point" filter().

@melonora melonora self-assigned this Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Subset spatialdata by list of cell ids
2 participants