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

Add support for packing grid value dimensions #3983

Merged
merged 9 commits into from
Sep 24, 2019

Conversation

philippjfr
Copy link
Member

@philippjfr philippjfr commented Sep 22, 2019

This PR makes it possible to construct gridded datasets where all the value dimensions are packed into a single array. This is often a much more natural format, e.g. for an RGB:

hv.RGB(([1, 2, 3], [1, 2, 3], np.random.rand(3, 3, 3)))
# or equivalently
hv.RGB({'x': [1, 2, 3], 'y': [1, 2, 3], ('R', 'G', 'B'): np.random.rand(3, 3, 3)})

Also adds support for packed value dimensions on xr.DataArray types:

da = xr.DataArray(data=np.random.randint(0, 255, (2, 2, 4)), dims=('x', 'y', 'band'), coords={'x': [1, 2], 'y': [1, 2], 'band': [0, 1, 2, 3]})
hv.RGB(da)

Closes #550
Closes #3311

@philippjfr philippjfr added tag: component: data type: enhancement Minor feature or improvement to an existing feature labels Sep 22, 2019
@philippjfr philippjfr added this to the v1.13.0 milestone Sep 22, 2019
@philippjfr philippjfr merged commit d120870 into master Sep 24, 2019
@philippjfr philippjfr deleted the philippjfr/packed_grid_vdims branch October 2, 2019 17:10
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tag: component: data type: enhancement Minor feature or improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RGB and xarray/dask Support packed value dimensions in Grid interfaces
1 participant