From c03f84c2ee1e38e4eec6689b524ee34b20370064 Mon Sep 17 00:00:00 2001 From: Jan Grewe Date: Wed, 2 Oct 2019 18:10:01 +0200 Subject: [PATCH] [fishbook] additional functions for Stimulus class --- fishbook/fishbook.py | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/fishbook/fishbook.py b/fishbook/fishbook.py index 62a2dd8..048baa0 100644 --- a/fishbook/fishbook.py +++ b/fishbook/fishbook.py @@ -307,6 +307,51 @@ class Stimulus: _safe_get_val(self.__tuple, "duration", 0.0)) return str + @property + def id(self): + return self.__tuple["stimulus_id"] + + @property + def name(self): + return self.__tuple["stimulus_name"] + + @property + def cell(self): + return Cells & "cell_id = %s" % self.__tuple["cell_id"] + + @property + def repro(self): + return Repros & "repro_id = %s" % self.__tuple["repro_id"] + + @property + def start_time(self): + return self.__tuple["start_time"] + + @property + def start_index(self): + return self.__tuple["start_index"] + + @property + def duration(self): + return self.__tuple["duration"] + + @property + def multi_tag_id(self): + return self.__tuple["mtag_id"] + + @property + def settings(self): + return self.__tuple["settings"] + + @property + def run(self): + return self.__tuple["run"] + + @property + def index(self): + return self.__tuple["stimulus_index"] + + @property def settings(self): return _safe_get_val(self.__tuple, "settings", "")