bootphon / abkhazia

ABX and kaldi experiments on speech corpora made easy
https://docs.cognitive-ml.fr/abkhazia
GNU General Public License v3.0
31 stars 6 forks source link

Fix zip usage for compatibility with python 3 #25

Open mxmpl opened 1 year ago

mxmpl commented 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.

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.

This PR fixes this by changing zip(...) to list(zip(...)).