2. Running a conversion example

Repository DRPOWER GRG CONVERSION contains:

  • the Python script psse2grg.py that takes one source file, either a PSSE model (.raw file) or a GRG model (.json file), as input and converts it into a given target file, either a GRG model or PSSE model.
  • a set of PSSE (.raw) files that could be used for testing in folder PSSE-test-files.

NAME

psse2grg.py

SYNOPSIS

python psse2grg.py [-h] [-s file -t file]

DESCRIPTION

The following arguments need to be given:

-h [--help]
  To get help on how to call the script.

-s [--source=]<path to source/input file>
  To provide the source model to be converted.

-t [--target=]<path to target/output file>
  To provide a target file to save the new converted model to.

EXAMPLE

python psse2grg.py -s ./PSSE-test-files/case24.raw -t ./case24_PSSE2GRG.json

2.1. psse2grg script documentation

Platform:Unix, Windows
Synopsis:This module converts an input model in PSSE format (.raw) to GRG format (.json) or vice-versa.
Module author:Laurentiu.Marinovici@pnnl.gov (Pacific Northwest National Laboratory)
psse2grg.main(argv)

Main function of the module.

Parameters:argv – Command line arguments given as: -s <source model file path> -t <output model file path>
Returns:
Return type:None
psse2grg.print_err()

print(value, …, sep=’ ‘, end=’n’, file=sys.stdout, flush=False)

Prints the values to a stream, or to sys.stdout by default. Optional keyword arguments: file: a file-like object (stream); defaults to the current sys.stdout. sep: string inserted between values, default a space. end: string appended after the last value, default a newline. flush: whether to forcibly flush the stream.