Open mxmpl opened 1 year ago
In Python 3, zip returns an iterator and not a list as in Python 2: it exhausts once it has been iterated over.
zip
This behaviour causes issues in https://github.com/bootphon/abkhazia/blob/79632be7283cfc51805d15e4c84005708770bb6f/abkhazia/corpus/corpus_merge_wavs.py#L87-L89 as self.utts is defined in https://github.com/bootphon/abkhazia/blob/79632be7283cfc51805d15e4c84005708770bb6f/abkhazia/corpus/corpus_merge_wavs.py#L61 For the first spkr, spk_utts is correct, but for the next ones it is an empty list as self.utts is exhausted.
self.utts
spkr
spk_utts
This PR fixes this by changing zip(...) to list(zip(...)).
zip(...)
list(zip(...))
In Python 3,
zip
returns an iterator and not a list as in Python 2: it exhausts once it has been iterated over.This behaviour causes issues in https://github.com/bootphon/abkhazia/blob/79632be7283cfc51805d15e4c84005708770bb6f/abkhazia/corpus/corpus_merge_wavs.py#L87-L89 as
self.utts
is defined in https://github.com/bootphon/abkhazia/blob/79632be7283cfc51805d15e4c84005708770bb6f/abkhazia/corpus/corpus_merge_wavs.py#L61 For the firstspkr
,spk_utts
is correct, but for the next ones it is an empty list asself.utts
is exhausted.This PR fixes this by changing
zip(...)
tolist(zip(...))
.