timmahrt / praatIO

A python library for working with praat, textgrids, time aligned audio transcripts, and audio files. It is primarily used for extracting features from and making manipulations on audio files given hierarchical time-aligned transcriptions (utterance > word > syllable > phone, etc).
MIT License
311 stars 33 forks source link

Incorrect Error Message /praatio/data_classes/interval_tier.py line 99 #56

Closed johannahom closed 11 months ago

johannahom commented 1 year ago

Hi there,

Very nice package. I just noticed one of the error messages is not informative for when intervals overlap. It prints out only one of the intervals twice:

for entry, nextEntry in zip(self.entries[0::], self.entries[1::]): if entry.end > nextEntry.start: raise errors.TextgridStateError( "Two intervals in the same tier overlap in time:\n" f"({entry.start}, {entry.end}, {entry.label}) and ({entry.start}, {entry.end}, {entry.label})" )

Should read:

for entry, nextEntry in zip(self.entries[0::], self.entries[1::]): if entry.end > nextEntry.start: raise errors.TextgridStateError( "Two intervals in the same tier overlap in time:\n" f"({entry.start}, {entry.end}, {entry.label}) and ({nextEntry.start}, {nextEntry.end}, {nextEntry.label})" )

timmahrt commented 1 year ago

Hello! Thank you for the bug report. I've made a bug fix https://github.com/timmahrt/praatIO/pull/57 and have already released it. If you update your praatio version you should see it fixed.

Please let me know if that works for you and if you have any other issues!

timmahrt commented 11 months ago

I'll close this issue for now. If you have related issues, feel free to reopen it. Thank you!