home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 91109966

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
91109966 MDU6SXNzdWU5MTEwOTk2Ng== 443 multiple files - variable X not equal across datasets 1177508 closed 0     9 2015-06-26T00:18:21Z 2015-06-29T18:06:54Z 2015-06-29T18:06:54Z NONE      

The other day I was playing with xray.open_mfdataset and I noticed you can get this error, when opening multiple files at the same time. I think there is a pretty easy solution to this:

``` python import glob as g from toolz.curried import curry, map, pipe import xray

def get_ds(glob): def _get_ds(file_path): dim = 'mean_height_agl' dim_new = 'agl' with xray.open_dataset(file_path) as _ds: _ds.load() return (_ds.assign_coords(**{dim_new: (dim, range(_ds.coords[dim].size))}) .swap_dims({dim: dim_new}))

return pipe(g.glob(glob),
            sorted,
            map(_get_ds),
            curry(xray.concat)(dim='time'))

```

Of course, this is for a particular variable I was having trouble with, but the idea is to swap dimensions, that is create a dummy dimension with the same length as the troublesome variable and then swap the two. This can be done for any number of troublesome variables. I don't know how feasible this is though. Just thought to share my idea...

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/443/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 1 row from issues_id in issues_labels
  • 9 rows from issue in issue_comments
Powered by Datasette · Queries took 159.201ms · About: xarray-datasette