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

Set default callable for match_lists_function #1520

Merged

Conversation

roomrys
Copy link
Collaborator

@roomrys roomrys commented Sep 28, 2023

Description

Set the default value for the argument match_lists_function to match_instance_lists_nodewise in the helper function matched_instance_distances (which is not used in the package code).

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?

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

  • Refactor: In sleap/info/metrics.py, the function matched_instance_distances has been repositioned and its default value for match_lists_function parameter has been updated to improve code readability and maintainability.
  • Test: Added new test function test_matched_instance_distances in tests/info/test_metrics.py. This function validates the accuracy of distance calculations between nodes in two sets of labels, enhancing the robustness of our testing suite.

@roomrys roomrys marked this pull request as ready for review September 28, 2023 20:59
@coderabbitai
Copy link

coderabbitai bot commented Sep 28, 2023

Walkthrough

The changes primarily focus on refactoring the sleap.info.metrics module and adding corresponding tests. The matched_instance_distances function has been updated, and its associated test cases have been added to ensure its correct functionality.

Changes

File Summary
sleap/info/metrics.py Moved matched_instance_distances function, changed its default parameter, and removed the script execution block.
tests/info/test_metrics.py Added test_matched_instance_distances function to calculate and assert mean distances between nodes in two sets of labels.

🐇💻

Code shuffled, tests unfurled,

In the realm of the digital world.

With each change, we refine,

Our software design so fine. 🎉


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

Commits Files that changed from the base of the PR and between 4100153 and f1b0be4.
Files selected for processing (2)
  • sleap/info/metrics.py (3 hunks)
  • tests/info/test_metrics.py (1 hunks)
Files skipped from review due to trivial changes (1)
  • sleap/info/metrics.py

tests/info/test_metrics.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Sep 28, 2023

Codecov Report

Merging #1520 (2c8fc45) into develop (4100153) will increase coverage by 0.27%.
The diff coverage is 91.30%.

@@             Coverage Diff             @@
##           develop    #1520      +/-   ##
===========================================
+ Coverage    73.11%   73.39%   +0.27%     
===========================================
  Files          134      134              
  Lines        23972    23961      -11     
===========================================
+ Hits         17528    17586      +58     
+ Misses        6444     6375      -69     
Files Coverage Δ
sleap/info/metrics.py 61.05% <91.30%> (+61.05%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

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

Commits Files that changed from the base of the PR and between f1b0be4 and 2c8fc45.
Files selected for processing (1)
  • tests/info/test_metrics.py (1 hunks)

tests/info/test_metrics.py Show resolved Hide resolved
@roomrys roomrys merged commit ed77b49 into develop Sep 29, 2023
9 checks passed
@roomrys roomrys deleted the liezl/default-callable-for-`match_instance_lists_nodewise` branch September 29, 2023 13:43
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.

2 participants