MCPcopy Index your code
hub / github.com/SLiCAP/SLiCAP_python / _checkNumber

Function _checkNumber

SLiCAP/SLiCAPmath.py:528–546  ·  view source on GitHub ↗

Returns a number with its value represented by var. :param var: Variable that may represent a number. :type var: str, sympy object, int, float :return: Rational number :rtype: sympy.rational

(var)

Source from the content-addressed store, hash-verified

526 return result
527
528def _checkNumber(var):
529 """
530 Returns a number with its value represented by var.
531
532 :param var: Variable that may represent a number.
533 :type var: str, sympy object, int, float
534
535 :return: Rational number
536 :rtype: sympy.rational
537 """
538 if type(var) == str:
539 var = _replaceScaleFactors(var)
540 else:
541 var = str(var)
542 try:
543 var = sp.Rational(var)
544 except BaseException:
545 var = None
546 return var
547
548def str2number(var):
549 """

Callers 7

checkStepStartMethod · 0.90
checkStepStopMethod · 0.90
checkStepListMethod · 0.90
checkStepArrayMethod · 0.90
plotSweepFunction · 0.90
plotPZFunction · 0.90
_varNoiseFunction · 0.85

Calls 1

_replaceScaleFactorsFunction · 0.90

Tested by

no test coverage detected