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

Fix ValueError due to inhomogeneous numpy (v1.24+) array #1

Open
wants to merge 1 commit into
base: master_arclab
Choose a base branch
from

Conversation

varunvora
Copy link

This line creates a numpy array of floats and a sequence (X_at_H) as one of its elements. This infers the array's dtype=object. This "feature" was unintended behavior. It was deprecated and raised a warning. As of Numpy v1.24, this feature was removed. Instantiating an SDRaceCar always throws
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (7,) + inhomogeneous part.

More on this here:
https://numpy.org/neps/nep-0034-infer-dtype-is-object.html
numpy/numpy#22004

I explicitly set dtype=object. This change can be verified by instantiating an SDRaceCar object using Numpy v1.24 or newer with and without dtype=object.

@varunvora
Copy link
Author

@jacobjj @njzhangyifei can you have a look?

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

Successfully merging this pull request may close these issues.

None yet

1 participant