Ask Your Question

AttributeError: tuple object has no attribute 'realari' when I tried to print the tap position

asked 2021-02-11 11:22:20 -0500

L0r3als gravatar image


I did a program which increases a TAPs position in an OLTC transformer. However, when I want to see the tap position I have an Error. Someone knows how could I obtain the TAP position with print command? or maybe I need to use another, What do you think?

Set the TAP position

ierr, TRF = psspy.two_winding_data_6(ibus_trafo, jbus_trafo, '1', realari4=TAP)

For obtaining the value I used the next command:

print("TAP = " TRF.realari[3])
print("TAP = " TRF.realari4)

I obtained the next error message depending on the print used:

AttributeError: 'tuple' object has no attribute 'realari'
attributeError: tuple object has no attribute 'realari4'
edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2021-02-15 05:21:32 -0500

perolofl gravatar image

The API is returning ierr, realaro. Print ierr and realaro to see the content. The value returned in realaro is the actual transforrmer resistance and reactande, i.e. a tuple. Note that the API is not returning the ratio of the transformer or the tap position.

edit flag offensive delete link more

answered 2021-02-11 16:27:37 -0500

wayne850306 gravatar image

you can use print(TRF) to see the structure of TRF. Probably try print(TRF[0].realari[3]).

edit flag offensive delete link more


Thank you but it does not work. Now it says that this property is a float, so I tried to convert to string but it does not work. AttributeError: 'float' object has no attribute 'realari'

L0r3als gravatar imageL0r3als ( 2021-02-12 02:52:31 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools


Asked: 2021-02-11 11:22:20 -0500

Seen: 50 times

Last updated: Feb 15