home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 165540231

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/681#issuecomment-165540231 https://api.github.com/repos/pydata/xarray/issues/681 165540231 MDEyOklzc3VlQ29tbWVudDE2NTU0MDIzMQ== 1217238 2015-12-17T18:31:08Z 2015-12-17T18:31:08Z MEMBER

Yes, this is probably related to the netCDF4-python change discussed here: https://github.com/Unidata/netcdf4-python/issues/388

Unfortunately, lots of older netCDF programs don't know how to interpret the netCDF4 "string" dtype -- and to be honest, even the netCDF-C library doesn't always properly save such data as Unicode yet, though that should be fixed in the next release (4.4.0 -- see https://github.com/Unidata/netcdf-c/issues/127 for more details).

So an alternative choice would be to attempt to always encode unicode (str on Python 3) attributes as ASCII when saving with netCDF4, e.g.,

python def maybe_encode(string, encoding='ascii'): try: return string.encode(encoding) except UnicodeEncodeError: return string

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