Update plot.py for more recent xarray; also allow dask arrays to be passed to single_panel, six_plot routines #257
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.
This PR fixes an issue that seems to have been introduced with recent versions of xarray. The following updates were made:
(1) The following code in routine
get_extents_for_color
(ingcpy/plot.py
):needed to be changed to
as calling
where
withdrop=True
on an xarray object silently evaluates the data. Using.compute()
forces xarray to do the actual computation. This behavior seems to have changed in xarray recently. For a similar issue, see: hainegroup/oceanspy#332. The object returned also seems to be of typedask.array.Array
instead ofxarray.DataArray
ornumpy.ndarray
.(2) We now must add this import statement;
so that we can add this to calls to
verify_variable_type
.(3) We must now also add
DaskArray
to the calls toverify_variable_type
insix_plot
andsingle_panel
inplot.py
:(4) Update Pydoc headers accordingly:
(5) Because these fixes allow benchmark plots to proceed, we can remove the pegged xarray from
environment.yml
and replace it with