read_transformers#

popo.network.read_transformers(definition, secondary_kv=None, tolerance_kv=0.01)#

Read transformers from an OpenDSS definition file.

Parameters:
  • definition (Path) – Path to the Transformers.dss file of a circuit.

  • secondary_kv (float | None) – Keep only transformers with a winding at this voltage, and report that winding, which is how distribution transformers are separated from upstream ones. None keeps every transformer and reports its lowest-voltage winding as the secondary.

  • tolerance_kv (float) – Tolerance when matching secondary_kv.

Return type:

DataFrame

Returns:

A frame with columns name, rating_kva, low_voltage_bus and secondary_kv, one row per transformer, duplicates removed.

Raises:
  • FileNotFoundError – If the definition file does not exist.

  • ValueError – If the file parses but yields no transformer, which means the format is not the one expected rather than that the circuit is empty.