Exemplo n.º 1
0
    def test_get_new_filename(self):
        different_gt = "ignoreThisPart_g1_t2.imec.ap.meta"
        nidaq = 'foobar_g0_t0.nidq.cbin'

        for suf in ('.ap.bin', '0.ap.bin', '1.ap.meta'):
            newfname = misc.get_new_filename(f'ignoreThisPart_g0_t0.imec{suf}')
            self.assertEqual(f'_spikeglx_ephysData_g0_t0.imec{suf}', newfname)
        newfname = misc.get_new_filename(different_gt)
        self.assertEqual('_spikeglx_ephysData_g1_t2.imec.ap.meta', newfname)
        self.assertEqual('_spikeglx_ephysData_g0_t0.nidq.cbin',
                         misc.get_new_filename(nidaq))

        # Test errors
        with self.assertRaises(ValueError):
            misc.get_new_filename('_spikeglx_ephysData_g0_t0.wiring')
        with self.assertRaises(ValueError):
            misc.get_new_filename('_spikeglx_ephysData.meta.cbin')
Exemplo n.º 2
0
    def test_get_new_filename(self):
        binFname3A = 'ignoreThisPart_g0_t0.imec.ap.bin'
        binFname3B = 'ignoreThisPart_g0_t0.imec0.ap.bin'
        metaFname3A = 'ignoreThisPart_g0_t0.imec.ap.meta'
        metaFname3B = 'ignoreThisPart_g0_t0.imec0.ap.meta'
        probe1_3B_Meta = 'ignoreThisPart_g0_t0.imec1.ap.meta'
        different_gt = 'ignoreThisPart_g1_t2.imec0.ap.meta'

        newfname = misc.get_new_filename(binFname3A)
        self.assertTrue(newfname == '_spikeglx_ephysData_g0_t0.imec.ap.bin')
        newfname = misc.get_new_filename(binFname3B)
        self.assertTrue(newfname == '_spikeglx_ephysData_g0_t0.imec0.ap.bin')
        newfname = misc.get_new_filename(metaFname3A)
        self.assertTrue(newfname == '_spikeglx_ephysData_g0_t0.imec.ap.meta')
        newfname = misc.get_new_filename(metaFname3B)
        self.assertTrue(newfname == '_spikeglx_ephysData_g0_t0.imec0.ap.meta')
        newfname = misc.get_new_filename(probe1_3B_Meta)
        self.assertTrue(newfname == '_spikeglx_ephysData_g0_t0.imec1.ap.meta')
        newfname = misc.get_new_filename(different_gt)
        self.assertTrue(newfname == '_spikeglx_ephysData_g1_t2.imec0.ap.meta')
Exemplo n.º 3
0
    def test_get_new_filename(self):
        binFname3A = "ignoreThisPart_g0_t0.imec.ap.bin"
        binFname3B = "ignoreThisPart_g0_t0.imec0.ap.bin"
        metaFname3A = "ignoreThisPart_g0_t0.imec.ap.meta"
        metaFname3B = "ignoreThisPart_g0_t0.imec0.ap.meta"
        probe1_3B_Meta = "ignoreThisPart_g0_t0.imec1.ap.meta"
        different_gt = "ignoreThisPart_g1_t2.imec0.ap.meta"

        newfname = misc.get_new_filename(binFname3A)
        self.assertTrue(newfname == "_spikeglx_ephysData_g0_t0.imec.ap.bin")
        newfname = misc.get_new_filename(binFname3B)
        self.assertTrue(newfname == "_spikeglx_ephysData_g0_t0.imec0.ap.bin")
        newfname = misc.get_new_filename(metaFname3A)
        self.assertTrue(newfname == "_spikeglx_ephysData_g0_t0.imec.ap.meta")
        newfname = misc.get_new_filename(metaFname3B)
        self.assertTrue(newfname == "_spikeglx_ephysData_g0_t0.imec0.ap.meta")
        newfname = misc.get_new_filename(probe1_3B_Meta)
        self.assertTrue(newfname == "_spikeglx_ephysData_g0_t0.imec1.ap.meta")
        newfname = misc.get_new_filename(different_gt)
        self.assertTrue(newfname == "_spikeglx_ephysData_g1_t2.imec0.ap.meta")