Skip to content

Commit

Permalink
Accommodate sessions with two sets of ephys data in different locations
Browse files Browse the repository at this point in the history
  • Loading branch information
bjhardcastle committed Jul 18, 2024
1 parent b90e93e commit 70ecec8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/npc_sessions/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2292,11 +2292,18 @@ def stim_frame_times(self) -> dict[str, npt.NDArray[np.float64]]:
@property
def ephys_record_node_dirs(self) -> tuple[upath.UPath, ...]:
if getattr(self, "_ephys_record_node_dirs", None) is None:
self.ephys_record_node_dirs = tuple(
all_ = tuple(
p
for p in self.raw_data_paths
if re.match(r"^Record Node [0-9]+$", p.name)
)
# if data has been reuploaded and lives in a modality subfolder as
# well as the root, we want to use the modality subfolder
modality = tuple(
p for p in all_
if '/ecephys/ecephys_clipped' in p.as_posix()
)
self.ephys_record_node_dirs = modality or all_
return self._ephys_record_node_dirs

@ephys_record_node_dirs.setter
Expand Down

0 comments on commit 70ecec8

Please sign in to comment.