Skip to content

Commit

Permalink
add error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
neworderofjamie committed Mar 7, 2023
1 parent 0053fcf commit fd7acef
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ml_genn/ml_genn/callbacks/var_recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ def __init__(self, pop: PopulationType, var: Optional[str], key=None,
self._var = get_genn_var_name(self._pop.neuron, var)
elif genn_var is not None:
self._var = genn_var
else:
raise RuntimeError("SpikeRecorder callback requires a "
"variable to be specified, either "
"via 'var' or 'genn_var' argument")

# Stash key
self.key = key
Expand Down

0 comments on commit fd7acef

Please sign in to comment.