home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 303583082

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/1421#issuecomment-303583082 https://api.github.com/repos/pydata/xarray/issues/1421 303583082 MDEyOklzc3VlQ29tbWVudDMwMzU4MzA4Mg== 1217238 2017-05-24T00:52:20Z 2017-05-24T00:52:20Z MEMBER

Pickle works out the protocol automatically (no protocol keyword for load or loads), so we wouldn't really need to save the protocol as an attribute, although it would be a way to work out which variables to unpickle once saved, if we went this route.

I think we do want some sort of marker attribute, but I agree that it doesn't need to include the pickle version.

Maybe the attribute _FileFormat = 'python-pickle' would make sense? This would have the advantage of being obvious to anyone inspecting the netCDF file with standard tools (not xarray).

It seems a shame not to use np.void though, so perhaps it makes sense to add the opaque types to netCDF4-python and forget the np.uint8 trick.

I think netCDF actually maps np.int8 -> NC_BYTE, so that's at least some justification for this choice: http://www.unidata.ucar.edu/software/netcdf/docs/data_type.html

Certainly handling opaque types in netCDF4-python would be nice, though I don't think it should be a blocker for this. I suspect the reason this isn't done is that NumPy maps bytes -> np.string_ even on Python 3. Thus np.void is used far less often than it should. Also the repr for np.void has been pretty poor, though that's being worked on currently in https://github.com/numpy/numpy/pull/8981.

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