Skip to content

Commit 8d5e276

Browse files
committedJun 25, 2014
Merge pull request the-virtual-brain#27 from timpx/trunk
change equation_scientific for more idiomatic python and to accept ndarrays for var
2 parents 8e28b6a + 33d0501 commit 8d5e276

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎tvb/datatypes/equations_scientific.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,10 @@ def _set_pattern(self, var):
168168
# rolling in the deep ...
169169
onset = self.parameters["onset"]
170170
off = var < onset
171-
var = numpy.roll(var, int(off.sum() + 1))
172-
var[:, 0:off.sum()] = 0.0
171+
var = numpy.roll(var, off.sum() + 1)
172+
var[..., off] = 0.0
173173
self._pattern = numexpr.evaluate(self.equation, global_dict=self.parameters)
174-
self._pattern[:, 0:off.sum()] = 0.0
174+
self._pattern[..., off] = 0.0
175175

176176

177177
pattern = property(fget=_get_pattern, fset=_set_pattern)

0 commit comments

Comments
 (0)
Please sign in to comment.