Skip to main content

A Python package to assist in the use of Python within PowerFactory

Project description

pfgadgets package

Description: This package is designed to assist in the use of python within the powerfactory environment

Classes List:

  • CreateSet
  • FrequencySweep
  • GetData
  • GetObject
  • GetPlot
  • HarmonicLoadFlow
  • LoadFlow
  • ShortCircuit

Class Description

pfgadgets.CreateSet

CreateSet(setName, *args, setType=5, studyCaseName=None)

Description: This class is designed to create a set

Parameters:

  • setName - Name of set to create
  • setType - Defines the type of set to create. Refer PF for types
  • studyCaseName - Defines the name of the study case to create set in. If None then will create in active study case

Attributes:

  • .set - Returns the created set object

pfgadgets.FrequencySweep

FrequencySweep(*args, method=0, init=0, start=50, stop=2500, results=None)

Description: This class is designed to perform a frequency sweep calaculation

Parameters:

  • method - defines the frequency sweep method (0 - balanced, 1 - unbalanced)
  • init - defines whether to initialise with load flow
  • start - defines the starting frequency
  • stop - defines the ending frequency
  • results - defines which results variable to save results to

pfgadgets.GetData

GetData(setName, attributeList, *args, resultHeadings=None)

Description: This class is designed to collect data from a set and offers export to csv option

Parameters:

  • setName - Name of the set to extract data from
  • attributeList - List of attributes to get data from
  • resultHeadings - List of strings for data frame headings

Attributes:

  • .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 data

pfgadgets.GetData.export

pfgadgets.GetData.export(fileName = 'results', filePath = None, replace=False)

Description: Exports the collected data to a csv

Parameters:

  • 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 directory
  • replace - Defines whether to replace existing files or not. (False - do not replace existing, True - replace existing)

pfgadgets.GetObject

pfgadgets.GetObject(objectName)

Description: This class is deisnged to collect a given object

Parameters:

  • objectName - Name of object to collect

Attributes:

  • .obj - Returns the collected object
  • .name - Returns the name of the collected object

pfgadgets.GetPlot

pfgadgets.GetPlot(plotName, pageType='SetVipage')

Description: This class is designed to collect a plot page and offers an export option

Parameters:

  • plotName - Name of plot to be collected
  • pageType - Defined the type of page to be collected

Attributes:

  • .plot - Returns to plot objects that was collected
  • .title - Returns the title object that may be included in a plot page

pfgadgets.GetPlot.export

pfgadgets.GetPlot.export(*args, fileType='wmf', filePath=None, frame = 0, fileName=None, replace=False)

Description: Exports the plot page to the desired type and location

Parameters:

  • fileType - Defines the extension of the exported plot page file
  • filePath - Defines directory where csv will export to. If None then export to script directory
  • frame - 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.HarmonicLoadFlow

pfgadgets.HarmonicLoadFlow(*args, method=0)

Description: This class is designed to perform a harmonic load flow calcualtion

Parameters:

  • method - defines the harmonic load flow method (0 - balanced, 1 - unbalanced)

pfgadgets.LoadFlow

pfgadgets.LoadFlow(method=0, autoTap=0, feederScaling=0, opScen=None)

Description: This class is designed to perform a load flow calculation

Parameters:

  • 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.ShortCircuit

pfgadgets.ShortCircuit(objectName, faultType='3psc', calculate=0, setSelect=None, opScen=None)

Description: This class is designed to perform a short-circuit calculation

Parameters:

  • objectName - Name of object to perform short-circuit calculation on. If setSelect!=None then a set can be passed instead of an object
  • faultType - Defines the type of fault to use during short-circuit calculation
  • calculate - 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pfgadgets-0.0.2.tar.gz (6.1 kB view hashes)

Uploaded Source

Built Distribution

pfgadgets-0.0.2-py3-none-any.whl (6.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page