From 84290cb0508041c8e44659333e07d468fe742bf9 Mon Sep 17 00:00:00 2001 From: Liezl Maree <38435167+roomrys@users.noreply.github.com> Date: Wed, 11 Sep 2024 10:14:08 -0700 Subject: [PATCH 1/3] Add imageio dependencies for pypi wheel (#1950) Add imagio dependencies for pypi wheel Co-authored-by: roomrys --- pypi_requirements.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pypi_requirements.txt b/pypi_requirements.txt index 62c0c0ddc..ad34e2ad8 100644 --- a/pypi_requirements.txt +++ b/pypi_requirements.txt @@ -6,6 +6,8 @@ # These are also distributed through conda and not pip installed when using conda. attrs>=21.2.0,<=21.4.0 cattrs==1.1.1 +imageio +imageio-ffmpeg # certifi>=2017.4.17,<=2021.10.8 jsmin jsonpickle==1.2 From c090df3a33dc6426d5196055bf3c9d6180ba72e1 Mon Sep 17 00:00:00 2001 From: Liezl Maree <38435167+roomrys@users.noreply.github.com> Date: Wed, 11 Sep 2024 10:14:50 -0700 Subject: [PATCH 2/3] Do not always color skeletons table black (#1952) Co-authored-by: roomrys --- sleap/gui/dataviews.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/sleap/gui/dataviews.py b/sleap/gui/dataviews.py index 0a008bea7..f68dc0180 100644 --- a/sleap/gui/dataviews.py +++ b/sleap/gui/dataviews.py @@ -413,13 +413,6 @@ def set_item(self, item, key, value): elif key == "symmetry": self.context.setNodeSymmetry(skeleton=self.obj, node=item, symmetry=value) - def get_item_color(self, item: Any, key: str): - if self.skeleton: - color = self.context.app.color_manager.get_item_color( - item, parent_skeleton=self.skeleton - ) - return QtGui.QColor(*color) - class SkeletonEdgesTableModel(GenericTableModel): """Table model for skeleton edges.""" @@ -436,14 +429,6 @@ def object_to_items(self, skeleton: Skeleton): ] return items - def get_item_color(self, item: Any, key: str): - if self.skeleton: - edge_pair = (item["source"], item["destination"]) - color = self.context.app.color_manager.get_item_color( - edge_pair, parent_skeleton=self.skeleton - ) - return QtGui.QColor(*color) - class LabeledFrameTableModel(GenericTableModel): """Table model for listing instances in labeled frame. From e4bb4449ee4907f8315ef9f64511a7aaa0c79155 Mon Sep 17 00:00:00 2001 From: Liezl Maree <38435167+roomrys@users.noreply.github.com> Date: Wed, 11 Sep 2024 10:16:03 -0700 Subject: [PATCH 3/3] Remove no module named work error (#1956) * Do not always color skeletons table black * Remove offending (possibly unneeded) line that causes the no module named work error to print in terminal * Remove offending (possibly unneeded) line that causes the no module named work error to print in terminal * Remove accidentally added changes * Add (failing) test to ensure menu-item updates with state change * Reconnect callback for menu-item (using lambda) * Add (failing) test to ensure menu-item updates with state change Do not assume inital state * Reconnect callback for menu-item (using lambda) --------- Co-authored-by: roomrys --- sleap/gui/app.py | 4 +++- tests/gui/test_app.py | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/sleap/gui/app.py b/sleap/gui/app.py index 4c75dac3f..2dbceb3b7 100644 --- a/sleap/gui/app.py +++ b/sleap/gui/app.py @@ -377,7 +377,9 @@ def add_menu_item(menu, key: str, name: str, action: Callable): def connect_check(key): self._menu_actions[key].setCheckable(True) self._menu_actions[key].setChecked(self.state[key]) - self.state.connect(key, self._menu_actions[key].setChecked) + self.state.connect( + key, lambda checked: self._menu_actions[key].setChecked(checked) + ) # add checkable menu item connected to state variable def add_menu_check_item(menu, key: str, name: str): diff --git a/tests/gui/test_app.py b/tests/gui/test_app.py index 745989da1..def835b6e 100644 --- a/tests/gui/test_app.py +++ b/tests/gui/test_app.py @@ -414,6 +414,12 @@ def toggle_and_verify_visibility(expected_visibility: bool = True): window.showNormal() vp = window.player + # Change state and ensure menu-item check updates + color_predicted = window.state["color predicted"] + assert window._menu_actions["color predicted"].isChecked() == color_predicted + window.state["color predicted"] = not color_predicted + assert window._menu_actions["color predicted"].isChecked() == (not color_predicted) + # Enable distinct colors window.state["color predicted"] = True