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

Additional useful PyGeNN errors #464

Merged
merged 1 commit into from
Oct 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pygenn/genn_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ def use_backend(self):

@use_backend.setter
def use_backend(self, backend):
if self._built:
raise Exception("GeNN model already built")

# If no backend is specified
if backend is None:
# Check we have managed to import any bagenn_wrapperckends
Expand All @@ -212,6 +215,9 @@ def timing_enabled(self):

@timing_enabled.setter
def timing_enabled(self, timing):
if self._built:
raise Exception("GeNN model already built")

self._model.set_timing(timing)

@property
Expand All @@ -220,6 +226,9 @@ def batch_size(self):

@batch_size.setter
def batch_size(self, batch_size):
if self._built:
raise Exception("GeNN model already built")

self._model.set_batch_size(batch_size)

@property
Expand Down