Skip to content

Allow different mapping from annotations to annotated files - #572

Merged
NickleDave merged 11 commits into
mainfrom
allow-difft-audio-annot-mapping
Aug 29, 2022
Merged

NickleDave merged 11 commits into
mainfrom
allow-difft-audio-annot-mapping

Conversation

@NickleDave

Copy link
Copy Markdown
Collaborator

Adds the simpler way of mapping from annotations to annotated: by simply replacing the annotation extension with the extension of the annotated file.
We check for both ways: the original way, including the source audio file, and this new way.

Fixes #563

Removes repeated `if annot_list` code block
inside `audio.to_spect` function.

There were two places that check if there's a list of
annotations, and then call `map_annotated_to_annot`,
to map the annotation to `audio_files`.

The first in the `if audio_files` code block,
and the second in the `if audio_dir` code block
right under the first.

But after both code blocks we end up with a list of
`audio_files`.
So we can just wait until after and then check `if annot_list`
and (if there is an `annot_list`)
finally call `map_annotated_to_annot`.
This commit changes the function to do so.
Step towards allowing a different mapping
from annotation files to annotated, by
removed the annotations extension
and replacing with the annotated.

Split 'map_annotated_to_annot' into two helper functions.

Also add type annotations.
- Add fixtures for TextGrid annotations
- Add fixtures for 'simple-seq' annotations
- Add links to howto_prep_annotate
  + at top of page and in middle,
    linking to "how vak associates annotations with
    files they annotate"
- Fix formatting of file extension + library names
to explain the two valid ways of naming
derived files with one-to-one mappings
from audio file to derived file,
i.e., some annotation file formats
and array files containing spectrograms.
Revise file naming convention section,
and add link there to updated
page on naming conventions.
@codecov-commenter

codecov-commenter commented Aug 28, 2022 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.68421% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.94%. Comparing base (36c2cd0) to head (a2b55a7).
⚠️ Report is 321 commits behind head on main.

Files with missing lines Patch % Lines
tests/test_annotation.py 97.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #572      +/-   ##
==========================================
- Coverage   92.98%   92.94%   -0.05%     
==========================================
  Files          65       65              
  Lines        2295     2367      +72     
==========================================
+ Hits         2134     2200      +66     
- Misses        161      167       +6     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@NickleDave
NickleDave merged commit 5f5b8f4 into main Aug 29, 2022
@NickleDave
NickleDave deleted the allow-difft-audio-annot-mapping branch August 29, 2022 01:30
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.

ENH: allow and check for "annotated file = annotation file - annot ext + annotated format ext"

2 participants