Metadata-Version: 2.4
Name: dummy-spatialdata
Version: 0.1.3
Summary: A package for creating arbitrary spatialdata for testing purposes.
Project-URL: Documentation, https://dummy-spatialdata.readthedocs.io/
Project-URL: Homepage, https://github.com/BIMSBBioinfo/dummy-spatialdata
Project-URL: Source, https://github.com/BIMSBBioinfo/dummy-spatialdata
Author-email: Artür Manukyan <amanukyan.umms@gmail.com>
License: MIT
Requires-Python: >=3.13
Requires-Dist: dummy-anndata>=0.0.3
Requires-Dist: geopandas>=0.14
Requires-Dist: pillow>=12.1.1
Requires-Dist: requests>=2.31
Requires-Dist: shapely>=2.0.1
Requires-Dist: spatialdata-plot>=0.3.2
Requires-Dist: spatialdata>=0.7.2
Provides-Extra: dev
Requires-Dist: pre-commit; extra == 'dev'
Requires-Dist: twine>=4.0.2; extra == 'dev'
Provides-Extra: test
Requires-Dist: coverage; extra == 'test'
Requires-Dist: pytest; extra == 'test'
Description-Content-Type: text/markdown

# dummy-spatialdata

Allows generating dummy spatialdata objects, which can be useful for testing purposes.

## Installation

```bash
pip install dummy-spatialdata
```

## Example usage
```{python}
from dummy_spatialdata import generate_dataset
import dummy_anndata
import spatialdata_plot as sdp 
import spatialdata as sd
import matplotlib.pyplot as plt
import anndata as ad

# generate dummy anndata
adata = dummy_anndata.generate_dataset(n_obs=12, n_vars=20)
sdata = generate_dataset(
    images = [
        {"type": "rgb", "n_layers": 4, "coordinate_system": "global"},
        {"type": "grayscale", "n_layers": 1, "coordinate_system": "global"},
    ],
    labels = [
        {"n_labels": 12, "n_layers": 4, "coordinate_system": "global2"},
        {"n_labels": 12, "n_layers": 0, "coordinate_system": "global2"},
    ], 
    shapes = [
        {"n_shapes": 12, "coordinate_system": "global"},
        {"n_shapes": 20},
    ],
    points = [
        {"n_points": 12}
    ],
    tables = [
        {"table": adata, "element": "shape", "element_index": 0}
    ],
    coordinate_systems = {
        "global": {"transformations": ["affine"], "shape": {"x": 2000, "y": 2000}},
        "global2": {"transformations": ["scale", "translation"], "shape":{"x": 500, "y": 500}}},
    SEED=13
)
sdata
```

```
SpatialData object
├── Images
│     ├── 'image_0': DataTree[cyx] (3, 2000, 2000), (3, 1000, 1000), (3, 500, 500), (3, 250, 250)
│     └── 'image_1': DataTree[cyx] (1, 2000, 2000)
├── Labels
│     ├── 'label_0': DataTree[yx] (500, 500), (250, 250), (125, 125), (62, 62)
│     └── 'label_1': DataTree[yx] (500, 500)
├── Points
│     └── 'point_0': DataFrame with shape: (<Delayed>, 2) (2D points)
├── Shapes
│     ├── 'shape_0': GeoDataFrame shape: (12, 1) (2D shapes)
│     └── 'shape_1': GeoDataFrame shape: (20, 1) (2D shapes)
└── Tables
      └── 'table_0': AnnData (12, 20)
with coordinate systems:
    ▸ 'global', with elements:
        image_0 (Images), image_1 (Images), shape_0 (Shapes)
    ▸ 'global2', with elements:
        label_0 (Labels), label_1 (Labels)
    ▸ 'point_0', with elements:
        point_0 (Points)
    ▸ 'shape_1', with elements:
        shape_1 (Shapes)
```

You can plot the demo data now!

```{python}
sdata.pl.render_images("image_0").pl.render_shapes("shape_0", color="Gene001", table_name = "table_0", table_layer = "float_matrix").pl.show(coordinate_systems = "global")
```