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

Function _checkNumeric

SLiCAP/SLiCAPmath.py:560–580  ·  view source on GitHub ↗

Returns True is all entries in the list 'exprList' are numeric. :param exprList; List with numbers and/or expressions :type exprList: list :return: True is all entries in 'exprList' are numeric. :rtype: Bool

(exprList)

Source from the content-addressed store, hash-verified

558 return eval(_replaceScaleFactors(str(var)))
559
560def _checkNumeric(exprList):
561 """
562 Returns True is all entries in the list 'exprList' are numeric.
563
564 :param exprList; List with numbers and/or expressions
565 :type exprList: list
566
567 :return: True is all entries in 'exprList' are numeric.
568 :rtype: Bool
569 """
570 numeric = True
571 for item in exprList:
572 try:
573 complex(item)
574 except:
575 item = item.evalf()
576 params = item.atoms(sp.Symbol)
577 if len(params) > 0:
578 numeric = False
579 break
580 return numeric
581
582def _checkExpression(expr):
583 """

Callers 3

pzMethod · 0.90
pz2htmlFunction · 0.90
pzMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected