Overview
The Network module provides the core functionality for working with power system networks in PyPowSyBl. It includes the mainNetwork class for representing and manipulating power networks, as well as utilities for loading networks from files, creating test networks, and accessing network data.
Network Class
TheNetwork class represents a power system network and provides methods for accessing and modifying network data.
Constructor
The Network class is typically not instantiated directly. Instead, use one of the factory functions likeload() or create_empty().
Properties
The unique identifier of the network
The name of the network
The format of the source file from which the network was loaded (e.g., ‘XIIDM’, ‘UCTE’)
The date of the network case, in UTC timezone
The forecast distance (0 for a snapshot)
The nominal power used to convert the network to per-unit (in kVA). Default is 100.0
Whether the network data should be used in per-unit representation. Default is False
Key Methods
save
Save a network to a file using the specified format.Path to the exported file
Format to save the network (e.g., ‘XIIDM’, ‘UCTE’)
A dictionary of export parameters
Reporter for creating an execution report
This method does not return a value
connect / disconnect
Connect or disconnect a network element.The ID of the element to connect or disconnect
True if the operation was successful
open_switch / close_switch
Open or close a switch.The ID of the switch
True if the operation was successful
reduce_by_voltage_range
Reduce the network to a smaller network by voltage range.Minimum voltage of the voltage levels kept after reducing (in kV)
Maximum voltage of the voltage levels kept after reducing (in kV)
Whether dangling lines should be created to replace lines cut at the boundary of reduction
Loading Networks
load
Load a network from a file.Path to the network file. Supported formats include XIIDM, UCTE, and more. Compression formats (gzip, bzip2) are also supported
A dictionary of import parameters specific to the file format
A list of import post-processors to apply after loading
Reporter for creating an execution report
Allow multi-thread access to network variants
The loaded network object
is_loadable
Check if a file is a loadable network.Path to the file to check
True if the file is a loadable network, False otherwise
Creating Networks
create_empty
Create an empty network.ID of the network
Allow multi-thread access to network variants
A new empty network
IEEE Test Networks
Create standard IEEE test networks:Other Test Networks
Utility Functions
get_import_formats
Get the list of supported import formats.List of supported import format names
get_export_formats
Get the list of supported export formats.List of supported export format names
get_import_parameters
Get the import parameters for a specific format.The import format name
DataFrame containing the available import parameters for the specified format
Enumerations
ElementType
Enumeration of network element types:NETWORKSUBSTATIONVOLTAGE_LEVELGENERATORLOADBUSLINETWO_WINDINGS_TRANSFORMERTHREE_WINDINGS_TRANSFORMER- And more…
ValidationLevel
Enumeration of validation levels:STEADY_STATE_HYPOTHESISEQUIPMENT
See Also
- Load Flow - Run power flow calculations
- Security Analysis - Perform security analysis
