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

uninformative error when creating dataset from nameless xarray.DataArray #1867

Closed
rabernat opened this issue Sep 12, 2017 · 5 comments
Closed
Assignees
Milestone

Comments

@rabernat
Copy link

I tried to create a holoviews Dataset as follows

data = xr.DataArray(np.random.rand(20,30,40),
                    dims=['z', 'y', 'x'],
                    coords={'z': np.arange(20),
                            'y': np.arange(30),
                            'x': np.arange(40)})
ds = hv.Dataset(data)

I got the error

ValueError: None of the available storage backends were able to support the supplied data format.

Finally I figured out that I needed to provide a name to the dataarray

data = xr.DataArray(np.random.rand(20,30,40),
                    dims=['z', 'y', 'x'],
                    coords={'z': np.arange(20),
                            'y': np.arange(30),
                            'x': np.arange(40)},
                    name='testdata')
ds = hv.Dataset(data)

...and it worked fine.

If the error had said something like "xarray dataarrays must have a name to convert to holoviews datasets", it would have saved me some considerable headache.

@philippjfr
Copy link
Member

We need to improve exception handling around the Dataset constructor in general. I've got a proposal around this, which I will describe in detail in a new issue as soon as I get some time to flesh it out.

@jlstevens
Copy link
Contributor

Agreed. We really want better exception messages so I am assigning this issue (tentatively) to the 1.9 milestone.

@philippjfr
Copy link
Member

This should now raise the following error:

DataError: If xarray DataArray does not define a name an explicit vdim must be supplied.

XArrayInterface expects gridded data, for more information on supported datatypes see http://holoviews.org/user_guide/Gridded_Datasets.html

@maxibor
Copy link

maxibor commented Oct 16, 2019

I'm not sure this is related, but I'm getting the same error message here: maxibor/panel-holoviews-volcano#1

Copy link

This issue 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
None yet
Projects
None yet
Development

No branches or pull requests

4 participants