home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

7 rows where issue = 185709414 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 4

  • NotSqrt 3
  • Scheibs 2
  • shoyer 1
  • jhamman 1

author_association 3

  • CONTRIBUTOR 3
  • MEMBER 2
  • NONE 2

issue 1

  • Differences on datetime values appears after writing reindexed variable on netCDF file · 7 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
359839979 https://github.com/pydata/xarray/issues/1064#issuecomment-359839979 https://api.github.com/repos/pydata/xarray/issues/1064 MDEyOklzc3VlQ29tbWVudDM1OTgzOTk3OQ== NotSqrt 1997005 2018-01-23T16:07:44Z 2018-01-23T16:07:44Z CONTRIBUTOR

FYI, merged.time.encoding = {} before calling to_netcdf seems to avoid the RuntimeWarning.

{
    "total_count": 2,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 1,
    "rocket": 0,
    "eyes": 0
}
  Differences on datetime values appears after writing reindexed variable on netCDF file 185709414
358570582 https://github.com/pydata/xarray/issues/1064#issuecomment-358570582 https://api.github.com/repos/pydata/xarray/issues/1064 MDEyOklzc3VlQ29tbWVudDM1ODU3MDU4Mg== NotSqrt 1997005 2018-01-18T08:16:06Z 2018-01-18T08:16:06Z CONTRIBUTOR

There you go !

```python import numpy import pandas import tempfile import warnings import xarray

array1 = xarray.DataArray( numpy.random.rand(5), dims=['time'], coords={'time': pandas.to_datetime(['2018-01-01', '2018-01-01 00:01', '2018-01-01 00:02', '2018-01-01 00:03', '2018-01-01 00:04'])}, name='foo' )

array2 = xarray.DataArray( numpy.random.rand(5), dims=['time'], coords={'time': pandas.to_datetime(['2018-01-01 00:05', '2018-01-01 00:05:10', '2018-01-01 00:05:20', '2018-01-01 00:05:30', '2018-01-01 00:05:40'])}, name='foo' )

with tempfile.NamedTemporaryFile() as tmp: # save first array array1.to_netcdf(tmp.name) # reload it array1_reloaded = xarray.open_dataarray(tmp.name)

# the time encoding stores minutes as int, so seconds won't be allowed at next call of to_netcdf
assert array1_reloaded.time.encoding['dtype'] == numpy.int64
assert array1_reloaded.time.encoding['units'] == 'minutes since 2018-01-01 00:00:00'

merged = xarray.merge([array1_reloaded, array2])
array1_reloaded.close()

with warnings.catch_warnings():
    warnings.filterwarnings('error', category=RuntimeWarning)
    merged.to_netcdf(tmp.name)

```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Differences on datetime values appears after writing reindexed variable on netCDF file 185709414
358454214 https://github.com/pydata/xarray/issues/1064#issuecomment-358454214 https://api.github.com/repos/pydata/xarray/issues/1064 MDEyOklzc3VlQ29tbWVudDM1ODQ1NDIxNA== shoyer 1217238 2018-01-17T21:34:13Z 2018-01-17T21:34:13Z MEMBER

@NotSqrt can you make a minimum working example for this? e.g., a netCDF file with problematic data, and associated code that writes a netCDF file with lost time resolution. That would really help us diagnose and solve this problem.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Differences on datetime values appears after writing reindexed variable on netCDF file 185709414
358324488 https://github.com/pydata/xarray/issues/1064#issuecomment-358324488 https://api.github.com/repos/pydata/xarray/issues/1064 MDEyOklzc3VlQ29tbWVudDM1ODMyNDQ4OA== NotSqrt 1997005 2018-01-17T14:41:14Z 2018-01-17T14:41:14Z CONTRIBUTOR

I faced this issue when switching from a concat to a merge.

The first merged dataset had a time dimension which encoding says {'calendar': 'proleptic_gregorian', 'dtype': dtype('int64'), 'units': 'minutes since 2017-08-20 00:00:00'}, which meant that the data from the second merged dataset could not be stored with a finer resolution than minutes.

If I try to store values like '2017-08-20 00:00:30', I get the warning xarray\conventions.py:1092: RuntimeWarning: saving variable time with floating point data as an integer dtype without any _FillValue to use for NaNs.

Maybe it is similar in your case: netcdf stored the data as 'hours since XXXX', so you lose the minutes.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Differences on datetime values appears after writing reindexed variable on netCDF file 185709414
261004033 https://github.com/pydata/xarray/issues/1064#issuecomment-261004033 https://api.github.com/repos/pydata/xarray/issues/1064 MDEyOklzc3VlQ29tbWVudDI2MTAwNDAzMw== Scheibs 16919188 2016-11-16T16:57:21Z 2016-11-16T16:57:21Z NONE

@jhamman Here my example file ftp://ftp.irsn.fr/argon/Example

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Differences on datetime values appears after writing reindexed variable on netCDF file 185709414
260994864 https://github.com/pydata/xarray/issues/1064#issuecomment-260994864 https://api.github.com/repos/pydata/xarray/issues/1064 MDEyOklzc3VlQ29tbWVudDI2MDk5NDg2NA== Scheibs 16919188 2016-11-16T16:29:32Z 2016-11-16T16:29:32Z NONE

This is the warning I got when I wrote on my file with "to_necdf()" xarray\conventions.py:1060: RuntimeWarning: saving variable time with floating point data as an integer dtype without any _FillValue to use for NaNs for k, v in iteritems(variables))

@jhamman It's seems than the error appears only with a variable "rain" who commes from a previous created netcdf file, but I will try to provide you an example. tanks

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Differences on datetime values appears after writing reindexed variable on netCDF file 185709414
257053396 https://github.com/pydata/xarray/issues/1064#issuecomment-257053396 https://api.github.com/repos/pydata/xarray/issues/1064 MDEyOklzc3VlQ29tbWVudDI1NzA1MzM5Ng== jhamman 2443309 2016-10-28T23:38:46Z 2016-10-28T23:38:46Z MEMBER

@Scheibs - thanks for the report. Can you provide a simple, minimum working example (MWE)?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Differences on datetime values appears after writing reindexed variable on netCDF file 185709414

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 15.504ms · About: xarray-datasette