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 compile_targets.py when using numpy 1.24.0 or newer #220

Merged
merged 1 commit into from
Feb 17, 2023

Conversation

pekkarr
Copy link
Contributor

@pekkarr pekkarr commented Feb 9, 2023

Fixes #217

Numpy 1.24.0 removed creation of arrays with mismatched dimensions to have implicit dtype=object. To maintain the old behavior, dtype=object has to be specified explicitly.

https://numpy.org/neps/nep-0034-infer-dtype-is-object.html

This changes the return type of LicenseInfo.toNumpyString() to a numpy array. The method is used in three places:

  • compile_targets.py: Previously the tuple return value was converted to a numpy array implicitly by the np.save method. With this change, it gets a numpy array instead of a tuple, so the behavior is exactly the same as with older numpy versions.
  • core/algos3d.py: The return value is passed to np.ascontiguousarray, which also converts arguments implicitly to numpy arrays, so this should work with the change as well.
  • shared/proxy.py: The return value is destructured to two variables. Numpy arrays support this so it isn't affcected by the change.

Numpy 1.24.0 removed creation of arrays with mismatched
dimensions to have implicit dtype=object. To maintain the old behavior,
dtype=object has to be specified explicitly.
@joepal1976 joepal1976 self-requested a review February 17, 2023 07:43
@joepal1976 joepal1976 self-assigned this Feb 17, 2023
@joepal1976
Copy link
Contributor

So far validated not causing problems on earlier numpy (1.17.4)

@joepal1976
Copy link
Contributor

Can't see any obvious downside of this. Going to merge so it ends up in nightly and see if we feedback from somewhere else.

@joepal1976 joepal1976 merged commit d89a93d into makehumancommunity:master Feb 17, 2023
ryanakca pushed a commit to ryanakca/OpenBSD-ports that referenced this pull request Mar 22, 2023
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.

Building makehuman fails with numpy 1.24+ in compile_targets.py
2 participants