def determineFraction(resultFilename): assert os.path.exists(resultFilename) result = utils.rasterMaximum(resultFilename) assert result != "mv" result = float(result) utils.testNumberWithinRange(result, 0.0, 1.0) return result
def testValidationSetOption(self): """ FIXME """ assert self.validationSet() try: if self.validationSetIsFilename(): utils.testFileIsReadable(self.validationSet()) elif self.validationSetIsPercentage(): utils.testStringIsPositiveFloat(self.validationSet()) utils.testNumberWithinRange(float(self.validationSet()), 0.0, 100.0) except AssertionError, exception: raise