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

catch hopper error on shape so shape doesn't die #127

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pyoperant/behavior/shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import datetime as dt
from pyoperant import panels
from pyoperant import utils
from pyoperant import components

class Shaper(object):
"""
Expand Down Expand Up @@ -250,7 +251,11 @@ def temp():
def reward(self, value, next_state):
def temp():
self.log.info('%d\t%d\t%s\t%s'%(self.recent_state, self.response_counter, self.last_response, dt.datetime.now().isoformat(' ')))
self.panel.reward(value=value)
try:
self.panel.reward(value=value)
except components.HopperWontComeUpError as err:
self.panel.reset()

return next_state
return temp

Expand Down