engineerjoe440 / ElectricPy

Electrical Engineering Formulas in Python
https://electricpy.readthedocs.io/en/latest/
MIT License
86 stars 16 forks source link

Support Creation of Phasor Array Using Load from NumPy Array #115

Open engineerjoe440 opened 1 year ago

engineerjoe440 commented 1 year ago

There's got to be a way to support this syntax:

import numpy as np
import electricpy as ep
x = np.arrange(0, 720, 1)
v = ep.phasor(1, 178 + x)

Presently, there's an error:

Traceback (most recent call last):
  File "<pyshell#27>", line 1, in <module>
    v = ep.phasor(1, 178 + x)
  File "C:\Python311\Lib\site-packages\electricpy\phasors.py", line 89, in phasor
    return _c.rect(mag, _np.radians(ang))
TypeError: only size-1 arrays can be converted to Python scalars