From 581caf75c604dd0f64be0070cb4e2f853c8cefe1 Mon Sep 17 00:00:00 2001 From: "Peter N. Steinmetz" Date: Tue, 8 Sep 2020 11:52:10 -0700 Subject: [PATCH 01/11] Use NLX_Base_Class_Type to determine recording type. --- neo/rawio/neuralynxrawio.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/neo/rawio/neuralynxrawio.py b/neo/rawio/neuralynxrawio.py index 305049b18..46f930b06 100644 --- a/neo/rawio/neuralynxrawio.py +++ b/neo/rawio/neuralynxrawio.py @@ -661,6 +661,7 @@ def _to_bool(txt): ('ApplicationName', '', None), # also include version number when present ('AcquisitionSystem', '', None), ('ReferenceChannel', '', None), + ('NLX_Base_Class_Type','',None) # in version 4 and earlier versions of Cheetah ] # Filename and datetime may appear in header lines starting with # at @@ -809,6 +810,37 @@ def buildForFile(filename): return info + def typeOfRecording(self): + """ + Determines type of recording in Ncs file with this header. + + RETURN: + one of 'PRE4','BML','DIGITALLYNX','DIGITALLYNXSX','UNKNOWN' + """ + + if 'NLX_Base_Class_Type' in self: + + # older style standard neuralynx acquisition with rounded sampling frequency + if self['NLX_Base_Class_Type'] == 'CscAcqEnt': + return 'PRE4' + + # BML style with fractional frequency and microsPerSamp + elif self['NLX_Base_Class_Type'] == 'BmlAcq': + return 'BML' + + elif 'HardwareSubsystemType' in self: + + # DigitalLynx + if self['HardwareSubsystemType'] == 'DigitalLynx': + return 'DIGITALLYNX' + + # DigitalLynxSX + elif self['HardwareSubsystemType'] == 'DigitalLynxSX': + return 'DIGITALLYNXSX' + + else: + return 'UNKNOWN' + class NcsHeader(): """ From 2bbc68f0269f6a90771ae549f68c79dc768c5fa2 Mon Sep 17 00:00:00 2001 From: "Peter N. Steinmetz" Date: Tue, 8 Sep 2020 11:52:45 -0700 Subject: [PATCH 02/11] Initial test of Ncs recording type from header. --- neo/test/rawiotest/test_neuralynxrawio.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/neo/test/rawiotest/test_neuralynxrawio.py b/neo/test/rawiotest/test_neuralynxrawio.py index 1c5a1aa92..b13c9e689 100644 --- a/neo/test/rawiotest/test_neuralynxrawio.py +++ b/neo/test/rawiotest/test_neuralynxrawio.py @@ -2,6 +2,7 @@ from neo.rawio.neuralynxrawio import NeuralynxRawIO from neo.test.rawiotest.common_rawio_test import BaseTestRawIO +from neo.rawio.neuralynxrawio import NlxHeader import logging @@ -14,7 +15,8 @@ class TestNeuralynxRawIO(BaseTestRawIO, unittest.TestCase, ): 'Cheetah_v5.5.1/original_data', 'Cheetah_v5.6.3/original_data', 'Cheetah_v5.7.4/original_data', - 'Cheetah_v6.3.2/incomplete_blocks' + 'Cheetah_v6.3.2/incomplete_blocks', + 'Cheetah_v4.0.2/original_data' ] files_to_download = [ 'Cheetah_v5.5.1/original_data/CheetahLogFile.txt', @@ -58,7 +60,20 @@ class TestNeuralynxRawIO(BaseTestRawIO, unittest.TestCase, ): 'Cheetah_v5.7.4/README.txt', 'Cheetah_v6.3.2/incomplete_blocks/CSC1_reduced.ncs', 'Cheetah_v6.3.2/incomplete_blocks/Events.nev', - 'Cheetah_v6.3.2/incomplete_blocks/README.txt'] + 'Cheetah_v6.3.2/incomplete_blocks/README.txt', + 'Cheetah_v4.0.2/original_data/CSC14_trunc.Ncs'] + +class TestNcsRecordingType(TestNeuralynxRawIO, unittest.TestCase): + """ + Test of decoding of NlxHeader for type of recording. + """ + + def test_recording_types(self): + + filename = self.get_filename_path('Cheetah_v4.0.2/original_data/CSC14_trunc.Ncs') + hdr = NlxHeader.buildForFile(filename) + self.assertEqual(hdr.typeOfRecording(),'PRE4') + if __name__ == "__main__": From c421a307bf6a77ea5d3b6412d2019ffda7c5f350 Mon Sep 17 00:00:00 2001 From: "Peter N. Steinmetz" Date: Thu, 8 Oct 2020 11:07:16 -0700 Subject: [PATCH 03/11] Decode headers from recent file types and test them. --- neo/rawio/neuralynxrawio.py | 15 ++++++++++--- neo/test/rawiotest/test_neuralynxrawio.py | 27 +++++++++++++++++------ 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/neo/rawio/neuralynxrawio.py b/neo/rawio/neuralynxrawio.py index 46f930b06..4dd9f4bac 100644 --- a/neo/rawio/neuralynxrawio.py +++ b/neo/rawio/neuralynxrawio.py @@ -828,16 +828,25 @@ def typeOfRecording(self): elif self['NLX_Base_Class_Type'] == 'BmlAcq': return 'BML' - elif 'HardwareSubsystemType' in self: + else: return 'UNKNOWN' + + elif 'HardwareSubSystemType' in self: # DigitalLynx - if self['HardwareSubsystemType'] == 'DigitalLynx': + if self['HardwareSubSystemType'] == 'DigitalLynx': return 'DIGITALLYNX' # DigitalLynxSX - elif self['HardwareSubsystemType'] == 'DigitalLynxSX': + elif self['HardwareSubSystemType'] == 'DigitalLynxSX': return 'DIGITALLYNXSX' + elif 'FileType' in self: + + if self['FileVersion'] in ['3.3','3.4']: + return self['AcquisitionSystem'].split()[1].upper() + + else: return 'UNKNOWN' + else: return 'UNKNOWN' diff --git a/neo/test/rawiotest/test_neuralynxrawio.py b/neo/test/rawiotest/test_neuralynxrawio.py index b13c9e689..0985d7635 100644 --- a/neo/test/rawiotest/test_neuralynxrawio.py +++ b/neo/test/rawiotest/test_neuralynxrawio.py @@ -12,13 +12,14 @@ class TestNeuralynxRawIO(BaseTestRawIO, unittest.TestCase, ): rawioclass = NeuralynxRawIO entities_to_test = [ + 'Cheetah_v4.0.2/original_data', 'Cheetah_v5.5.1/original_data', 'Cheetah_v5.6.3/original_data', 'Cheetah_v5.7.4/original_data', - 'Cheetah_v6.3.2/incomplete_blocks', - 'Cheetah_v4.0.2/original_data' + 'Cheetah_v6.3.2/incomplete_blocks' ] files_to_download = [ + 'Cheetah_v4.0.2/original_data/CSC14_trunc.Ncs', 'Cheetah_v5.5.1/original_data/CheetahLogFile.txt', 'Cheetah_v5.5.1/original_data/CheetahLostADRecords.txt', 'Cheetah_v5.5.1/original_data/Events.nev', @@ -60,20 +61,32 @@ class TestNeuralynxRawIO(BaseTestRawIO, unittest.TestCase, ): 'Cheetah_v5.7.4/README.txt', 'Cheetah_v6.3.2/incomplete_blocks/CSC1_reduced.ncs', 'Cheetah_v6.3.2/incomplete_blocks/Events.nev', - 'Cheetah_v6.3.2/incomplete_blocks/README.txt', - 'Cheetah_v4.0.2/original_data/CSC14_trunc.Ncs'] + 'Cheetah_v6.3.2/incomplete_blocks/README.txt' + ] + class TestNcsRecordingType(TestNeuralynxRawIO, unittest.TestCase): """ Test of decoding of NlxHeader for type of recording. """ + ncsTypeTestFiles = [ + ('Cheetah_v4.0.2/original_data/CSC14_trunc.Ncs','PRE4'), + ('Cheetah_v5.5.1/original_data/STet3a.nse','DIGITALLYNXSX'), + ('Cheetah_v5.5.1/original_data/Tet3a.ncs','DIGITALLYNXSX'), + ('Cheetah_v5.6.3/original_data/CSC1.ncs','DIGITALLYNXSX'), + ('Cheetah_v5.6.3/original_data/TT1.ntt','DIGITALLYNXSX'), + ('Cheetah_v5.7.4/original_data/CSC1.ncs','DIGITALLYNXSX'), + ('Cheetah_v6.3.2/incomplete_blocks/CSC1_reduced.ncs','DIGITALLYNXSX') + ] + def test_recording_types(self): - filename = self.get_filename_path('Cheetah_v4.0.2/original_data/CSC14_trunc.Ncs') - hdr = NlxHeader.buildForFile(filename) - self.assertEqual(hdr.typeOfRecording(),'PRE4') + for typeTest in self.ncsTypeTestFiles: + filename = self.get_filename_path(typeTest[0]) + hdr = NlxHeader.buildForFile(filename) + self.assertEqual(hdr.typeOfRecording(),typeTest[1]) if __name__ == "__main__": From 5e224b62ab56e64f8fa423d17ab467df1f66fa70 Mon Sep 17 00:00:00 2001 From: "Peter N. Steinmetz" Date: Thu, 8 Oct 2020 11:08:07 -0700 Subject: [PATCH 04/11] Add self to authors file. --- doc/source/authors.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/source/authors.rst b/doc/source/authors.rst index f48515458..bddb41844 100644 --- a/doc/source/authors.rst +++ b/doc/source/authors.rst @@ -52,6 +52,7 @@ and may not be the current affiliation of a contributor. * rishidhingra@github * Hugo van Kemenade * Aitor Morales-Gregorio [13] +* Peter N Steinmetz [22] 1. Centre de Recherche en Neuroscience de Lyon, CNRS UMR5292 - INSERM U1028 - Universite Claude Bernard Lyon 1 2. Unité de Neuroscience, Information et Complexité, CNRS UPR 3293, Gif-sur-Yvette, France @@ -74,6 +75,7 @@ and may not be the current affiliation of a contributor. 19. IAL Developmental Neurobiology, Kazan Federal University, Kazan, Russia 20. Harden Technologies, LLC 21. Institut des Neurosciences Paris-Saclay, CNRS UMR 9197 - Université Paris-Sud, Gif-sur-Yvette, France +22. Neurtex Brain Research Institute, Dallas, TX, USAs If we've somehow missed you off the list we're very sorry - please let us know. From 1a5a3fc976c5b6bf1283d5a6ed4787322704c6cc Mon Sep 17 00:00:00 2001 From: "Peter N. Steinmetz" Date: Thu, 8 Oct 2020 11:11:08 -0700 Subject: [PATCH 05/11] Add 4.0.2 test data. --- neo/test/iotest/test_neuralynxio.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/neo/test/iotest/test_neuralynxio.py b/neo/test/iotest/test_neuralynxio.py index adc97ba6a..a6b82d5f4 100644 --- a/neo/test/iotest/test_neuralynxio.py +++ b/neo/test/iotest/test_neuralynxio.py @@ -22,12 +22,14 @@ class CommonNeuralynxIOTest(BaseTestIO, unittest.TestCase, ): ioclass = NeuralynxIO files_to_test = [ + 'Cheetah_v4.0.2/original_data', 'Cheetah_v5.5.1/original_data', 'Cheetah_v5.6.3/original_data', 'Cheetah_v5.7.4/original_data', 'Pegasus_v2.1.1', 'Cheetah_v6.3.2/incomplete_blocks'] files_to_download = [ + 'Cheetah_v4.0.2/original_data/CSC14_trunc.Ncs', 'Cheetah_v5.5.1/original_data/CheetahLogFile.txt', 'Cheetah_v5.5.1/original_data/CheetahLostADRecords.txt', 'Cheetah_v5.5.1/original_data/Events.nev', @@ -71,7 +73,8 @@ class CommonNeuralynxIOTest(BaseTestIO, unittest.TestCase, ): 'Pegasus_v2.1.1/Events_0008.nev', 'Cheetah_v6.3.2/incomplete_blocks/CSC1_reduced.ncs', 'Cheetah_v6.3.2/incomplete_blocks/Events.nev', - 'Cheetah_v6.3.2/incomplete_blocks/README.txt'] + 'Cheetah_v6.3.2/incomplete_blocks/README.txt' + ] class TestCheetah_v551(CommonNeuralynxIOTest, unittest.TestCase): @@ -336,7 +339,6 @@ def test_gap_handling_v563(self): self.assertEqual(len(block.channel_indexes[0].analogsignals), n_gaps + 1) self.assertEqual(len(block.channel_indexes[-1].units[0].spiketrains), n_gaps + 1) - def compare_old_and_new_neuralynxio(): base = '/tmp/files_for_testing_neo/neuralynx/' dirname = base + 'Cheetah_v5.5.1/original_data/' From 7008f9c5e73e1a3604fcdcc328c177520326a016 Mon Sep 17 00:00:00 2001 From: "Peter N. Steinmetz" Date: Fri, 9 Oct 2020 09:32:24 -0700 Subject: [PATCH 06/11] Do not fully test the 4.0.2 data yet. Allows full normal testing to run, using the 4.0.2 data only to test the parsing of ncs recording from the header information. --- neo/test/rawiotest/test_neuralynxrawio.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neo/test/rawiotest/test_neuralynxrawio.py b/neo/test/rawiotest/test_neuralynxrawio.py index 0985d7635..3a8641a97 100644 --- a/neo/test/rawiotest/test_neuralynxrawio.py +++ b/neo/test/rawiotest/test_neuralynxrawio.py @@ -12,7 +12,7 @@ class TestNeuralynxRawIO(BaseTestRawIO, unittest.TestCase, ): rawioclass = NeuralynxRawIO entities_to_test = [ - 'Cheetah_v4.0.2/original_data', + # 'Cheetah_v4.0.2/original_data', 'Cheetah_v5.5.1/original_data', 'Cheetah_v5.6.3/original_data', 'Cheetah_v5.7.4/original_data', From b6f8153b14baa8a2c34b89a4cf6a3e9789648f31 Mon Sep 17 00:00:00 2001 From: "Peter N. Steinmetz" Date: Fri, 9 Oct 2020 09:43:07 -0700 Subject: [PATCH 07/11] =?UTF-8?q?Don=E2=80=99t=20test=204.0.2=20in=20test?= =?UTF-8?q?=20of=20neuralynxio=20either.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- neo/test/iotest/test_neuralynxio.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neo/test/iotest/test_neuralynxio.py b/neo/test/iotest/test_neuralynxio.py index a6b82d5f4..3bf29d12f 100644 --- a/neo/test/iotest/test_neuralynxio.py +++ b/neo/test/iotest/test_neuralynxio.py @@ -22,7 +22,7 @@ class CommonNeuralynxIOTest(BaseTestIO, unittest.TestCase, ): ioclass = NeuralynxIO files_to_test = [ - 'Cheetah_v4.0.2/original_data', + # 'Cheetah_v4.0.2/original_data', 'Cheetah_v5.5.1/original_data', 'Cheetah_v5.6.3/original_data', 'Cheetah_v5.7.4/original_data', From b0deaf287a6fd8d55ce6d11175e6f97e3a238f21 Mon Sep 17 00:00:00 2001 From: "Peter N. Steinmetz" Date: Fri, 9 Oct 2020 09:46:17 -0700 Subject: [PATCH 08/11] Add blank line for PEP8. --- neo/test/iotest/test_neuralynxio.py | 1 + 1 file changed, 1 insertion(+) diff --git a/neo/test/iotest/test_neuralynxio.py b/neo/test/iotest/test_neuralynxio.py index 3bf29d12f..85667034d 100644 --- a/neo/test/iotest/test_neuralynxio.py +++ b/neo/test/iotest/test_neuralynxio.py @@ -339,6 +339,7 @@ def test_gap_handling_v563(self): self.assertEqual(len(block.channel_indexes[0].analogsignals), n_gaps + 1) self.assertEqual(len(block.channel_indexes[-1].units[0].spiketrains), n_gaps + 1) + def compare_old_and_new_neuralynxio(): base = '/tmp/files_for_testing_neo/neuralynx/' dirname = base + 'Cheetah_v5.5.1/original_data/' From 51daa9325ca5c34ebbfaa4e65199f11ac132cfd7 Mon Sep 17 00:00:00 2001 From: "Peter N. Steinmetz" Date: Fri, 9 Oct 2020 10:05:21 -0700 Subject: [PATCH 09/11] Clean up more PEP8 style issues. --- neo/rawio/neuralynxrawio.py | 10 ++++++---- neo/test/iotest/test_neuralynxio.py | 3 +-- neo/test/rawiotest/test_neuralynxrawio.py | 21 +++++++++------------ 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/neo/rawio/neuralynxrawio.py b/neo/rawio/neuralynxrawio.py index 4dd9f4bac..4e08d120c 100644 --- a/neo/rawio/neuralynxrawio.py +++ b/neo/rawio/neuralynxrawio.py @@ -661,7 +661,7 @@ def _to_bool(txt): ('ApplicationName', '', None), # also include version number when present ('AcquisitionSystem', '', None), ('ReferenceChannel', '', None), - ('NLX_Base_Class_Type','',None) # in version 4 and earlier versions of Cheetah + ('NLX_Base_Class_Type', '', None) # in version 4 and earlier versions of Cheetah ] # Filename and datetime may appear in header lines starting with # at @@ -828,7 +828,8 @@ def typeOfRecording(self): elif self['NLX_Base_Class_Type'] == 'BmlAcq': return 'BML' - else: return 'UNKNOWN' + else: + return 'UNKNOWN' elif 'HardwareSubSystemType' in self: @@ -842,10 +843,11 @@ def typeOfRecording(self): elif 'FileType' in self: - if self['FileVersion'] in ['3.3','3.4']: + if self['FileVersion'] in ['3.3', '3.4']: return self['AcquisitionSystem'].split()[1].upper() - else: return 'UNKNOWN' + else: + return 'UNKNOWN' else: return 'UNKNOWN' diff --git a/neo/test/iotest/test_neuralynxio.py b/neo/test/iotest/test_neuralynxio.py index 85667034d..116515940 100644 --- a/neo/test/iotest/test_neuralynxio.py +++ b/neo/test/iotest/test_neuralynxio.py @@ -73,8 +73,7 @@ class CommonNeuralynxIOTest(BaseTestIO, unittest.TestCase, ): 'Pegasus_v2.1.1/Events_0008.nev', 'Cheetah_v6.3.2/incomplete_blocks/CSC1_reduced.ncs', 'Cheetah_v6.3.2/incomplete_blocks/Events.nev', - 'Cheetah_v6.3.2/incomplete_blocks/README.txt' - ] + 'Cheetah_v6.3.2/incomplete_blocks/README.txt'] class TestCheetah_v551(CommonNeuralynxIOTest, unittest.TestCase): diff --git a/neo/test/rawiotest/test_neuralynxrawio.py b/neo/test/rawiotest/test_neuralynxrawio.py index 3a8641a97..ba20bdb83 100644 --- a/neo/test/rawiotest/test_neuralynxrawio.py +++ b/neo/test/rawiotest/test_neuralynxrawio.py @@ -16,8 +16,7 @@ class TestNeuralynxRawIO(BaseTestRawIO, unittest.TestCase, ): 'Cheetah_v5.5.1/original_data', 'Cheetah_v5.6.3/original_data', 'Cheetah_v5.7.4/original_data', - 'Cheetah_v6.3.2/incomplete_blocks' - ] + 'Cheetah_v6.3.2/incomplete_blocks'] files_to_download = [ 'Cheetah_v4.0.2/original_data/CSC14_trunc.Ncs', 'Cheetah_v5.5.1/original_data/CheetahLogFile.txt', @@ -61,8 +60,7 @@ class TestNeuralynxRawIO(BaseTestRawIO, unittest.TestCase, ): 'Cheetah_v5.7.4/README.txt', 'Cheetah_v6.3.2/incomplete_blocks/CSC1_reduced.ncs', 'Cheetah_v6.3.2/incomplete_blocks/Events.nev', - 'Cheetah_v6.3.2/incomplete_blocks/README.txt' - ] + 'Cheetah_v6.3.2/incomplete_blocks/README.txt'] class TestNcsRecordingType(TestNeuralynxRawIO, unittest.TestCase): @@ -71,14 +69,13 @@ class TestNcsRecordingType(TestNeuralynxRawIO, unittest.TestCase): """ ncsTypeTestFiles = [ - ('Cheetah_v4.0.2/original_data/CSC14_trunc.Ncs','PRE4'), - ('Cheetah_v5.5.1/original_data/STet3a.nse','DIGITALLYNXSX'), - ('Cheetah_v5.5.1/original_data/Tet3a.ncs','DIGITALLYNXSX'), - ('Cheetah_v5.6.3/original_data/CSC1.ncs','DIGITALLYNXSX'), - ('Cheetah_v5.6.3/original_data/TT1.ntt','DIGITALLYNXSX'), - ('Cheetah_v5.7.4/original_data/CSC1.ncs','DIGITALLYNXSX'), - ('Cheetah_v6.3.2/incomplete_blocks/CSC1_reduced.ncs','DIGITALLYNXSX') - ] + ('Cheetah_v4.0.2/original_data/CSC14_trunc.Ncs', 'PRE4'), + ('Cheetah_v5.5.1/original_data/STet3a.nse', 'DIGITALLYNXSX'), + ('Cheetah_v5.5.1/original_data/Tet3a.ncs', 'DIGITALLYNXSX'), + ('Cheetah_v5.6.3/original_data/CSC1.ncs', 'DIGITALLYNXSX'), + ('Cheetah_v5.6.3/original_data/TT1.ntt', 'DIGITALLYNXSX'), + ('Cheetah_v5.7.4/original_data/CSC1.ncs', 'DIGITALLYNXSX'), + ('Cheetah_v6.3.2/incomplete_blocks/CSC1_reduced.ncs', 'DIGITALLYNXSX')] def test_recording_types(self): From ea95d7065c632c722776e28e4a0998ad9e0b6e4b Mon Sep 17 00:00:00 2001 From: "Peter N. Steinmetz" Date: Fri, 9 Oct 2020 10:13:13 -0700 Subject: [PATCH 10/11] Clean up another whitespace issue for PEP8. --- neo/test/rawiotest/test_neuralynxrawio.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neo/test/rawiotest/test_neuralynxrawio.py b/neo/test/rawiotest/test_neuralynxrawio.py index ba20bdb83..dce7357ac 100644 --- a/neo/test/rawiotest/test_neuralynxrawio.py +++ b/neo/test/rawiotest/test_neuralynxrawio.py @@ -83,7 +83,7 @@ def test_recording_types(self): filename = self.get_filename_path(typeTest[0]) hdr = NlxHeader.buildForFile(filename) - self.assertEqual(hdr.typeOfRecording(),typeTest[1]) + self.assertEqual(hdr.typeOfRecording(), typeTest[1]) if __name__ == "__main__": From 6ed65a219bca18638726ba78ca55b8d4eb8ce6ae Mon Sep 17 00:00:00 2001 From: "Peter N. Steinmetz" Date: Fri, 6 Nov 2020 13:46:36 -0700 Subject: [PATCH 11/11] Language and function renaming. --- neo/rawio/neuralynxrawio.py | 8 ++++---- neo/test/rawiotest/test_neuralynxrawio.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/neo/rawio/neuralynxrawio.py b/neo/rawio/neuralynxrawio.py index eb86a960f..818a4c270 100644 --- a/neo/rawio/neuralynxrawio.py +++ b/neo/rawio/neuralynxrawio.py @@ -108,7 +108,7 @@ def _parse_header(self): continue # All file have more or less the same header structure - info = NlxHeader.buildForFile(filename) + info = NlxHeader.build_for_file(filename) chan_names = info['channel_names'] chan_ids = info['channel_ids'] @@ -227,7 +227,7 @@ def _parse_header(self): self._timestamp_limits = None self._nb_segment = 1 - # Read ncs files for gaps detection and nb_segment computation. + # Read ncs files for gap detection and nb_segment computation. # :TODO: current algorithm depends on side-effect of read_ncs_files on # self._sigs_memmap, self._sigs_t_start, self._sigs_t_stop, # self._sigs_length, self._nb_segment, self._timestamp_limits @@ -695,7 +695,7 @@ def _to_bool(txt): datetimeformat='%Y/%m/%d %H:%M:%S') } - def buildForFile(filename): + def build_for_file(filename): """ Factory function to build NlxHeader for a given file. """ @@ -810,7 +810,7 @@ def buildForFile(filename): return info - def typeOfRecording(self): + def type_of_recording(self): """ Determines type of recording in Ncs file with this header. diff --git a/neo/test/rawiotest/test_neuralynxrawio.py b/neo/test/rawiotest/test_neuralynxrawio.py index dce7357ac..4e0bc40cb 100644 --- a/neo/test/rawiotest/test_neuralynxrawio.py +++ b/neo/test/rawiotest/test_neuralynxrawio.py @@ -82,8 +82,8 @@ def test_recording_types(self): for typeTest in self.ncsTypeTestFiles: filename = self.get_filename_path(typeTest[0]) - hdr = NlxHeader.buildForFile(filename) - self.assertEqual(hdr.typeOfRecording(), typeTest[1]) + hdr = NlxHeader.build_for_file(filename) + self.assertEqual(hdr.type_of_recording(), typeTest[1]) if __name__ == "__main__":