Repository navigation
Closed
Labels
Description
Found while reviewing #591.
csv_to_wfdb accepts several parameters that have no effect on the written record:
dat_file_nameis always overwritten with<record_name>.dat(), in both modes.wfdb-python/src/wfdb/io/convert/csv.py
Lines 332 to 333 in b8914e1
dat_file_name = record_name + ".dat" dat_file_name = [dat_file_name] * n_sig - When writing (
record_only=False), only some arguments are passed towrsamp():wfdb-python/src/wfdb/io/convert/csv.py
Lines 453 to 466 in b8914e1
# Write the information to a record and header file wrsamp( record_name=record_name, fs=fs, units=units, sig_name=sig_name, p_signal=p_signal, fmt=fmt, adc_gain=adc_gain, baseline=baseline, comments=comments, base_time=base_time, base_date=base_date, write_dir=write_dir, samps_per_frameis dropped, althoughwrsampaccepts it.counter_freq,base_counter,skewandbyte_offsetare dropped, andwrsamphas no matching parameters.adc_res,adc_zero,init_value,checksumandblock_sizeare computed or accepted but then recomputed bywrsamp.
One option is to build a Record in both modes and call Record.wrsamp(write_dir=...), so that writing uses the same fields as record_only=True. For parameters that don't make sense for CSV input (for example checksum or init_value, which should follow from the samples), deprecating them may be better than passing them through.
Activity