Example #1
0
    def test_ival_overlap(self):

        ival0 = s_interval.fold(10, 20)
        ival1 = s_interval.fold(15, 30)
        ival2 = s_interval.fold(30, 50)
        ival3 = s_interval.fold(1, 100)

        self.true(s_interval.overlap(ival0, ival1))
        self.false(s_interval.overlap(ival1, ival2))

        self.true(s_interval.overlap(ival0, ival3))
        self.true(s_interval.overlap(ival1, ival3))
        self.true(s_interval.overlap(ival2, ival3))
Example #2
0
    def test_ival_overlap(self):

        ival0 = s_interval.fold(10, 20)
        ival1 = s_interval.fold(15, 30)
        ival2 = s_interval.fold(30, 50)
        ival3 = s_interval.fold(1, 100)

        self.true(s_interval.overlap(ival0, ival1))
        self.false(s_interval.overlap(ival1, ival2))

        self.true(s_interval.overlap(ival0, ival3))
        self.true(s_interval.overlap(ival1, ival3))
        self.true(s_interval.overlap(ival2, ival3))
Example #3
0
        def cmpr(tufo):

            minv = tufo[1].get(minp)
            maxv = tufo[1].get(maxp)

            if minv is None or maxv is None:
                return False

            return s_interval.overlap(ival, (minv, maxv))