Package: pfgadgets
pfgadgets packageDescription: This package is designed to assist in the use of python within the powerfactory environmentClasses List:CreateSetFrequencySweepGetDataGetObjectGetPlotHarmonicLoadFlowLoadFlowShortCircuitClass Descriptionpfgadgets.CreateSetCreateSet(setName, *args, setType=5, studyCaseName=None)Description: This class is designed to create a setParameters:setName - Name of set to createsetType - Defines the type of set to create. Refer PF for typesstudyCaseName - Defines the name of the study case to create set in. If None then will create in active study caseAttributes:.set - Returns the created set objectpfgadgets.FrequencySweepFrequencySweep(*args, method=0, init=0, start=50, stop=2500, results=None)Description: This class is designed to perform a frequency sweep calaculationParameters:method - defines the frequency sweep method (0 - balanced, 1 - unbalanced)init - defines whether to initialise with load flowstart - defines the starting frequencystop - defines the ending frequencyresults - defines which results variable to save results topfgadgets.GetDataGetData(setName, attributeList, *args, resultHeadings=None)Description: This class is designed to collect data from a set and offers export to csv optionParameters:setName - Name of the set to extract data fromattributeList - List of attributes to get data fromresultHeadings - List of strings for data frame headingsAttributes:.obj - Returns object/s that data was collected from.name - Returns name of object/s that data was collected from.attribute - Returns list of attributes that was collected.result - Returns the results data frame that holds the extracted datapfgadgets.GetData.exportpfgadgets.GetData.export(fileName = 'results', filePath =  None, replace=False)Description: Exports the collected data to a csvParameters:fileName - Name of file that data will export to. Should not include file extension.filePath - Defines directory where csv will export to. If None then export to script directoryreplace - Defines whether to replace existing files or not. (False - do not replace existing, True - replace existing)pfgadgets.GetObjectpfgadgets.GetObject(objectName)Description: This class is deisnged to collect a given objectParameters:objectName - Name of object to collectAttributes:.obj - Returns the collected object.name - Returns the name of the collected objectpfgadgets.GetPlotpfgadgets.GetPlot(plotName, pageType='SetVipage')Description: This class is designed to collect a plot page and offers an export optionParameters:plotName - Name of plot to be collectedpageType - Defined the type of page to be collectedAttributes:.plot - Returns to plot objects that was collected.title - Returns the title object that may be included in a plot pagepfgadgets.GetPlot.exportpfgadgets.GetPlot.export(*args, fileType='wmf', filePath=None, frame = 0, fileName=None, replace=False)Description: Exports the plot page to the desired type and locationParameters:fileType - Defines the extension of the exported plot page filefilePath - Defines directory where csv will export to. If None then export to script directoryframe - Defines whether to include a page fram or not (0 - no frame, 1 - include frame)fileName - Name of file that data will export to. Should not include file extension.replace - Defines whether to replace existing files or not. (False - do not replace existing, True - replace existing)pfgadgets.HarmonicLoadFlowpfgadgets.HarmonicLoadFlow(*args, method=0)Description: This class is designed to perform a harmonic load flow calcualtionParameters:method - defines the harmonic load flow method (0 - balanced, 1 - unbalanced)pfgadgets.LoadFlowpfgadgets.LoadFlow(method=0, autoTap=0, feederScaling=0, opScen=None)Description: This class is designed to perform a load flow calculationParameters:method - defines the load flow method (0 - balanced, 1 - unbalanced)autoTap - defines whether to enable automatic tap changine (0 - off, 1 - on)feederScaling - defines whether to enable feeder load scaling (0 - off, 1 - on)opScen - defines the operation scenario to activate before calculation (if None then then no operation sceanrio will be activated)pfgadgets.ShortCircuitpfgadgets.ShortCircuit(objectName, faultType='3psc', calculate=0, setSelect=None, opScen=None)Description: This class is designed to perform a short-circuit calculationParameters:objectName - Name of object to perform short-circuit calculation on. If setSelect!=None then a set can be passed instead of an objectfaultType - Defines the type of fault to use during short-circuit calculationcalculate - Defines whether to use maximum or minimum fault calculation (0 - maximum, 1 - minimum)setSelect - Defines whether a set or single object is used for calculation (None - single object, != None - set)Attributes:.obj - Returns object/s where short-circuit calculation was performed.name - Returns name/s of objects where short-circuit calculation was performed