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
14 changes: 4 additions & 10 deletions docs/_static/css/override.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,8 @@ dl.citation > dt {
font-size: 70% !important;
}

/* RSC colors are
#7400ff - violet
#76b900 - green
#4169e1 - blue
Comment on lines -23 to -25

@flying-sheep flying-sheep Oct 26, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these should be configured on the website too!

https://github.com/scverse/scverse.github.io/blob/main/assets/accents.json

Then you don’t even need to configure them here

*/

p.caption .caption-text {
color: #7400ff;
font-weight: 600;
text-transform: uppercase;
/* scverse-doc mixes the link hover colour towards the (near-white) text colour,
which greys out the accent in dark mode. Brighten it instead, keeping chroma and hue. */
html[data-theme="dark"] {
--pst-color-primary-highlight: oklch(from var(--scverse-color-accent-text) calc(l + 0.08) c h);
}
67 changes: 0 additions & 67 deletions docs/_templates/autosummary/class.rst

This file was deleted.

91 changes: 12 additions & 79 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

# -- Path setup --------------------------------------------------------------
import sys
import os
from datetime import datetime
from importlib.metadata import metadata
from pathlib import Path, PurePosixPath
from pathlib import Path
from typing import TYPE_CHECKING
import anndata # noqa
import fast_array_utils # noqa
from docutils import nodes
from docutils.parsers.rst import roles
from scverse_doc.config import DEFAULTS
from scverse_doc.registry import intersphinx

if TYPE_CHECKING:
from sphinx.application import Sphinx
Expand All @@ -19,9 +20,6 @@
HERE = Path(__file__).parent
sys.path.insert(0, str(HERE.parent / "src/"))

on_rtd = os.environ.get("READTHEDOCS") == "True"
rtd_links_prefix = PurePosixPath("src")

# -- Project information -----------------------------------------------------

info = metadata("rapids_singlecell")
Expand All @@ -31,15 +29,13 @@
author = info["Author"]
copyright = f"{datetime.now():%Y}, {author}"
version = info["Version"]
repository_url = "https://github.com/scverse/rapids-singlecell"
source_repository = "https://github.com/scverse/rapids-singlecell"

# The full version, including alpha/beta/rc tags
release = info["Version"]

templates_path = ["_templates"]
bibtex_bibfiles = ["references.bib"]
nitpicky = True # Warn about broken links
needs_sphinx = "4.5"
suppress_warnings = [
"ref.citation",
"myst.header", # https://github.com/executablebooks/MyST-Parser/issues/262
Expand All @@ -48,30 +44,20 @@
# -- General configuration ---------------------------------------------------

extensions = [
"myst_nb",
"sphinx_design",
"sphinx.ext.autodoc",
"scverse_doc", # sets up napoleon, so needs to be before sphinx_autodoc_typehints
"sphinx.ext.doctest",
"sphinx.ext.coverage",
"sphinx.ext.mathjax",
"sphinx.ext.autosummary",
"sphinx.ext.napoleon",
"sphinx.ext.intersphinx",
"sphinx.ext.githubpages",
"sphinx_autodoc_typehints",
"sphinx.ext.extlinks",
"sphinx.ext.imgconverter",
"sphinx_copybutton",
"nbsphinx",
"scanpydoc",
"scverse_misc.sphinx_ext",
"sphinx.ext.linkcode",
"sphinx_tabs.tabs",
"sphinxext.opengraph",
"sphinxcontrib.bibtex",
]

autosummary_generate = True
autodoc_member_order = "bysource"
autodoc_mock_imports = [
"cudf",
Expand All @@ -82,49 +68,18 @@
"pylibraft",
"cuvs",
]
default_role = "literal"
napoleon_google_docstring = False
napoleon_numpy_docstring = True
napoleon_include_init_with_doc = False
napoleon_use_rtype = False # having a separate entry generally helps readability
napoleon_use_param = True
api_dir = HERE / "api"
myst_enable_extensions = [
"amsmath",
"colon_fence",
"deflist",
"dollarmath",
"html_image",
"html_admonition",
]
myst_url_schemes = ("http", "https", "mailto", "ftp")
nb_output_stderr = "remove"
nb_execution_mode = "off"
nb_merge_streams = True
typehints_defaults = "braces"

source_suffix = {
".rst": "restructuredtext",
".ipynb": "myst-nb",
".myst": "myst-nb",
}

intersphinx_mapping = {
"anndata": ("https://anndata.scverse.org/en/stable/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
# scverse core packages, Python, NumPy, SciPy, pandas and Matplotlib come from the registry
intersphinx_mapping = intersphinx("squidpy", "spatialdata", "pertpy", "decoupler") | {
"cupy": ("https://docs.cupy.dev/en/stable/", None),
"python": ("https://docs.python.org/3", None),
"cuml": ("https://docs.rapids.ai/api/cuml/stable/", None),
"pandas": ("https://pandas.pydata.org/docs/", None),
"cudf": ("https://docs.rapids.ai/api/cudf/stable/", None),
"cugraph": ("https://docs.rapids.ai/api/cugraph/stable/", None),
"scanpy": ("https://scanpy.scverse.org/en/stable/", None),
"squidpy": ("https://squidpy.readthedocs.io/en/stable/", None),
"spatialdata": ("https://spatialdata.scverse.org/en/stable/", None),
"pertpy": ("https://pertpy.scverse.org/en/stable/", None),
"seaborn": ("https://seaborn.pydata.org/", None),
"decoupler": ("https://decoupler.readthedocs.io/en/latest/", None),
"rmm": ("https://docs.rapids.ai/api/rmm/stable/", None),
"statsmodels": ("https://www.statsmodels.org/stable/", None),
"omnipath": ("https://omnipath.readthedocs.io/en/latest/", None),
Expand All @@ -135,11 +90,8 @@
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = [
"_build",
"Thumbs.db",
".DS_Store",
*DEFAULTS.exclude_patterns,
"._*",
"*.ipynb_checkpoints",
"release-notes/blank.md",
]

Expand All @@ -158,32 +110,24 @@

# -- Options for HTML output -------------------------------------------------

html_theme = "scanpydoc"
html_theme_options = {
"repository_url": repository_url,
"repository_branch": os.environ.get("READTHEDOCS_GIT_IDENTIFIER", "main"),
"use_repository_button": True,
# TODO: drop once scverse-doc is released with the website accents (scverse/scverse-doc#78)
"accent": "#76b900", # NVIDIA green
"secondary_accent": "#7400ff", # violet, used for the sidebar captions
"navigation_with_keys": False,
"show_toc_level": 2,
}
html_show_sphinx = False
html_logo = "_static/logo_RTD.svg"
html_static_path = ["_static"]
html_css_files = ["css/override.css"]
html_title = "rapids-singlecell"

# OpenGraph metadata for social media previews
ogp_site_url = "https://rapids-singlecell.readthedocs.io/"
ogp_site_name = "rapids-singlecell"
ogp_image = "_static/logo_RTD.svg"

qualname_overrides = {
"numpy.bool_": "numpy.bool", # Since numpy 2, numpy.bool is the canonical dtype
# Since numpy 2.5, NDArray is a TypeAliasType defined in numpy._typing._array_like,
# so a subscripted NDArray[...] reports that private module and sphinx-autodoc-typehints
# builds the target as <annotation module>.<type qualname> -- a name numpy does not
# document. Same treatment as anndata gives the pre-2.5 spelling of this alias.
"numpy._typing._array_like.GenericAlias": ("py:data", "numpy.typing.NDArray"),
xref_overrides = {
"spatialdata._core.spatialdata.SpatialData": "spatialdata.SpatialData",
}

Expand Down Expand Up @@ -215,17 +159,6 @@ def setup(app: Sphinx) -> None:
"""App setup hook."""
app.add_role("small", roles.GenericRole("small", nodes.inline))
app.add_role("smaller", roles.GenericRole("smaller", nodes.inline))
app.add_config_value(
"recommonmark_config",
default={
"auto_toc_tree_section": "Contents",
"enable_auto_toc_tree": True,
"enable_math": True,
"enable_inline_math": False,
"enable_eval_rst": True,
},
rebuild=True,
)


# extlinks config
Expand Down
5 changes: 5 additions & 0 deletions docs/release-notes/0.19.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### 0.19.0 {small}`the-future`

```{rubric} Misc
```
* Switch the documentation theme from `scanpydoc` to the shared scverse theme `scverse-doc` {pr}`856` {smaller}`S Dicks`
4 changes: 4 additions & 0 deletions docs/release-notes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

# Release notes

## Version 0.19.0
```{include} /release-notes/0.19.0.md
```

## Version 0.18.0
```{include} /release-notes/0.18.1.md
```
Expand Down
10 changes: 3 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,11 @@ rapids-cu12 = [

[dependency-groups]
docs = [
"sphinx>=4.5.0",
"sphinx-copybutton",
"sphinx>=8.1",
"nbsphinx>=0.8.12",
"myst-nb",
"sphinx-design",
"sphinx-tabs",
"sphinxext-opengraph",
"sphinxcontrib.bibtex",
"scanpydoc[typehints,theme]>=0.9.4",
"scverse-doc[full]>=0.3",
"sphinx-autodoc-typehints",
"scverse-misc[sphinx]>=0.1.3",
"dask",
"pytest",
Expand Down
Loading