Skip to content

Commit

Permalink
Add example to docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
SylviaWhittle committed Apr 30, 2024
1 parent 4db2370 commit 95a9fcf
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions topofileformats/jpk.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,21 @@ def load_jpk(file_path: Path | str, channel: str) -> tuple[np.ndarray, float]:
-------
tuple[npt.NDArray, float]
A tuple containing the image and its pixel to nanometre scaling value.
Raises
------
FileNotFoundError
If the file is not found.
KeyError
If the channel is not found in the file.
Examples
--------
```python
from topofileformats.jpk import load_jpk
# Load height trace channel from the .jpk file. "height_trace" is the default channel name.
image, pixel_to_nanometre_scaling_factor = load_jpk(file_path="./my_jpk_file.jpk", channel="height_trace")
```
"""
logger.info(f"Loading image from : {file_path}")
file_path = Path(file_path)
Expand Down

0 comments on commit 95a9fcf

Please sign in to comment.