예제 #1
0
 def floatForwardTransform(self, x):
     """
     transform a float.
     """
     # TODO: refactor this with proper object-oriented design
     # This code stinks.
     if self.xLabel == "x":
         return transform.toX(x)
     if self.xLabel == "x^(2)":
         return transform.toX2(x)
     if self.xLabel == "ln(x)":
         return transform.toLogX(x)
     if self.xLabel == "log10(x)":
         return math.log10(x)
예제 #2
0
 def floatForwardTransform(self, x):
     """
     transform a float.
     """
     # TODO: refactor this with proper object-oriented design
     # This code stinks.
     if self.xLabel == "x":
         return transform.toX(x)
     if self.xLabel == "x^(2)":
         return transform.toX2(x)
     if self.xLabel == "ln(x)":
         return transform.toLogX(x)
     if self.xLabel == "log10(x)":
         return math.log10(x)
예제 #3
0
 def floatTransform(self, x):
     """
     transform a float.It is use to determine the x.
     View min and x.View max for values
     not in x
     """
     # TODO: refactor this with proper object-oriented design
     # This code stinks.
     if self.xLabel == "x":
         return transform.toX(x)
     if self.xLabel == "x^(2)":
         return transform.toX2(x)
     if self.xLabel == "ln(x)":
         return transform.toLogX(x)
     if self.xLabel == "log10(x)":
         if x > 0:
             return x
         else:
             raise ValueError, "cannot compute log of a negative number"
예제 #4
0
 def floatTransform(self, x):
     """
     transform a float.It is use to determine the x.
     View min and x.View max for values
     not in x
     """
     # TODO: refactor this with proper object-oriented design
     # This code stinks.
     if self.xLabel == "x":
         return transform.toX(x)
     if self.xLabel == "x^(2)":
         return transform.toX2(x)
     if self.xLabel == "ln(x)":
         return transform.toLogX(x)
     if self.xLabel == "log10(x)":
         if x > 0:
             return x
         else:
             raise ValueError, "cannot compute log of a negative number"