Skip to content

Commit 0de0693

Browse files
committed
fi test bugs
1 parent cb9f0cf commit 0de0693

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

brainpy/connect/tests/test_regular_conn.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def test_one2one():
1414
num = bp.tools.size2num(size)
1515

1616
actual_mat = bp.math.zeros((num, num), dtype=bp.math.bool_)
17-
actual_mat = bp.math.fill_diagonal(actual_mat, True)
17+
bp.math.fill_diagonal(actual_mat, True)
1818

1919
assert bp.math.array_equal(actual_mat, conn_mat)
2020
assert bp.math.array_equal(pre_ids, bp.math.arange(num))
@@ -42,7 +42,7 @@ def test_all2all():
4242
print(mat)
4343
actual_mat = bp.math.ones((num, num), dtype=bp.math.bool_)
4444
if not has_self:
45-
actual_mat = bp.math.fill_diagonal(actual_mat, False)
45+
bp.math.fill_diagonal(actual_mat, False)
4646

4747
assert bp.math.array_equal(actual_mat, mat)
4848

brainpy/math/delay_vars.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ def __init__(
168168

169169
def _check_time(self, times, transforms):
170170
prev_time, current_time = times
171+
current_time = current_time[0]
171172
if prev_time > current_time + 1e-6:
172173
raise ValueError(f'\n'
173174
f'!!! Error in {self.__class__.__name__}: \n'
@@ -194,7 +195,7 @@ def __call__(self, time, indices=None):
194195
return self._after_t0(time)
195196

196197
def _after_t0(self, prev_time):
197-
diff = self.delay_len - (self.current_time - prev_time)
198+
diff = self.delay_len - (self.current_time[0] - prev_time)
198199
if isinstance(diff, ndarray):
199200
diff = diff.value
200201
if self.interp_method == _INTERP_LINEAR:

0 commit comments

Comments
 (0)