def test_sim_combined(): simulations = { 'sim_oscillation': { 'freq': FREQ1 }, 'sim_powerlaw': { 'exponent': -2 } } out = sim_combined(N_SECONDS, FS, simulations) check_sim_output(out) # Test case with multiple uses of same function simulations = { 'sim_oscillation': [{ 'freq': FREQ1 }, { 'freq': FREQ2 }], 'sim_powerlaw': { 'exponent': -2 } } variances = [0.5, 0.5, 1] out = sim_combined(N_SECONDS, FS, simulations, variances) check_sim_output(out) # Check the variance mismatch error variances = [0.5, 1] with raises(ValueError): out = sim_combined(N_SECONDS, FS, simulations, variances)
def test_sim_powerlaw(): sig = sim_powerlaw(N_SECONDS, FS) check_sim_output(sig) # Test with a filter applied sig = sim_powerlaw(N_SECONDS, FS, f_range=(2, None)) check_sim_output(sig)
def test_create_powerlaw(): sig = _create_powerlaw(int(N_SECONDS*FS), FS, -2) check_sim_output(sig)
def test_sim_synaptic_current(): sig = sim_synaptic_current(N_SECONDS, FS) check_sim_output(sig)
def test_sim_random_walk(): sig = sim_random_walk(N_SECONDS, FS) check_sim_output(sig)
def test_sim_poisson_pop(): sig = sim_poisson_pop(N_SECONDS, FS) check_sim_output(sig)
def test_create_cycle_time(): times = create_cycle_time(N_SECONDS, FS) check_sim_output(times)
def test_asine_cycle(): cycle = sim_asine_cycle(N_SECONDS, FS, 0.25) check_sim_output(cycle)
def test_sim_cycle(): cycle = sim_cycle(N_SECONDS, FS, 'sine') check_sim_output(cycle) cycle = sim_cycle(N_SECONDS, FS, 'asine', rdsym=0.75) check_sim_output(cycle) cycle = sim_cycle(N_SECONDS, FS, 'sawtooth', width=0.5) check_sim_output(cycle) cycle = sim_cycle(N_SECONDS, FS, 'gaussian', std=2) check_sim_output(cycle) cycle = sim_cycle(N_SECONDS, FS, 'exp', tau_d=0.2) check_sim_output(cycle) cycle = sim_cycle(N_SECONDS, FS, '2exp', tau_r=0.2, tau_d=0.2) check_sim_output(cycle) with raises(ValueError): sim_cycle(N_SECONDS, FS, 'not_a_cycle')
def test_sim_bursty_oscillation(): sig = sim_bursty_oscillation(N_SECONDS, FS, FREQ1) check_sim_output(sig)