I/O with DSS files (debug)

krangpower offers compatibilty with the classic DSS format of OpenDSS, mainly for purposes of back-compatibility and debugging.


Krang exposes a Krang.from_dss class method. It was written with the only scope of allowing direct use of existing dss scripts without having to translate them to krangpower instructions; in all other cases, writing a krangpower script is to be always preferred.

classmethod Krang.from_dss(file_path, target_krang=None, frequency=50.0)

from_dss(file_path, target_krang, frequency) allows to create a krang from an existing dss script or to pass commands to a krang from an existing dss script. USE AT YOUR OWN RISK.

  • file_path – The path of the dss file to utilize
  • target_krang
    • If None, a new krang will be created and initialized with the information from the file (must contain a ‘new circuit’ command).
    • If a Krang is passed, the commands in the script will be passed to that Krang.
  • frequency – the general frequency to use for the krang, if a new one is created.


Krang.save_dss saves a dss from the series of instructions that were imparted through the Krang.command method.


Modifications operated through other means than the text interface won’t be included!


Saves a file with the text commands that were imparted by the Krang.command method aside from those for which echo was False. The file output should be loadable and runnable in traditional OpenDSS with no modifications.