Skip to content

Commit f394f68

Browse files
committed
Fix tiny bug in asd loading - ensure strings are converted to paths
1 parent a0f837d commit f394f68

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

topofileformats/asd.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""For decoding and loading .asd AFM file format into Python Numpy arrays."""
2+
23
from __future__ import annotations
34
from pathlib import Path
45
from typing import BinaryIO
@@ -163,6 +164,9 @@ def load_asd(file_path: Path | str, channel: str):
163164
version please either look into the `read_header_file_version_x` functions or print the keys too see what metadata
164165
is available.
165166
"""
167+
# Ensure the file path is a Path object
168+
file_path = Path(file_path)
169+
# Open the file in binary mode
166170
with Path.open(file_path, "rb", encoding=None) as open_file: # pylint: disable=W1514
167171
file_version = read_file_version(open_file)
168172

0 commit comments

Comments
 (0)