0

Is there an API call to get existing Channel arrays directly into Python?

I'm trying to load all existing channel data (ID, name, desc) from a snapshot into a python dictionary so it can be searched to avoid adding duplicate channels later on in my script. Is there any way to get the data from the API directly into a list or dict array?

All I've found is the following process:

psspy.report_output(2,"chan.txt",[1,0])
ierr = psspy.dlst(1,5)
# then open the text file chan.txt
# then parse the text in the report to build my list/dict manually

It would be ideal if I could avoid the cumbersome process of saving out a text report only to read it back in and split the text into a usable Python dictionary. I was hoping there was an API that had the data come out in arrays directly similar to the PSSARRAYS functions for ACCC data.

bronco7TX's avatar
9
bronco7TX
asked 2020-07-31 13:07:27 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

There is the dyntools API. I have only used it to process that kind of data from .out files, not snapshots so I am not sure it can do exactly what you are looking for. The help(dyntools) documentation is probably worth a look.

oppossumX's avatar
50
oppossumX
answered 2020-08-22 20:28:12 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Login/Signup to Answer