home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

2 rows where issue = 286072335 and user = 4133310 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

user 1

  • milancurcic · 2 ✖

issue 1

  • WRF output : cannot serialize variable · 2 ✖

author_association 1

  • NONE 2
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
486390856 https://github.com/pydata/xarray/issues/1809#issuecomment-486390856 https://api.github.com/repos/pydata/xarray/issues/1809 MDEyOklzc3VlQ29tbWVudDQ4NjM5MDg1Ng== milancurcic 4133310 2019-04-24T19:22:52Z 2019-04-24T19:24:27Z NONE

I can't seem recreate this with a minimal example, xarray roundtrips a NetCDF file with a coordinates attribute correctly:

```python from netCDF4 import Dataset import xarray as xr

with Dataset('test.nc', format='NETCDF4', mode='w') as nc: nc.createDimension('dim1', size=0) var = nc.createVariable('var1', 'f8', dimensions=('dim1')) var[:] = [1., 2., 3.] var.setncattr('coordinates', 'dim1')

xr.open_dataset('test.nc').to_netcdf('test2.nc') ```

There is something peculiar about how WRF handles the coordinates attribute, but I can't see anything off about it yet.

Interestingly, I can workaround the WRF coordinates issue by setting decode_coords=False in xarray.open_dataset(), for example, this works:

python xr.open_dataset('wrfout_d01_2019-04-16_15_00_00', decode_coords=False).to_netcdf('test.nc')

while this doesn't:

python xr.open_dataset('wrfout_d01_2019-04-16_15_00_00').to_netcdf('test.nc')

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  WRF output : cannot serialize variable 286072335
485210441 https://github.com/pydata/xarray/issues/1809#issuecomment-485210441 https://api.github.com/repos/pydata/xarray/issues/1809 MDEyOklzc3VlQ29tbWVudDQ4NTIxMDQ0MQ== milancurcic 4133310 2019-04-21T01:09:04Z 2019-04-24T19:24:02Z NONE

I ran into this issue trying to roundtrip a WRF output file. It looks like xarray raises an error for any NetCDF file that has variables with a coordinates attribute:

python # These coordinates are saved according to CF conventions for var_name, coord_names in variable_coordinates.items(): attrs = variables[var_name].attrs if 'coordinates' in attrs: raise ValueError('cannot serialize coordinates because variable ' "%s already has an attribute 'coordinates'" % var_name) attrs['coordinates'] = ' '.join(map(str, coord_names))

~~Both this choice, and the proposed solution in this issue (delete all coordinates attributes), I don't understand.~~ Variables with a coordinates attribute are CF conforming, so xarray should be able to play along with this.

~~The solution that makes more sense to me is to raise a warning and overwrite or ignore the coordinates attribute, if the attribute is already present. Later step of the fix could even be a keyword argument to allow the user to choose whether to overwrite or ignore "conflicting" attributes.~~

Or perhaps I'm missing something obvious here... Let me know either way. I'd be happy to make a PR to patch this.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  WRF output : cannot serialize variable 286072335

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
);
CREATE INDEX [idx_issue_comments_issue]
    ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
    ON [issue_comments] ([user]);
Powered by Datasette · Queries took 14.461ms · About: xarray-datasette