-
Notifications
You must be signed in to change notification settings - Fork 11
/
pyLib.py
36 lines (27 loc) · 1.09 KB
/
pyLib.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from robot.api import logger
import numpy
class pyLib():
def print_message(self, message):
"""Prints a custom message to log
"""
logger.warn(message)
def squareroot(self, baseNum):
logger.warn("Taking Squareroot of %s" %(baseNum))
newNum = numpy.sqrt(float(baseNum))
logger.warn("%s calculated to %s" %(baseNum,newNum))
return newNum
def double(self, baseNum):
logger.warn("Doubling the value of %s" %(baseNum))
newNum = numpy.multiply(float(baseNum), 2.0)
logger.warn("%s calculated to %s" %(baseNum,newNum))
return newNum
def halve(self, baseNum):
logger.warn("Halving the value of %s" %(baseNum))
newNum = numpy.divide(float(baseNum),2.0)
logger.warn("%s calculated to %s" %(baseNum,newNum))
return newNum
def sum(self, baseNum, number):
logger.warn("Summming the values of %s and %s" %(baseNum,number))
newNum = numpy.add(float(baseNum), float(number))
logger.warn("%s calculated to %s" %(baseNum,newNum))
return newNum