Skip to content

Commit 7998a40

Browse files
author
Benjamin Moody
committed
wrsamp: add base_datetime argument.
Allow passing base_datetime to wfdb.wrsamp, as an alternative to specifying both base_date and base_time. Note that it is an error to specify base_datetime while also specifying base_date or base_time, and we raise a TypeError in that case.
1 parent 6573f81 commit 7998a40

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

wfdb/io/record.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5049,6 +5049,7 @@ def wrsamp(
50495049
comments=None,
50505050
base_time=None,
50515051
base_date=None,
5052+
base_datetime=None,
50525053
write_dir="",
50535054
):
50545055
"""
@@ -5097,6 +5098,9 @@ def wrsamp(
50975098
The time of day at the beginning of the record.
50985099
base_date : datetime.date, optional
50995100
The date at the beginning of the record.
5101+
base_datetime : datetime.datetime, optional
5102+
The date and time at the beginning of the record, equivalent to
5103+
setting both `base_date` and `base_time`.
51005104
write_dir : str, optional
51015105
The directory in which to write the files.
51025106
@@ -5154,6 +5158,7 @@ def wrsamp(
51545158
comments=comments,
51555159
base_time=base_time,
51565160
base_date=base_date,
5161+
base_datetime=base_datetime,
51575162
)
51585163
# Compute optimal fields to store the digital signal, carry out adc,
51595164
# and set the fields.
@@ -5172,6 +5177,7 @@ def wrsamp(
51725177
comments=comments,
51735178
base_time=base_time,
51745179
base_date=base_date,
5180+
base_datetime=base_datetime,
51755181
)
51765182
# Use d_signal to set the fields directly
51775183
record.set_d_features()

0 commit comments

Comments
 (0)