Esempio n. 1
0
File: Range.py Progetto: lepy/Ranger
    def atLeast(val):
        """ Makes range including all values greater than or equal to
        some value (i.e. [val, inf))

        Parameters
        ----------
        val : comparable
            The lower bound

        Raises
        ------
        ValueError
            If type not comparable

        Returns
        -------
        A Range object [val, inf)
        """
        Range._validate_cutpoints(val)
        theType = Range._get_type(val)
        return Range(Cut.belowValue(val, theType=theType),
                     Cut.aboveAll(theType=theType))
Esempio n. 2
0
def range_all(theType):
    """Create a range than contains every value of the given type."""
    return Range(
        Cut.belowAll(theType=theType),
        Cut.aboveAll(theType=theType))
Esempio n. 3
0
def range_all(theType: Any) -> Range:
    """Create a range than contains every value of the given type."""
    return Range(Cut.belowAll(theType=theType), Cut.aboveAll(theType=theType))
Esempio n. 4
0
 def test_aboveAll(self):
     if debug: print("Testing aboveAll")
     theCut = Cut.aboveAll(int)
     self.assertFalse(theCut.belowAll)
     self.assertTrue(theCut.aboveAll)
     self.assertIsNone(theCut.point)        
Esempio n. 5
0
 def test_aboveAll(self):
     if debug: print("Testing aboveAll")
     theCut = Cut.aboveAll(int)
     self.assertFalse(theCut.belowAll)
     self.assertTrue(theCut.aboveAll)
     self.assertIsNone(theCut.point)