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

Added dt parameter #964

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Added dt parameter #964

wants to merge 1 commit into from

Conversation

tcstewar
Copy link
Collaborator

For some of the backends (especially nengo_brainstorm), it is quite useful to be able to adjust dt. This adds a quick command-line option to do this.

@arvoelke
Copy link
Contributor

arvoelke commented May 30, 2018

Is there an easy way to expose this value to the Nengo model (script in the GUI)? I'm thinking something like being able to use the variable nengo_gui.settings.dt (or similar) within the model.

@tcstewar
Copy link
Collaborator Author

Is there an easy way to expose this value to the Nengo model (script in the GUI)? I'm thinking something like being able to use the variable nengo_gui.settings.dt (or similar) within the model.

Currently we don't have anything like that. I could definitely see working towards that sort of direction, along with the nengo_gui.hooks discussion and also I think even how the keyboard state is kept in #942

@arvoelke
Copy link
Contributor

arvoelke commented May 31, 2018

In the mean time, here's a really hacky way to access the page settings from the file scope of the model, just in case anyone is dying for a temporary solution:

import inspect
dt = inspect.getargvalues(inspect.stack()[1][0]).locals['self'].settings.dt

(Tested with Python 2.7 and this branch of nengo-gui.)

You can also replace dt with backend to get the current backend.

Another solution could be to extend the code_locals dictionary passed into exec in some way.

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

Successfully merging this pull request may close these issues.

2 participants