Skip to content

Commit

Permalink
Merge branch 'develop' into liezl/handle-no-frame-selection-for-trail…
Browse files Browse the repository at this point in the history
…-overlay
  • Loading branch information
eberrigan authored Jul 1, 2024
2 parents 18c3658 + 436b177 commit 26214a1
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Please include information about how you installed.
- OS:
<!-- [e.g. ubuntu 20.04, macOS 11.0] -->
- Version(s):
<!-- e.g. [SLEAP v1.4.1a1, python 3.8] --->
<!-- e.g. [SLEAP v1.4.1a2, python 3.8] --->
- 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)
Expand Down
5 changes: 3 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
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:
# version_file = f.read()
# 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"
Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/gui.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
6 changes: 3 additions & 3 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,13 @@ SLEAP can be installed three different ways: via {ref}`conda package<condapackag
**Windows** and **Linux**

```bash
mamba create -y -n sleap -c conda-forge -c nvidia -c sleap -c anaconda sleap=1.4.1a1
mamba create -y -n sleap -c conda-forge -c nvidia -c sleap -c anaconda sleap=1.4.1a2
```

**Mac OS X** and **Apple Silicon**

```bash
mamba create -y -n sleap -c conda-forge -c anaconda -c sleap sleap=1.4.1a1
mamba create -y -n sleap -c conda-forge -c anaconda -c sleap sleap=1.4.1a2
```

**This is the recommended installation method**.
Expand Down Expand Up @@ -232,7 +232,7 @@ Although you do not need Mambaforge installed to perform a `pip install`, we rec
3. Finally, we can perform the `pip install`:

```bash
pip install sleap[pypi]==1.4.1a1
pip install sleap[pypi]==1.4.1a2
```

This works on **any OS except Apple silicon** and on **Google Colab**.
Expand Down
3 changes: 3 additions & 0 deletions sleap/gui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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"]

Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion sleap/gui/overlays/tracks.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,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):
Expand Down
4 changes: 4 additions & 0 deletions sleap/prefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions sleap/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
Must be a semver string, "aN" should be appended for alpha releases.
"""


__version__ = "1.4.1a1"
__version__ = "1.4.1a2"


def versions():
Expand Down

0 comments on commit 26214a1

Please sign in to comment.