# Path: praatio/textgrid.py
# def openTextgrid(
#     fnFullPath: str,
#     includeEmptyIntervals: bool,
#     reportingMode: Literal["silence", "warning", "error"] = "warning",
#     duplicateNamesMode: Literal["error", "rename"] = "error",
# ) -> Textgrid:
# def _dictionaryToTg(
#     tgAsDict: dict, reportingMode: Literal["silence", "warning", "error"]
# ) -> Textgrid:
# 
# Path: praatio/utilities/constants.py
# class Interval(namedtuple("Interval", ["start", "end", "label"])):
#     def __eq__(self, other):
#         if not isinstance(other, Interval):
#             return False
# 
#         return (
#             math.isclose(self.start, other.start)
#             and math.isclose(self.end, other.end)
#             and self.label == other.label
#         )
# 
#     def __ne__(self, other):
#         return not self == other
# 
# class Point(namedtuple("Point", ["time", "label"])):
#     def __eq__(self, other):
#         if not isinstance(other, Point):
#             return False
# 
#         return (
#             math.isclose(self.time, other.time, abs_tol=1e-14)
#             and self.label == other.label
#         )
# 
#     def __ne__(self, other):
#         return not self == other
# 
# POINT_TIER: Final = "TextTier"
# 
# Path: praatio/utilities/constants.py
# INTERVAL_TIER: Final = "IntervalTier"
# POINT_TIER: Final = "TextTier"
# MIN_INTERVAL_LENGTH: Final = 0.00000001  # Arbitrary threshold
#     LONG_TEXTGRID: Final = "long_textgrid"
#     SHORT_TEXTGRID: Final = "short_textgrid"
#     JSON: Final = "json"
#     POINT: Final = "PointProcess"
#     PITCH: Final = "PitchTier"
#     DURATION: Final = "DurationTier"
#     STRICT: Final = "strict"
#     LAX: Final = "lax"
#     TRUNCATED: Final = "truncated"
#     SILENCE: Final = "silence"
#     WARNING: Final = "warning"
#     ERROR: Final = "error"
#     REPLACE: Final = "replace"
#     MERGE: Final = "merge"
#     ERROR: Final = "error"
#     STRETCH: Final = "stretch"
#     SPLIT: Final = "split"
#     NO_CHANGE: Final = "no_change"
#     ERROR: Final = "error"
#     TRUNCATE: Final = "truncate"
#     CATEGORICAL: Final = "categorical"
#     ERROR: Final = "error"
#     ERROR: Final = "error"
#     RENAME: Final = "rename"
# class Interval(namedtuple("Interval", ["start", "end", "label"])):
# class Point(namedtuple("Point", ["time", "label"])):
# class TextgridFormats:
# class DataPointTypes:
# class CropCollision:
# class ErrorReportingMode:
# class IntervalCollision:
# class WhitespaceCollision:
# class EraseCollision:
# class DuplicateNames:
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __eq__(self, other):
#     def __ne__(self, other):
# 
# Path: praatio/utilities/errors.py
# class PraatioException(Exception):
# class SafeZipException(PraatioException):
# class FileNotFound(PraatioException):
# class ParsingError(PraatioException):
# class ArgumentError(PraatioException):
# class UnexpectedError(PraatioException):
# class WrongOption(PraatioException):
# class TextgridException(PraatioException):
# class DuplicateTierName(TextgridException):
# class OutOfBounds(TextgridException):
# class CollisionError(TextgridException):
# class TimelessTextgridTierException(TextgridException):
# class TextgridStateAutoModified(TextgridException):
# class TextgridStateError(TextgridException):
# class TierNameExistsError(TextgridException):
# class IncompatibleTierError(TextgridException):
# class PraatExecutionFailed(PraatioException):
# class EndOfAudioData(PraatioException):
# class FindZeroCrossingError(PraatioException):
# class NormalizationException(PraatioException):
#     def __init__(self, fullPath: str):
#     def __str__(self):
#     def __init__(self, argumentName: str, givenValue: str, availableOptions: List[str]):
#     def __str__(self):
#     def __str__(self):
#     def __init__(self, tier):
#     def __str__(self):
#     def __init__(self, cmdList: List[str]):
#     def __str__(self):
#     def __init__(self, startTime: float, endTime: float):
#     def __str__(self):
#     def __str__(self):
# 
# Path: tests/praatio_test_case.py
# class PraatioTestCase(unittest.TestCase):
#     def __init__(self, *args, **kargs):
#         super(PraatioTestCase, self).__init__(*args, **kargs)
# 
#         root = os.path.dirname(os.path.realpath(__file__))
#         self.dataRoot = os.path.join(root, "files")
#         self.outputRoot = os.path.join(self.dataRoot, "test_output")
# 
#     def setUp(self):
#         if not os.path.exists(self.outputRoot):
#             os.mkdir(self.outputRoot)
# 
#     def assertAllAlmostEqual(self, listA, listB):
#         for valA, valB in zip(listA, listB):
#             self.assertAlmostEqual(valA, valB)


import unittest
from praatio import textgrid
from praatio.utilities.constants import Interval, Point, POINT_TIER
from praatio.utilities import constants
from praatio.utilities import errors
from tests.praatio_test_case import PraatioTestCase




def makePointTier(name="pitch_values", points=None, minT=0, maxT=5.0):
    if points is None:
        points = [Point(1.3, "55"), Point(3.7, "99")]
    return textgrid.PointTier(name, points, minT, maxT)


class TestPointTier(PraatioTestCase):
    def test_inequivalence_with_non_point_tiers(self):
        sut = makePointTier()
        self.assertNotEqual(sut, 55)

    def test_append_tier_with_mixed_type_throws_exception(self):
        pointTier = makePointTier()

# Path: praatio/textgrid.py
# def openTextgrid(
#     fnFullPath: str,
#     includeEmptyIntervals: bool,
#     reportingMode: Literal["silence", "warning", "error"] = "warning",
#     duplicateNamesMode: Literal["error", "rename"] = "error",
# ) -> Textgrid:
# def _dictionaryToTg(
#     tgAsDict: dict, reportingMode: Literal["silence", "warning", "error"]
# ) -> Textgrid:
# 
# Path: praatio/utilities/constants.py
# class Interval(namedtuple("Interval", ["start", "end", "label"])):
#     def __eq__(self, other):
#         if not isinstance(other, Interval):
#             return False
# 
#         return (
#             math.isclose(self.start, other.start)
#             and math.isclose(self.end, other.end)
#             and self.label == other.label
#         )
# 
#     def __ne__(self, other):
#         return not self == other
# 
# class Point(namedtuple("Point", ["time", "label"])):
#     def __eq__(self, other):
#         if not isinstance(other, Point):
#             return False
# 
#         return (
#             math.isclose(self.time, other.time, abs_tol=1e-14)
#             and self.label == other.label
#         )
# 
#     def __ne__(self, other):
#         return not self == other
# 
# POINT_TIER: Final = "TextTier"
# 
# Path: praatio/utilities/constants.py
# INTERVAL_TIER: Final = "IntervalTier"
# POINT_TIER: Final = "TextTier"
# MIN_INTERVAL_LENGTH: Final = 0.00000001  # Arbitrary threshold
#     LONG_TEXTGRID: Final = "long_textgrid"
#     SHORT_TEXTGRID: Final = "short_textgrid"
#     JSON: Final = "json"
#     POINT: Final = "PointProcess"
#     PITCH: Final = "PitchTier"
#     DURATION: Final = "DurationTier"
#     STRICT: Final = "strict"
#     LAX: Final = "lax"
#     TRUNCATED: Final = "truncated"
#     SILENCE: Final = "silence"
#     WARNING: Final = "warning"
#     ERROR: Final = "error"
#     REPLACE: Final = "replace"
#     MERGE: Final = "merge"
#     ERROR: Final = "error"
#     STRETCH: Final = "stretch"
#     SPLIT: Final = "split"
#     NO_CHANGE: Final = "no_change"
#     ERROR: Final = "error"
#     TRUNCATE: Final = "truncate"
#     CATEGORICAL: Final = "categorical"
#     ERROR: Final = "error"
#     ERROR: Final = "error"
#     RENAME: Final = "rename"
# class Interval(namedtuple("Interval", ["start", "end", "label"])):
# class Point(namedtuple("Point", ["time", "label"])):
# class TextgridFormats:
# class DataPointTypes:
# class CropCollision:
# class ErrorReportingMode:
# class IntervalCollision:
# class WhitespaceCollision:
# class EraseCollision:
# class DuplicateNames:
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def __eq__(self, other):
#     def __ne__(self, other):
# 
# Path: praatio/utilities/errors.py
# class PraatioException(Exception):
# class SafeZipException(PraatioException):
# class FileNotFound(PraatioException):
# class ParsingError(PraatioException):
# class ArgumentError(PraatioException):
# class UnexpectedError(PraatioException):
# class WrongOption(PraatioException):
# class TextgridException(PraatioException):
# class DuplicateTierName(TextgridException):
# class OutOfBounds(TextgridException):
# class CollisionError(TextgridException):
# class TimelessTextgridTierException(TextgridException):
# class TextgridStateAutoModified(TextgridException):
# class TextgridStateError(TextgridException):
# class TierNameExistsError(TextgridException):
# class IncompatibleTierError(TextgridException):
# class PraatExecutionFailed(PraatioException):
# class EndOfAudioData(PraatioException):
# class FindZeroCrossingError(PraatioException):
# class NormalizationException(PraatioException):
#     def __init__(self, fullPath: str):
#     def __str__(self):
#     def __init__(self, argumentName: str, givenValue: str, availableOptions: List[str]):
#     def __str__(self):
#     def __str__(self):
#     def __init__(self, tier):
#     def __str__(self):
#     def __init__(self, cmdList: List[str]):
#     def __str__(self):
#     def __init__(self, startTime: float, endTime: float):
#     def __str__(self):
#     def __str__(self):
# 
# Path: tests/praatio_test_case.py
# class PraatioTestCase(unittest.TestCase):
#     def __init__(self, *args, **kargs):
#         super(PraatioTestCase, self).__init__(*args, **kargs)
# 
#         root = os.path.dirname(os.path.realpath(__file__))
#         self.dataRoot = os.path.join(root, "files")
#         self.outputRoot = os.path.join(self.dataRoot, "test_output")
# 
#     def setUp(self):
#         if not os.path.exists(self.outputRoot):
#             os.mkdir(self.outputRoot)
# 
#     def assertAllAlmostEqual(self, listA, listB):
#         for valA, valB in zip(listA, listB):
#             self.assertAlmostEqual(valA, valB)


# Path: tests/test_point_tier.py
import unittest
from praatio import textgrid
from praatio.utilities.constants import Interval, Point, POINT_TIER
from praatio.utilities import constants
from praatio.utilities import errors
from tests.praatio_test_case import PraatioTestCase





def makePointTier(name="pitch_values", points=None, minT=0, maxT=5.0):
    if points is None:
        points = [Point(1.3, "55"), Point(3.7, "99")]
    return textgrid.PointTier(name, points, minT, maxT)


class TestPointTier(PraatioTestCase):
    def test_inequivalence_with_non_point_tiers(self):
        sut = makePointTier()
        self.assertNotEqual(sut, 55)

    def test_append_tier_with_mixed_type_throws_exception(self):
        pointTier = makePointTier()

        intervalTier = textgrid.IntervalTier(