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
10 changes: 3 additions & 7 deletions .github/workflows/make-tutorials-json.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,11 @@ jobs:
filter: blob:none
fetch-depth: 0

- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip" # caching pip dependencies
- name: Install dependencies for validation script
run: pip install .[registry]
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Execute validation script and create output directory
run: |
./tutorial-registry/validate.py --outdir=build
uvx hatch run registry:validate --outdir build

- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion docs/extensions/typed_returns.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from sphinx.ext.napoleon import NumpyDocstring


def _process_return(lines: Iterable[str]) -> Generator[str, None, None]:
def _process_return(lines: Iterable[str]) -> Generator[str]:
for line in lines:
if m := re.fullmatch(r"(?P<param>\w+)\s+:\s+(?P<type>[\w.]+)", line):
yield f"-{m['param']} (:class:`~{m['type']}`)"
Expand Down
22 changes: 11 additions & 11 deletions docs/notebooks/anndata_getting_started.ipynb

Large diffs are not rendered by default.

79 changes: 44 additions & 35 deletions docs/notebooks/basic-scrna-tutorial.ipynb

Large diffs are not rendered by default.

210 changes: 193 additions & 17 deletions docs/notebooks/scverse_data_backed.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/notebooks/scverse_data_interoperability.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.11"
"version": "3.12.12"
}
},
"nbformat": 4,
Expand Down
66 changes: 57 additions & 9 deletions docs/notebooks/tutorial_axes_anndata_mudata.ipynb

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/notebooks/tutorial_concatenation_anndata_mudata.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@
"name": "stderr",
"output_type": "stream",
"text": [
"/home/runner/miniconda3/envs/tutorials/lib/python3.12/site-packages/anndata/_core/anndata.py:1793: UserWarning: Variable names are not unique. To make them unique, call `.var_names_make_unique`.\n",
"/home/runner/miniconda3/envs/tutorials/lib/python3.12/site-packages/anndata/_core/anndata.py:1798: UserWarning: Variable names are not unique. To make them unique, call `.var_names_make_unique`.\n",
" utils.warn_names_duplicates(\"var\")\n",
"/home/runner/miniconda3/envs/tutorials/lib/python3.12/site-packages/anndata/_core/anndata.py:1793: UserWarning: Variable names are not unique. To make them unique, call `.var_names_make_unique`.\n",
"/home/runner/miniconda3/envs/tutorials/lib/python3.12/site-packages/anndata/_core/anndata.py:1798: UserWarning: Variable names are not unique. To make them unique, call `.var_names_make_unique`.\n",
" utils.warn_names_duplicates(\"var\")\n",
"/home/runner/miniconda3/envs/tutorials/lib/python3.12/site-packages/mudata/_core/mudata.py:947: UserWarning: var_names are not unique. To make them unique, call `.var_names_make_unique`.\n",
" warnings.warn(\n"
Expand Down Expand Up @@ -948,7 +948,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.11"
"version": "3.12.12"
},
"vscode": {
"interpreter": {
Expand Down
20 changes: 4 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,12 @@ version = "0.0.1"
description = "Tutorials for single-cell analysis with scverse packages"
readme = "README.md"
license = "BSD-3-Clause"
maintainers = [
{ name = "scverse team", email = "core-team@scverse.org" },
]
authors = [
{ name = "scverse team" },
]
requires-python = ">=3.10"
maintainers = [ { name = "scverse team", email = "core-team@scverse.org" } ]
authors = [ { name = "scverse team" } ]
requires-python = ">=3.13"
classifiers = [
"Private :: Do Not Upload", # Prevent uploading to PyPI
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
Expand All @@ -39,12 +32,7 @@ optional-dependencies.docs = [
"sphinxcontrib-bibtex>=1",
"sphinxext-opengraph",
]
optional-dependencies.registry = [
"httpx",
"jsonschema",
"pillow",
"pyyaml",
]
optional-dependencies.registry = [ "httpx", "jsonschema", "pillow", "pyyaml" ]
urls.Documentation = "https://scverse.org/scverse-tutorials"
urls.Home-page = "https://github.com/scverse/scverse-tutorials"
urls.Source = "https://github.com/scverse/scverse-tutorials"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Pseudo-bulk differential expression and functional analysis
description: |
This notebook showcases decoupler for pathway and TF enrichment on ~5k
Blood myeloid cells from healthy and COVID-19 infected patients.
link: https://decoupler-py.readthedocs.io/en/latest/notebooks/pseudobulk.html
link: https://decoupler.readthedocs.io/en/latest/notebooks/scell/rna_psbk.html
image: icon.png
primary_category: scRNA-seq
order: 30
Expand Down
2 changes: 1 addition & 1 deletion tutorial-registry/tutorials/plotting-in-scanpy/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Plotting in scanpy
description: |
This tutorial explores the visualization possibilities of scanpy, including
embeddings and the visualization of marker genes and differentially expressed genes.
link: https://scanpy-tutorials.readthedocs.io/en/latest/plotting/core.html
link: https://scanpy.readthedocs.io/en/stable/tutorials/plotting/core.html
image: icon.png
primary_category: Tips & Tricks
order: 10
Expand Down
10 changes: 8 additions & 2 deletions tutorial-registry/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import argparse
import json
import logging
import shutil
import sys
from pathlib import Path
Expand All @@ -16,14 +17,17 @@
import yaml
from PIL import Image

logger = logging.getLogger(__name__)

if TYPE_CHECKING:
from collections.abc import Generator, Iterable, Mapping

HERE = Path(__file__).absolute().parent


def _check_url_exists(url: str) -> None:
response = httpx.get(url)
logger.info(f"Testing URL: {url}")
response = httpx.head(url, follow_redirects=True)
if response.status_code != 200:
raise ValueError(f"URL {url} is not reachable (error {response.status_code}). ")

Expand All @@ -47,7 +51,7 @@ def _check_image(img_path: Path) -> None:
)


def validate_tutorials(schema_file: Path, tutorials_dir: Path) -> Generator[dict, None, None]:
def validate_tutorials(schema_file: Path, tutorials_dir: Path) -> Generator[dict]:
"""Find all tutorial `meta.yaml` files in the tutorials dir and yield tutorial records."""
schema = json.loads(schema_file.read_bytes())
known_links = set()
Expand Down Expand Up @@ -143,6 +147,8 @@ def main(schema_file: Path, meta_dir: Path, categories_file: Path, *, outdir: Pa


if __name__ == "__main__":
logging.basicConfig(level=logging.INFO, format="%(message)s")

parser = argparse.ArgumentParser(
prog="validate.py",
description="Validate tutorials' meta.yaml and generate an output directory with json/images to be uploaded on github pages.",
Expand Down