wfdb-python icon indicating copy to clipboard operation
wfdb-python copied to clipboard

csv_to_wfdb writes to current dir; needs param to specify output folder

Open jshaffer94247 opened this issue 1 year ago • 3 comments

csv_to_wfdb currently strips the path from the input .csv, then writes the output to .dat and .hea

Request is for a) full path to be preserved for the output file (not backward compatible) b) accept an optional parameter to specify the output folder (preserves backward compatibility)

jshaffer94247 avatar Jun 26 '24 15:06 jshaffer94247

@jshaffer94247 not ideal, it should definitely be possible to specify the output directory!

Does adding an output_dir argument sound okay, or do you have a cleaner suggestion?

def csv_to_wfdb(
    ...
    delimiter=",",
    verbose=False,
    output_dir=None,
):

tompollard avatar Jul 01 '24 17:07 tompollard

I do not have a cleaner suggestion; that's what I'd do.

jshaffer94247 avatar Jul 01 '24 18:07 jshaffer94247

write_dir will be available in the next release. If you'd like to use it now, you should be able to pip install from this repo with:

pip install git+https://github.com/MIT-LCP/wfdb-python.git@6a0de803b4d396fa22da583dfa0d19250d347217

tompollard avatar Jul 11 '24 18:07 tompollard