Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Update textgrid.py #40

Merged
merged 2 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ def test_interval_containing(self):
self.foo.add(2.0, 2.5, 'baz')

self.assertEqual(repr(self.foo.intervalContaining(2.25)), 'Interval(2.0, 2.5, baz)')
self.assertEqual(repr(self.foo.intervalContaining(0.5)), 'Interval(0.0, 1.0, bar)')

def test_add_too_late(self):
foo = textgrid.textgrid.IntervalTier('foo', maxTime=3.5)
Expand Down Expand Up @@ -577,4 +578,4 @@ def test_read_long(self):


if __name__ == '__main__':
unittest.main()
unittest.main()
2 changes: 1 addition & 1 deletion textgrid/textgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ def intervalContaining(self, time):
can be a numeric type, or a Point object.
"""
i = self.indexContaining(time)
if i:
if i is not None:
return self.intervals[i]

def read(self, f, round_digits=DEFAULT_TEXTGRID_PRECISION):
Expand Down