예제 #1
0
	def getSurfaceParameters(self):

		xLowerLimit = helper_functions.validateValue(self.errorXLowerLimitE.get(),
									self.xSymbol + " lower limit must be a positive number",
									"float",
									lowerBound=0)
		xUpperLimit = helper_functions.validateValue(self.errorXUpperLimitE.get(),
									self.xSymbol + " upper limit must be greater than the lower limit",
									"float",
									strictLowerBound=xLowerLimit)
		yLowerLimit = helper_functions.validateValue(self.errorYLowerLimitE.get(),
									self.ySymbol + " lower limit must be a positive number",
									"float",
									lowerBound=0)
		yUpperLimit = helper_functions.validateValue(self.errorYUpperLimitE.get(),
									self.ySymbol + " upper limit must be greater than the lower limit",
									"float",
									strictLowerBound=yLowerLimit)
		resolution = helper_functions.validateValue(self.errorResolutionE.get(),
								   "Resolution must be " + str(ERROR_SURFACE_MIN_RESOLUTION) + " \u2264 x \u2264 " + str(ERROR_SURFACE_MAX_RESOLUTION),
								   "int",
								   lowerBound=ERROR_SURFACE_MIN_RESOLUTION,
								   upperBound=ERROR_SURFACE_MAX_RESOLUTION)

		return [xLowerLimit,xUpperLimit,yLowerLimit,yUpperLimit,resolution]
예제 #2
0
	def getSurfaceParameters(self):
		
		xLowerLimit = helper_functions.validateValue(self.errorXLowerLimitE.get(),
									self.xSymbol + " lower limit must be a positive number",
									"float",
									lowerBound=0)
		xUpperLimit = helper_functions.validateValue(self.errorXUpperLimitE.get(),
									self.xSymbol + " upper limit must be greater than the lower limit",
									"float",
									strictLowerBound=xLowerLimit)
		yLowerLimit = helper_functions.validateValue(self.errorYLowerLimitE.get(),
									self.ySymbol + " lower limit must be a positive number",
									"float",
									lowerBound=0)
		yUpperLimit = helper_functions.validateValue(self.errorYUpperLimitE.get(),
									self.ySymbol + " upper limit must be greater than the lower limit",
									"float",
									strictLowerBound=yLowerLimit)
		resolution = helper_functions.validateValue(self.errorResolutionE.get(),
								   "Resolution must be " + str(ERROR_SURFACE_MIN_RESOLUTION) + " \u2264 x \u2264 " + str(ERROR_SURFACE_MAX_RESOLUTION),
								   "int",
								   lowerBound=ERROR_SURFACE_MIN_RESOLUTION,
								   upperBound=ERROR_SURFACE_MAX_RESOLUTION)
		
		return [xLowerLimit,xUpperLimit,yLowerLimit,yUpperLimit,resolution]
예제 #3
0
    def getData(self):
        values = [
            (thicknessVar.get(), sqrtAreaVar.get(), includeVar.get())
            for (_,
                 _), (_,
                      thicknessVar), (_,
                                      sqrtAreaVar), (_,
                                                     includeVar) in self.rows
        ]
        isopachs = []
        for index, (thicknessStr, sqrtAreaStr,
                    includeInt) in enumerate(values):
            if includeInt == 1:
                thicknessM = helper_functions.validateValue(
                    thicknessStr,
                    "Isopach " + str(index + 1) +
                    "'s thickness must be a strictly positive number",
                    "float",
                    strictLowerBound=0)
                sqrtAreaKM = helper_functions.validateValue(
                    sqrtAreaStr,
                    "Isopach " + str(index + 1) +
                    "'s area must be a strictly positive number",
                    "float",
                    strictLowerBound=0)
                isopachs.append(Isopach(thicknessM, sqrtAreaKM))
        isopachs = sorted(isopachs, key=lambda i: i.thicknessM, reverse=True)

        if len({i.thicknessM for i in isopachs}) != len(isopachs):
            raise ValueError("Isopachs must all have unique thicknesses")

        return isopachs
예제 #4
0
 def getParameters(self, model):
     if model == Model.EXP:
         return {
             "c":
             helper_functions.validateValue(
                 self.expSegCoefficent_E.get(),
                 "Coefficient, c, must be a number", "float"),
             "m":
             helper_functions.validateValue(
                 self.expSegExponent_E.get(),
                 "Exponent, m, must be a number", "float"),
             "segStart":
             helper_functions.validateValue(
                 self.expSegStartLimit_E.get(),
                 "'Start of segment' must be a number > 0",
                 "float",
                 lowerBound=0),
             "segEnd":
             helper_functions.validateValue(
                 self.expSegEndLimit_E.get(),
                 "'End of segment' must be a number greater than the 'Start of segment'",
                 "float",
                 strictLowerBound=float(self.expSegStartLimit_E.get())),
         }
     elif model == Model.POW:
         return {
             "c":
             helper_functions.validateValue(
                 self.powCoefficient_E.get(),
                 "coefficient, c, must be a number", "float"),
             "m":
             helper_functions.validateValue(
                 self.powExponent_E.get(), "exponent, m, must be a number",
                 "float")
         }
     elif model == Model.WEI:
         return {
             "lambda":
             helper_functions.validateValue(
                 self.weiLambdaE.get(),
                 "\u03BB must be a positive number",
                 "float",
                 strictLowerBound=0),
             "k":
             helper_functions.validateValue(self.weiKE.get(),
                                            "k must be a positive number",
                                            "float",
                                            strictLowerBound=0),
             "theta":
             helper_functions.validateValue(
                 self.weiThetaE.get(),
                 "\u03B8 must be a positive number",
                 "float",
                 strictLowerBound=0)
         }
예제 #5
0
 def getData(self):
     values = [(thicknessVar.get(), sqrtAreaVar.get(), includeVar.get()) for (_,_),(_,thicknessVar),(_,sqrtAreaVar),(_,includeVar) in self.rows]
     isopachs = []
     for index, (thicknessStr, sqrtAreaStr, includeInt) in enumerate(values):
         if includeInt == 1:
             thicknessM = helper_functions.validateValue(
                             thicknessStr,
                             "Isopach " + str(index+1) + "'s thickness must be a strictly positive number",
                             "float",
                             strictLowerBound=0)
             sqrtAreaKM = helper_functions.validateValue(
                             sqrtAreaStr,
                             "Isopach " + str(index+1) + "'s area must be a strictly positive number",
                             "float",
                             strictLowerBound=0)
             isopachs.append(Isopach(thicknessM, sqrtAreaKM))
     isopachs = sorted(isopachs, key=lambda i : i.thicknessM, reverse=True)
     
     if len({i.thicknessM for i in isopachs}) != len(isopachs):
         raise ValueError("Isopachs must all have unique thicknesses")
     
     return isopachs
예제 #6
0
	def getParameters(self, model):
		if model == Model.EXP:
			return {
				"c" : 			helper_functions.validateValue(self.expSegCoefficent_E.get(), 	"Coefficient, c, must be a number", 									"float"),
				"m" : 			helper_functions.validateValue(self.expSegExponent_E.get(), 	"Exponent, m, must be a number", 										"float"),
				"segStart" : 	helper_functions.validateValue(self.expSegStartLimit_E.get(), 	"'Start of segment' must be a number > 0", 								"float", lowerBound=0),
				"segEnd" : 		helper_functions.validateValue(self.expSegEndLimit_E.get(), 	"'End of segment' must be a number greater than the 'Start of segment'","float", strictLowerBound=float(self.expSegStartLimit_E.get())),
			}
		elif model == Model.POW:
			return {
				"c" : 			helper_functions.validateValue(self.powCoefficient_E.get(), "coefficient, c, must be a number", "float"),
				"m" : 			helper_functions.validateValue(self.powExponent_E.get(), 	"exponent, m, must be a number", 	"float")
			}
		elif model == Model.WEI:
			return {
				"lambda" : 		helper_functions.validateValue(self.weiLambdaE.get(), 	"\u03BB must be a positive number", "float", strictLowerBound=0),
				"k" : 			helper_functions.validateValue(self.weiKE.get(), 		"k must be a positive number", 		"float", strictLowerBound=0),
				"theta" : 		helper_functions.validateValue(self.weiThetaE.get(), 	"\u03B8 must be a positive number", "float", strictLowerBound=0)
			}
예제 #7
0
    def getModelDetails(self):
        modelType = Model(self.selection.get())
        values = [modelType]

        if modelType == Model.EXP:
            numberOfSegments = helper_functions.validateValue(
                self.expNumberOfSegments_E.get(),
                "The number of exponential segments must be 1 \u2264 n \u2264 "
                + str(settings.EXP_MAX_NUMBER_OF_SEGMENTS),
                "int",
                lowerBound=1,
                upperBound=settings.EXP_MAX_NUMBER_OF_SEGMENTS)
            values.append(numberOfSegments)

        elif modelType == Model.POW:
            proximalLimitKM = helper_functions.validateValue(
                self.powProximalLimit_E.get(),
                "The proximal limit of integration must be 0 \u2264 x \u2264 \u221E",
                "float",
                strictLowerBound=0,
                strictUpperBound=float('inf'))
            proximalLimitKM /= SQRT_PI

            distalLimitKM = helper_functions.validateValue(
                self.powDistalLimit_E.get(),
                "The distal limit of integration must be prox \u2264 x \u2264 \u221E",
                "float",
                strictLowerBound=proximalLimitKM,
                strictUpperBound=float('inf'))
            distalLimitKM /= SQRT_PI

            values.extend([proximalLimitKM, distalLimitKM])

        elif modelType == Model.WEI:
            numberOfRuns = helper_functions.validateValue(
                self.weiNumberOfRuns_E.get(),
                "The number of runs must be greater than 0",
                "int",
                strictLowerBound=0)

            iterationsPerRun = helper_functions.validateValue(
                self.weiIterationsPerRun_E.get(),
                "The number of iterations must be greater than 0",
                "int",
                strictLowerBound=0)

            lambdaLowerBound = helper_functions.validateValue(
                self.weiLambdaLowerBoundE.get(),
                "The lower bound for \u03BB must be a decimal", "float")

            lambdaUpperBound = helper_functions.validateValue(
                self.weiLambdaUpperBoundE.get(),
                "The upper bound for \u03BB must be greater than the lower bound",
                "float",
                strictLowerBound=lambdaLowerBound)

            kLowerBound = helper_functions.validateValue(
                self.weiKLowerBoundE.get(),
                "The lower bound for k must be numeric and less than 2",
                "float",
                strictUpperBound=2)

            kUpperBound = helper_functions.validateValue(
                self.weiKUpperBoundE.get(),
                "The upper bound for k must be greater than the lower bound and less than or equal to 2",
                "float",
                strictLowerBound=kLowerBound,
                upperBound=2)

            values.extend([
                numberOfRuns, iterationsPerRun,
                [[lambdaLowerBound, lambdaUpperBound],
                 [kLowerBound, kUpperBound]]
            ])

        return values
예제 #8
0
	def getModelDetails(self):
		modelType = Model(self.selection.get())
		values = [modelType]

		if modelType == Model.EXP:
			numberOfSegments = helper_functions.validateValue(
									self.expNumberOfSegments_E.get(),
									"The number of exponential segments must be 1 \u2264 n \u2264 " + str(settings.EXP_MAX_NUMBER_OF_SEGMENTS),
									"int",
									lowerBound=1,
									upperBound=settings.EXP_MAX_NUMBER_OF_SEGMENTS)
			values.append(numberOfSegments)
			
		elif modelType == Model.POW:
			proximalLimitKM = helper_functions.validateValue(
									self.powProximalLimit_E.get(),
									"The proximal limit of integration must be 0 \u2264 x \u2264 \u221E",
									"float",
									strictLowerBound=0,
									strictUpperBound=float('inf'))
			proximalLimitKM /= SQRT_PI
			
			distalLimitKM = helper_functions.validateValue(
									self.powDistalLimit_E.get(),
									"The distal limit of integration must be prox \u2264 x \u2264 \u221E",
									"float",
									strictLowerBound=proximalLimitKM,
									strictUpperBound=float('inf'))
			distalLimitKM /= SQRT_PI
			
			values.extend([proximalLimitKM,distalLimitKM])
			
		elif modelType == Model.WEI:
			numberOfRuns = helper_functions.validateValue(
									self.weiNumberOfRuns_E.get(),
									"The number of runs must be greater than 0",
									"int",
									strictLowerBound=0)
			
			iterationsPerRun = helper_functions.validateValue(
									self.weiIterationsPerRun_E.get(),
									"The number of iterations must be greater than 0",
									"int",
									strictLowerBound=0)
			
			lambdaLowerBound = helper_functions.validateValue(
									self.weiLambdaLowerBoundE.get(),
									"The lower bound for \u03BB must be a decimal",
									"float")
			  
			lambdaUpperBound = helper_functions.validateValue(
									self.weiLambdaUpperBoundE.get(),
									"The upper bound for \u03BB must be greater than the lower bound",
									"float",
									strictLowerBound=lambdaLowerBound)
			
			kLowerBound = helper_functions.validateValue(
									self.weiKLowerBoundE.get(),
									"The lower bound for k must be numeric and less than 2",
									"float",
									strictUpperBound=2)
												
			kUpperBound = helper_functions.validateValue(
									self.weiKUpperBoundE.get(),
									"The upper bound for k must be greater than the lower bound and less than or equal to 2",
									"float",
									strictLowerBound=kLowerBound,
									upperBound=2)
			
			values.extend([numberOfRuns,iterationsPerRun,[[lambdaLowerBound,lambdaUpperBound],[kLowerBound,kUpperBound]]])
		
		return values