def test_get_spikes(load_data): gen_current = load_data['group_gen_current'] spike_time = load_data['spike_time'] py_spike_time = np.array(lif_model.get_spikes(gen_current)) cy_spike_time = np.array(cy_lif_model.get_spikes(gen_current)) assert np.allclose(py_spike_time, cy_spike_time) assert np.allclose(spike_time, py_spike_time) assert np.allclose(spike_time, cy_spike_time)
def stress_to_fr_inst(fine_time, fine_stress, groups, **params): group_gen_current = stress_to_group_current(fine_time, fine_stress, groups, **params) spike_time = get_spikes(group_gen_current) return np.array(spike_time), spike_time_to_fr_inst(spike_time)
def setup_lif_model(data): data['group_gen_current'] = stress_to_group_current( data['fine_time'], data['fine_stress'], MC_GROUPS, **params) data['spike_time'] = lif_model.get_spikes(data['group_gen_current'])