Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLEAP 1.3.3 #1505

Merged
merged 6 commits into from
Sep 15, 2023
Merged

SLEAP 1.3.3 #1505

merged 6 commits into from
Sep 15, 2023

Conversation

roomrys
Copy link
Collaborator

@roomrys roomrys commented Sep 15, 2023

Description

Hotfix for 1.3.2 which had inadequate restrictions on the tensorflow dependencies for the sleap[pypi] extra. Also fixes an overlay issue and sets an environment variable upon activating the environment in conda packages for Linux.

Types of changes

  • Bugfix
  • New feature
  • Refactor / Code style update (no logical changes)
  • Build / CI changes
  • Documentation Update
  • Other (dependencies)

Does this address any currently open issues?

Outside contributors checklist

  • Review the guidelines for contributing to this repository
  • Read and sign the CLA and add yourself to the authors list
  • Make sure you are making a pull request against the develop branch (not main). Also you should start your branch off develop
  • Add tests that prove your fix is effective or that your feature works
  • Add necessary documentation (if appropriate)

Thank you for contributing to SLEAP!

❤️

Summary by CodeRabbit

  • New Feature: Switched to mamba package manager for faster environment creation in Conda.
  • Bug Fix: Added exception handling in sleap/gui/overlays/base.py to prevent runtime errors when removing items from the scene.
  • Documentation: Updated installation instructions and version numbers across various documentation files, including notebooks and markdown files.
  • Chore: Updated the SLEAP version to 1.3.3 across all relevant files.
  • Chore: Added shell scripts for setting and resetting library paths during environment activation and deactivation, improving GPU detection by TensorFlow on some systems.
  • Chore: Updated dependencies in pypi_requirements.txt for better compatibility and stability.

* Do not try to remove item if already deleted

* Lint
* Set LD_LIBRARY_PATH on mamba activate

* Rename libcudart_activate.sh to sleap_activate.sh in docs

* Remove comments from environment.yml
* Add version restrictions to tensorflow for pypi

* Get GUI working on Linux

* Add comments

* Get GUI working on Windows

* Get inference working on windows

* Restrict urllib3 range (non-blocking error in installation)

* Get training/inference working on linux minimal environment
* Add version restrictions to tensorflow for pypi

* Bump to 1.3.3

* Advise 1.3.3 pip install

* Get GUI working on Linux

* Get GUI working on Windows

* Get inference working on windows

* Restrict urllib3 range (non-blocking error in installation)

* Get training/inference working on linux minimal environment

* Put quotes around sleap install
@roomrys roomrys marked this pull request as ready for review September 15, 2023 23:16
@coderabbitai
Copy link

coderabbitai bot commented Sep 15, 2023

Walkthrough

This pull request primarily focuses on updating the SLEAP package from version 1.3.2 to 1.3.3 across various files, introducing mamba as a package manager, and improving error handling in the GUI. It also includes changes to handle TensorFlow 2.7+ detection issues and updates to dependencies.

Changes

File(s) Summary
.conda/README.md, .conda/build.sh, .conda/sleap_activate.sh, .conda/sleap_deactivate.sh Switched to mamba for package management and added scripts to manage library paths during environment activation/deactivation.
.github/ISSUE_TEMPLATE/bug_report.md, docs/conf.py, sleap/version.py Updated SLEAP version from 1.3.2 to 1.3.3.
docs/installation.md, docs/notebooks/*.ipynb Updated SLEAP installation instructions and commands across documentation and notebooks. Added instructions for handling TensorFlow 2.7+ detection issues.
pypi_requirements.txt Updated dependencies with version constraints and platform-specific requirements.
sleap/gui/overlays/base.py Improved error handling when removing items from the scene in the GUI.

🐇💻

With each update, we hop ahead,
Fixing bugs, improving code, full speed ahead.
Mamba now manages our packages neat,
And TensorFlow issues we can beat.
From 1.3.2 to 1.3.3 we leap,
Making strides with SLEAP so deep.
So here's to progress, swift and fine,
In the world of code, everything's divine! 🎉🥕


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • Mention @coderabbitai in any review comment for bot assistance.
  • Note: Review comments are made on code diffs or files, not on the PR overview.

Pause Incremental Reviews

  • Insert @coderabbitai: ignore in the PR description to halt the bot's ongoing reviews. Remove the line to resume.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 2

Commits Files that changed from the base of the PR and between e4fca4f and a2092f0 commits.
Files ignored due to filter (1)
  • environment.yml
Files selected for processing (17)
  • .conda/README.md (2 hunks)
  • .conda/build.sh (1 hunks)
  • .conda/sleap_activate.sh (1 hunks)
  • .conda/sleap_deactivate.sh (1 hunks)
  • .github/ISSUE_TEMPLATE/bug_report.md (1 hunks)
  • docs/conf.py (1 hunks)
  • docs/installation.md (2 hunks)
  • docs/notebooks/Data_structures.ipynb (1 hunks)
  • docs/notebooks/Interactive_and_realtime_inference.ipynb (1 hunks)
  • docs/notebooks/Interactive_and_resumable_training.ipynb (1 hunks)
  • docs/notebooks/Model_evaluation.ipynb (1 hunks)
  • docs/notebooks/Post_inference_tracking.ipynb (1 hunks)
  • docs/notebooks/Training_and_inference_on_an_example_dataset.ipynb (1 hunks)
  • docs/notebooks/Training_and_inference_using_Google_Drive.ipynb (1 hunks)
  • pypi_requirements.txt (1 hunks)
  • sleap/gui/overlays/base.py (2 hunks)
  • sleap/version.py (1 hunks)
Files skipped from review due to trivial changes (12)
  • .conda/README.md
  • .conda/build.sh
  • .conda/sleap_activate.sh
  • .conda/sleap_deactivate.sh
  • .github/ISSUE_TEMPLATE/bug_report.md
  • docs/conf.py
  • docs/installation.md
  • docs/notebooks/Post_inference_tracking.ipynb
  • docs/notebooks/Training_and_inference_on_an_example_dataset.ipynb
  • docs/notebooks/Training_and_inference_using_Google_Drive.ipynb
  • pypi_requirements.txt
  • sleap/version.py
Additional comments (Suppressed): 5
docs/notebooks/Interactive_and_realtime_inference.ipynb (1)
  • 63-63: The pip install command has been updated to ensure that at least version 1.3.3 of SLEAP is installed from PyPI. This change aligns with the PR's goal of updating the software package version.
docs/notebooks/Data_structures.ipynb (1)
  • 59-59: The pip installation command has been updated to install the latest version of SLEAP (at least version 1.3.3) from PyPI. Ensure that this version is available on PyPI and that it includes all the necessary dependencies for the software to function correctly.
docs/notebooks/Interactive_and_resumable_training.ipynb (1)
  • 64-65: The pip install command has been updated to ensure that at least version 1.3.3 of SLEAP is installed from PyPI. This change aligns with the PR's goal of updating the software package's version number.
docs/notebooks/Model_evaluation.ipynb (1)
  • 43-43: The pip install command has been updated to ensure that the latest version of SLEAP (at least version 1.3.3) is installed from PyPI. This change aligns with the PR's goal of updating the software package's version.
sleap/gui/overlays/base.py (1)
  • 76-77: This line ensures that the list of items is cleared after they have been removed from the scene. This is a good practice as it prevents attempts to interact with items that no longer exist in the scene.

Comment on lines 66 to 78
if self.items is None:
return
for item in self.items:
self.player.scene.removeItem(item)
try:
self.player.scene.removeItem(item)

except RuntimeError as e: # Internal C++ object (PySide2.QtWidgets.QGraphicsPathItem) already deleted.
logger.debug(e)
pass

# Stop tracking the items after they been removed from the scene
self.items = []

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new code introduces exception handling when removing items from the scene. This is a good practice as it prevents the program from crashing due to a RuntimeError. However, it's important to ensure that this doesn't mask other potential issues. The error message suggests that the issue arises when trying to remove an item that has already been deleted. If this happens frequently, it might indicate a problem with the logic of the program. Consider investigating why these errors are occurring and whether they can be prevented.

Comment on lines +69 to +74
try:
self.player.scene.removeItem(item)

except RuntimeError as e: # Internal C++ object (PySide2.QtWidgets.QGraphicsPathItem) already deleted.
logger.debug(e)
pass
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pass statement after logging the exception is redundant and can be removed. Python will automatically continue execution at the next statement after the except block.

-                pass

@roomrys roomrys merged commit f77af11 into main Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant