File size: 1,389 Bytes
e4cdd5f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
"""Shared fixtures for neurocore tests."""

import pytest
import sys
import os

sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))

import neurocore as nc


@pytest.fixture
def small_network():
    """A small 2-population network for basic tests."""
    net = nc.Network()
    exc = net.population(8, params={"threshold": 1000, "leak": 3}, label="exc")
    inh = net.population(4, params={"threshold": 800, "leak": 5}, label="inh")
    net.connect(exc, inh, topology="all_to_all", weight=200)
    net.connect(inh, exc, topology="all_to_all", weight=-300)
    return net, exc, inh


@pytest.fixture
def chain_network():
    """A simple 4-neuron chain: N0 -> N1 -> N2 -> N3."""
    net = nc.Network()
    pop = net.population(4, label="chain")
    net.connect(pop, pop, topology="one_to_one", weight=1200)
    return net, pop


@pytest.fixture
def chain_network_manual():
    """Manual 4-neuron chain using individual 1-neuron populations."""
    net = nc.Network()
    n0 = net.population(1, label="n0")
    n1 = net.population(1, label="n1")
    n2 = net.population(1, label="n2")
    n3 = net.population(1, label="n3")
    net.connect(n0, n1, topology="all_to_all", weight=1200)
    net.connect(n1, n2, topology="all_to_all", weight=1200)
    net.connect(n2, n3, topology="all_to_all", weight=1200)
    return net, n0, n1, n2, n3