summaryrefslogtreecommitdiff
path: root/lib/param/float_.py
diff options
context:
space:
mode:
authorPepper <pepper@scannerjammer.com>2015-09-26 22:00:15 -0400
committerPepper <pepper@scannerjammer.com>2015-09-26 22:00:15 -0400
commit0e9991e9bd5748a6d32c825e0a00a5ac15c29982 (patch)
tree7bf222228a84793f1980db61a37c060afa616541 /lib/param/float_.py
parent4ebeb643da6419835e9ac3adb731e38a8ec9c7b4 (diff)
linting...
Diffstat (limited to 'lib/param/float_.py')
-rw-r--r--lib/param/float_.py39
1 files changed, 22 insertions, 17 deletions
diff --git a/lib/param/float_.py b/lib/param/float_.py
index f5d1816..88ed066 100644
--- a/lib/param/float_.py
+++ b/lib/param/float_.py
@@ -1,19 +1,24 @@
+"""Defines the float param type"""
from param import Param
-
class Float(Param):
- def __init__(self, value, classname=""):
- self._classname = classname
- super(Float, self).__init__(classname=classname)
- try:
- if value:
- self.value = float(value)
- else:
- self.value = 0.0
- except Exception as e:
- self.err_warn("Not a float: %s" % str(value))
- self.err_warn(str(e))
- def __int__(self):
- return int(self.value)
-
- def __float__(self):
- return float(self.value)
+ """Defines the float param type
+ Args:
+ value: the value of the Float
+ classname: the name of the class to which the param belongs
+ """
+ def __init__(self, value, classname=""):
+ self._classname = classname
+ super(Float, self).__init__(classname=classname)
+ try:
+ if value:
+ self.value = float(value)
+ else:
+ self.value = 0.0
+ except Exception as e:
+ self.err_warn("Not a float: %s" % str(value))
+ self.err_warn(str(e))
+ def __int__(self):
+ return int(self.value)
+
+ def __float__(self):
+ return float(self.value)