NetworkLV
Low-voltage network model supporting unbalanced analysis.
Import
python
from pyptp import NetworkLVQuick Start
python
# Load from file
network = NetworkLV.from_file("input.gnf")
# Access elements
for node in network.nodes.values():
print(node.general.name)
# Save to file
network.save("output.gnf")Properties
The network's global properties are stored in the properties attribute:
properties: PropertiesLV
Element Collections
The network stores elements in typed collections:
Dict Collections
Elements indexed by key (typically GUID):
| Collection | Key Type | Element Type |
|---|---|---|
frames | Guid | FrameLV |
profiles | Guid | ProfileLV |
gmtypes | int | GMTypeLV |
sheets | Guid | SheetLV |
nodes | Guid | NodeLV |
cables | Guid | CableLV |
links | Guid | LinkLV |
homes | Guid | ConnectionLV |
legends | Guid | LegendLV |
sources | Guid | SourceLV |
fuses | Guid | FuseLV |
transformers | Guid | TransformerLV |
special_transformers | Guid | SpecialTransformerLV |
reactance_coils | Guid | ReactanceCoilLV |
syn_generators | Guid | SynchronousGeneratorLV |
async_generators | Guid | AsynchronousGeneratorLV |
async_motors | Guid | AsynchronousMotorLV |
earthing_transformers | Guid | EarthingTransformerLV |
shunt_capacitors | Guid | ShuntCapacitorLV |
batteries | Guid | BatteryLV |
loads | Guid | LoadLV |
circuit_breakers | Guid | CircuitBreakerLV |
pvs | Guid | PVLV |
load_switches | Guid | LoadSwitchLV |
measure_fields | Guid | MeasureFieldLV |
List Collections
Elements stored in ordered lists:
| Collection | Element Type |
|---|---|
comments | CommentLV |
selections | SelectionLV |
Methods
Class Methods
| Method | Description |
|---|---|
from_file(path: str | Path) -> NetworkLV | Create LV network from GNF file. |
Instance Methods
| Method | Description |
|---|---|
delete_transformer(guid: str) -> bool | Remove transformer from network by GUID string. |
get_cable_guid_by_name(name: str) -> str | Find cable GUID by name. |
get_link(guid: Guid) -> LinkLV | None | Find link by GUID. |
get_node_guid_by_name(name: str) -> str | Find node GUID by name. |
get_sheet_guid_by_name(name: str) -> str | Find sheet GUID by name. |
get_transformer(guid: str) -> TransformerLV | None | Find transformer by GUID string. |
save(path: str | Path) -> None | Save network to GNF file. |