-
Notifications
You must be signed in to change notification settings - Fork 17
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
Rename and refactor recursive_stem
, add clearer error messages in vak/annotation.py
#566
Rename and refactor recursive_stem
, add clearer error messages in vak/annotation.py
#566
Conversation
- Rename `vak.annotation.recursive_stem` -> `audio_stem_from_path` Trying to convey that we are specifically looking for an audio filename, and then returning only its stem, while keeping function name concise. - Rename `annotation.source_annot_map` -> `map_annotated_to_annot`
- Add custom exception `AudioFilenameNotFound` - Have `audio_stem_from_path` raise this exception when it fails to find a valid audio format extension and then runs out of extensions to remove. The error clearly states that an audio filename was not found in the path, instead of short cryptic "unable to stem". - Have `map_annoted_to_annot` look for this custom exception in a try-except block when it first creates the keys for the map. If we catch an AudioFilenameNotFound exception, then we raise a verbose ValueError explaining what happened, including both `audio_path` and the path to the annotation itself, and a link to the file naming convention page added in #564 and to the how-to-user-annotation-format page.
Fix parameter names, rename variables to match
Note to self to give @sthaar and @@yangzheng-121 bugs + ideas credit for this one |
Codecov Report
@@ Coverage Diff @@
## main #566 +/- ##
=======================================
Coverage 93.09% 93.09%
=======================================
Files 65 65
Lines 2288 2288
=======================================
Hits 2130 2130
Misses 158 158
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@all-contributors please add @sthaar and @yangzheng-121 for bugs and ideas |
I've put up a pull request to add @sthaar! 🎉 |
@all-contributors please add @yangzheng-121 for bugs and ideas |
I've put up a pull request to add @yangzheng-121! 🎉 |
Fixes #525, addresses issues discussed in #523.