Skip to content
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

Incorrect results from calling read_digital_signal when opening more than one file #10

Closed
pbunnun opened this issue Jan 21, 2017 · 1 comment

Comments

@pbunnun
Copy link

pbunnun commented Jan 21, 2017

Calling read_digital_signal from the first EdfReader instance is alright. However, if calling it from the following instances, it will return incorrect results. After looking at the _pyedflib.pyx, self.handle causes the problem. It has never been assigned to any value but is used in read_digital_signal. If I added

def check_open_ok(self, result):
if result == 0:
self.handle = self.hdr.handle <---- add this line
return True
else:
raise IOError, open_errors[self.hdr.filetype]

, everything seems to work correctly. I don't know why the code still needs self.handle. If removing "cdef int handle" and change self.handle to self.hdr.handle, I think _pyedflib.pyx should work as expected. Haven't tested though.

@pbunnun pbunnun changed the title Incorrect results from calling read_digital_signal when opennig more than one file Incorrect results from calling read_digital_signal when opening more than one file Jan 21, 2017
@holgern
Copy link
Owner

holgern commented Apr 6, 2017

Thank you, i changed the source code.

@holgern holgern closed this as completed Apr 6, 2017
holgern added a commit that referenced this issue Apr 6, 2017
fix travis
blockwrite_digital_samples added
write_digital_short_samples added
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants