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

Method specs

SLiCAP/SLiCAPrst.py:387–415  ·  view source on GitHub ↗

Creates a table with specifications of type *specType*. If no label AND no caption are given this method returns a LaTeX tabular snippet. Else it returns a table snippet. :param specs: List with SLiCAP.SLiCAPdesignData.specItem objects. :type specs: list

(self, specs, specType, label="", caption="")

Source from the content-addressed store, hash-verified

385 return Snippet(RST, self.format)
386
387 def specs(self, specs, specType, label="", caption=""):
388 """
389 Creates a table with specifications of type *specType*.
390 If no label AND no caption are given this method returns a LaTeX
391 tabular snippet. Else it returns a table snippet.
392
393 :param specs: List with SLiCAP.SLiCAPdesignData.specItem objects.
394 :type specs: list
395
396 :param label: Reference label for the table. Defaults to an empty string.
397 :type label: str
398
399 :param caption: Table caption.
400 :type caption: str
401
402 :return: SLiCAP Snippet object
403 :rtype: SLiCAP.SLiCAPprotos.Snippet
404 """
405 linesList = []
406 headerList = ["Name", "Description", "value", "units"]
407 for specItem in specs:
408 if specItem.specType.lower()==specType.lower():
409 linesList.append(specItem._specLine())
410 if len(linesList) > 0:
411 RST = _RSTcreateCSVtable(caption, headerList, linesList,
412 label=label) + '\n'
413 else:
414 RST = "**Found no specifications of type: " + specType + ".**\n\n"
415 return Snippet(RST, self.format)
416
417 def eqn(self, LHS, RHS, units="", label="", multiline=False):
418 """

Callers 2

sphinx_report.pyFile · 0.45
specifications.pyFile · 0.45

Calls 3

SnippetClass · 0.90
_RSTcreateCSVtableFunction · 0.85
_specLineMethod · 0.80

Tested by

no test coverage detected