Skip to content

Refactoring query functions #225

Open

Description

@LucaMarconato

There are multiple ways (some still to be implemented) to subset/query a SpatialData object. Some of these methods are living outside this repo. We need to port them here and use a more consistent syntax (for instance always sdata.query.query_method).

  • spatial query (bounding box query): sdata.query.bounding_box()
  • spatial query (general polygon): not implemented yet
  • query by obs: implemented in napari-spatialdata, branch spatialdata
  • query by var: not implemented yet
  • query by coordinate system: sdata.filter_by_coordinate_system()
  • query by (a list of) element names: implemented in spatialdata-plot

FYI @giovp @timtreis

Activity

  1. changed the title [-]refactoring query functions[/-] [+]Refactoring query functions[/+] on Apr 13, 2023
  2. kevinyamauchi commented on Apr 13, 2023

    @kevinyamauchi
    Collaborator

    Currently, the bounding_box_query doesn't automatically filter for elements within the target coordinate system. I think we should add that. We could just add a call to filter_by_coordinate_system to the beginning of the query. Thoughts?

  3. LucaMarconato commented on Jan 9, 2024

    @LucaMarconato
    MemberAuthor

    Also:

    • SpatialData.subset()
  4. LucaMarconato commented on Feb 1, 2024

    @LucaMarconato
    MemberAuthor

    Another point to consider, as observed in #443 (comment), is that query functions that appear only as methods of SpatialData maybe be a bit hidden in the docs.

    • Modules and functions of modules are better (or we can also put an explicit link to those methods in the docs).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions