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

Add GUI Nodes and Connections in a parent Network #871

Open
tcstewar opened this issue Feb 17, 2017 · 1 comment
Open

Add GUI Nodes and Connections in a parent Network #871

tcstewar opened this issue Feb 17, 2017 · 1 comment

Comments

@tcstewar
Copy link
Collaborator

Currently, all of the Nodes and Connections needed for the plots and other components of Nengo GUI are added to the top-level Network defined by the user (i.e. model). These are then removed after building the Simulator. In normal usage, this is fine, but in multi-threaded environments, it may be possible for another thread to access the model during the build process, and there'll be these odd extra Nodes and Connections.

To get around this (and to be a bit cleaner in general), we could change this algorithm from:

create_gui_components_in(model)
sim = nengo.Simulator(model)
remove_gui_components_from(model)

to this:

parent = nengo.Network()
parent.networks.append(model)
create_gui_components_in(parent)
sim = nengo.Simulator(parent)

Notice that this means that we don't have to remove the components afterward!

@jgosmann
Copy link
Collaborator

Tagging issue #870 which discusses the same problem, but proposes a different solution.

I wonder if this approach could make it easier to solve the problem that we have to rebuild the model when inserting graphs. Maybe it is possible to build model keep the built model around and use the already built signals when building the parent? Though, that makes some assumptions about how the model gets built that might not hold on all backends.

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

No branches or pull requests

2 participants