susantoj / PYPOWER-Dynamics

Python-based transient stability simulation program
BSD 3-Clause "New" or "Revised" License
57 stars 31 forks source link

Wrap replace with unicode function call in neg_token #13

Open rwl opened 7 years ago

rwl commented 7 years ago

In order to get controllers to work with Python 2.7 I had to wrap the replace operation with a unicode call in the neg_token function. I suspect this is a Python 2 only issue and has no effect when using Python 3.

            if unicode(x.replace('.','0')).isnumeric() == True:

https://github.com/susantoj/PYPOWER-Dynamics/blob/bb90844434e35fa6be3387c85bf9ed7e30e9f4c6/pydyn/controller.py#L197