Skip to content
Closed
Show file tree
Hide file tree
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
Empty file added 0.5
Empty file.
Empty file added 1
Empty file.
Empty file added 1.5
Empty file.
Empty file added 2
Empty file.
25 changes: 25 additions & 0 deletions brian2/tests/test_synapses.py
Original file line number Diff line number Diff line change
Expand Up @@ -3730,6 +3730,31 @@ def test_setting_from_weight_matrix():
assert all(syn.w[i, j] == weights[i, j])


def test_synapses_cython_codegen_target_runs():
old_target = prefs.codegen.target
prefs.codegen.target = "cython"

try:
start_scope()

G = NeuronGroup(
2,
"v : 1",
threshold="v > 1",
reset="v = 0",
)

S = Synapses(G, G, on_pre="v_post += 1")
S.connect(i=0, j=1)

G.v = [2, 0]
run(1 * ms)

assert_allclose(G.v[:], [0, 1])
finally:
prefs.codegen.target = old_target


if __name__ == "__main__":
SANITY_CHECK_PERMUTATION_ANALYSIS_EXAMPLE = True
# prefs.codegen.target = 'numpy'
Expand Down
Empty file added findstr
Empty file.
Empty file added q
Empty file.