Skip to content

Commit

Permalink
docs: doctest format for example in docstring
Browse files Browse the repository at this point in the history
Re-writing example in docstring to use [doctest format](https://numpydoc.readthedocs.io/en/latest/format.html#examples).

Minor tpyo in README.md corrected.
  • Loading branch information
ns-rse committed Apr 30, 2024
1 parent 89319e9 commit d9ec44a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ frames, pixel_to_nanometre_scaling_factor, metadata = load_asd(file_path="./my_a

You can open `.ibw` files using the `load_ibw` function. Just pass in the path to the file
and the channel name that you want to use. (If in doubt, use `HeightTracee` (yes, with the
exta 'e'), `ZSensorTrace`, or `ZSensor`).
extra 'e'), `ZSensorTrace`, or `ZSensor`).

```python
from topofileformats.ibw import load_ibw
Expand Down
11 changes: 5 additions & 6 deletions topofileformats/ibw.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,11 @@ def load_ibw(file_path: Path | str, channel: str) -> tuple[np.ndarray, float]:
Examples
--------
```python
from topofileformats.ibw import load_ibw
# Load the image and pixel to nanometre scaling factor - HeightTracee is the default channel name
# (yes, with the extra e)
image, pixel_to_nanometre_scaling_factor = load_ibw(file_path="./my_ibw_file.ibw", channel="HeightTracee")
```
Load the image and pixel to nanometre scaling factor - 'HeightTracee' is the default channel name (the extra 'e' is
not a typo!).
>>> from topofileformats.ibw import load_ibw
>>> image, pixel_to_nanometre_scaling_factor = load_ibw(file_path="./my_ibw_file.ibw", channel="HeightTracee")
"""
logger.info(f"Loading image from : {file_path}")
file_path = Path(file_path)
Expand Down

0 comments on commit d9ec44a

Please sign in to comment.