Skip to content

Commit 6089a88

Browse files
committed
update docstrings
1 parent 0651991 commit 6089a88

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

wfdb/io/_coreio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def _open_file(
3232
----------
3333
pn_dir : str or None
3434
The PhysioNet database directory where the file is stored, or None
35-
if file_name is a local path.
35+
if file_name is a local or cloud path.
3636
file_name : str
3737
The name of the file, either as a local filesystem path or cloud
3838
URL (if `pn_dir` is None) or a PhysioNet URL path

wfdb/io/util.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,20 @@ def overlapping_ranges(
128128

129129
def fromfile(fileobj, dtype, count=-1):
130130
"""
131-
Detect if the object will work with numpy.fromfile - if so, use it. If not, read the object into a numpy array and
132-
calculate the number of elements (if not provided) - this is needed for fsspec objects.
131+
Read binary data from a file-like object into a NumPy array, using `np.fromfile` when possible.
132+
Falls back to manual reading for file-like objects that are not compatible with np.fromfile.
133+
134+
Parameters
135+
----------
136+
fileobj : file-like object
137+
A binary file-like object
138+
dtype :
139+
The NumPy data type to read
140+
count : int, optional
141+
Number of elements or bytes to read depending on the format:
142+
- For most formats, this is the number of elements (e.g., samples) to read.
143+
- For formats "212", "310", "311", and "24", this is the number of bytes.
144+
If set to -1 (default), reads until the end of the file and infers size from the stream
133145
"""
134146
if isinstance(fileobj, io.FileIO) or (
135147
isinstance(fileobj, (io.BufferedReader, io.BufferedRandom))

0 commit comments

Comments
 (0)