forallpeople icon indicating copy to clipboard operation
forallpeople copied to clipboard

Error when multiplying arrays

Open cslotboom opened this issue 4 years ago • 4 comments

Hey, I recently got this error when attempting to multiply a numpy array by a scalar "forallpeople.Physical" object It seems like I can multiply two numpy arrays but not a scalar and array.

This might be expected behavior, if it's not I thought I would mention it:

image

image

Vector multiplication works: image

cslotboom avatar Oct 22 '20 19:10 cslotboom

Hi Christian (@cslotboom),

Thanks for bringing this up. It is a problem that I am aware of. In the short-term, does changing the order of multiplication work?

e.g. (F*height) instead of (height*F)

connorferster avatar Oct 22 '20 19:10 connorferster

Hey Connor! Thanks for your reply. I've since changed around my example a bit, but in general changing the order seems to work. The issue only seems to occur when printing too. All the lines work except for the last one image

cslotboom avatar Oct 27 '20 22:10 cslotboom

The next major version of forallpeople will look to incorporate numpy ufuncs for full and proper numpy compatibility. Don't have a timeline yet but it will certainly be this year.

connorferster avatar Apr 17 '21 06:04 connorferster

@cslotboom Or maybe in 2023...? It's still very much on my mind.

connorferster avatar Aug 31 '22 05:08 connorferster