-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
necessary after renaming the package to `birdsong-recognition-dataset` and the module to `birdsongrec` - switch dependency and rename entry point in pyproject.toml - update poetry.lock - rename crowsetta/koumura.py -> crowsetta/birdsongrec.py - fix tests after renaming
- Loading branch information
1 parent
5bacc97
commit de1a7de
Showing
7 changed files
with
231 additions
and
192 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
from . import ( | ||
csv, | ||
formats, | ||
koumura, | ||
birdsongrec, | ||
notmat, | ||
phn, | ||
textgrid, | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
"""test functions in birdsongrec module""" | ||
import csv | ||
|
||
import crowsetta | ||
|
||
|
||
def test_birdsongrec2annot(birdsong_rec_xml_file, | ||
birdsong_rec_wavpath): | ||
annots = crowsetta.birdsongrec.birdsongrec2annot(annot_path=birdsong_rec_xml_file, | ||
concat_seqs_into_songs=True, | ||
wavpath=birdsong_rec_wavpath) | ||
assert isinstance(annots, list) | ||
assert all([type(annot) == crowsetta.Annotation for annot in annots]) | ||
|
||
|
||
def test_birdsongrec2csv(tmp_path, | ||
birdsong_rec_xml_file, | ||
birdsong_rec_wavpath): | ||
# since birdsongrec2csv is basically a wrapper around | ||
# birdsongrec2seq and seq2csv, | ||
# and those are tested above and in other test modules, | ||
# here just need to make sure this function doesn't fail | ||
csv_filename = tmp_path / 'test.csv' | ||
crowsetta.birdsongrec.birdsongrec2csv(annot_path=birdsong_rec_xml_file, | ||
wavpath=birdsong_rec_wavpath, | ||
csv_filename=csv_filename, | ||
basename=True) | ||
# make sure file was created | ||
assert csv_filename.exists() | ||
|
||
# to be extra sure, make sure all .wav files filenames from are in csv | ||
filenames_from_csv = [] | ||
with open(csv_filename, 'r', newline='') as csvfile: | ||
reader = csv.DictReader(csvfile) | ||
header = next(reader) | ||
for row in reader: | ||
filenames_from_csv.append(row['audio_path']) | ||
|
||
wav_list = sorted(birdsong_rec_wavpath.glob('*.wav')) | ||
wav_list = [wav_file.name for wav_file in wav_list] | ||
for wav_file in wav_list: | ||
assert(wav_file in filenames_from_csv) |
This file was deleted.
Oops, something went wrong.
This file contains 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