home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 274296715

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/issues/1215#issuecomment-274296715 https://api.github.com/repos/pydata/xarray/issues/1215 274296715 MDEyOklzc3VlQ29tbWVudDI3NDI5NjcxNQ== 1217238 2017-01-22T00:01:12Z 2017-01-22T00:01:12Z MEMBER

OK, I understand what's going on now.

Previously, we had a hack that disabled writing variables along dimensions of the form [0, 1, ..., n-1] to disk, because these corresponded to default coordinates and would get created automatically. We disable this hack as part of #1017, because it was no longer necessary.

So although your example worked in v0.8.2, this small variation did not, because we call netCDF4.Dataset.createVariable twice with a dimension of the name 'dim': ```python ds = xr.Dataset() ds['dim'] = ('dim', [1, 2, 3]) ds['var1'] = ('dim', [10, 11, 12]) ds.to_netcdf(path)

ds = xr.Dataset() ds['dim'] = ('dim', [1, 2, 3]) ds['var2'] = ('dim', [10, 11, 12]) ds.to_netcdf(path, 'a') ```

I find it reassuring that this only worked in limited cases before, so it unlikely that many users are depending on this functionality. It would be nice if mode='a' worked to append new variables to an existing netCDF file in the case of overlapping variables, but perhaps we don't need to fix this for v0.9.

My main concern with squeezing this in is that the proper behavior is not entirely clear and will need to go through some review:

  • Do we load existing variable values to check them for equality with the new values, or alternatively always skip or override them?
  • How do we handle cases where dims, attrs or encoding differs from the exiting variable? Do we attempt to delete and replace the existing variable, update it inplace or error?
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  201428093
Powered by Datasette · Queries took 0.617ms · About: xarray-datasette