Skip to content

Commit 782f588

Browse files
committed
Fix discovery of paths
1 parent f854a7c commit 782f588

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/npc_ephys/spikeinterface.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def get_json(self, filename: str) -> dict:
167167
assert self.root is not None
168168
return self.read_json(self.get_correct_path(self.root, filename))
169169

170-
def get_path(self, dirname: str, probe: str | None = None, extra_name_component: str | None = None) -> upath.UPath:
170+
def get_path(self, dirname: str, probe: str | None = None, excl_name_component: str | None = None) -> upath.UPath:
171171
"""Return a path to a single dir or file: either `self.root/dirname` or, if `probe` is specified,
172172
the probe-specific sub-path within `self.root/dirname`."""
173173
assert self.root is not None
@@ -185,7 +185,7 @@ def get_path(self, dirname: str, probe: str | None = None, extra_name_component:
185185
for path in sorted(self.get_correct_path(self.root, dirname).iterdir())
186186
if npc_session.ProbeRecord(probe)
187187
== npc_session.ProbeRecord(path.as_posix())
188-
and (extra_name_component is None or extra_name_component in path.name)
188+
and (excl_name_component is None or excl_name_component not in path.name)
189189
),
190190
None,
191191
)
@@ -205,10 +205,10 @@ def get_path(self, dirname: str, probe: str | None = None, extra_name_component:
205205
)
206206

207207
# dirs
208-
drift_maps = functools.partialmethod(get_path, "drift_maps")
209-
output = functools.partialmethod(get_path, "output")
210-
postprocessed = functools.partialmethod(get_path, "postprocessed", "experiment")
211-
spikesorted = functools.partialmethod(get_path, "spikesorted", "experiment")
208+
drift_maps = functools.partialmethod(get_path, dirname="drift_maps")
209+
output = functools.partialmethod(get_path, dirname="output")
210+
postprocessed = functools.partialmethod(get_path, dirname="postprocessed", excl_name_component="sorting")
211+
spikesorted = functools.partialmethod(get_path, dirname="spikesorted", excl_name_component="sorting")
212212

213213
@functools.cache
214214
def curated(self, probe: str) -> upath.UPath:

0 commit comments

Comments
 (0)