示例#1
0
class TestAR(ChannelTestBase):
    channelname = 'AR'
    params = run_single_channel(channelname, 1e-9, simtime)
    vm = np.array(params['Vm'].vector)
    gk = np.array(params['Gk'].vector)
    tseries = np.arange(0, len(vm), 1.0) * simdt

    def testAR_Vm_Neuron(self):
        data = np.c_[self.tseries, self.vm]
        try:
            err = compare_channel_data(data,
                                       self.channelname,
                                       'Vm',
                                       'neuron',
                                       x_range=(simtime / 10.0, simtime))
            self.assertLess(err, 0.01)
        except IOError:
            print('Could not find NRN data')

    def testAR_Gk_Neuron(self):
        data = np.c_[self.tseries, self.gk]
        try:
            err = compare_channel_data(data,
                                       self.channelname,
                                       'Gk',
                                       'neuron',
                                       x_range=(simtime / 10.0, simtime),
                                       plot=True)
            self.assertLess(err, 0.01)
        except IOError:
            print('Could not find NRN data')
示例#2
0
class TestNaF_TCR(ChannelTestBase):
    channelname = 'NaF_TCR'
    params = run_single_channel(channelname, 1e-9, simtime)
    vm = np.asarray(params['Vm'].vector)        
    gk = np.asarray(params['Gk'].vector)
    tseries = np.array(range(0, len(params['Vm'].vector))) * simdt
    def testNaF_TCR_Vm_Moose(self):
        print 'Testing MOOSE Vm  ...',
        err = compare_channel_data(self.vm, TestNaF_TCR.channelname, 'Vm', 'moose', x_range=(simtime/10.0, simtime))
        self.assertLess(err, 0.01)
        print 'OK'
        
    def testNaF_TCR_Gk_Moose(self):
        print 'Testing MOOSE Gk  ...',
        err = compare_channel_data(self.gk, TestNaF_TCR.channelname, 'Gk', 'moose', x_range=(simtime/10.0, simtime))
        self.assertLess(err, 0.05)
        print 'OK'

    def testNaF_TCR_Vm_Neuron(self):
        print 'Testing NEURON Vm  ...',
        data = np.c_[self.tseries, self.vm]
        err = compare_channel_data(data, self.channelname, 'Vm', 'neuron', x_range=(simtime/10.0, simtime))
        self.assertLess(err, 0.01)        
        print 'OK'

    def testNaF_TCR_Gk_Neuron(self):
        print 'Testing NEURON Gk  ...',
        data = np.c_[self.tseries, self.gk]
        err = compare_channel_data(data, self.channelname, 'Gk', 'neuron', x_range=(simtime/10.0, simtime), plot=True)
        self.assertLess(err, 0.05)
        print 'OK'
示例#3
0
class TestKDR_FS(ChannelTestBase):
    channelname = 'KDR_FS'
    params = run_single_channel(channelname, 1e-9, simtime)
    vm = np.array(params['Vm'].vector)
    gk = np.array(params['Gk'].vector)
    tseries = np.arange(0, len(vm), 1.0) * simdt

    def testKDR_FS_Vm_Neuron(self):
        data = np.c_[self.tseries, self.vm]
        err = compare_channel_data(data,
                                   self.channelname,
                                   'Vm',
                                   'neuron',
                                   x_range=(simtime / 10.0, simtime))
        self.assertLess(err, 0.01)

    def testKDR_FS_Gk_Neuron(self):
        data = np.c_[self.tseries, self.gk]
        err = compare_channel_data(data,
                                   self.channelname,
                                   'Gk',
                                   'neuron',
                                   x_range=(simtime / 10.0, simtime),
                                   plot=True)
        self.assertLess(err, 0.01)