simplipfy.Export package

Subpackages

Submodules

simplipfy.Export.dictExportBase module

class simplipfy.Export.dictExportBase.DictExportBase(precision: int, langSymbol: LangSymbols, isSymbolic=False)

Bases: object

Base class for the classes that create dictionaries with information about the circuit relevant to the frontend Handles conversation from lcapy objects to latex strings

Note

The difference between ExportDict and DictExport

  • ExportDict is a modified Dictionary to hold data

  • DictExport is the class that populates an ExportDict with data for the frontend

getDictForStep(step, solution: Solution)
latexWithPrefix(value: Mul | Expr, prec=None, addPrefix: bool = True) str
latexWithoutPrefix(value: Expr, prec=None) str
toLatex(toPrint)

simplipfy.Export.dictExportCircuitInfo module

class simplipfy.Export.dictExportCircuitInfo.DictExportCircuitInfo(langSymbols: <simplipfy.Helpers.langSymbols.LangSymbols object at 0x000001AA802B1810>, cirType='RLC', isSymbolic=False, precision=3)

Bases: DictExportBase

Export for step 0 of <simplipfy.Solution> Steps 1 - n are handled in <simplipfy.Export.dictExport>

getDictForStep(step, solution: Solution) Step0ExportDict
Returns:

Step0ExportDict with the circuit information for step 0

simplipfy.Export.dictExportError module

class simplipfy.Export.dictExportError.DictExportError(error: Exception)

Bases: DictExportBase

Is returned if lcapy throws an error during the simplification process. The error message is stored in the “error” field of the ExportDict. The frontend can then display this message to the user.

simplipfy.Export.dictExportSimpStep module

class simplipfy.Export.dictExportSimpStep.DictExportSimpStep(langSymbol: <simplipfy.Helpers.langSymbols.LangSymbols object at 0x000001AA802B1450>, isSymbolic=False, precision=3)

Bases: DictExportBase

Export for steps 1 - n of <simplipfy.Solution> is handled in this class. Export for step 0 is handled in <simplipfy.Export.dictExportCircuitInfo>.

getDictForStep(step: str, solution: Solution) ExportDict
Parameters:
  • step – step to export

  • solution – solution object to get the data from

Returns:

an Step0ExportDict or an ExportDict object with the data of the step

substituteSymbols(solution: Solution)
class simplipfy.Export.dictExportSimpStep.SimpStepElements(elems: list[ExportElement], resElm: ExportElement = None)

Bases: object

Data class that provides a clear structure for the simplified elements and the result

makeCptExportDictLists() tuple[list[CptExportDict], list[CptExportDict]]
Returns:

tuple of two lists, the first list contains the CptExportDicts of the simplified elements, the second list contains the CptExportDicts of all elements. The first list ist a subset of the second list.

Module contents

This package is used to export data from the lcapyInskale package. The relevant functions for usage are:

  • DictExportCircuitInfo

    Exports information about all components in the circuit and creates the image of the initial circuit.

  • DictExport

    Exports information about a simplification step created with SimplifyInUserOrder Package or SimplifyStepWise Package. Creates the image of the circuit after the simplification step is applied.

The classes use the following objects outside of this module to gather information about the circuit:
  • lcapyInskale.Solution

  • lcapyInskale.SolutionStep