simplipfy.Export.DataStructures package

Submodules

simplipfy.Export.DataStructures.exportDict module

class simplipfy.Export.DataStructures.exportDict.CptExportDict(rName: str, uName: str, iName: str, zImpedance, cpxVal, re, im, phase, zVal, uVal, uPhase, iVal, iPhase, hasConversion: bool)

Bases: dict

Dict that holds the data of one component and is used in classes derived from ExportDictBase

class simplipfy.Export.DataStructures.exportDict.EmptyCptExportDict

Bases: CptExportDict

Dict that holds the data of one empty component and is used in classes derived from ExportDictBase

class simplipfy.Export.DataStructures.exportDict.EmptyExportDict(simplifierState: SimplifierStates)

Bases: ExportDict

Export dict that holds the data of an empty step<n> where n>0, and is used in DictExport class

class simplipfy.Export.DataStructures.exportDict.ExportDict(step: str, canBeSimplified: bool, simplifiedTo: dict, componentsRelation: ComponentRelation, simplifierState: SimplifierStates, svgData: str, cpts: list[CptExportDict], allCpts: list[CptExportDict])

Bases: ExportDictBase

Export dict that holds the data of step<n> where n>0 and is used in DictExport class

class simplipfy.Export.DataStructures.exportDict.ExportDictBase

Bases: dict

file_name = ''

Base class for all export dicts. Handles save to file to create json and svg files.

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

save_path = ''
classmethod set_paths(savePath, fileName)
toFiles(savePath=None, fileName=None) tuple[bool, str, str]
toJSON(savePath=None, fileName=None) str

Saves the export dict to a json file. The file is saved in the format <filename>_<step>.json :param savePath: path to save the file to, defaults to self.save_path :param fileName: name of the saved file, defaults to self.file_name :returns: path to the saved file

toSVG(savePath=None, fileName=None) str

Saves the export dict to a svg file. The file is saved in the format <filename>_<step>.json :param savePath: path to save the file to, defaults to self.save_path :param fileName: name of the saved file, defaults to self.file_name :returns: path to the saved file

class simplipfy.Export.DataStructures.exportDict.Step0ExportDict(step, sources: list[Step0ExportDictSource], allCpts: list[DictExportElement], circuitType: str, svgData: str)

Bases: ExportDictBase

Export dict that holds the data of step0 and is used in DictExport class

class simplipfy.Export.DataStructures.exportDict.Step0ExportDictSource(sourceType: str, omega_0: str, frequency: str, val: CptExportDict)

Bases: dict

Dict that holds the data of one source and is used in classes derived from ExportDictBase

simplipfy.Export.DataStructures.exportElement module

class simplipfy.Export.DataStructures.exportElement.ExportElement(circuit: Circuit, omega_0, compName: str, langSymbols: LangSymbols, multipleSources: bool, prefAndUnit=True, precision=3)

Bases: DictExportBase

Collects the infromation needed in the frontend for a comoponent

property cpxVal
property hasConversion: bool
property i
property magnitude
toCptDict() CptExportDict

Handles unit and prefix depending on the self.isSymbolic flag. Function is assigned at runtime in __init__ to self.toCptDict. if self.isSymbolic is True, no unit and prefix are added to latex strings, if self.isSymbolic is False, unit and prefix are added to latex strings :returns: CptExportDict, a dictionary with the values of one element see exportDict.py

toSourceDict()
property u
property value

simplipfy.Export.DataStructures.simpStepElements module

Module contents

Separate data structures from the logic classes of Export Module