-
Notifications
You must be signed in to change notification settings - Fork 14
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
Updates for recent Nengo changes #128
Conversation
@@ -431,6 +431,15 @@ def __init__(self, network, dt=0.001, seed=None, model=None, context=None, | |||
self._reset_cl_rngs() | |||
self._probe_step_time() | |||
|
|||
@property | |||
def model(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this inherited from nengo.Simulator
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is in Nengo master, but when using OCL with older versions of Nengo it doesn't exist, so this is here just for compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, right, but then people will get warnings if they call nengo_ocl.Simulator.model
with an older version of Nengo.
I don't like what happened in nengo/nengo#1173. To me it seems too prescriptive. If a user wants to access So the question is for here, what to do. I was happy with my |
That PR's in master but it hasn't been released, so I would say the ship hasn't necessarily sailed. @drasmuss was also in favor of reverting it, so that's an alternative to the changes in this PR. I don't feel too strongly either way, but I agree that it does seem somewhat prescriptive. Actually, I was somewhat surprised that people were using
I actually originally did this originally, but nengo/nengo#1173 also included a test that accessing Anyhow, since there it's contentious I'll open up a vote on the forum and point people it at the next dev meeting. |
Sure, but the user should be aware that they are accessing an implementation detail, that might not be supported by all backends or might change without notice. That is why I think there should be an underscore in front.
You don't get a warning when using
I don't think we have any examples of accessing static parameters generated during the build (but I might be wrong) and I don't think there is any real documentation so far how to do that. Thus, it was not obvious that Also, there was a number of tests using
You mean only in Nengo OCL? (Thus, the reference simulator still gives the warning.) I might not endorse it, but would be ok with that. Though, keep in mind that the underscore is a common Python idiom.
You could configure that warning to raise an exception.
It violates the Zen of Python: “There should be one-- and preferably only one --obvious way to do it.” With nengo/nengo#1173 I did not really intend to prescribe this warning to other backends. As mentioned before I think the main problem here is |
This changed in Nengo 2.3. In order to maintain compatibility with older versions of Nengo, we do this in a try/except.
We reverted the model privatization in nengo/nengo#1210, so I took out the commit here making those changes. What's left is pretty small, but still needed for Nengo master at the moment! Once this is merged I'll do the final checks and go ahead with releases. |
We're hoping to push out a Nengo 2.3.0 release soon, so I made some changes to fix compatibility as a result of some recent changes, specifically nengo/nengo#1151 and nengo/nengo#1173.
With these commits, the tests run successfully for me with Nengo master (soon to be 2.3.0) and with the versions that previously worked (e.g. 2.1.2.).