Skip to content

Commit

Permalink
reformatted with black package
Browse files Browse the repository at this point in the history
  • Loading branch information
briangow committed Oct 19, 2024
1 parent 11e8756 commit f8084d3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions wfdb/io/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -2937,15 +2937,21 @@ def wrsamp(
# If samps_per_frame is a list, check that it aligns as expected with the channels in the signal
if isinstance(samps_per_frame, list):
# Get properties of the signal being passed
first_valid_signal = next(signal for signal in signal_list if signal is not None)
first_valid_signal = next(
signal for signal in signal_list if signal is not None
)
if isinstance(first_valid_signal, np.ndarray):
num_sig_channels = first_valid_signal.shape[1]
channel_samples = [first_valid_signal.shape[0]] * first_valid_signal.shape[1]
channel_samples = [
first_valid_signal.shape[0]
] * first_valid_signal.shape[1]
elif isinstance(first_valid_signal, list):
num_sig_channels = len(first_valid_signal)
channel_samples = [len(channel) for channel in first_valid_signal]
else:
raise TypeError("Unsupported signal format. Must be ndarray or list of lists.")
raise TypeError(
"Unsupported signal format. Must be ndarray or list of lists."
)

# Check that the number of channels matches the number of samps_per_frame entries
if num_sig_channels != len(samps_per_frame):
Expand Down

0 comments on commit f8084d3

Please sign in to comment.