From e11a6102586c1ac58a24221afb7355fca682bb8c Mon Sep 17 00:00:00 2001 From: Jan Gosmann Date: Wed, 6 Jun 2018 15:53:01 -0400 Subject: [PATCH] Prevent failure for SPA Transcode plots. Fixes #970. This is only a hotfix preventing a complete crash of the GUI. The functionality to override the output value for Transcode modules is still not working with this even though the context menu suggests otherwise. In the future, values should be overwritten in the same way as we do for nodes. --- CHANGES.rst | 1 + nengo_gui/components/pointer.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 22d34e21..666f1546 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -22,6 +22,7 @@ Release History 0.4.2 (unreleased) ================== +- Bugfix: Cloud plots for nengo_spa.Transcode plots no longer fail 0.4.1 (June 5, 2018) diff --git a/nengo_gui/components/pointer.py b/nengo_gui/components/pointer.py index df43e12d..fc0fb226 100644 --- a/nengo_gui/components/pointer.py +++ b/nengo_gui/components/pointer.py @@ -57,12 +57,15 @@ def add_nengo_objects(self, page): if loop_in and self.target == 'default': input = self.obj.inputs[self.target][0] self.conn2 = nengo.Connection(self.node, input, synapse=0.01) - else: + elif output.size_in > 0: self.conn2 = nengo.Connection(self.node, output, synapse=0.01) + else: + self.conn2 = None def remove_nengo_objects(self, page): page.model.connections.remove(self.conn1) - page.model.connections.remove(self.conn2) + if self.conn2 is not None: + page.model.connections.remove(self.conn2) page.model.nodes.remove(self.node) def gather_data(self, t, x):