-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rdsamp and wrsamp not isopmorphic #484
Comments
Wanted to post a late update to this – ultimately it turned out I was unable to write data using the |
@greenstick , I apologize for the delay in responding. Thank you for you suggestion! I have opened a separate issue to indicate that we want to make our read and write function(s) isomorphic: #500 . Regarding being unable to write data using |
Hi @briangow, sure thing. Here's an example of code that generates an error: data = wfdb.rdsamp(input_file)
signal, fields = data
wfdb.wrsamp(output_file_path, p_signal = signal, **fields) This is an example of the code I couldn't get to work where I last left off, so it may be incorrect. However, I did follow the documentation and found I was unable to have that work using similar logic (i.e. read > assign > write) in a way that from my reading of the docs should be isomorphic. In the code above, the error generated by TypeError: wrsamp() got an unexpected keyword argument 'sig_len' Which seems surprising given that the If it's working as expected, it may make sense to allow |
@greenstick , thanks! Yeah, If you are interested, here is an example where we manually set some of the parameters in
|
Hi there, this has likely been discussed somewhere at length however I can't seem to find such a discussion and the documentation doesn't appear to cover this key limitation:
In short, if I call
wfdb.rdsamp
and then use the correspondingwrsamp
method, typical programming conventions assume that the two methods should be isomorphic – whatever is read into memory byrdsamp
should be sufficient and, by default, produce an identical output whenwrsamp
is called to process the in-memory object. However, as best as I can tell, this is not the case, which is very counterintuitive and breaks with standard programming conventions.This key limitation doesn't appear to be covered in the documentation and, at minimum, it would seem it should be. Better yet, an example of what arguments to set to make them isomorphic should be documented. This assumes that the ideal (that they are isomorphic) is not possible, however, for the library UX, this seems something to strive.
I would send a PR myself, however, I'm actively running up against this issue and therefore do not currently have a solution to propose.
The text was updated successfully, but these errors were encountered: