From fc78d46da88574865aeb87bbe717584f134e754f Mon Sep 17 00:00:00 2001 From: Micah Woodard Date: Mon, 16 Dec 2024 13:18:59 -0800 Subject: [PATCH 1/8] resetting shadding --- src/foraging_gui/bias_indicator.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/foraging_gui/bias_indicator.py b/src/foraging_gui/bias_indicator.py index 7f2015d3b..a11484abc 100644 --- a/src/foraging_gui/bias_indicator.py +++ b/src/foraging_gui/bias_indicator.py @@ -231,6 +231,8 @@ def clear(self): # reset bias list self._biases = [] # reset upper and lower ci + self._upper_scatter_item = PlotDataItem([0], [0], pen='lightgray') + self._lower_scatter_item = PlotDataItem([0], [0], pen='lightgray') self.bias_plot.addItem(self._upper_scatter_item) self.bias_plot.addItem(self._lower_scatter_item) self.bias_plot.addItem(FillBetweenItem(curve1=self._upper_scatter_item, From 06b26e4398dffe76d7c82535067f8f924b5adb56 Mon Sep 17 00:00:00 2001 From: Micah Woodard Date: Mon, 16 Dec 2024 14:28:15 -0800 Subject: [PATCH 2/8] index eperimenter list --- src/foraging_gui/Foraging.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/foraging_gui/Foraging.py b/src/foraging_gui/Foraging.py index 544a23a99..5ed0175f4 100644 --- a/src/foraging_gui/Foraging.py +++ b/src/foraging_gui/Foraging.py @@ -2987,7 +2987,7 @@ def _Open(self,open_last = False,input_file = ''): # list of mice, experimenters, and two week in chronological order form date modified mice, experimenters, two_week = self._Open_getListOfMice() # only add mice from two weeks in drop down. - W = MouseSelectorDialog(self, [m + ' ' + n for m, n in zip(two_week, experimenters)]) + W = MouseSelectorDialog(self, [m + ' ' + experimenters[mice.index(m)] for m in two_week]) ok, info = ( W.exec_() == QtWidgets.QDialog.Accepted, From 97b329e7bfa6188f570ccb8c6e2d91f6385295bf Mon Sep 17 00:00:00 2001 From: Micah Woodard Date: Mon, 16 Dec 2024 15:16:42 -0800 Subject: [PATCH 3/8] add print to debug --- src/foraging_gui/Foraging.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/foraging_gui/Foraging.py b/src/foraging_gui/Foraging.py index 5ed0175f4..a72a739ee 100644 --- a/src/foraging_gui/Foraging.py +++ b/src/foraging_gui/Foraging.py @@ -2987,6 +2987,8 @@ def _Open(self,open_last = False,input_file = ''): # list of mice, experimenters, and two week in chronological order form date modified mice, experimenters, two_week = self._Open_getListOfMice() # only add mice from two weeks in drop down. + print(mice) + print(m) W = MouseSelectorDialog(self, [m + ' ' + experimenters[mice.index(m)] for m in two_week]) ok, info = ( From 257ed804985e72c3fc4a088be4e69089903c7b4c Mon Sep 17 00:00:00 2001 From: Micah Woodard Date: Mon, 16 Dec 2024 15:17:20 -0800 Subject: [PATCH 4/8] print list --- src/foraging_gui/Foraging.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/foraging_gui/Foraging.py b/src/foraging_gui/Foraging.py index a72a739ee..c0b58872b 100644 --- a/src/foraging_gui/Foraging.py +++ b/src/foraging_gui/Foraging.py @@ -2988,7 +2988,7 @@ def _Open(self,open_last = False,input_file = ''): mice, experimenters, two_week = self._Open_getListOfMice() # only add mice from two weeks in drop down. print(mice) - print(m) + print(two_week) W = MouseSelectorDialog(self, [m + ' ' + experimenters[mice.index(m)] for m in two_week]) ok, info = ( From 9cb0173bd142c69364512ee56ff4e543d161e160 Mon Sep 17 00:00:00 2001 From: Micah Woodard Date: Mon, 16 Dec 2024 15:21:03 -0800 Subject: [PATCH 5/8] add print --- src/foraging_gui/Foraging.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/foraging_gui/Foraging.py b/src/foraging_gui/Foraging.py index c0b58872b..c5740536e 100644 --- a/src/foraging_gui/Foraging.py +++ b/src/foraging_gui/Foraging.py @@ -2961,6 +2961,8 @@ def _Open_getListOfMice(self): mouse_dirs.sort(reverse=True, key=lambda x: os.path.getmtime(os.path.join(filepath, x))) # in order of date modified dates = [datetime.fromtimestamp(os.path.getmtime(os.path.join(filepath, path))) for path in mouse_dirs] two_week = [mouse_dir for mouse_dir, mod_date in zip(mouse_dirs, dates) if (now-mod_date).days <= 14] + print(mouse_dirs) + print(two_week) mice = [] experimenters = [] for m in mouse_dirs: @@ -2976,6 +2978,7 @@ def _Open_getListOfMice(self): mice.append(m) experimenters.append(name) break + print(mice) return mice, experimenters, two_week def _Open(self,open_last = False,input_file = ''): From f010103ccd16dedd42de5221a0b8f9c7dd4b5d8b Mon Sep 17 00:00:00 2001 From: Micah Woodard Date: Mon, 16 Dec 2024 15:22:43 -0800 Subject: [PATCH 6/8] change where two week is created --- src/foraging_gui/Foraging.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/foraging_gui/Foraging.py b/src/foraging_gui/Foraging.py index c5740536e..74f5fd430 100644 --- a/src/foraging_gui/Foraging.py +++ b/src/foraging_gui/Foraging.py @@ -2959,10 +2959,6 @@ def _Open_getListOfMice(self): now = datetime.now() mouse_dirs = os.listdir(filepath) mouse_dirs.sort(reverse=True, key=lambda x: os.path.getmtime(os.path.join(filepath, x))) # in order of date modified - dates = [datetime.fromtimestamp(os.path.getmtime(os.path.join(filepath, path))) for path in mouse_dirs] - two_week = [mouse_dir for mouse_dir, mod_date in zip(mouse_dirs, dates) if (now-mod_date).days <= 14] - print(mouse_dirs) - print(two_week) mice = [] experimenters = [] for m in mouse_dirs: @@ -2978,7 +2974,8 @@ def _Open_getListOfMice(self): mice.append(m) experimenters.append(name) break - print(mice) + dates = [datetime.fromtimestamp(os.path.getmtime(os.path.join(filepath, path))) for path in mouse_dirs] + two_week = [mouse_dir for mouse_dir, mod_date in zip(mouse_dirs, dates) if (now - mod_date).days <= 14] return mice, experimenters, two_week def _Open(self,open_last = False,input_file = ''): From b048ec906dfc486f0060e1c2c8824b2539495401 Mon Sep 17 00:00:00 2001 From: Micah Woodard Date: Mon, 16 Dec 2024 15:25:24 -0800 Subject: [PATCH 7/8] iterating through mice list --- src/foraging_gui/Foraging.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/foraging_gui/Foraging.py b/src/foraging_gui/Foraging.py index 74f5fd430..58796802f 100644 --- a/src/foraging_gui/Foraging.py +++ b/src/foraging_gui/Foraging.py @@ -2975,7 +2975,7 @@ def _Open_getListOfMice(self): experimenters.append(name) break dates = [datetime.fromtimestamp(os.path.getmtime(os.path.join(filepath, path))) for path in mouse_dirs] - two_week = [mouse_dir for mouse_dir, mod_date in zip(mouse_dirs, dates) if (now - mod_date).days <= 14] + two_week = [mouse_dir for mouse_dir, mod_date in zip(mice, dates) if (now - mod_date).days <= 14] return mice, experimenters, two_week def _Open(self,open_last = False,input_file = ''): From 398cc81f1aa7c7d174b9f78e8070e86eaeb7bbb6 Mon Sep 17 00:00:00 2001 From: Micah Woodard Date: Mon, 16 Dec 2024 16:02:11 -0800 Subject: [PATCH 8/8] removing print --- src/foraging_gui/Foraging.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/foraging_gui/Foraging.py b/src/foraging_gui/Foraging.py index 58796802f..52d6df42a 100644 --- a/src/foraging_gui/Foraging.py +++ b/src/foraging_gui/Foraging.py @@ -2987,8 +2987,6 @@ def _Open(self,open_last = False,input_file = ''): # list of mice, experimenters, and two week in chronological order form date modified mice, experimenters, two_week = self._Open_getListOfMice() # only add mice from two weeks in drop down. - print(mice) - print(two_week) W = MouseSelectorDialog(self, [m + ' ' + experimenters[mice.index(m)] for m in two_week]) ok, info = (