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

Method elementData

SLiCAP/SLiCAPlatex.py:78–142  ·  view source on GitHub ↗

Creates a table with data of expanded netlist elements of *circuitObject*. If no label AND no caption are given this method returns a LaTeX tabular snippet. Else it returns a table snippet. :param circuitObject: SLiCAP circuit object that comprises the circ

(self, circuitObject, label="", caption="", 
                    color="myyellow")

Source from the content-addressed store, hash-verified

76 return Snippet(TEX, self.format)
77
78 def elementData(self, circuitObject, label="", caption="",
79 color="myyellow"):
80 """
81 Creates a table with data of expanded netlist elements of
82 *circuitObject*.
83 If no label AND no caption are given this method returns a LaTeX
84 tabular snippet. Else it returns a table snippet.
85
86 :param circuitObject: SLiCAP circuit object that comprises the circuit
87 data to be listed.
88 :type circuitObject: SLiCAP.SLiCAPprotos.circuit
89
90 :param label: Reference label for the table. Defaults to an empty
91 string.
92 :type label: str
93
94 :param caption: Text that will used as table caption.
95 :type caption: str
96
97 :param color: Alternate row color name, should be defined in
98 'preambuleSLiCAP.tex' defaults to 'myyellow'. Use None for
99 no background color.
100 :type color: str
101
102 :return: SLiCAP Snippet object
103 :rtype: SLiCAP.SLiCAPprotos.Snippet
104 """
105 headerList = ["ID", "Nodes", "Refs", "Model", "Param", "Symbolic",
106 "Numeric"]
107 alignstring= '[c]{lllllll}'
108 linesList = []
109 for key in circuitObject.elements.keys():
110 el = circuitObject.elements[key]
111 line = [key]
112 lineItem = ''
113 for node in el.nodes:
114 lineItem += node + ' '
115 line.append(lineItem)
116
117 lineItem = ''
118 for ref in el.refs:
119 lineItem += ref + ' '
120 line.append(lineItem)
121 line.append(el.model)
122 if len(el.params.keys()) == 0:
123 line += ['','','']
124 else:
125 keys = list(el.params.keys())
126 for i in range(len(keys)):
127 if i == 0:
128 line.append(keys[i])
129 line.append(el.params[keys[i]])
130 line.append(fullSubs(el.params[keys[i]],
131 circuitObject.parDefs))
132 linesList.append(line)
133 else:
134 line = ['','','','']
135 line.append(keys[i])

Callers

nothing calls this directly

Calls 3

fullSubsFunction · 0.90
SnippetClass · 0.90
_TEXcreateCSVtableFunction · 0.85

Tested by

no test coverage detected