-
Notifications
You must be signed in to change notification settings - Fork 174
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
Simulator should have close() method #857
Comments
Another useful thing I found recently is the |
Doesn't solve my problem at hand because I want to create another simulator after closing the first one in the same script. But maybe it makes sense to implement this in general. (I believe nengo_spinnaker might already be doing this?) |
As I said, we'd still have the option to manually close. The |
See #739, I (roughly) followed the recommendations there in nengo_mpi. https://github.com/e2crawfo/nengo_mpi/blob/operational/nengo_mpi/simulator.py |
Yes, it seems that we just repeated that conversation, just with different people 😄 Good that we're all on the same page now. |
:) One thing that comes to mind that didn't come up in the previous conversation: should And can you |
I would say a) |
That seems sensible to me too. |
I was the main dissenting voice on the Makes sense for consistency that Closing more than once seems fine to me. I just tried this with file pointers in Python; you can call close multiple time, so there's precedent for that. One question that comes to mind: should |
I don't think we should have core nengo manage this. It might make sense in the future if we find that a lot of backends are using similar code to do this management, but at the moment things are so different that I'd prefer to let the backends handle this however they want to independently. |
I was thinking the opposite. It would be nice to have core Nengo do the |
My opinion is that core Nengo should handle this too. If a backend needs something done other than just calling |
I think the
Simulator
class should have aclose
method because some backends require closing (e.g. SpiNNaker). This would make it easier to write code independent of the backend (which comes up in my spaopt branch).In addition to that I would vote to allow a the simulator in a
with
statement like so:(I think we had an unresolved discussion on this in some other issue already.)
The text was updated successfully, but these errors were encountered: