Skip to content

Commit 3458990

Browse files
committed
🎨 Use sphinx-ext-mystmd patch to unindent doctest blocks
Figured out how to get doctest_block nodes working with a one-line change at jupyter-book/sphinx-ext-mystmd#2. Partially reverts 5d0ff56.
1 parent dba63ae commit 3458990

File tree

2 files changed

+20
-19
lines changed

2 files changed

+20
-19
lines changed

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ docs = [
2929
"jupyter-book>=2.0.0a0",
3030
"myst_parser",
3131
"sphinx",
32-
"sphinx-ext-mystmd",
32+
# https://github.com/jupyter-book/sphinx-ext-mystmd/pull/2
33+
"sphinx-ext-mystmd @ git+https://github.com/weiji14/sphinx-ext-mystmd@e995908b3a898b9c9d5d3fec4ff1478f1f4c1ccd",
3334
]
3435
tests = [
3536
"pytest",

src/python/adapters.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@ use crate::io::geotiff::{CogReader, read_geotiff};
2828
///
2929
/// Examples
3030
/// --------
31-
/// Read a GeoTIFF from a HTTP url into a numpy.ndarray::
31+
/// Read a GeoTIFF from a HTTP url into a numpy.ndarray:
3232
///
33-
/// >>> import numpy as np
34-
/// >>> from cog3pio import CogReader
35-
/// ...
36-
/// cog = CogReader(
37-
/// path="https://github.com/rasterio/rasterio/raw/refs/tags/1.4.3/tests/data/RGBA.uint16.tif"
38-
/// )
39-
/// >>> array: np.ndarray = np.from_dlpack(cog)
40-
/// >>> array.shape
41-
/// (4, 411, 634)
42-
/// >>> array.dtype
43-
/// dtype('uint16')
33+
/// >>> import numpy as np
34+
/// >>> from cog3pio import CogReader
35+
/// ...
36+
/// >>> cog = CogReader(
37+
/// ... path="https://github.com/rasterio/rasterio/raw/refs/tags/1.4.3/tests/data/RGBA.uint16.tif"
38+
/// ...)
39+
/// >>> array: np.ndarray = np.from_dlpack(cog)
40+
/// >>> array.shape
41+
/// (4, 411, 634)
42+
/// >>> array.dtype
43+
/// dtype('uint16')
4444
#[pyclass]
4545
#[pyo3(name = "CogReader")]
4646
struct PyCogReader {
@@ -166,13 +166,13 @@ fn path_to_stream(path: &str) -> PyResult<Cursor<Bytes>> {
166166
///
167167
/// Examples
168168
/// --------
169-
/// Read a GeoTIFF from a HTTP url into a numpy.ndarray::
169+
/// Read a GeoTIFF from a HTTP url into a numpy.ndarray:
170170
///
171-
/// >>> from cog3pio import read_geotiff
172-
/// ...
173-
/// >>> array = read_geotiff("https://github.com/pka/georaster/raw/v0.2.0/data/tiff/float32.tif")
174-
/// >>> array.shape
175-
/// (1, 20, 20)
171+
/// >>> from cog3pio import read_geotiff
172+
/// ...
173+
/// >>> array = read_geotiff("https://github.com/pka/georaster/raw/v0.2.0/data/tiff/float32.tif")
174+
/// >>> array.shape
175+
/// (1, 20, 20)
176176
#[pyfunction]
177177
#[pyo3(name = "read_geotiff")]
178178
fn read_geotiff_py<'py>(path: &str, py: Python<'py>) -> PyResult<Bound<'py, PyArray3<f32>>> {

0 commit comments

Comments
 (0)