Skip to content

Commit 28af705

Browse files
committed
bug fix on exclude filenames
1 parent b92568f commit 28af705

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

neo/rawio/neuralynxrawio/neuralynxrawio.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,14 @@ def _parse_header(self):
213213
event_annotations = []
214214

215215
if self.rawmode == "one-dir":
216-
filenames = [os.path.join(self.dirname, f) for f in os.listdir(self.dirname)]
216+
filenames = os.listdir(self.dirname)
217217
else:
218-
filenames = [os.path.join(self.dirname, f) for f in self.include_filenames]
218+
filenames = self.include_filenames
219219

220220
filenames = [f for f in filenames if f not in self.exclude_filenames]
221+
full_filenames = [os.path.join(self.dirname, f) for f in filenames]
221222

222-
for filename in filenames:
223+
for filename in full_filenames:
223224
if not os.path.isfile(filename):
224225
raise ValueError(
225226
f"Provided Filename is not a file: "
@@ -229,7 +230,7 @@ def _parse_header(self):
229230

230231
stream_props = {} # {(sampling_rate, n_samples, t_start): {stream_id: [filenames]}
231232

232-
for filename in filenames:
233+
for filename in full_filenames:
233234
filename = os.path.join(self.dirname, filename)
234235
_, ext = os.path.splitext(filename)
235236
ext = ext[1:] # remove dot

0 commit comments

Comments
 (0)