def testLoadSpikeListWithIds(self): spk = spikes.load_spikelist("tmp2.txt", id_list=range(30,40)) assert (len(spk) == 10) and (spk.mean_rate() > 0)
def testLoadSpikeListWithTime(self): spk = spikes.load_spikelist("tmp2.txt", id_list=range(30,40), t_start=0, t_stop=100) assert (len(spk) == 10) and (spk.mean_rate() > 0) and (spk.time_parameters() == (0,100))
def testSaveAndLoadPickleTimePart(self): file = io.StandardPickleFile("tmp.pickle") self.spk.save(file) spk2 = spikes.load_spikelist(file, t_start = 0, t_stop= 50) assert (spk2.t_start == 0) and (spk2.t_stop == 50)
def testLoadSpikeList(self): spk = spikes.load_spikelist("tmp2.txt") assert (len(spk) == 50) and (spk.mean_rate() > 0)
def testSaveAndLoadPickle(self): file = io.StandardPickleFile("tmp.pickle") self.spk.save(file) spk2 = spikes.load_spikelist(file) assert len(spk2) == len(self.spk)
def testSaveAndLoadTxtIdsPartInt(self): file = io.StandardTextFile("tmp.txt") self.spk.save(file) spk2 = spikes.load_spikelist(file, id_list=5) assert numpy.all(spk2.id_list == [0,1,2,3,4])
def testSaveAndLoadTxtIdsPart(self): self.spk.save("tmp.txt") spk2 = spikes.load_spikelist("tmp.txt", id_list=[1,2,3]) assert numpy.all(spk2.id_list == [1,2,3])
def testSaveAndLoadTxtTimePart(self): self.spk.save("tmp.txt") spk2 = spikes.load_spikelist("tmp.txt", t_start = 0, t_stop= 50) assert (spk2.t_start == 0) and (spk2.t_stop == 50)
def testSaveAndLoadTxt(self): self.spk.save("tmp.txt") spk2 = spikes.load_spikelist("tmp.txt") assert len(spk2) == len(self.spk)