Skip to content

Commit

Permalink
fix div 0 error
Browse files Browse the repository at this point in the history
  • Loading branch information
skjerns committed Feb 17, 2021
1 parent fb496b9 commit bd803bd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pyedflib/_extensions/_pyedflib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,10 @@ cdef class CyEdfReader:
return self.hdr.signalparam[channel].transducer

def samplefrequency(self, channel):
return (<double>self.hdr.signalparam[channel].smp_in_datarecord / self.hdr.datarecord_duration) * EDFLIB_TIME_DIMENSION

try:
return (<double>self.hdr.signalparam[channel].smp_in_datarecord / self.hdr.datarecord_duration) * EDFLIB_TIME_DIMENSION
except:
return 0
# def _tryoffset0(self):
# """
# fooling around to find offset in file to allow shortcut mmap interface
Expand Down

0 comments on commit bd803bd

Please sign in to comment.