0

Caspy breaks Python

Hello, I have done a range of tasks using psspy. I can also import caspy successfully, import caspy ; however, when I try to read a saved case using sample = caspy.Savecase(r'path/to/examples/savnw.sav') , Python stops working and I get the infamous window of "Python has stopped working." What do you think is the problem?

  1. The psspy functions work perfectly.
  2. PSSE 34
  3. I am running Python 2.7.9 from PSSE Command Prompt, on Windows 7

Any help is appreciated.

Ali's avatar
26
Ali
asked 2017-08-02 23:42:23 -0500, updated 2017-08-02 23:44:38 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

0

I tested caspy on PSSE v.34.2, running from the GUI and from python:

  • It works as expected using a v.34 sav case
  • When 'loading' a previous version (v.32) sav case, it did not crash but it gave truncated data, like not being picked up from the right location. (due to different version internal formatting!?).

    import psse34

    import caspy

    sample = caspy.Savecase('savnw34.sav')

    print sample.pssznm

jconto's avatar
2.9k
jconto
answered 2017-08-03 08:19:19 -0500
edit flag offensive 0 remove flag delete link

Comments

Thank you, but this is what I have been doing and every time I do it, Python stops working. Any other ideas?

Ali's avatar Ali (2017-08-03 17:51:35 -0500) edit

are you using PSSe v.34.2? is your sav case a v.34 case?

jconto's avatar jconto (2017-08-03 19:55:52 -0500) edit

I am using PSSE Version 34.0.0 April 23rd, 2015 (RC8). I am using the case file that is provided with the software. The savnw.sav file was last edited April 16, 2015, which makes me think they must be from the same version.

Ali's avatar Ali (2017-08-03 20:47:42 -0500) edit

I had submitted the bug to PTI about a year ago and the tech engineer rather brusquely told me it was fixed in version 33.9 and asked me to update. However my company only paid for the onetime v33.1 so I am stuck with that buggy version.

mbong's avatar mbong (2017-08-04 00:52:36 -0500) edit
add a comment see more comments
0

This has been a problem which seemingly is supposed to have been fixed (according to the PTI engineer in version > 33). I had to rewrite Gridcompare into PSSEcompare to handle it. you can download and see the code that somewhat handles it: by forking a process seeing if it crashes (meaning bad caspy) and uses another accessor library.

mbong's avatar
26
mbong
answered 2017-08-03 19:36:55 -0500, updated 2017-08-03 19:37:50 -0500
edit flag offensive 0 remove flag delete link

Comments

Thank you. I had seen the PSSECompare before, however, I don't know how to use it here to fix this issue. Would you care to elaborate?

Ali's avatar Ali (2017-08-03 20:49:33 -0500) edit

if you have a bad caspy with your PSSE installation the only other way is to use psspy. I have more detailed explanation of the problem and solution in my PSSEcompare page in the readme file. There is no workarond to caspy except updating psse

mbong's avatar mbong (2017-08-04 00:47:24 -0500) edit

I have tried to make the python code as simple as possible (one of the main reason for writing the utility)

mbong's avatar mbong (2017-08-04 00:58:06 -0500) edit

I tested caspy on PSSE v.33.10, running from the GUI and from python: It works as expected using a v.33 sav case When 'loading' a previous version (v.32) sav case, it did not crash but it gave an error.

jconto's avatar jconto (2017-08-04 10:41:39 -0500) edit

Well that confirms that they fixed it. I think I was told v 33.09 as the version that fixed it by PTI.

mbong's avatar mbong (2017-08-04 11:59:13 -0500) edit
add a comment see more comments

Your Answer

Login/Signup to Answer