MIT-LCP / wfdb-python

Native Python WFDB package
MIT License
730 stars 298 forks source link

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

Open jshaffer94247 opened 3 weeks ago

jshaffer94247 commented 3 weeks ago

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)

tompollard commented 2 weeks ago

@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,
):
jshaffer94247 commented 2 weeks ago

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

tompollard commented 1 week ago

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