Skip to content

Commit

Permalink
Merge branch 'develop' into elise/multiple-inputs-for-sleap-track
Browse files Browse the repository at this point in the history
  • Loading branch information
emdavis02 committed Jul 10, 2024
2 parents be02a7d + 14c21b4 commit 2fd8ab9
Show file tree
Hide file tree
Showing 52 changed files with 752 additions and 180 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.3.3, 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
49 changes: 25 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,32 @@ jobs:
include:
# Use this condarc as default
- condarc: .conda/condarc.yaml
- pyver: "3.7"
# Use special condarc if macos
- os: "macos-14"
condarc: .conda_mac/condarc.yaml
pyver: "3.9"
steps:
# Setup
- uses: actions/checkout@v2
- name: Cache conda
uses: actions/cache@v1
env:
# Increase this value to reset cache if environment_build.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment_build.yml', 'requirements.txt') }}
- name: Checkout
uses: actions/checkout@v4

- name: Setup Miniconda
# https://github.com/conda-incubator/setup-miniconda
uses: conda-incubator/setup-miniconda@v2.0.1
uses: conda-incubator/setup-miniconda@v3.0.3
with:
python-version: 3.7
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
environment-file: environment_build.yml
miniforge-version: latest
condarc-file: ${{ matrix.condarc }}
python-version: ${{ matrix.pyver }}
environment-file: environment_build.yml
activate-environment: sleap_ci
conda-solver: "libmamba"

- name: Print environment info
shell: bash -l {0}
run: |
which python
conda info
conda list
# Build pip wheel (Ubuntu)
- name: Build pip wheel (Ubuntu)
Expand All @@ -69,20 +67,23 @@ jobs:
shell: bash -l {0}
run: |
conda build .conda --output-folder build
echo "BUILD_PATH=$(pwd)/build" >> "$GITHUB_ENV"
# Build conda package (Windows)
# Build conda package (Windows)
- name: Build conda package (Windows)
if: matrix.os == 'windows-2022'
shell: powershell
run: |
conda build .conda --output-folder build
echo "BUILD_PATH=\$(pwd)\build" >> "$env:GITHUB_ENV"
# Build conda package (Mac)
- name: Build conda package (Mac)
if: matrix.os == 'macos-14'
shell: bash -l {0}
run: |
conda build .conda_mac --output-folder build
echo "BUILD_PATH=$(pwd)/build" >> "$GITHUB_ENV"
# Test built conda package (Ubuntu and Windows)
- name: Test built conda package (Ubuntu and Windows)
Expand All @@ -91,7 +92,7 @@ jobs:
run: |
echo "Current build path: $BUILD_PATH"
conda deactivate
echo "Python executable before activating environment:"
which python
echo "Python version before activating environment:"
Expand All @@ -113,7 +114,7 @@ jobs:
conda list
echo "List of installed pip packages in the sleap_test environment:"
pip list
echo "Testing sleap package installation..."
sleap_version=$(python -c "import sleap; print(sleap.__version__)")
echo "Test completed using sleap version: $sleap_version"
Expand All @@ -125,18 +126,18 @@ jobs:
run: |
echo "Current build path: $BUILD_PATH"
conda deactivate
echo "Python executable before activating environment:"
which python
echo "Python version before activating environment:"
python --version
echo "Conda info before activating environment:"
conda info
echo "Creating and testing conda environment with sleap package..."
conda create -y -n sleap_test -c file://$BUILD_PATH -c conda-forge -c anaconda sleap
conda activate sleap_test
echo "Python executable after activating sleap_test environment:"
which python
echo "Python version after activating sleap_test environment:"
Expand All @@ -147,7 +148,7 @@ jobs:
conda list
echo "List of installed pip packages in the sleap_test environment:"
pip list
echo "Testing sleap package installation..."
sleap_version=$(python -c "import sleap; print(sleap.__version__)")
echo "Test completed using sleap version: $sleap_version"
Expand All @@ -163,7 +164,7 @@ jobs:
# Login to conda (Windows)
- name: Login to Anaconda (Windows)
if: matrix.os == 'windows-2019'
if: matrix.os == 'windows-2022'
env:
ANACONDA_LOGIN: ${{ secrets.ANACONDA_LOGIN }}
shell: powershell
Expand All @@ -181,12 +182,12 @@ jobs:
# Upload conda package (Windows)
- name: Upload conda package (Windows/main)
if: matrix.os == 'windows-2019' && !github.event.release.prerelease
if: matrix.os == 'windows-2022' && !github.event.release.prerelease
shell: powershell
run: |
anaconda -v upload "build\win-64\*.tar.bz2"
- name: Upload conda package (Windows/dev)
if: matrix.os == 'windows-2019' && github.event.release.prerelease
if: matrix.os == 'windows-2022' && github.event.release.prerelease
shell: powershell
run: |
anaconda -v upload "build\win-64\*.tar.bz2" --label dev
Expand Down
23 changes: 7 additions & 16 deletions .github/workflows/build_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,8 @@ jobs:
- pyver: "3.7"
steps:
# Setup
- uses: actions/checkout@v2

- name: Cache conda
uses: actions/cache@v1
env:
# Increase this value to reset cache if environment_build.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment_build.yml', 'pyproject.toml') }}
- name: Checkout
uses: actions/checkout@v4

- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3.0.3
Expand All @@ -49,7 +41,6 @@ jobs:
environment-file: environment_build.yml
activate-environment: sleap_ci
conda-solver: "libmamba"
# use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!

- name: Print build environment info
shell: bash -l {0}
Expand All @@ -66,7 +57,7 @@ jobs:
# Upload artifact "tests" can use it
- name: Upload wheel artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.wheel_name }}
path: dist/*.whl
Expand Down Expand Up @@ -111,16 +102,16 @@ jobs:

steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.pyver }}

# Download wheel
- name: Download wheel artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
id: download
with:
name: ${{ matrix.wheel_name }}
Expand Down
28 changes: 10 additions & 18 deletions .github/workflows/build_manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,8 @@ jobs:
pyver: "3.9"
steps:
# Setup
- uses: actions/checkout@v2
- name: Cache conda
uses: actions/cache@v1
env:
# Increase this value to reset cache if environment_build.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment_build.yml', 'requirements.txt') }}
- name: Checkout
uses: actions/checkout@v4

- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3.0.3
Expand All @@ -51,7 +44,6 @@ jobs:
environment-file: environment_build.yml
activate-environment: sleap_ci
conda-solver: "libmamba"
# use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!

- name: Print environment info
shell: bash -l {0}
Expand All @@ -67,14 +59,14 @@ jobs:
run: |
python setup.py bdist_wheel
# Upload pip wheel (Ubuntu)
- name: Upload pip wheel (Ubuntu)
if: matrix.os == 'ubuntu-22.04'
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
shell: bash -l {0}
run: |
twine upload -u __token__ -p "$PYPI_TOKEN" dist/* --non-interactive --skip-existing --disable-progress-bar
# # Upload pip wheel (Ubuntu)
# - name: Upload pip wheel (Ubuntu)
# if: matrix.os == 'ubuntu-22.04'
# env:
# PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
# shell: bash -l {0}
# run: |
# twine upload -u __token__ -p "$PYPI_TOKEN" dist/* --non-interactive --skip-existing --disable-progress-bar

# Build conda package (Ubuntu)
- name: Build conda package (Ubuntu)
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ jobs:
runs-on: "ubuntu-22.04"
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Python 3.7
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.7
- name: Install Dependencies
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:

steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Conda
uses: conda-incubator/setup-miniconda@v3.0.3
Expand Down
24 changes: 10 additions & 14 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
# 'main' triggers updates to 'sleap.ai', all others to 'sleap.ai/develop'
- main
- develop
- liezl/add-abl-2023-workshop-link
- fakebranch
paths:
- "docs/**"
- "README.rst"
Expand All @@ -20,21 +20,13 @@ jobs:
steps:
# Setup
- name: Checkout
uses: actions/checkout@v2
- name: Cache conda
uses: actions/cache@v1
env:
# Increase this value to reset cache if environment_build.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment_build.yml', 'requirements.txt') }}
uses: actions/checkout@v4

- name: Setup Miniconda
# https://github.com/conda-incubator/setup-miniconda
uses: conda-incubator/setup-miniconda@v2.0.1
uses: conda-incubator/setup-miniconda@v3.0.3
with:
python-version: 3.7
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
environment-file: environment_no_cuda.yml
activate-environment: sleap_ci
- name: Print environment info
Expand All @@ -44,14 +36,18 @@ jobs:
conda info
- name: Build
# """Could not import extension myst_nb (exception: lxml.html.clean module is now
# a separate project lxml_html_clean. Install lxml[html_clean] or
# lxml_html_clean directly.)"""
shell: bash -l {0}
run: |
pip install lxml[html_clean]
cd docs
python make_api_doctree.py
make html
- name: Deploy (sleap.ai)
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -60,7 +56,7 @@ jobs:
keep_files: true

- name: Deploy (test)
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
if: github.ref != 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
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.3.3"
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.3.3"
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
6 changes: 4 additions & 2 deletions docs/guides/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ optional arguments:

```none
usage: sleap-train [-h] [--video-paths VIDEO_PATHS] [--val_labels VAL_LABELS]
[--test_labels TEST_LABELS] [--tensorboard] [--save_viz]
[--zmq] [--run_name RUN_NAME] [--prefix PREFIX]
[--test_labels TEST_LABELS] [--tensorboard] [--save_viz]
[--keep_viz] [--zmq] [--run_name RUN_NAME] [--prefix PREFIX]
[--suffix SUFFIX]
training_job_path [labels_path]
Expand Down Expand Up @@ -68,6 +68,8 @@ optional arguments:
--save_viz Enable saving of prediction visualizations to the run
folder if not already specified in the training job
config.
--keep_viz Keep prediction visualization images in the run
folder after training if --save_viz is enabled.
--zmq Enable ZMQ logging (for GUI) if not already specified
in the training job config.
--run_name RUN_NAME Run name to use when saving file, overrides other run
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
Loading

0 comments on commit 2fd8ab9

Please sign in to comment.