-
Notifications
You must be signed in to change notification settings - Fork 18
Feature/auto detect format #77
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
base: main
Are you sure you want to change the base?
Feature/auto detect format #77
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #77 +/- ##
==========================================
+ Coverage 98.82% 98.99% +0.17%
==========================================
Files 5 5
Lines 255 299 +44
==========================================
+ Hits 252 296 +44
Misses 3 3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Hi @rajatkriplani, thanks for this! I approved the CI workflows now, would you mind having a look at the failed checks? Additionally, we usually open PRs separately for different features / issues, but I noticed in this PR the diff with Feel free to have a go, let me know if you get stuck at any point. |
47105b4
to
aacdbe8
Compare
Hi @sfmig I have improved the test coverage, still the following line are uncovered in except Exception as e: # Catch other potential file reading errors
raise ValueError(f"Could not read file {file_path}: {e}") from e for the above mocking is required, so should I go with |
Hi @rajatkriplani, Yes do have a go at using unittest.mock for this. You may find examples of its use in the Hope this helps! |
Also, do have a look at the docs building check which seems to be failing (alongside the code coverage checks) |
@sfmig I have done the mocking for some tests please have a look at it. |
Hello @sfmig |
Hello @sfmig just dropping a quick follow-up here since Zulip’s been a bit quiet — would love any further thoughts or feedback on this when you get a chance. |
Description
What is this PR
Why is this PR needed?
This PR aims to improve user experience by automatically detecting the format based on the file's content.
What does this PR do?
This PR introduces automatic detection for the format of input annotation files:
_detect_format
withinload_bboxes.py
from_files
function signature to make theformat
argument optional, defaulting"auto"
.format="auto"
success and failure scenarios.References
Closes #43
How has this PR been tested?
The code has been tested locally by running
pytest
. New unit tests have been added totests/test_unit/test_annotations/test_load_bboxes.py
Is this a breaking change?
No. This PR only adds a new, optional behavior (format="auto") as the default.
Does this PR require an update to the documentation?
Yes. The docstring for the
ethology.annotations.io.load_bboxes.from_files
functionChecklist: