jonathf / numpoly

Numpy compatible polynomial representation
https://numpoly.readthedocs.io
BSD 2-Clause "Simplified" License
12 stars 5 forks source link

AttributeError with division #88

Open Archerlite opened 3 years ago

Archerlite commented 3 years ago

Hi,

I'm a brand new user on Github and therefore sorry if it is not how I'm expected to use this topic.

Your package seems very useful and I thank you for implementing all of that. However, I'm finding an error when dividing a polynomial by another. Using "/", "%" and "divmod" all end up in an error : AttributeError: module 'numpy' has no attribute 'broadcast_shapes'

Do you have any idea what in the division functions could end up in such an error ? I tried with elements of the 'numpoly.baseclass.ndpoly' class of different lengths, and none worked. Note that the same error appears when using the symbol "*".

Thank you, Archer

jonathf commented 3 years ago

No worries.

Can you give me the following info?

Archerlite commented 3 years ago

I'm using Python 3.8, Numpy 1.19, and Numpoly 1.2.3 .

Thank you for answering, I'm really interested in knowing what my mistake can be and how to solve this error. I however found a solution to achieve my program, using the "traditional" functions of Numpy.polynomial with arrays of coefficients rather than Polynomials class. I don't know if this solution I found can help you to understand my mistakes with Numpoly (which I'd really like to use for further projects).

Thanks for your commitment.

jonathf commented 3 years ago

I don't think this is an error you created. Numpoly is dependent on a Numpy function that isn't introduced before 1.20 if I remember correctly.

Run pip install -U numpy and try running your code again.