ivoflipse / Pawlabeling

Tool for processing and analyzing pressure measurements
Other
18 stars 1 forks source link

Infinite loop in processingwidget's next_contact #69

Closed ivoflipse closed 10 years ago

ivoflipse commented 10 years ago

While I've encountered something similar before, there seems to be an infinite loop in next_contact when you're the first/last, something like that.

  File "C:\Dropbox\Development\Pawlabeling\pawlabeling\widgets\processing\processingwidget.py", line 312, in next_contact
    self.next_contact()
  File "C:\Dropbox\Development\Pawlabeling\pawlabeling\widgets\processing\processingwidget.py", line 312, in next_contact
    self.next_contact()
  File "C:\Dropbox\Development\Pawlabeling\pawlabeling\widgets\processing\processingwidget.py", line 312, in next_contact
    self.next_contact()
  File "C:\Dropbox\Development\Pawlabeling\pawlabeling\widgets\processing\processingwidget.py", line 312, in next_contact
    self.next_contact()
  File "C:\Dropbox\Development\Pawlabeling\pawlabeling\widgets\processing\processingwidget.py", line 297, in next_contact
    if not self.contacts_available():
  File "C:\Dropbox\Development\Pawlabeling\pawlabeling\widgets\processing\processingwidget.py", line 263, in contacts_available
    return True if self.contacts[self.measurement_name] else False
RuntimeError: maximum recursion depth exceeded in cmp
Closing remaining open files: C:\Dropbox\Development\Pawlabeling\pawlabeling\database\data.h5... done
ivoflipse commented 10 years ago

Fixed! Turns out I was making it overly complicated. If the first or the last contact is selected, we don't have to change anything, so we just make sure current_contact_index doesn't go out of bounds and return.