scverse / spatialdata

An open and interoperable data framework for spatial omics data
https://spatialdata.scverse.org/
BSD 3-Clause "New" or "Revised" License
237 stars 45 forks source link

Minor ergonomics/usability improvements #770

Open quentinblampey opened 2 weeks ago

quentinblampey commented 2 weeks ago

Here is a container for small changes regarding ergonomics (Basel Hackathon).

josenimo commented 1 week ago

I fully support this, the documentation for spatial query is inconsistent and incomplete.

Tutorial shows this:

cropped_sdata = sdata_ST8059050.query.bounding_box(
    axes=["x", "y"],
    min_coordinate=[bb_xmin, bb_ymin],
    max_coordinate=[bb_xmax, bb_ymax],
    target_coordinate_system="ST8059050",
)

cropped_sdata

But the query function is not documented. Image

Also, https://spatialdata.scverse.org/en/stable/generated/spatialdata.bounding_box_query.html is not currently working.. orImage

quentinblampey commented 1 week ago

Hi @josenimo, thanks for your comment! Indeed, SpatialData.query is not documented

Regarding spatialdata.bounding_box_query, it is actually a function from spatialdata, not a method, so you should call it via spatialdata.bounding_box_query(sdata, ...) instead of sdata.bounding_box_query(...). Let me know if that works!