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

ActionSelection does not clean up after exception handling #230

Closed
jgosmann opened this issue Jun 19, 2019 · 0 comments · Fixed by #231
Closed

ActionSelection does not clean up after exception handling #230

jgosmann opened this issue Jun 19, 2019 · 0 comments · Fixed by #231
Labels
Milestone

Comments

@jgosmann
Copy link
Collaborator

When an exception was raised from within a spa.ActionSelection block, subsequent spa.ActionSelection blocks will produce an exception even though they are correct. Apparently the tracking of connections not enclosed in ifmax calls does not get reset and this lets the ActionSelection believe that there are still free floating connections.

Example exception:

---------------------------------------------------------------------------
SpaActionSelectionError                   Traceback (most recent call last)
<ipython-input-12-7720533943af> in <module>()
      5     with spa.ActionSelection():
      6         spa.ifmax(spa.dot(a, spa.sym.KEEP_INPUT), spa.sym.X >> b, (a * (~b).reinterpret()) >> c)
----> 7         spa.ifmax(spa.dot(a, spa.sym.KEEP_INPUT), spa.sym.X >> b, (a * (~b).reinterpret()) >> c)

~/Library/Python/3.7/lib/python/site-packages/nengo_spa/action_selection.py in __exit__(self, exc_type, exc_value, traceback)
     93         if exc_type is not None:
     94             return
---> 95         self._build()
     96 
     97     def _build(self):

~/Library/Python/3.7/lib/python/site-packages/nengo_spa/action_selection.py in _build(self)
     99             if len(RoutedConnection.free_floating) > 0:
    100                 raise SpaActionSelectionError(
--> 101                     "All actions in an action selection context must be part "
    102                     "of an ifmax call.")
    103         finally:

SpaActionSelectionError: All actions in an action selection context must be part of an ifmax call.
@jgosmann jgosmann added the bug label Jun 19, 2019
@jgosmann jgosmann added this to the 0.6.2 milestone Jun 19, 2019
jgosmann added a commit that referenced this issue Jun 20, 2019
after leaving ActionSelection block.

Fixes #230.
jgosmann added a commit that referenced this issue Jun 20, 2019
after leaving ActionSelection block.

Fixes #230.
jgosmann added a commit that referenced this issue Jun 20, 2019
after leaving ActionSelection block.

Fixes #230.
jgosmann added a commit that referenced this issue Jun 20, 2019
after leaving ActionSelection block.

Fixes #230.
jgosmann added a commit that referenced this issue Jun 21, 2019
after leaving ActionSelection block.

Fixes #230.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

1 participant