How do I call a psspy function without listing every argument?
Many psspy
functions take an enormous number of arguments. In most cases I am using the defaults except for one or two arguments that I actually wish to specify. How can I make my code easier to read by calling the functions with only the arguments I want.
In particular, I am looking for the methodology to take the arguments I want to specify from the Python PSSE API document (normally listed under OPTIONS, INTGAR, etc.) for a particular function and only passing them to the function in my code.
Here is an example piece of API documentation:
1.61 FNSL Use this API to apply the Newton-Raphson power flow calculation (activity FNSL).
...
Python Syntax:
ierr = fnsl(options)
...
where:
Integer OPTIONS(8) Is an array of eight elements specifying solution options (input).
The values are as follows:OPTIONS(1) tap adjustment flag (use tap adjustment option setting by default).
OPTIONS(1) = 0 disable.
OPTIONS(1) = 1 enable stepping adjustment.
OPTIONS(1) = 2 enable direct adjustment.
OPTIONS(2) area interchange adjustment flag (use area interchange adjustment option setting by default).
OPTIONS(2) = 0 disable.
OPTIONS(2) = 1 enable using tie line flows only in calculating area interchange.
etc...
How would I call this function with only issuing keyword arguments for, say, only OPTIONS(2) and not specifying OPTIONS(1)?
Do you have an example? For instance the output of the PSSE macro recording?
It's not necessarily a macro recording (although it will help with that). My problem is when I want to write my own scripts. I would like to know how to compose a function call using the API documentation. I have updated the question to reflect this.