From 05283629a67385f40a6e8302519393fb2f87ecfb Mon Sep 17 00:00:00 2001 From: Elizabeth <106755962+eberrigan@users.noreply.github.com> Date: Fri, 28 Jun 2024 10:32:35 -0500 Subject: [PATCH 1/2] Bump to v1.4.1a2 (#1835) bump to 1.4.1a2 --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- docs/conf.py | 5 +++-- docs/installation.md | 6 +++--- sleap/version.py | 3 +-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index c0fdb26ca..108c2a65e 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -28,7 +28,7 @@ Please include information about how you installed. - OS: - Version(s): - + - SLEAP installation method (listed [here](https://sleap.ai/installation.html#)): - [ ] [Conda from package](https://sleap.ai/installation.html#conda-package) - [ ] [Conda from source](https://sleap.ai/installation.html#conda-from-source) diff --git a/docs/conf.py b/docs/conf.py index d8470a190..6cd9593ef 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -28,7 +28,7 @@ copyright = f"2019–{date.today().year}, Talmo Lab" # The short X.Y version -version = "1.4.1a1" +version = "1.4.1a2" # Get the sleap version # with open("../sleap/version.py") as f: @@ -36,7 +36,7 @@ # version = re.search("\d.+(?=['\"])", version_file).group(0) # Release should be the full branch name -release = "v1.4.1a1" +release = "v1.4.1a2" html_title = f"SLEAP ({release})" html_short_title = "SLEAP" @@ -85,6 +85,7 @@ pygments_style = "sphinx" pygments_dark_style = "monokai" + # Autosummary linkcode resolution # https://www.sphinx-doc.org/en/master/usage/extensions/linkcode.html def linkcode_resolve(domain, info): diff --git a/docs/installation.md b/docs/installation.md index dcb233904..c0ab66580 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -137,13 +137,13 @@ SLEAP can be installed three different ways: via {ref}`conda package Date: Fri, 28 Jun 2024 10:51:50 -0700 Subject: [PATCH 2/2] Updated trail length viewing options (#1822) * updated trail length optptions * Updated trail length options in the view menu * Updated `prefs` to include length info from `preferences.yaml` * Added trail length as method of `MainWindow` * Updated trail length documentation * black formatting --------- Co-authored-by: Keya Loding --- docs/guides/gui.md | 2 +- sleap/gui/app.py | 3 +++ sleap/gui/overlays/tracks.py | 4 +++- sleap/prefs.py | 4 ++++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/guides/gui.md b/docs/guides/gui.md index 88cf3f656..813ed68fa 100644 --- a/docs/guides/gui.md +++ b/docs/guides/gui.md @@ -60,7 +60,7 @@ Note that many of the menu command have keyboard shortcuts which can be configur "**Edge Style**" controls whether edges are drawn as thin lines or as wedges which indicate the {ref}`orientation` of the instance (as well as the direction of the part affinity field which would be used to predict the connection between nodes when using a "bottom-up" approach). -"**Trail Length**" allows you to show a trail of where each instance was located in prior frames (the length of the trail is the number of prior frames). This can be useful when proofreading predictions since it can help you detect swaps in the identities of animals across frames. +"**Trail Length**" allows you to show a trail of where each instance was located in prior frames (the length of the trail is the number of prior frames). This can be useful when proofreading predictions since it can help you detect swaps in the identities of animals across frames. By default, you can only select trail lengths of up to 250 frames. You can use a custom trail length by modifying the default length in the `preferences.yaml` file. However, using trail lengths longer than about 500 frames can result in significant lag. "**Fit Instances to View**" allows you to toggle whether the view is auto-zoomed to the instances in each frame. This can be useful when proofreading predictions. diff --git a/sleap/gui/app.py b/sleap/gui/app.py index becc1d83a..736d7207f 100644 --- a/sleap/gui/app.py +++ b/sleap/gui/app.py @@ -151,6 +151,7 @@ def __init__( self.state["edge style"] = prefs["edge style"] self.state["fit"] = False self.state["color predicted"] = prefs["color predicted"] + self.state["trail_length"] = prefs["trail length"] self.state["trail_shade"] = prefs["trail shade"] self.state["marker size"] = prefs["marker size"] self.state["propagate track labels"] = prefs["propagate track labels"] @@ -221,6 +222,7 @@ def closeEvent(self, event): prefs["edge style"] = self.state["edge style"] prefs["propagate track labels"] = self.state["propagate track labels"] prefs["color predicted"] = self.state["color predicted"] + prefs["trail length"] = self.state["trail_length"] prefs["trail shade"] = self.state["trail_shade"] prefs["share usage data"] = self.state["share usage data"] @@ -1025,6 +1027,7 @@ def _load_overlays(self): labels=self.labels, player=self.player, trail_shade=self.state["trail_shade"], + trail_length=self.state["trail_length"], ) self.overlays["instance"] = InstanceOverlay( labels=self.labels, player=self.player, state=self.state diff --git a/sleap/gui/overlays/tracks.py b/sleap/gui/overlays/tracks.py index 361585719..bf0b633cd 100644 --- a/sleap/gui/overlays/tracks.py +++ b/sleap/gui/overlays/tracks.py @@ -48,7 +48,9 @@ def __attrs_post_init__(self): @classmethod def get_length_options(cls): - return (0, 10, 50, 100, 250) + if prefs["trail length"] != 0: + return (0, 10, 50, 100, 250, 500, prefs["trail length"]) + return (0, 10, 50, 100, 250, 500) @classmethod def get_shade_options(cls): diff --git a/sleap/prefs.py b/sleap/prefs.py index 3d5a2113e..8790f1d3f 100644 --- a/sleap/prefs.py +++ b/sleap/prefs.py @@ -45,6 +45,10 @@ def load_(self): self._prefs = util.get_config_yaml(self._filename) if not hasattr(self._prefs, "get"): self._prefs = self._defaults + else: + self._prefs["trail length"] = self._prefs.get( + "trail length", self._defaults["trail length"] + ) except FileNotFoundError: self._prefs = self._defaults