mzy2240/ESA

How to open RawFile Version 26?

SaeedNsh opened this issue · 13 comments

Hi everyone,
Anybody knows how Can I open a powercase in rawfile format with version26?
The following code will open Version33 but when I tried for Version 26 it comes with an error.

from esa import SAW
saw=SAW(CASE_PATH)

Check this out:

ESA/esa/saw.py

Line 2646 in 77fd899

def OpenCaseType(self, FileName: str, FileType: str,

I received this error:
'str' object has no attribute 'pwb_file_path'

Work around solution:

saw = SAW(fake_case) # load any case first, PTI v33 or PWB file
saw.OpenCaseType(real_case, "PTI26") # now load the case that is PTI26

Currently there is no elegant way to load a case with specified file type, which could be easily fixed in the init method by introducing a new optional argument file_type.

from esa import SAW
saw=SAW(CASE_PATH)  # load a case first with PTI v33
saw.OpenCaseType(myfilename,"PTI26") # Then load the real file with PTI v26

The second line get loaded but still the following error comes up for third line:
esa.saw.PowerWorldError: OpenCaseTypeSimAuto: Invalid Creation of Loads Transactions parameter.

The alternative way to load a version26 Rawfile is the following line:
simauto_obj.RunScriptCommand("OpenCase(" + myfilename + ", PTI26)")

It is working, However, I need to use ESA package.

Then try this

from esa import SAW
saw = SAW(CASE_PATH) # load a case first with PTI v33
saw.RunScriptCommand("OpenCase(" + myfilename + ", PTI26)")

The second line get loaded but still the following error comes up for third line:
esa.saw.PowerWorldError: OpenCaseTypeSimAuto: Invalid Creation of Loads Transactions parameter.

Do you mind to share the PTI26 case? OpenCaseType works fine in our test.

Original200_1_0.856147436030558.zip
It is in the zip file attached.

saw.OpenCaseType(r"C:\Users\\Downloads\Original200_1_0.856147436030558\Original200_1_0.856147436030558.raw", FileType="PTI26", Options="NO") you need to set LoadTransactions to NO

Zeyu,
Thanks for your support. It is working now.

Feel free to leave a comment if you found ESA useful: #110