Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numpy Arrays Not Vectorizing #2102

Open
HDavidBarth opened this issue Oct 21, 2023 · 2 comments
Open

Numpy Arrays Not Vectorizing #2102

HDavidBarth opened this issue Oct 21, 2023 · 2 comments
Assignees

Comments

@HDavidBarth
Copy link

HDavidBarth commented Oct 21, 2023

Describe the bug

Numpy arrays not properly working with scalar multiplication. If you try to multiply a scalar into a numpy array then you get a Type Error: Unsupported types. This only happens if you have the scalar in front of the array, if you have the scalar after the array then it works as expected

Screenshots

Expected behavior:
image

Error:
screenshot

Strangely I just realized if you do np.array * scalar then it works, but if you have the scalar in front of the array it does not work properly.

To Reproduce

create a numpy arr and multiply by a scalar (scalar in front)

Expected behavior

The scalar should multiply by each element in the array and return the scaled array

Environment

  • Epsilon version 21.3.0.
  • Online simulator. And handheld
serval2412 added a commit to serval2412/epsilon that referenced this issue Feb 25, 2024
instead of duplicating ndarray management for int/float (more?),
just swap lhs and rhs (see bug numworks#2102)
@serval2412
Copy link
Contributor

I gave a try with #2159 (don't know if it's the right way to fix this or if it'll be accepted but it works for me locally).

@HugoNumworks
Copy link
Contributor

Hi @serval2412 !

Thanks a lot for identifying this problem, I looked into it and it will be fixed for next version of Epsilon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants