home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 333175863

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/1598#issuecomment-333175863 https://api.github.com/repos/pydata/xarray/issues/1598 333175863 MDEyOklzc3VlQ29tbWVudDMzMzE3NTg2Mw== 13837821 2017-09-29T16:37:07Z 2017-09-29T16:37:20Z CONTRIBUTOR

@jhamman In brief, it's weird.

Engine | encoding['_FillValue'] = False | Do nothing ----- | ----- | ----- netCDF4 | Filling off | Filling on scipy | Filling off | Filling off h5netcdf | Filling on | Filling off

So, this is some peculiar behavior. Setting _FillValue to False works for netCDF4 (as we have seen), has no effect using the scipy engine, and seems to do the opposite of intended for h5netcdf.

Code below:

``` import xarray as xr import numpy as np import pandas as pd

ds = xr.Dataset({'foo': (('x', 'y'), np.random.rand(4, 5))}, coords={'x': [10, 20, 30, 40], 'y': pd.date_range('2000-01-01', periods=5), 'z': ('x', list('abcd'))})

ds.to_netcdf('notset_scipy.nc', engine='scipy') ds.to_netcdf('notset_netcdf4.nc', engine='netcdf4') ds.to_netcdf('notset_h5netcdf.nc', engine='h5netcdf')

ds.y.encoding['_FillValue'] = False

ds.to_netcdf('False_scipy.nc', engine='scipy') ds.to_netcdf('False_netcdf4.nc', engine='netcdf4') ds.to_netcdf('False_h5netcdf.nc', engine='h5netcdf') ```

netCDF4 $ ncinfo -v y notset_netcdf4.nc <type 'netCDF4._netCDF4.Variable'> int64 y(y) units: days since 2000-01-01 00:00:00 calendar: proleptic_gregorian unlimited dimensions: current shape = (5,) filling on, default _FillValue of -9223372036854775806 used $ ncinfo -v y False_netcdf4.nc <type 'netCDF4._netCDF4.Variable'> int64 y(y) units: days since 2000-01-01 00:00:00 calendar: proleptic_gregorian unlimited dimensions: current shape = (5,) filling off

scipy $ ncinfo -v y notset_scipy.nc <type 'netCDF4._netCDF4.Variable'> int32 y(y) units: days since 2000-01-01 00:00:00 calendar: proleptic_gregorian unlimited dimensions: current shape = (5,) filling off

$ ncinfo -v y False_scipy.nc <type 'netCDF4._netCDF4.Variable'> int32 y(y) units: days since 2000-01-01 00:00:00 calendar: proleptic_gregorian _FillValue: 0 unlimited dimensions: current shape = (5,) filling off

h5netcdf $ ncinfo -v y notset_h5netcdf.nc <type 'netCDF4._netCDF4.Variable'> int64 y(y) units: days since 2000-01-01 00:00:00 calendar: proleptic_gregorian unlimited dimensions: current shape = (5,) filling off

$ ncinfo -v y False_h5netcdf.nc <type 'netCDF4._netCDF4.Variable'> int64 y(y) _FillValue: 0 units: days since 2000-01-01 00:00:00 calendar: proleptic_gregorian unlimited dimensions: current shape = (5,) filling on

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