From 8a6884d2db93ffece662277ed9e75ecddc049dfa Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Wed, 4 Mar 2026 18:10:40 +0100 Subject: [PATCH] chore(docs): upgrade sphinx use numpy doc style fix minor warnings --- .readthedocs.yaml | 6 ++++-- README.rst | 2 +- docs/requirements.txt | 2 +- docs/src/conf.py | 17 ++++------------- src/affine/__init__.py | 13 ++++++++----- 5 files changed, 18 insertions(+), 22 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 91e9f96..11d2009 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,9 +1,9 @@ version: 2 build: - os: ubuntu-22.04 + os: ubuntu-24.04 tools: - python: "3.11" + python: "3.14" sphinx: configuration: docs/src/conf.py @@ -11,3 +11,5 @@ sphinx: python: install: - requirements: docs/requirements.txt + - method: pip + path: . diff --git a/README.rst b/README.rst index cc428dd..8ae5f72 100644 --- a/README.rst +++ b/README.rst @@ -22,7 +22,7 @@ Usage The 3x3 augmented affine transformation matrix for transformations in two dimensions is illustrated below. -:: +.. code-block:: none | x' | | a b c | | x | | y' | = | d e f | | y | diff --git a/docs/requirements.txt b/docs/requirements.txt index 3bf9c2a..75765cc 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,2 +1,2 @@ attrs -sphinx==6.2.1 +sphinx==9.1.0 diff --git a/docs/src/conf.py b/docs/src/conf.py index e86d4a4..a64e56d 100644 --- a/docs/src/conf.py +++ b/docs/src/conf.py @@ -11,7 +11,7 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information project = "rasterio/affine" -copyright = "2025, Sean Gillies" +project_copyright = "%Y, Sean Gillies" author = "Sean Gillies" release = "development" @@ -22,27 +22,18 @@ "sphinx.ext.autodoc", "sphinx.ext.coverage", "sphinx.ext.ifconfig", + "sphinx.ext.napoleon", # NumPy doc style. + "sphinx.ext.todo", "sphinx.ext.viewcode", - "sphinx.ext.githubpages", ] templates_path = ["_templates"] -exclude_patterns = ["Thumbs.db", ".DS_Store"] - -# The suffix of source filenames. -source_suffix = ".rst" - -# The root toctree document. -root_doc = "index" - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" +exclude_patterns = ["build", "Thumbs.db", ".DS_Store"] # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output html_theme = "nature" - html_static_path = ["_static"] # If this is not None, a 'Last updated on:' timestamp is inserted at every page bottom. diff --git a/src/affine/__init__.py b/src/affine/__init__.py index 29eeb39..ab1cb09 100644 --- a/src/affine/__init__.py +++ b/src/affine/__init__.py @@ -89,15 +89,18 @@ class Affine: Parameters ---------- - a, b, c, d, e, f, [g, h, i] : float - Coefficients of the 3 x 3 augmented affine transformation - matrix. + a, b, c, d, e, f : float + Coefficients of the 3 x 3 augmented affine transformation matrix. + + g, h, i : float, optional + Coefficients of the 3 x 3 augmented affine transformation matrix. Attributes ---------- a, b, c, d, e, f, g, h, i : float - Coefficients of the 3 x 3 augmented affine transformation - matrix:: + Coefficients of the 3 x 3 augmented affine transformation matrix. + + .. code-block:: none | x' | | a b c | | x | | y' | = | d e f | | y |