### Install development dependencies Source: https://github.com/scverse/spatialdata/blob/main/docs/contributing.md Install the package in editable mode with development, testing, and documentation dependencies. ```bash cd spatialdata-io pip install -e ".[dev,test,doc]" ``` -------------------------------- ### Install test dependencies Source: https://github.com/scverse/spatialdata/blob/main/docs/contributing.md Install the package with development and testing dependencies required for running tests. ```bash pip install '-e[dev,test]' ``` -------------------------------- ### Install SpatialData with Extra Dependencies Source: https://github.com/scverse/spatialdata/blob/main/README.md Use this command to install the 'spatialdata' package with all optional dependencies included. This is recommended for a full-featured installation. ```bash pip install "spatialdata[extra]" ``` -------------------------------- ### Install Airspeed Velocity and Dependencies Source: https://github.com/scverse/spatialdata/blob/main/benchmarks/README.md Installs the airspeed velocity framework and necessary dependencies for benchmarking. Ensure your working directory is the root of the SpatialData repository. ```bash pip install -e '.[docs,test,benchmark]' ``` -------------------------------- ### Install SpatialData via PyPI Source: https://github.com/scverse/spatialdata/blob/main/docs/installation.md Use this command to install the base SpatialData package from the Python Package Index. ```bash pip install spatialdata ``` -------------------------------- ### Install SpatialData Development Version from GitHub Source: https://github.com/scverse/spatialdata/blob/main/docs/installation.md Install the latest development version of SpatialData directly from its GitHub repository. ```bash pip install git+https://github.com/scverse/spatialdata ``` -------------------------------- ### Check Editable Install Path Source: https://github.com/scverse/spatialdata/blob/main/docs/installation.md Verify if an editable installation of SpatialData has been overridden by a PyPI installation. If the path contains 'site-packages', re-run the editable install command. ```python import spatialdata; print(spatialdata.__path__) ``` -------------------------------- ### Editable Install SpatialData from Cloned Repository Source: https://github.com/scverse/spatialdata/blob/main/docs/installation.md Perform an editable installation of SpatialData after cloning the repository. This is recommended for developers contributing to the project. ```bash pip install -e . ``` -------------------------------- ### Install SpatialData and Related Packages via Mamba Source: https://github.com/scverse/spatialdata/blob/main/README.md This command installs SpatialData and related visualization and I/O packages using Mamba. Note that conda installation is currently not recommended due to dependency issues, but this command is provided for reference. ```bash mamba install -c conda-forge spatialdata napari-spatialdata spatialdata-io spatialdata-plot ``` -------------------------------- ### Run all benchmarks Source: https://github.com/scverse/spatialdata/blob/main/benchmarks/README.md Executes all benchmarks defined in the project. This command can take a significant amount of time and may require specific environment setup (e.g., conda). It demonstrates the output format of `asv run` when encountering environment issues. ```bash $ asv run ``` -------------------------------- ### Install SpatialData with PyTorch DataLoader Source: https://github.com/scverse/spatialdata/blob/main/docs/installation.md Install SpatialData with the PyTorch dataloader dependency. This is required if you plan to use PyTorch-based data loading functionalities. ```bash pip install "spatialdata[torch]" ``` -------------------------------- ### Install SpatialData Ecosystem via Conda Source: https://github.com/scverse/spatialdata/blob/main/docs/installation.md Install SpatialData and related packages (spatialdata-io, spatialdata-plot, napari-spatialdata) using the conda-forge channel. Note: Latest versions might not be available on conda-forge. ```bash mamba install -c conda-forge spatialdata spatialdata-io spatialdata-plot napari-spatialdata ``` -------------------------------- ### Raccoon Dataset Source: https://github.com/scverse/spatialdata/blob/main/docs/api/datasets.md Loads the raccoon dataset, a small dataset for testing and examples. ```APIDOC ## GET /datasets/raccoon ### Description Loads the raccoon dataset, a small dataset for testing and examples. ### Method GET ### Endpoint /datasets/raccoon ### Parameters None ### Request Example None ### Response #### Success Response (200) - **data** (SpatialData) - The raccoon dataset. #### Response Example ```json { "data": "SpatialData object representing the raccoon dataset" } ``` ``` -------------------------------- ### Example of Scale Transformation in SpatialData Source: https://github.com/scverse/spatialdata/blob/main/docs/design_doc.md Demonstrates applying a Scale transformation to an image. Axes present in the element but not in the transformation are passed through, while axes in the transformation but not the element are ignored. ```python Scale([2, 3, 4], axes=('x', 'y', 'z')) ``` -------------------------------- ### Blobs Dataset Source: https://github.com/scverse/spatialdata/blob/main/docs/api/datasets.md Loads the blobs dataset, a small dataset for testing and examples. ```APIDOC ## GET /datasets/blobs ### Description Loads the blobs dataset, a small dataset for testing and examples. ### Method GET ### Endpoint /datasets/blobs ### Parameters None ### Request Example None ### Response #### Success Response (200) - **data** (SpatialData) - The blobs dataset. #### Response Example ```json { "data": "SpatialData object representing the blobs dataset" } ``` ``` -------------------------------- ### Blobs Annotating Element Dataset Source: https://github.com/scverse/spatialdata/blob/main/docs/api/datasets.md Loads the blobs_annotating_element dataset, a small dataset for testing and examples. ```APIDOC ## GET /datasets/blobs_annotating_element ### Description Loads the blobs_annotating_element dataset, a small dataset for testing and examples. ### Method GET ### Endpoint /datasets/blobs_annotating_element ### Parameters None ### Request Example None ### Response #### Success Response (200) - **data** (SpatialData) - The blobs_annotating_element dataset. #### Response Example ```json { "data": "SpatialData object representing the blobs_annotating_element dataset" } ``` ``` -------------------------------- ### Build documentation locally Source: https://github.com/scverse/spatialdata/blob/main/docs/contributing.md Commands to navigate to the documentation directory, build the HTML output, and open the index file in a browser. ```bash cd docs make html open _build/html/index.html ``` -------------------------------- ### Run a single dataloader benchmark method Source: https://github.com/scverse/spatialdata/blob/main/benchmarks/README.md Executes a specific dataloader benchmark method, such as `time_init` or `time_fetch`, in the current environment. ```bash asv run --python=same --show-stderr -b TimeDataloader.time_init asv run --python=same --show-stderr -b TimeDataloader.time_fetch ``` -------------------------------- ### Build and Run SpatialData Docker Image Source: https://github.com/scverse/spatialdata/blob/main/docs/installation.md Build a Docker image containing SpatialData with PyTorch, spatialdata-io, and spatialdata-plot. This command is for Apple Silicon machines; omit --build-arg for others. ```bash # this is for Apple Silicon machines, if you are not using such machine you can omit the --build-arg docker build --build-arg TARGETPLATFORM=linux/arm64 --tag spatialdata . docker run -it spatialdata ``` -------------------------------- ### Run all import benchmarks Source: https://github.com/scverse/spatialdata/blob/main/benchmarks/README.md Executes all import-related benchmarks in the current environment. Use `-b timeraw` to target raw import timing functions. ```bash asv run --python=same --show-stderr -b timeraw ``` -------------------------------- ### Run Spatialdata Benchmark Module Source: https://github.com/scverse/spatialdata/blob/main/benchmarks/README.md Use this command to execute the spatialdata benchmark module. Ensure your environment is set up correctly. ```bash python -m benchmarks.spatialdata_benchmark ``` -------------------------------- ### Enable pre-commit hooks Source: https://github.com/scverse/spatialdata/blob/main/docs/contributing.md Initialize pre-commit hooks in the local repository to enforce consistent code styling. ```bash pre-commit install ``` -------------------------------- ### Continuous comparison of dataloader benchmarks Source: https://github.com/scverse/spatialdata/blob/main/benchmarks/README.md Compares the current branch's dataloader benchmarks against a specified branch (e.g., `main`) in a single command. Uses `HEAD` to refer to the current branch tip. ```bash asv continuous --show-stderr -v -b TimeDataloader main HEAD ``` -------------------------------- ### Collect and compare import benchmark results Source: https://github.com/scverse/spatialdata/blob/main/benchmarks/README.md Collects import benchmark results for two specified commits (e.g., `main` and `HEAD`) separately and then compares them. This allows for more detailed analysis. ```bash # 1. Collect results for the tip of main and the tip of your branch asv run --show-stderr -b timeraw main asv run --show-stderr -b timeraw HEAD # 2. Print a side-by-side comparison asv compare main HEAD ``` -------------------------------- ### Run import benchmarks reusing current environment Source: https://github.com/scverse/spatialdata/blob/main/benchmarks/README.md Runs import benchmarks using the current Python environment to speed up the process, at the cost of accuracy. Requires stashing and restoring git state. ```bash asv run --python=same --show-stderr -b timeraw HEAD git stash && git checkout main asv run --python=same --show-stderr -b timeraw HEAD git checkout - && git stash pop asv compare main HEAD ``` -------------------------------- ### Continuous comparison of import benchmarks Source: https://github.com/scverse/spatialdata/blob/main/benchmarks/README.md Compares the current branch's import benchmarks against a specified branch (e.g., `main`) in a single command. The `-v` flag provides per-sample timings. ```bash asv continuous --show-stderr -v -b timeraw main faster-import ``` -------------------------------- ### Run all dataloader benchmarks Source: https://github.com/scverse/spatialdata/blob/main/benchmarks/README.md Executes all dataloader benchmarks in the current environment. Targets benchmarks related to `TimeDataloader`. ```bash asv run --python=same --show-stderr -b TimeDataloader ``` -------------------------------- ### Run a single import benchmark Source: https://github.com/scverse/spatialdata/blob/main/benchmarks/README.md Executes a specific import benchmark, `timeraw_import_spatialdata`, in the current environment. This is useful for isolating performance issues. ```bash asv run --python=same --show-stderr -b timeraw_import_spatialdata ``` -------------------------------- ### Push tags to GitHub Source: https://github.com/scverse/spatialdata/blob/main/docs/contributing.md Command to publish local version tags to the remote repository. ```bash git push --tags ``` -------------------------------- ### Run tests with pytest Source: https://github.com/scverse/spatialdata/blob/main/docs/contributing.md Execute the full test suite from the root of the repository using pytest. ```bash pytest ``` -------------------------------- ### Run time_query_bounding_box benchmark Source: https://github.com/scverse/spatialdata/blob/main/benchmarks/README.md Executes the `time_query_bounding_box` benchmark, which measures the performance of spatial querying without a spatial index. The output table shows timings for different numbers of transcripts per cell and whether filtering is enabled. ```bash asv run --python=same --show-stderr -b time_query_bounding_box ``` -------------------------------- ### Pull and Run Published Docker Image Source: https://github.com/scverse/spatialdata/blob/main/docs/installation.md Pull a specific version of the SpatialData Docker image from GitHub Container Registry and run it. Replace the tag with the desired image version. ```bash docker pull ghcr.io/scverse/spatialdata:spatialdata0.3.0_spatialdata-io0.1.7_spatialdata-plot0.2.9 docker run -it ghcr.io/scverse/spatialdata:spatialdata0.3.0_spatialdata-io0.1.7_spatialdata-plot0.2.9 ``` -------------------------------- ### Integrate pre-commit changes Source: https://github.com/scverse/spatialdata/blob/main/docs/contributing.md Pull changes from the remote repository using rebase to incorporate automatic fixes applied by pre-commit.ci. ```bash git pull --rebase ``` -------------------------------- ### Update version with bump2version Source: https://github.com/scverse/spatialdata/blob/main/docs/contributing.md Commands to increment the project version number according to semantic versioning rules. ```bash bump2version patch bump2version minor bump2version major ``` -------------------------------- ### Testing Utilities API Source: https://github.com/scverse/spatialdata/blob/main/docs/api/testing.md Functions for asserting the identity and equality of spatial data objects and their elements. ```APIDOC ## Testing Utilities ### Description Provides functions to assert the identity and equality of spatial data objects and their constituent elements. ### Functions #### `assert_spatial_data_objects_are_identical` ##### Description Asserts that two `SpatialData` objects are identical. ##### Parameters - `adata1` (SpatialData) - The first `SpatialData` object. - `adata2` (SpatialData) - The second `SpatialData` object. #### `assert_elements_are_identical` ##### Description Asserts that two elements (e.g., DataFrames, Arrays) are identical. ##### Parameters - `element1` (Any) - The first element to compare. - `element2` (Any) - The second element to compare. #### `assert_elements_dict_are_identical` ##### Description Asserts that two dictionaries of elements are identical. ##### Parameters - `elements1` (Dict[str, Any]) - The first dictionary of elements. - `elements2` (Dict[str, Any]) - The second dictionary of elements. ``` -------------------------------- ### Create SpatialData Object from MERSCOPE Data Source: https://github.com/scverse/spatialdata/blob/main/docs/user_guide.md Initializes a SpatialData object using the spatialdata-io reader for MERSCOPE data. ```python sdata = spatialdata_io.merscope( 'merscope_ex/' # path to the folder with MERSCOPE files ) ``` -------------------------------- ### get_dask_backing_files Source: https://github.com/scverse/spatialdata/blob/main/docs/api/io.md Retrieves the list of files backing the Dask arrays in a SpatialData object. ```APIDOC ## get_dask_backing_files ### Description Returns a list of file paths that are currently backing the Dask arrays within the provided SpatialData object. ### Method FUNCTION ### Endpoint spatialdata.get_dask_backing_files ``` -------------------------------- ### SpatialData Transformation Classes Source: https://github.com/scverse/spatialdata/blob/main/docs/api/transformations.md Overview of the available transformation classes for coordinate system mapping. ```APIDOC ## Transformation Classes ### Description The following classes are used to define transformations between elements and coordinate systems in `SpatialData`. ### Classes - **BaseTransformation**: The base class for all transformations. - **Identity**: Represents an identity transformation. - **MapAxis**: Maps axes between coordinate systems. - **Translation**: Represents a translation transformation. - **Scale**: Represents a scaling transformation. - **Affine**: Represents an affine transformation. - **Sequence**: Represents a sequence of transformations. ``` -------------------------------- ### Transformation Management API Source: https://github.com/scverse/spatialdata/blob/main/docs/api/transformations_utils.md Functions for retrieving, setting, and removing transformation information. ```APIDOC ## GET / Transformations ### Description Retrieves the transformation associated with a given coordinate system. ### Method GET ### Endpoint `/transformations` (conceptual, refers to function usage) ### Parameters #### Query Parameters - **coordinate_system** (str) - Required - The target coordinate system. ### Response #### Success Response (200) - **transformation** (dict) - The transformation matrix or object. ## POST / Transformations ### Description Sets a transformation for a given coordinate system. ### Method POST ### Endpoint `/transformations` (conceptual, refers to function usage) ### Parameters #### Query Parameters - **coordinate_system** (str) - Required - The coordinate system to set the transformation for. - **transformation** (dict) - Required - The transformation matrix or object to set. ### Response #### Success Response (200) - **status** (str) - Confirmation message. ## DELETE / Transformations ### Description Removes the transformation associated with a given coordinate system. ### Method DELETE ### Endpoint `/transformations` (conceptual, refers to function usage) ### Parameters #### Query Parameters - **coordinate_system** (str) - Required - The coordinate system whose transformation should be removed. ### Response #### Success Response (200) - **status** (str) - Confirmation message. ``` -------------------------------- ### Landmark Transformation API Source: https://github.com/scverse/spatialdata/blob/main/docs/api/transformations_utils.md Functions specifically for transforming or aligning based on landmarks. ```APIDOC ## GET /transformations/between_landmarks ### Description Gets the transformation between two sets of landmarks. ### Method GET ### Endpoint `/transformations/between_landmarks` (conceptual, refers to function usage) ### Parameters #### Query Parameters - **source_landmarks** (dict) - Required - The source landmarks. - **target_landmarks** (dict) - Required - The target landmarks. ### Response #### Success Response (200) - **transformation** (dict) - The transformation matrix or object. ## DELETE /transformations/to_coordinate_system ### Description Removes all transformations leading to a specific coordinate system. ### Method DELETE ### Endpoint `/transformations/to_coordinate_system` (conceptual, refers to function usage) ### Parameters #### Query Parameters - **coordinate_system** (str) - Required - The coordinate system to remove transformations to. ### Response #### Success Response (200) - **status** (str) - Confirmation message. ``` -------------------------------- ### ImageTilesDataset Class Source: https://github.com/scverse/spatialdata/blob/main/docs/api/dataloader.md Documentation for the ImageTilesDataset class located in the spatialdata.dataloader module. ```APIDOC ## Class: ImageTilesDataset ### Description A dataset class designed for handling image tiles within the spatialdata framework. ### Module spatialdata.dataloader ``` -------------------------------- ### Read SpatialData Zarr Dataset Source: https://github.com/scverse/spatialdata/blob/main/docs/user_guide.md Loads a SpatialData object from a Zarr file. ```python sdata = sd.read_zarr(“your-dataset.zarr") ``` -------------------------------- ### SpatialData Format Classes Source: https://github.com/scverse/spatialdata/blob/main/docs/api/data_formats.md Overview of the available format classes for Raster, Shapes, Points, and Tables data types. ```APIDOC ## SpatialData Format Classes ### Description The SpatialData format is defined as a set of versioned subclasses of `ome_zarr.format.Format`. These classes ensure backward compatibility for different data elements. ### Format Classes - **CurrentRasterFormat** - The latest format implementation for raster data. - **RasterFormatV01** - Version 0.1 of the raster format. - **CurrentShapesFormat** - The latest format implementation for shapes data. - **ShapesFormatV01** - Version 0.1 of the shapes format. - **ShapesFormatV02** - Version 0.2 of the shapes format. - **CurrentPointsFormat** - The latest format implementation for points data. - **PointsFormatV01** - Version 0.1 of the points format. - **CurrentTablesFormat** - The latest format implementation for tables data. - **TablesFormatV01** - Version 0.1 of the tables format. ``` -------------------------------- ### Visualize SpatialData Layers Source: https://github.com/scverse/spatialdata/blob/main/docs/user_guide.md Use the spatialdata-plot syntax to render specific elements or chain multiple layers for visualization. ```python sdata.pl.render_("").pl.show() ``` ```python ( sdata .pl.render_image( "image_layer_name" ) .pl.render_shapes( "shape_layer_name" ) .pl.show() ) ``` -------------------------------- ### Spatial Data Table and Element Matching Operations Source: https://github.com/scverse/spatialdata/blob/main/docs/api/operations.md Functions for joining spatial element tables, matching elements to tables, and vice versa, as well as filtering data based on table queries. ```APIDOC ## Spatial Data Table and Element Matching ### Description Operations related to integrating and matching spatial elements with tabular data. ### Methods - `join_spatialelement_table` - `match_element_to_table` - `match_table_to_element` - `match_sdata_to_table` - `filter_by_table_query` ### Usage These functions facilitate the linkage and filtering of spatial data based on associated metadata. ``` -------------------------------- ### SpatialData Models Overview Source: https://github.com/scverse/spatialdata/blob/main/docs/api/models.md Definitions of the core data models used to represent spatial elements in the SpatialData framework. ```APIDOC ## SpatialData Models ### Description The following models represent the core building-blocks for spatial data structures within the library. ### Models - **Image2DModel**: Represents 2D image data. - **Image3DModel**: Represents 3D image data. - **Labels2DModel**: Represents 2D label/segmentation data. - **Labels3DModel**: Represents 3D label/segmentation data. - **ShapesModel**: Represents spatial shapes (e.g., polygons, circles). - **PointsModel**: Represents point-based spatial data. - **TableModel**: Represents tabular data associated with spatial elements. ``` -------------------------------- ### read_zarr Source: https://github.com/scverse/spatialdata/blob/main/docs/api/io.md Reads spatial data from a Zarr store. ```APIDOC ## read_zarr ### Description Reads spatial data from a Zarr store into a SpatialData object. ### Method FUNCTION ### Endpoint spatialdata.read_zarr ``` -------------------------------- ### SpatialElement Source: https://github.com/scverse/spatialdata/blob/main/docs/api/models_utils.md Represents a generic spatial element. ```APIDOC ## SpatialElement ### Description A base class or type alias representing a generic spatial element in spatialdata. ### Type `SpatialElement` ``` -------------------------------- ### Coordinate System Transformation API Source: https://github.com/scverse/spatialdata/blob/main/docs/api/transformations_utils.md Functions for transforming data between different coordinate systems. ```APIDOC ## GET /transformations/between_coordinate_systems ### Description Gets the transformation between two specified coordinate systems. ### Method GET ### Endpoint `/transformations/between_coordinate_systems` (conceptual, refers to function usage) ### Parameters #### Query Parameters - **source_coordinate_system** (str) - Required - The source coordinate system. - **target_coordinate_system** (str) - Required - The target coordinate system. ### Response #### Success Response (200) - **transformation** (dict) - The transformation matrix or object. ## POST /transformations/align_elements ### Description Aligns elements using landmarks between two coordinate systems. ### Method POST ### Endpoint `/transformations/align_elements` (conceptual, refers to function usage) ### Parameters #### Request Body - **source_coordinate_system** (str) - Required - The source coordinate system. - **target_coordinate_system** (str) - Required - The target coordinate system. - **source_landmarks** (dict) - Required - Landmarks in the source coordinate system. - **target_landmarks** (dict) - Required - Landmarks in the target coordinate system. ### Response #### Success Response (200) - **transformation** (dict) - The computed transformation matrix or object. ``` -------------------------------- ### Spatial Data Transformation and Rasterization Operations Source: https://github.com/scverse/spatialdata/blob/main/docs/api/operations.md Operations for concatenating, transforming, rasterizing, and converting spatial data into different formats like circles and polygons. ```APIDOC ## Spatial Data Transformation and Rasterization ### Description Functions for manipulating and converting `SpatialData` objects, including concatenation, transformations, and rasterization. ### Methods - `concatenate` - `transform` - `rasterize` - `rasterize_bins` - `rasterize_bins_link_table_to_labels` - `to_circles` - `to_polygons` ### Usage These operations are useful for data preprocessing, format conversion, and preparing data for analysis. ``` -------------------------------- ### get_model Source: https://github.com/scverse/spatialdata/blob/main/docs/api/models_utils.md Retrieves the model class for a given spatial element type. ```APIDOC ## get_model ### Description Retrieves the model class for a given spatial element type. ### Signature `get_model(element: SpatialElement)` ### Parameters * **element** (`SpatialElement`) - The spatial element to get the model for. ``` -------------------------------- ### Spatial Data Relabeling and Utility Operations Source: https://github.com/scverse/spatialdata/blob/main/docs/api/operations.md Operations for relabeling sequential data, checking extent equality, deep copying, and retrieving pyramid levels. ```APIDOC ## Spatial Data Relabeling and Utility Functions ### Description Utility functions for managing and inspecting `SpatialData` objects. ### Methods - `relabel_sequential` - `are_extents_equal` - `deepcopy` - `get_pyramid_levels` - `sanitize_name` - `sanitize_table` ### Usage These functions provide essential utilities for data cleaning, validation, and management. ``` -------------------------------- ### set_channel_names Source: https://github.com/scverse/spatialdata/blob/main/docs/api/models_utils.md Sets the channel names for a spatial element. ```APIDOC ## set_channel_names ### Description Sets the channel names for a spatial element. ### Signature `set_channel_names(element: SpatialElement, channel_names: list[str])` ### Parameters * **element** (`SpatialElement`) - The spatial element to set channel names for. * **channel_names** (`list[str]`) - A list of channel names. ``` -------------------------------- ### Spatial Data Aggregation and Mapping Operations Source: https://github.com/scverse/spatialdata/blob/main/docs/api/operations.md Operations for aggregating spatial data, mapping rasters, and unpadding raster data. ```APIDOC ## Spatial Data Aggregation and Mapping ### Description Functions for aggregating spatial data and performing operations on raster data. ### Methods - `aggregate` - `map_raster` - `unpad_raster` ### Usage These functions enable summarization of spatial data and manipulation of raster representations. ``` -------------------------------- ### force_2d Source: https://github.com/scverse/spatialdata/blob/main/docs/api/models_utils.md Forces a spatial element to be 2D by dropping the z-axis if present. ```APIDOC ## force_2d ### Description Forces a spatial element to be 2D by dropping the z-axis if present. ### Signature `force_2d(element: SpatialElement)` ### Parameters * **element** (`SpatialElement`) - The spatial element to convert to 2D. ``` -------------------------------- ### Spatial Data Query Operations Source: https://github.com/scverse/spatialdata/blob/main/docs/api/operations.md Operations for querying spatial data based on bounding boxes and polygons, and retrieving specific data values or element instances. ```APIDOC ## Operations on SpatialData Objects ### Description This section covers operations for querying and retrieving data from `SpatialData` objects. ### Methods - `bounding_box_query` - `polygon_query` - `get_values` - `get_element_instances` - `get_extent` - `get_centroids` ### Usage These functions allow for efficient spatial subsetting and data extraction. ``` -------------------------------- ### points_dask_dataframe_to_geopandas Source: https://github.com/scverse/spatialdata/blob/main/docs/api/models_utils.md Converts a Dask DataFrame of points to a GeoPandas DataFrame. ```APIDOC ## points_dask_dataframe_to_geopandas ### Description Converts a Dask DataFrame of points to a GeoPandas DataFrame. ### Signature `points_dask_dataframe_to_geopandas(points: dd.DataFrame)` ### Parameters * **points** (`dd.DataFrame`) - The Dask DataFrame containing points. ``` -------------------------------- ### Add GeoJSON Annotations to SpatialData Source: https://github.com/scverse/spatialdata/blob/main/docs/user_guide.md Use ShapesModel to parse and add external geojson files as shapes to the SpatialData object. ```python from spatialdata.models import ShapesModel sdata['very_interesting_regions']=ShapesModel.parse('path_to_geojson') ``` -------------------------------- ### get_channel_names Source: https://github.com/scverse/spatialdata/blob/main/docs/api/models_utils.md Retrieves the channel names from a spatial element. ```APIDOC ## get_channel_names ### Description Retrieves the channel names from a spatial element. ### Signature `get_channel_names(element: SpatialElement)` ### Parameters * **element** (`SpatialElement`) - The spatial element to get channel names from. ``` -------------------------------- ### points_geopandas_to_dask_dataframe Source: https://github.com/scverse/spatialdata/blob/main/docs/api/models_utils.md Converts a GeoPandas DataFrame of points to a Dask DataFrame. ```APIDOC ## points_geopandas_to_dask_dataframe ### Description Converts a GeoPandas DataFrame of points to a Dask DataFrame. ### Signature `points_geopandas_to_dask_dataframe(points: gpd.GeoDataFrame)` ### Parameters * **points** (`gpd.GeoDataFrame`) - The GeoPandas DataFrame containing points. ``` -------------------------------- ### Disable Dask Tune Optimization for Points Data Source: https://github.com/scverse/spatialdata/blob/main/docs/index.md Use this context manager to disable dask graph optimization for Points dataframes with more than one partition, preventing potential errors. This is useful when performing operations directly on the dask dataframe. ```python from spatialdata import disable_dask_tune_optimization import contextlib ... with disable_dask_tune_optimization() if data.npartitions > 1 else contextlib.nullcontext(): ``` -------------------------------- ### validate_element Source: https://github.com/scverse/spatialdata/blob/main/docs/api/models_utils.md Validates a spatial element against its model. ```APIDOC ## validate_element ### Description Validates a spatial element against its model. ### Signature `validate_element(element: SpatialElement)` ### Parameters * **element** (`SpatialElement`) - The spatial element to validate. ``` -------------------------------- ### get_spatial_axes Source: https://github.com/scverse/spatialdata/blob/main/docs/api/models_utils.md Retrieves the spatial axes of a spatial element. ```APIDOC ## get_spatial_axes ### Description Retrieves the spatial axes of a spatial element. ### Signature `get_spatial_axes(element: SpatialElement)` ### Parameters * **element** (`SpatialElement`) - The spatial element to get the spatial axes from. ``` -------------------------------- ### get_axes_names Source: https://github.com/scverse/spatialdata/blob/main/docs/api/models_utils.md Retrieves the names of the axes for a spatial element. ```APIDOC ## get_axes_names ### Description Retrieves the names of the axes for a spatial element. ### Signature `get_axes_names(element: SpatialElement)` ### Parameters * **element** (`SpatialElement`) - The spatial element to get the axes names from. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.