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

Cleaned up some deprecations in the OpenMDAO code base #3035

Merged
merged 5 commits into from
Sep 26, 2023

Conversation

swryan
Copy link
Contributor

@swryan swryan commented Sep 22, 2023

Summary

Cleaned up occurrences of the following deprecations in the OpenMDAO code base:

  • Calling nonzero on 0d arrays is deprecated, as it behaves surprisingly. Use atleast_1d(cond).nonzero() if the old behavior was intended. If the context of this warning is of the form arr[nonzero(cond)], just use arr[cond]. (NumPy 1.17)
  • Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (NumPy 1.25)
  • Passing None into shape arguments as an alias for () is deprecated. (NumPy 1.20)
  • jax.linear_util.wrap_init is deprecated. Use jax.extend.linear_util.wrap_init instead. (jax 0.4.16)

Related Issues

Backwards incompatibilities

None

New Dependencies

None

@swryan swryan changed the title Deprecations Cleaned up occurrences of reported deprecations in the OpenMDAO code base Sep 22, 2023
@swryan swryan requested review from Kenneth-T-Moore and naylor-b and removed request for Kenneth-T-Moore September 22, 2023 20:13
Copy link
Member

@Kenneth-T-Moore Kenneth-T-Moore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .item thing is kind of lame, but i guess we have to live with it.

@swryan
Copy link
Contributor Author

swryan commented Sep 22, 2023

The .item thing is kind of lame, but i guess we have to live with it.

agreed.. fwiw, here is the discussion: numpy/numpy#10404

@swryan swryan changed the title Cleaned up occurrences of reported deprecations in the OpenMDAO code base Cleaned up some deprecations in the OpenMDAO code base Sep 22, 2023
@swryan swryan merged commit eca4a09 into OpenMDAO:master Sep 26, 2023
8 checks passed
@swryan swryan deleted the deprecations branch October 27, 2023 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants