Package pyfeyn :: Module utils
[hide private]
[frames] | no frames]

Source Code for Module pyfeyn.utils

 1  """Utility functions and classes for PyFeyn""" 
 2  import pyx 
 3   
 4   
 5  defunit = pyx.unit.cm 
 6  todefunit = pyx.unit.tocm 
 7   
 8   
9 -def sign(x):
10 """Get the sign of a numeric type""" 11 if x < 0: return -1 12 if x > 0: return 1 13 if x == 0: return 0
14 15
16 -class Visible:
17 - def isVisible(self):
18 return True
19
20 - def getPath(self):
21 return None
22
23 - def getVisiblePath(self):
24 return self.getPath()
25