Skip to content

Commit

Permalink
Fix recorders for non-ephys DR sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
bjhardcastle committed Apr 3, 2024
1 parent 4900f54 commit 2b5ed65
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions src/np_workflows/shared/base_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,24 +546,35 @@ def task_name(self, task_name: str) -> None:
print(f"{task_name = !r} doesn't correspond to a preset value, but the attribute is updated anyway!")
else:
print(f"Updated {self.__class__.__name__}.{task_name = !r}")

services = (
np_services.Sync,
np_services.VideoMVR,
np_services.OpenEphys,
np_services.NewScaleCoordinateRecorder,
np_services.ScriptCamstim,
np_services.MouseDirector,
)

stims = (np_services.ScriptCamstim,)

@property
def recorders(self) -> tuple[Service, ...]:
"""Services to be started before stimuli run, and stopped after. Session-dependent."""
if self.is_hab:
return (np_services.Sync, np_services.VideoMVR)
return (np_services.Sync, np_services.VideoMVR, np_services.OpenEphys)
if self.is_ephys:
return (np_services.Sync, np_services.VideoMVR, np_services.OpenEphys)
return (np_services.Sync, np_services.VideoMVR)

@property
def services(self) -> tuple[Service, ...]:
"""All services"""
if self.is_ephys:
return (
np_services.Sync,
np_services.VideoMVR,
np_services.OpenEphys,
np_services.NewScaleCoordinateRecorder,
np_services.ScriptCamstim,
np_services.MouseDirector,
)
return (
np_services.Sync,
np_services.VideoMVR,
np_services.ScriptCamstim,
np_services.MouseDirector,
)


@property
def hdf5_dir(self) -> pathlib.Path:
Expand Down

0 comments on commit 2b5ed65

Please sign in to comment.