BUG: fix future incompatiblities with unyt 3.0 (2/n) #4166
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Summary
Follow up to #4136 and yt-project/unyt#293, this adapts yt to stay compatible with latest development in unyt (#4162).
Here's my reasoning:
unyt.udot
andunyt.uconcatenate
)np.dot
andnp.concatenate
) that will be the replacement because that will not work before unyt 3.0 is available.yt
andyt.units
namespace currently re-expose this unyt API directlyThe simpler option I can see to get around the deprecation warnings in CI without simply filtering them is to
vendor specifically this part of unyt's API, but do so in an isolated and hidden module (
yt.units._numpy_wrapper_functions
), and use that internally. This module is meant to be deprecated itself at some point in the future, but we'll be able to control that on yt's own development cycle, instead of being tightly coupled to unyt's.I ran the bleeding-edge workflow on my fork to show that this branch fixes the current instabilities: https://github.com/neutrinoceros/yt/actions/runs/3241090204
I'm labelling this as 2/n because there will be more changes upstream soon ( we're making numpy API unit-aware), but this is by far the largest PR of this series. Upcoming PRs should be much smaller in size and look more like the second commit of this branch.