From 2a9b4ed527b6d417e1db6a8db4cd7df6392d9186 Mon Sep 17 00:00:00 2001 From: Neil Shephard Date: Tue, 30 Apr 2024 16:57:28 +0100 Subject: [PATCH] docs: doctest format for example in docstring Re-writing example in docstring to use [doctest format](https://numpydoc.readthedocs.io/en/latest/format.html#examples). --- topofileformats/spm.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/topofileformats/spm.py b/topofileformats/spm.py index 7b7f13e..7ba68c3 100644 --- a/topofileformats/spm.py +++ b/topofileformats/spm.py @@ -66,9 +66,11 @@ def load_spm(file_path: Path | str, channel: str) -> tuple: Examples -------- - ```python - from topofileformats.spm import load_spm - image, pixel_to_nm = load_spm(file_path="path/to/file.spm", channel="Height") + Load the image and pixel to nanometre scaling factor, available channels are 'Height', 'ZSensor' and 'Height + Sensor'. + + >>> from topofileformats.spm import load_spm + >>> image, pixel_to_nm = load_spm(file_path="path/to/file.spm", channel="Height") ``` """ logger.info(f"Loading image from : {file_path}")