Repository navigation
Rename and refactor recursive_stem, add clearer error messages in vak/annotation.py - #566
Merged
NickleDave merged 3 commits intoAug 18, 2022
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
Collaborator
Author
|
Note to self to give @sthaar and @@yangzheng-121 bugs + ideas credit for this one |
4 tasks
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. |
Collaborator
Author
|
@all-contributors please add @sthaar and @yangzheng-121 for bugs and ideas |
Contributor
|
I've put up a pull request to add @sthaar! 🎉 |
Collaborator
Author
|
@all-contributors please add @yangzheng-121 for bugs and ideas |
Contributor
|
I've put up a pull request to add @yangzheng-121! 🎉 |
NickleDave
deleted the
rename-refactor-recursive-stem-add-clearer-error-message
branch
August 18, 2022 12:42
NickleDave
added a commit
that referenced
this pull request
Aug 19, 2022
Closed
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #525, addresses issues discussed in #523.