Skip to content

Commit 165a0a4

Browse files
committed
Fix conflicts.
2 parents 6385b0f + 6cd8158 commit 165a0a4

File tree

4 files changed

+29
-27
lines changed

4 files changed

+29
-27
lines changed

neo/rawio/neuralynxrawio/ncssections.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
The challenge addressed by the NcsSectionsFactory of this module is to separate those intended
3434
gaps from those introduced by a quirk of the hardware, recording software, or file format.
3535
"""
36+
3637
import math
3738
import numpy as np
3839

@@ -87,12 +88,12 @@ class NcsSection:
8788
_RECORD_SIZE = 512 # nb sample per signal record
8889

8990
def __init__(self, startRec, startTime, endRec, endTime, n_samples):
90-
self.startRec = startRec # index of starting record
91-
self.startTime = startTime # starttime of first record
92-
self.endRec = endRec # index of last record (inclusive)
93-
self.endTime = endTime # end time of last record, that is, the end time of the last
94-
# sampling period contained in the last record of the section
95-
self.n_samples = n_samples # number of samples in record which are valid
91+
self.startRec = startRec # index of starting record
92+
self.startTime = startTime # starttime of first record
93+
self.endRec = endRec # index of last record (inclusive)
94+
self.endTime = endTime # end time of last record, that is, the end time of the last
95+
# sampling period contained in the last record of the section
96+
self.n_samples = n_samples # number of samples in record which are valid
9697

9798
def __eq__(self, other):
9899
return (

neo/rawio/neuralynxrawio/neuralynxrawio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ def _parse_header(self):
326326
internal_ids = []
327327
else:
328328
data = self._get_file_map(filename)
329-
if data.shape[0] == 0: # empty file
329+
if data.shape[0] == 0: # empty file
330330
self._empty_nse_ntt.append(filename)
331331
internal_ids = np.unique(data[["event_id", "ttl_input"]]).tolist()
332332
for internal_event_id in internal_ids:

neo/rawio/neuralynxrawio/nlxheader.py

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -81,52 +81,53 @@ def _to_bool(txt):
8181
"bml": dict(
8282
datetime1_regex=r"## Time Opened: \(m/d/y\): (?P<date>\S+)" r" At Time: (?P<time>\S+)",
8383
filename_regex=r"## File Name: (?P<filename>\S+)",
84-
datetimeformat="%m/%d/%y %H:%M:%S.%f"
84+
datetimeformat="%m/%d/%y %H:%M:%S.%f",
8585
),
8686
# Cheetah after version 1 and before version 5
8787
"bv5": dict(
8888
datetime1_regex=r"## Time Opened: \(m/d/y\): (?P<date>\S+)" r" At Time: (?P<time>\S+)",
8989
filename_regex=r"## File Name: (?P<filename>\S+)",
90-
datetimeformat="%m/%d/%Y %H:%M:%S.%f"
90+
datetimeformat="%m/%d/%Y %H:%M:%S.%f",
9191
),
9292
# Cheetah version 5.4.0
9393
"v5.4.0": dict(
9494
datetime1_regex=r"## Time Opened \(m/d/y\): (?P<date>\S+)" r" At Time: (?P<time>\S+)",
9595
datetime2_regex=r"## Time Closed \(m/d/y\): (?P<date>\S+)" r" At Time: (?P<time>\S+)",
9696
filename_regex=r"## File Name: (?P<filename>\S+)",
97-
datetimeformat="%m/%d/%Y %H:%M:%S.%f"
97+
datetimeformat="%m/%d/%Y %H:%M:%S.%f",
9898
),
9999
# Cheetah version 5.6.0, some range of versions in between
100100
"v5.6.0": dict(
101101
datetime1_regex=r"## Time Opened: \(m/d/y\): (?P<date>\S+)" r" At Time: (?P<time>\S+)",
102102
filename_regex=r"## File Name: (?P<filename>\S+)",
103-
datetimeformat="%m/%d/%Y %H:%M:%S.%f"
103+
datetimeformat="%m/%d/%Y %H:%M:%S.%f",
104104
),
105105
# Cheetah version 5 before and including v 5.6.4 as well as version 1
106106
"bv5.6.4": dict(
107107
datetime1_regex=r"## Time Opened \(m/d/y\): (?P<date>\S+)" r" \(h:m:s\.ms\) (?P<time>\S+)",
108108
datetime2_regex=r"## Time Closed \(m/d/y\): (?P<date>\S+)" r" \(h:m:s\.ms\) (?P<time>\S+)",
109109
filename_regex=r"## File Name (?P<filename>\S+)",
110-
datetimeformat="%m/%d/%Y %H:%M:%S.%f"
110+
datetimeformat="%m/%d/%Y %H:%M:%S.%f",
111111
),
112112
"neuraview2": dict(
113113
datetime1_regex=r"## Date Opened: \(mm/dd/yyy\): (?P<date>\S+)" r" At Time: (?P<time>\S+)",
114114
datetime2_regex=r"## Date Closed: \(mm/dd/yyy\): (?P<date>\S+)" r" At Time: (?P<time>\S+)",
115115
filename_regex=r"## File Name: (?P<filename>\S+)",
116-
datetimeformat="%m/%d/%Y %H:%M:%S"
116+
datetimeformat="%m/%d/%Y %H:%M:%S",
117117
),
118-
'peg': dict(
119-
datetime1_regex=r'-TimeCreated (?P<date>\S+) (?P<time>\S+)',
120-
datetime2_regex=r'-TimeClosed (?P<date>\S+) (?P<time>\S+)',
118+
"peg": dict(
119+
datetime1_regex=r"-TimeCreated (?P<date>\S+) (?P<time>\S+)",
120+
datetime2_regex=r"-TimeClosed (?P<date>\S+) (?P<time>\S+)",
121121
filename_regex=r'-OriginalFileName "?(?P<filename>\S+)"?',
122-
datetimeformat=r'%Y/%m/%d %H:%M:%S',
123-
datetime2format=r'%Y/%m/%d %H:%M:%S.f'),
122+
datetimeformat=r"%Y/%m/%d %H:%M:%S",
123+
datetime2format=r"%Y/%m/%d %H:%M:%S.f",
124+
),
124125
# Cheetah after v 5.6.4 and default for others such as Pegasus
125126
"def": dict(
126127
datetime1_regex=r"-TimeCreated (?P<date>\S+) (?P<time>\S+)",
127128
datetime2_regex=r"-TimeClosed (?P<date>\S+) (?P<time>\S+)",
128129
filename_regex=r'-OriginalFileName "?(?P<filename>\S+)"?',
129-
datetimeformat="%Y/%m/%d %H:%M:%S"
130+
datetimeformat="%Y/%m/%d %H:%M:%S",
130131
),
131132
}
132133

@@ -144,7 +145,7 @@ def __init__(self, filename, props_only=False):
144145

145146
# must start with 8 # characters
146147
if not props_only and not txt_header.startswith("########"):
147-
ValueError("Neuralynx files must start with 8 # characters.")
148+
ValueError("Neuralynx files must start with 8 # characters.")
148149

149150
self.read_properties(filename, txt_header)
150151

@@ -163,7 +164,6 @@ def build_with_properties_only(filename):
163164
"""
164165
res = OrderedDict()
165166

166-
167167
def read_properties(self, filename, txt_header):
168168
"""
169169
Read properties from header and place in OrderedDictionary which this object is.
@@ -272,8 +272,8 @@ def readTimeDate(self, txt_header):
272272
elif an == "Neuraview":
273273
hpd = NlxHeader.header_pattern_dicts["neuraview2"]
274274
av = Version("2")
275-
elif an == 'Pegasus':
276-
hpd = NlxHeader.header_pattern_dicts['peg']
275+
elif an == "Pegasus":
276+
hpd = NlxHeader.header_pattern_dicts["peg"]
277277
av = Version("2")
278278
else:
279279
an = "Unknown"
@@ -289,15 +289,16 @@ def readTimeDate(self, txt_header):
289289
dt1 = sr.groupdict()
290290
try: # allow two possible formats for date and time
291291
self["recording_opened"] = datetime.datetime.strptime(
292-
dt1["date"] + " " + dt1["time"], hpd["datetimeformat"])
292+
dt1["date"] + " " + dt1["time"], hpd["datetimeformat"]
293+
)
293294
except:
294295
try:
295296
self["recording_opened"] = datetime.datetime.strptime(
296-
dt1["date"] + " " + dt1["time"], hpd["datetime2format"])
297+
dt1["date"] + " " + dt1["time"], hpd["datetime2format"]
298+
)
297299
except:
298300
self["recording_opened"] = None
299301

300-
301302
# close time, if available
302303
if "datetime2_regex" in hpd:
303304
sr = re.search(hpd["datetime2_regex"], txt_header)

neo/test/rawiotest/test_neuralynxrawio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class TestNeuralynxRawIO(
2727
"neuralynx/Cheetah_v5.5.1/original_data",
2828
"neuralynx/Cheetah_v5.6.3/original_data",
2929
"neuralynx/Cheetah_v5.7.4/original_data",
30-
"neuralynx/Cheetah_v6.3.2/incomplete_blocks"
30+
"neuralynx/Cheetah_v6.3.2/incomplete_blocks",
3131
]
3232

3333
def test_scan_ncs_files(self):

0 commit comments

Comments
 (0)