Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .panache.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#:schema https://panache.bz/panache.schema.json
flavor = "myst"
extend-exclude = [".claude/"]

[format]
wrap = "preserve"
smart-punctuation = "unicode"
tab-stops = "preserve"

# MyST syntax extensions from `scverse_doc.config.MYST_ENABLE_EXTENSIONS`
[extensions]
myst-colon-fence = true # colon_fence
definition-lists = true # deflist
tex-math-dollars = true # dollarmath, amsmath
raw-html = true # html_image, html_admonition
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ repos:
exclude: ^\.cruft\.json$ # inconsistent indentation with cruft - file never to be modified manually.
groups: [format]
# further file exclusions and other options are configured in biome.jsonc
- repo: https://github.com/jolars/panache-pre-commit
rev: v3.18.0
hooks:
- id: panache-format
groups: [format]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.30.3
hooks:
Expand Down
1 change: 1 addition & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
"editorconfig.editorconfig",
"charliermarsh.ruff",
"biomejs.biome",
"jolars.panache",
],
}
7 changes: 5 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"[python][json][jsonc]": {
"[python][json][jsonc][yaml][markdown]": {
"editor.formatOnSave": true,
},
"[python]": {
Expand All @@ -9,9 +9,12 @@
"source.organizeImports": "always",
},
},
"[json][jsonc]": {
"[json][jsonc][yaml]": {
"editor.defaultFormatter": "biomejs.biome",
},
"[markdown]": {
"editor.defaultFormatter": "jolars.panache",
},
"python.analysis.typeCheckingMode": "basic",
"python.testing.pytestEnabled": true,
"python.testing.pytestArgs": ["-vv", "--color=yes"],
Expand Down
6 changes: 3 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ assert not isinstance(transformation, dict)
assert_type(transformation, BaseTransformation)
```

When all branches of a union have been handled, use `typing.assert_never` instead of a generic "should not reach here"
When all branches of a union have been handled, use `typing.assert_never` instead of a generic “should not reach here”
error, so the type checker tells us if a new type is added to the union and not handled:

```python
Expand All @@ -42,7 +42,7 @@ else:

#### Why

Because of Python's (multiple-)inheritance model, a positive `isinstance` assertion can never be rejected by a type
Because of Python’s (multiple-)inheritance model, a positive `isinstance` assertion can never be rejected by a type
checker, even when it contradicts the declared type:

```python
Expand All @@ -60,7 +60,7 @@ assert not isinstance(transformations, BaseTransformation)
assert_type(transformations, dict[str, BaseTransformation])
```

Optional values are already narrowed "negatively", so keep using `is not None`:
Optional values are already narrowed “negatively”, so keep using `is not None`:

```python
assert target_depth is not None
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Another useful resource to get started is the source code of the [`spatialdata-i

## Installation

Check out the docs for more complete [installation instructions](https://spatialdata.scverse.org/en/stable/installation.html). To get started with the "batteries included" installation, you can install via pip:
Check out the docs for more complete [installation instructions](https://spatialdata.scverse.org/en/stable/installation.html). To get started with the “batteries included” installation, you can install via pip:

```bash
pip install "spatialdata[extra]"
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pip install -e . --group dev --group test --group doc --group benchmark

## Usage

Running all the benchmarks is usually not needed. You run the benchmark using `asv run`. See the [asv documentation](https://asv.readthedocs.io/en/stable/commands.html#asv-run) for interesting arguments, like selecting the benchmarks you're interested in by providing a regex pattern `-b` or `--bench` that links to a function or class method. You can run the benchmark in your current environment with `--python=same`. Some example benchmarks:
Running all the benchmarks is usually not needed. You run the benchmark using `asv run`. See the [asv documentation](https://asv.readthedocs.io/en/stable/commands.html#asv-run) for interesting arguments, like selecting the benchmarks you’re interested in by providing a regex pattern `-b` or `--bench` that links to a function or class method. You can run the benchmark in your current environment with `--python=same`. Some example benchmarks:

### Import time benchmarks

Expand Down
1 change: 1 addition & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"$schema": "https://biomejs.dev/schemas/2.6.4/schema.json",
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
"formatter": { "useEditorconfig": true },
"markdown": { "formatter": { "enabled": false } }, // handled by panache
"overrides": [
{
"includes": ["./.vscode/*.json", "**/*.jsonc"],
Expand Down
2 changes: 1 addition & 1 deletion docs/api/io.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Input/Output

To read the data from a specific technology (e.g., Xenium, MERSCOPE, ...), you can
To read the data from a specific technology (e.g., Xenium, MERSCOPE, …), you can
use any of the [spatialdata-io readers](https://spatialdata.scverse.org/projects/io/en/stable/api.html).

```{eval-rst}
Expand Down
2 changes: 1 addition & 1 deletion docs/citation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

If you use SpatialData in your work, please cite {cite:t}`marconatoSpatialDataOpenUniversal2024`:

> Marconato, L., Palla, G., Yamauchi, K.A. et al. SpatialData: an open and universal data framework for spatial omics. _Nature Methods_ (2024). doi: [10.1038/s41592-024-02212-x](https://doi.org/10.1038/s41592-024-02212-x).
> Marconato, L., Palla, G., Yamauchi, K.A. et al. SpatialData: an open and universal data framework for spatial omics. *Nature Methods* (2024). doi: [10.1038/s41592-024-02212-x](https://doi.org/10.1038/s41592-024-02212-x).
20 changes: 4 additions & 16 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ For more extensive tutorials, that also cover the absolute basics, please refer
[scanpy developer guide]: https://scanpy.scverse.org/page/dev/

:::{tip} The _hatch_ project manager

We highly recommend to familiarize yourself with [`hatch`][hatch].
Hatch is a Python project manager that

Expand All @@ -20,14 +19,13 @@ Hatch is a Python project manager that
- allows to run tasks defined in `pyproject.toml`, e.g. to build documentation.

While the project is setup with `hatch` in mind, it is still possible to use different tools to manage dependencies, such as `uv` or `pip`.

:::

[hatch]: https://hatch.pypa.io/latest/

## Installing dev dependencies

In addition to the packages needed to _use_ this package, you need additional python packages to [run tests](#writing-tests) and [build the documentation](#docs-building).
In addition to the packages needed to *use* this package, you need additional python packages to [run tests](#writing-tests) and [build the documentation](#docs-building).

:::::{tab-set}
::::{tab-item} Hatch
Expand All @@ -46,9 +44,9 @@ hatch run docs:build # defined in the table [tool.hatch.envs.docs]
If you are using VS code, install the [hatch-code][] extension.
Additionally, make sure that the `vscode-python-environments` extension is installed (should be by default) and `"python.useEnvironmentsExtension": true` is activated in your `settings.json`.

Next, open the "Python Environment Managers" sidebar.
Next, open the “Python Environment Managers” sidebar.
You can do so by opening the command palette (Ctrl+Shift+P) and searching for `Python: Focus on Environment Managers View`.
It will show a collapsible list where you can expand "Hatch" and activate an environment by clicking on the checkmark next to it.
It will show a collapsible list where you can expand “Hatch” and activate an environment by clicking on the checkmark next to it.
As the main development environment, we recommend to use `hatch-test` with the latest supported Python version.

### Other IDEs
Expand Down Expand Up @@ -93,8 +91,6 @@ hatch env find hatch-test.py3.14-stable
```

and manually point it to the python binary.


::::

::::{tab-item} uv
Expand All @@ -111,7 +107,6 @@ uv sync --group=test --group=doc --extra=torch
```

The `.venv` directory is typically automatically discovered by IDEs such as VS Code.

::::

::::{tab-item} Pip
Expand All @@ -127,7 +122,6 @@ pip install -e . --group dev --group test --group doc
```

The `.venv` directory is typically automatically discovered by IDEs such as VS Code.

::::
:::::

Expand Down Expand Up @@ -155,7 +149,7 @@ prek will automatically download all dependencies when it is run for the first t
If you didn’t run the checks locally, the `Pre-commit checks` job of the GitHub Actions CI runs them on your pull request and reports any failures.
We strongly encourage installing and running the checks locally first to understand their usage.

Finally, most editors have an _autoformat on save_ feature.
Finally, most editors have an *autoformat on save* feature.
Consider enabling this option for [ruff][ruff-editors] and [biome][biome-editors].

[pre-commit]: https://pre-commit.com/
Expand Down Expand Up @@ -184,7 +178,6 @@ hatch test # test with the highest supported Python version
# or
hatch test --all # test with all supported Python versions
```

::::

::::{tab-item} uv
Expand All @@ -193,7 +186,6 @@ hatch test --all # test with all supported Python versions
```bash
uv run pytest
```

::::

::::{tab-item} Pip
Expand All @@ -203,7 +195,6 @@ uv run pytest
source .venv/bin/activate
pytest
```

::::
:::::

Expand Down Expand Up @@ -349,7 +340,6 @@ If you are interested in automatically running notebooks as part of the continuo
hatch run docs:build
hatch run docs:open
```

::::

::::{tab-item} uv
Expand All @@ -360,7 +350,6 @@ cd docs
uv run sphinx-build -M html . _build -W
(xdg-)open _build/html/index.html
```

::::

::::{tab-item} Pip
Expand All @@ -372,7 +361,6 @@ cd docs
sphinx-build -M html . _build -W
(xdg-)open _build/html/index.html
```

::::
:::::

Expand Down
Loading
Loading