home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 565714909

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/3498#issuecomment-565714909 https://api.github.com/repos/pydata/xarray/issues/3498 565714909 MDEyOklzc3VlQ29tbWVudDU2NTcxNDkwOQ== 1186928 2019-12-14T13:00:28Z 2019-12-14T13:00:28Z CONTRIBUTOR

@TomNicholas I've had a closer look at the code. Nested lists of file paths are processed by:

https://github.com/pydata/xarray/blob/f2b2f9f62ea0f1020262a7ff563bfe74258ffaa1/xarray/backends/api.py#L881-L882

Using the method defined in:

https://github.com/pydata/xarray/blob/f2b2f9f62ea0f1020262a7ff563bfe74258ffaa1/xarray/core/combine.py#L15-L46

In Python 3.7+ the list of paths is essentially flattened list e.g.:

```

import xarray as xr paths = [list('abc'), list('def')] list(xr.core.combine._infer_concat_order_from_positions(paths).values()) ['a', 'b', 'c', 'd', 'e', 'f'] `` Unfortunately the current code uses a dictionary which means that in Python 3.6- the order is not guaranteed preserved. This also implies that the current default0` is not well defined in case of nested lists.

https://github.com/pydata/xarray/blob/f2b2f9f62ea0f1020262a7ff563bfe74258ffaa1/xarray/backends/api.py#L900 https://github.com/pydata/xarray/blob/f2b2f9f62ea0f1020262a7ff563bfe74258ffaa1/xarray/backends/api.py#L964

On the other hands the ids are essentially ND indexes that could perhaps be used...

```

list(xr.core.combine._infer_concat_order_from_positions(paths).keys()) [(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2)] ```

Or should we just stick to file paths as you suggest? And leave the default as is (e.g. ambiguous for Python 3.6-)?

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