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

Allow reading pose model metadata from local folder #421

Merged
merged 12 commits into from
Oct 3, 2024
Merged

Conversation

glopesdev
Copy link
Contributor

@glopesdev glopesdev commented Sep 26, 2024

To improve the portability of datasets, we discussed in #418 a proposal for allowing model metadata to be included as sub-folders inside the dataset device stream rather than retrieved from CEPH.

This PR is an attempt at implementing a backwards-compatible solution to allow both shared CEPH and local model metadata folders. Essentially, the model_root parameter is treated as a fallback. When loading a pose file, the model_dir is extracted and a quick check is performed to see if the folder exists in the same path as the data. If it does, that local path is preferred, otherwise the shared model_root is searched as before.

Fixes #418
Fixes #419
Fixes #420

@coderabbitai: ignore

Summary by CodeRabbit

  • Bug Fix: Updated the read method to prioritize local path for model directory and implemented a fallback mechanism for loading model metadata.
  • Refactor: Simplified the conversion of class integers to strings in class_int2str function by using the provided list of classes directly, improving performance and maintainability.
  • Bug Fix: Enhanced the find_nested_key function to check if obj is not None before iterating over it, preventing potential errors.
  • Chore: Modified codecov.yml to avoid coverage targets blocking the pipeline.

@glopesdev glopesdev added feature New planned feature fix Pull request that fixes an issue labels Sep 26, 2024
Copy link

github-actions bot commented Sep 26, 2024

Image description CodeRabbit

Walkthrough

The proposed changes primarily focus on improving the logic and functionality of the codebase. The read method and class_int2str function have been updated to enhance model directory location and class conversion respectively. A fallback mechanism for loading model metadata has been implemented, and a dictionary is now used for mapping classes to identities. The find_nested_key function now includes a check for non-null objects. The CI job configuration has also been modified.

Changes

File Summary
aeon/io/reader.py Updated the read method to prioritize a local path for the model directory and implemented a fallback mechanism for loading model metadata from local folders if not found in the shared directory.
aeon/util.py Modified the class_int2str function to use the provided list of classes directly for conversion instead of reading from a config file. Introduced a dictionary for mapping classes to identities. Updated the find_nested_key function to include a check for non-null objects.
.github/workflows/build_env_run_tests.yml Changed the fail_ci_if_error setting from true to false, potentially impacting the behavior of the CI pipeline.

Uplevel your code reviews with CodeRabbit Pro

CodeRabbit Pro

If you like this project, please support us by purchasing the Pro version. The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, CodeRabbit Pro is free for open source projects.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 7812b4f and 25b7195 commits.
Files selected (2)
  • aeon/io/reader.py (3)
  • aeon/util.py (1)
Review comments generated (4)
  • Review: 3
  • LGTM: 1

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

aeon/util.py Show resolved Hide resolved
aeon/io/reader.py Outdated Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 25b7195 and f77ac1d commits.
Files selected (1)
  • aeon/io/reader.py (3)
Review comments generated (3)
  • Review: 2
  • LGTM: 1

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Image description CodeRabbit

Commits Files that changed from the base of the PR and between f77ac1d and ac2aa13 commits.
Files selected (1)
  • aeon/io/reader.py (3)
Review comments generated (3)
  • Review: 2
  • LGTM: 1

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

aeon/io/reader.py Outdated Show resolved Hide resolved
Copy link

codecov bot commented Sep 26, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 18.77%. Comparing base (7812b4f) to head (f925d75).
Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
aeon/io/reader.py 73.33% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #421      +/-   ##
==========================================
+ Coverage   15.81%   18.77%   +2.95%     
==========================================
  Files          37       37              
  Lines        3009     3009              
==========================================
+ Hits          476      565      +89     
+ Misses       2533     2444      -89     

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

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Image description CodeRabbit

Commits Files that changed from the base of the PR and between ac2aa13 and d30ee91 commits.
Files selected (1)
  • aeon/io/reader.py (3)
Review comments generated (3)
  • Review: 2
  • LGTM: 1

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

aeon/io/reader.py Outdated Show resolved Hide resolved
aeon/io/reader.py Outdated Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Image description CodeRabbit

Commits Files that changed from the base of the PR and between ac2aa13 and 2c8c91e commits.
Files selected (1)
  • aeon/io/reader.py (3)
Review comments generated (3)
  • Review: 2
  • LGTM: 1

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

aeon/io/reader.py Show resolved Hide resolved
aeon/io/reader.py Outdated Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Image description CodeRabbit

Commits Files that changed from the base of the PR and between ac2aa13 and 93428c8 commits.
Files selected (1)
  • aeon/io/reader.py (3)
Review comments generated (3)
  • Review: 2
  • LGTM: 1

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

aeon/io/reader.py Show resolved Hide resolved
aeon/io/reader.py Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 93428c8 and 43e895d commits.
Files selected (1)
  • .github/workflows/build_env_run_tests.yml (1)
Review comments generated (1)
  • Review: 1
  • LGTM: 0

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

aeon/io/reader.py Outdated Show resolved Hide resolved
@glopesdev glopesdev merged commit 83cd905 into main Oct 3, 2024
6 checks passed
@glopesdev glopesdev deleted the gl-issue-418 branch October 3, 2024 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New planned feature fix Pull request that fixes an issue
Projects
None yet
2 participants