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 theTransformers.dssfile 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.Nonekeeps every transformer and reports its lowest-voltage winding as the secondary.tolerance_kv (
float) – Tolerance when matchingsecondary_kv.
- Return type:
- Returns:
A frame with columns
name,rating_kva,low_voltage_busandsecondary_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.