home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 519524084

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/pull/3159#issuecomment-519524084 https://api.github.com/repos/pydata/xarray/issues/3159 519524084 MDEyOklzc3VlQ29tbWVudDUxOTUyNDA4NA== 23618263 2019-08-08T13:44:22Z 2019-08-08T13:44:22Z CONTRIBUTOR

That's a good point. I think in this case, given that it's passed to an arg expected an array, we should raise on 0d.

I was expecting to rely on the current implementation of is_scalar to do the type checking since I'm moving _check_data_shape above as_compatible_data to do something like this

python if utils.is_scalar(data) and coords is not None:

Otherwise everything would be filter out since as_compatible_data returns a 0d given a scalar value. https://github.com/pydata/xarray/blob/8d46bf09f20e022baca98b4050584d93c0ea118b/xarray/core/variable.py#L195-L196

I can only imagine copying is_scalar but removing getattr(value, 'ndim', None) == 0 to filter out the 0d to only do the duplication on scalars.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  472100381
Powered by Datasette · Queries took 0.5ms · About: xarray-datasette