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

Fix package export #1619

Merged
merged 1 commit into from
Dec 1, 2023
Merged

Fix package export #1619

merged 1 commit into from
Dec 1, 2023

Conversation

talmo
Copy link
Collaborator

@talmo talmo commented Nov 30, 2023

Description

In #1559, we switched up the format to use zero-padded, constant length byte strings for embedded PNG encoded images for .pkg.slp files.

Right now this throws an error when we export from labels that have videos without any labeled frames, as is common when generating splits or when there are only predictions in a given video (but not user labels).

This PR fixes that by checking for zero length videos during export.

Types of changes

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

Does this address any currently open issues?

[list open issues here]

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

  • Bug Fixes
    • Improved handling of empty frames in video processing to ensure accurate frame size calculations.

Copy link

coderabbitai bot commented Nov 30, 2023

Walkthrough

The update in the codebase involves a modification to the way maximum frame size is calculated in a video processing context. This change specifically addresses the handling of empty frames to ensure the calculation is robust. There were no changes to function signatures or other global elements, indicating a targeted fix without altering the API or system-wide data structures.

Changes

File(s) Summary
sleap/io/video.py Modified the calculation of max_frame_size to better handle empty frames.

🐇🎉
To frames once empty, a fix we bestow,
In the code where the video streams flow.
No signature changed, no structure dismayed,
Just a rabbit's touch to the frames displayed. 🎬🌟


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

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: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between cb82d36 and de5556f.
Files selected for processing (1)
  • sleap/io/video.py (1 hunks)
Additional comments: 1
sleap/io/video.py (1)
  • 1450-1457: The changes to calculate max_frame_size correctly handle the case of empty frames by checking for non-zero length before finding the maximum. This should prevent errors during the export process when dealing with videos that have no labeled frames.

Copy link

codecov bot commented Nov 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (cb82d36) 73.37% compared to head (de5556f) 73.38%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1619   +/-   ##
========================================
  Coverage    73.37%   73.38%           
========================================
  Files          134      134           
  Lines        24024    24024           
========================================
+ Hits         17628    17630    +2     
+ Misses        6396     6394    -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@talmo talmo merged commit 2d24296 into develop Dec 1, 2023
9 checks passed
@talmo talmo deleted the talmo/fix-export-pkg branch December 1, 2023 01:21
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