Skip to content

Commit

Permalink
klustakwikio: Adjust regular expression to catch more filenames
Browse files Browse the repository at this point in the history
This will also match filenames with preceding dots & digits now, like
"ec013.395.clu.1".
  • Loading branch information
ximion committed Aug 18, 2023
1 parent fc6d20e commit 7cb9788
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion neo/io/klustakwikio.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* Load features in addition to spiketimes.
"""

import re
import glob
import logging
from pathlib import Path
Expand Down Expand Up @@ -439,7 +440,7 @@ def read_filenames(self, typestring='fet'):
for v in all_filenames:
# Test whether matches format, ie ends with digits
split_fn = v.name
m = glob.re.search((r'^(\w+)\.%s\.(\d+)$' % typestring), split_fn)
m = re.search(rf'^(.*)\.{typestring}\.(\d+)$', split_fn)
if m is not None:
# get basename from first hit if not specified
if self.basename is None:
Expand Down

0 comments on commit 7cb9788

Please sign in to comment.