Ask Your Question
0

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

asked Feb 11 '1

L0r3als gravatar image

Hello;

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

TAP=1.000+Tap_pos
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'

2 answers

Sort by » oldest newest most voted
2

answered Feb 15 '1

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.

link
0

answered Feb 11 '1

wayne850306 gravatar image

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

link

Comments

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 (Feb 12 '1)

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.
Want to format code in your answer? Here is a one minute demo on Youtube

Add Answer

[hide preview]

Question Tools

Stats

Asked: Feb 11 '1

Seen: 276 times

Last updated: Feb 15 '21