home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

8 rows where issue = 386268842 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 5

  • dcherian 3
  • rabernat 2
  • dopplershift 1
  • DennisHeimbigner 1
  • jjspergel 1

author_association 3

  • MEMBER 5
  • NONE 2
  • CONTRIBUTOR 1

issue 1

  • decode_cf not scaling and off-setting correctly · 8 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
443918114 https://github.com/pydata/xarray/issues/2583#issuecomment-443918114 https://api.github.com/repos/pydata/xarray/issues/2583 MDEyOklzc3VlQ29tbWVudDQ0MzkxODExNA== DennisHeimbigner 905179 2018-12-04T00:04:59Z 2018-12-04T00:04:59Z NONE

Very possibly. The first thing to look at is what opendap is sending:

http://www.ncei.noaa.gov/thredds/dodsC/avhrr-patmos-x-cloudprops-noaa-asc-fc/files/2003/patmosx_v05r03_NOAA-17_asc_d20030101_c20140314.nc.das

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  decode_cf not scaling and off-setting correctly 386268842
443908495 https://github.com/pydata/xarray/issues/2583#issuecomment-443908495 https://api.github.com/repos/pydata/xarray/issues/2583 MDEyOklzc3VlQ29tbWVudDQ0MzkwODQ5NQ== dopplershift 221526 2018-12-03T23:20:29Z 2018-12-03T23:20:29Z CONTRIBUTOR

@lesserwhirls @dennisHeimbigner Is there any reason to expect a difference between the downloaded file and the opendap view on TDS?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  decode_cf not scaling and off-setting correctly 386268842
443298207 https://github.com/pydata/xarray/issues/2583#issuecomment-443298207 https://api.github.com/repos/pydata/xarray/issues/2583 MDEyOklzc3VlQ29tbWVudDQ0MzI5ODIwNw== rabernat 1197350 2018-11-30T18:38:29Z 2018-11-30T18:38:29Z MEMBER

A temporary workaround without updating xarray might be to just edit the attributes to remove the offending unsigned attribute before decoding cf?

Sent from my iPhone

On Nov 30, 2018, at 1:35 PM, Deepak Cherian notifications@github.com wrote:

@jjspergel The single change in #2584 should fix your problem.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  decode_cf not scaling and off-setting correctly 386268842
443297363 https://github.com/pydata/xarray/issues/2583#issuecomment-443297363 https://api.github.com/repos/pydata/xarray/issues/2583 MDEyOklzc3VlQ29tbWVudDQ0MzI5NzM2Mw== dcherian 2448579 2018-11-30T18:35:28Z 2018-11-30T18:35:28Z MEMBER

@jjspergel The single change in #2584 should fix your problem.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  decode_cf not scaling and off-setting correctly 386268842
443284388 https://github.com/pydata/xarray/issues/2583#issuecomment-443284388 https://api.github.com/repos/pydata/xarray/issues/2583 MDEyOklzc3VlQ29tbWVudDQ0MzI4NDM4OA== dcherian 2448579 2018-11-30T17:51:18Z 2018-11-30T17:51:18Z MEMBER

The problem is that attrs['_Unsigned'] = 'false' which always triggers UnsignedIntegerCoder https://github.com/pydata/xarray/blob/0d6056e8816e3d367a64f36c7f1a5c4e1ce4ed4e/xarray/coding/variables.py#L269

That line expects unsigned to be bool and ends up casting the signed integer to an unsigned integer and things go haywire.

opendap is setting the _Unsigned attribute but it isn't present in the downloaded file.

ncdump -h http://www.ncei.noaa.gov/thredds/dodsC/avhrr-patmos-x-cloudprops-noaa-asc-fc/files/2003/patmosx_v05r03_NOAA-17_asc_d20030101_c20140314.nc byte cloud_fraction(time, latitude, longitude) ; cloud_fraction:_Unsigned = "false" ; cloud_fraction:standard_name = "cloud_area_fraction" ; cloud_fraction:long_name = "cloud fraction computed over a 3x3 pixel array at the native resolution centered on this pixel" ; cloud_fraction:coordinates = "latitude longitude" ; cloud_fraction:actual_range = 0.f, 1.f ; cloud_fraction:valid_range = -127s, 127s ; cloud_fraction:scale_factor = 0.003937008f ; cloud_fraction:add_offset = 0.5f ; cloud_fraction:_FillValue = -128b ; cloud_fraction:scaled = 1b ; cloud_fraction:_ChunkSizes = 1, 361, 361 ;

ncdump -h patmosx_v05r03_NOAA-17_asc_d20030101_c20140314.nc byte cloud_fraction_uncertainty(time, latitude, longitude) ; cloud_fraction_uncertainty:long_name = "cloud fraction uncertainty computed over a 3x3 array" ; cloud_fraction_uncertainty:coordinates = "latitude longitude" ; cloud_fraction_uncertainty:actual_range = 0.f, 1.f ; cloud_fraction_uncertainty:valid_range = -127b, 127b ; cloud_fraction_uncertainty:scale_factor = 0.003937008f ; cloud_fraction_uncertainty:add_offset = 0.5f ; cloud_fraction_uncertainty:_FillValue = -128b ; cloud_fraction_uncertainty:scaled = 1b ;

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  decode_cf not scaling and off-setting correctly 386268842
443281441 https://github.com/pydata/xarray/issues/2583#issuecomment-443281441 https://api.github.com/repos/pydata/xarray/issues/2583 MDEyOklzc3VlQ29tbWVudDQ0MzI4MTQ0MQ== rabernat 1197350 2018-11-30T17:41:12Z 2018-11-30T17:41:12Z MEMBER

The CF decoding fails using opendap but not from the downloaded file. Pretty weird.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  decode_cf not scaling and off-setting correctly 386268842
443278744 https://github.com/pydata/xarray/issues/2583#issuecomment-443278744 https://api.github.com/repos/pydata/xarray/issues/2583 MDEyOklzc3VlQ29tbWVudDQ0MzI3ODc0NA== jjspergel 42973457 2018-11-30T17:32:15Z 2018-11-30T17:32:15Z NONE

I can reproduce that on master. Thanks for the good example.

However, if I download the file, it seems to work OK. @jjspergel can you confirm that please?

EDIT:

Also, note that the scale_factor and add_offset attributes aren't set in the first ds.cloud_fraction repr but is in ds.cloud_fraction.encoding

``` {'source': 'http://www.ncei.noaa.gov/thredds/dodsC/avhrr-patmos-x-cloudprops-noaa-asc-fc/files/2003/patmosx_v05r03_NOAA-17_asc_d20030101_c20140314.nc', 'original_shape': (1, 1800, 3600), 'dtype': dtype('int8'), '_Unsigned': 'false', '_FillValue': 128, 'scale_factor': 0.003937008,

'add_offset': 0.5, 'coordinates': 'latitude longitude'} ```

Yes @dcherian, when I downloaded it, and then imported into a notebook it seems to have decoded fine.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  decode_cf not scaling and off-setting correctly 386268842
443271861 https://github.com/pydata/xarray/issues/2583#issuecomment-443271861 https://api.github.com/repos/pydata/xarray/issues/2583 MDEyOklzc3VlQ29tbWVudDQ0MzI3MTg2MQ== dcherian 2448579 2018-11-30T17:09:23Z 2018-11-30T17:14:02Z MEMBER

I can reproduce that on master. Thanks for the good example.

However, if I download the file, it seems to work OK. @jjspergel can you confirm that please?

EDIT:

Also, note that the scale_factor and add_offset attributes aren't set in the first ds.cloud_fraction repr but is in ds.cloud_fraction.encoding

{'source': 'http://www.ncei.noaa.gov/thredds/dodsC/avhrr-patmos-x-cloudprops-noaa-asc-fc/files/2003/patmosx_v05r03_NOAA-17_asc_d20030101_c20140314.nc', 'original_shape': (1, 1800, 3600), 'dtype': dtype('int8'), '_Unsigned': 'false', '_FillValue': 128, 'scale_factor': 0.003937008, 'add_offset': 0.5, 'coordinates': 'latitude longitude'}

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  decode_cf not scaling and off-setting correctly 386268842

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