def setUp(self): BaseTestIO.setUp(self) if sys.platform.startswith('win'): distantfile = 'http://download.multichannelsystems.com/download_data/software/neuroshare/nsMCDLibrary_3.7b.zip' localfile = os.path.join(tempfile.gettempdir(),'nsMCDLibrary_3.7b.zip') if not os.path.exists(localfile): urlretrieve(distantfile, localfile) if platform.architecture()[0].startswith('64'): self.dllname = os.path.join(tempfile.gettempdir(),'Matlab/Matlab-Import-Filter/Matlab_Interface/nsMCDLibrary64.dll') if not os.path.exists(self.dllname): zip = zipfile.ZipFile(localfile) zip.extract('Matlab/Matlab-Import-Filter/Matlab_Interface/nsMCDLibrary64.dll', path = tempfile.gettempdir()) else: self.dllname = os.path.join(tempfile.gettempdir(),'Matlab/Matlab-Import-Filter/Matlab_Interface/nsMCDLibrary.dll') if not os.path.exists(self.dllname): zip = zipfile.ZipFile(localfile) zip.extract('Matlab/Matlab-Import-Filter/Matlab_Interface/nsMCDLibrary.dll', path = tempfile.gettempdir()) elif sys.platform.startswith('linux'): distantfile = 'http://download.multichannelsystems.com/download_data/software/neuroshare/nsMCDLibrary_Linux64_3.7b.tar.gz' localfile = os.path.join(tempfile.gettempdir(),'nsMCDLibrary_Linux64_3.7b.tar.gz') if not os.path.exists(localfile): urlretrieve(distantfile, localfile) self.dllname = os.path.join(tempfile.gettempdir(),'nsMCDLibrary/nsMCDLibrary.so') if not os.path.exists(self.dllname): tar = tarfile.open(localfile) tar.extract('nsMCDLibrary/nsMCDLibrary.so', path = tempfile.gettempdir()) else: raise unittest.SkipTest("Not currently supported on OS X")
def setUp(self): BaseTestIO.setUp(self) filename = get_test_file_full_path( ioclass=NestIO, filename='0gid-1time-2Vm-3gex-4gin-1260-0.dat', directory=self.local_test_dir, clean=False) self.testIO = ColumnIO(filename=filename)
def test_write_read_single_spike(self): block1 = Block() seg = Segment('segment1') spiketrain1 = SpikeTrain([1] * pq.s, t_stop=10 * pq.s, sampling_rate=1 * pq.Hz) spiketrain1.annotate(yep='yop') block1.segments.append(seg) seg.spiketrains.append(spiketrain1) # write block filename = BaseTestIO.get_filename_path(self, 'matlabiotestfile.mat') io1 = self.ioclass(filename) io1.write_block(block1) # read block io2 = self.ioclass(filename) block2 = io2.read_block() self.assertEqual(block1.segments[0].spiketrains[0], block2.segments[0].spiketrains[0]) # test annotations spiketrain2 = block2.segments[0].spiketrains[0] assert 'yep' in spiketrain2.annotations assert spiketrain2.annotations['yep'] == 'yop'
def setUp(self): BaseTestIO.setUp(self) if sys.platform.startswith("win"): distantfile = ( "http://download.multichannelsystems.com/download_data/software/neuroshare/nsMCDLibrary_3.7b.zip" ) localfile = os.path.join(tempfile.gettempdir(), "nsMCDLibrary_3.7b.zip") if not os.path.exists(localfile): urlretrieve(distantfile, localfile) if platform.architecture()[0].startswith("64"): self.dllname = os.path.join( tempfile.gettempdir(), "Matlab/Matlab-Import-Filter/Matlab_Interface/nsMCDLibrary64.dll" ) if not os.path.exists(self.dllname): zip = zipfile.ZipFile(localfile) zip.extract( "Matlab/Matlab-Import-Filter/Matlab_Interface/nsMCDLibrary64.dll", path=tempfile.gettempdir() ) else: self.dllname = os.path.join( tempfile.gettempdir(), "Matlab/Matlab-Import-Filter/Matlab_Interface/nsMCDLibrary.dll" ) if not os.path.exists(self.dllname): zip = zipfile.ZipFile(localfile) zip.extract( "Matlab/Matlab-Import-Filter/Matlab_Interface/nsMCDLibrary.dll", path=tempfile.gettempdir() ) elif sys.platform.startswith("linux"): distantfile = "http://download.multichannelsystems.com/download_data/software/neuroshare/nsMCDLibrary_Linux64_3.7b.tar.gz" localfile = os.path.join(tempfile.gettempdir(), "nsMCDLibrary_Linux64_3.7b.tar.gz") if not os.path.exists(localfile): urlretrieve(distantfile, localfile) self.dllname = os.path.join(tempfile.gettempdir(), "nsMCDLibrary/nsMCDLibrary.so") if not os.path.exists(self.dllname): tar = tarfile.open(localfile) tar.extract("nsMCDLibrary/nsMCDLibrary.so", path=tempfile.gettempdir())
def test_write_read_single_spike(self): block1 = Block() seg = Segment('segment1') spiketrain = SpikeTrain([1] * pq.s, t_stop=10 * pq.s, sampling_rate=1 * pq.Hz) block1.segments.append(seg) seg.spiketrains.append(spiketrain) # write block filename = BaseTestIO.get_filename_path(self, 'matlabiotestfile.mat') io1 = self.ioclass(filename) io1.write_block(block1) # read block io2 = self.ioclass(filename) block2 = io2.read_block() self.assertEqual(block1.segments[0].spiketrains[0], block2.segments[0].spiketrains[0])
def setUp(self): auto_install_maxwell_hdf5_compression_plugin(force_download=False) BaseTestIO.setUp(self)
def setUp(self): BaseTestIO.setUp(self)
def setUp(self): BaseTestIO.setUp(self) filename = self.get_local_path( 'nest/0gid-1time-2Vm-3gex-4gin-1260-0.dat') self.testIO = ColumnIO(filename=filename)