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

Function _symRoots2RST

SLiCAP/SLiCAPrst.py:796–822  ·  view source on GitHub ↗

Returns a list of lists with row data for the creation of an RST table with symbolic poles or zeros. :param roots: List with symbolic roots :type roots: List with sympy expressions :param Hz: True if frequencies must be displayed in Hz, False for rad/s. :type Hz: Bool

(roots, Hz, pz)

Source from the content-addressed store, hash-verified

794 return lineList
795
796def _symRoots2RST(roots, Hz, pz):
797 """
798 Returns a list of lists with row data for the creation of an RST table
799 with symbolic poles or zeros.
800
801 :param roots: List with symbolic roots
802 :type roots: List with sympy expressions
803
804 :param Hz: True if frequencies must be displayed in Hz, False for rad/s.
805 :type Hz: Bool
806
807 :param pz: Identifier prefix: 'p' ofr poles 'z' for zeros.
808 :type pz: str
809
810 :return: List of lists with data of poles or zeros
811 :rtype: List of lists
812 """
813 lineList = []
814 i = 0
815 for root in roots:
816 i += 1
817 if Hz == True:
818 line = [sp.Symbol(pz + '_' + str(i)), ':math:`' + sp.latex(roundN(sp.simplify(root/2/sp.pi))) + '`']
819 else:
820 line = [sp.Symbol(pz + '_' + str(i)), ':math:`' + sp.latex(roundN(root)) + '`']
821 lineList.append(line)
822 return lineList

Callers 1

pzMethod · 0.85

Calls 1

roundNFunction · 0.90

Tested by

no test coverage detected