home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

6 rows where author_association = "MEMBER" and issue = 70805273 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 2

  • shoyer 3
  • jhamman 3

issue 1

  • Handle bool in NetCDF4 conversion · 6 ✖

author_association 1

  • MEMBER · 6 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
219189254 https://github.com/pydata/xarray/pull/401#issuecomment-219189254 https://api.github.com/repos/pydata/xarray/issues/401 MDEyOklzc3VlQ29tbWVudDIxOTE4OTI1NA== shoyer 1217238 2016-05-14T00:34:14Z 2016-05-14T00:34:14Z MEMBER

Yes, I still think that makes sense. I don't like issuing warnings other than for deprecation cycles. On Fri, May 13, 2016 at 5:29 PM Joe Hamman notifications@github.com wrote:

@shoyer https://github.com/shoyer - reading back in this thread (#401 (comment) https://github.com/pydata/xarray/pull/401#issuecomment-96085330) you mentioned moving this fix to conventions.py and writing a dtype: bool attribute for bool typed variables. Do you still think that makes since?

Alternatively, we could just raise a warning when typecasting on write. This is the lazy but less intrusive way of operating.

— You are receiving this because you were mentioned.

Reply to this email directly or view it on GitHub https://github.com/pydata/xarray/pull/401#issuecomment-219188897

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Handle bool in NetCDF4 conversion 70805273
219188897 https://github.com/pydata/xarray/pull/401#issuecomment-219188897 https://api.github.com/repos/pydata/xarray/issues/401 MDEyOklzc3VlQ29tbWVudDIxOTE4ODg5Nw== jhamman 2443309 2016-05-14T00:29:25Z 2016-05-14T00:29:25Z MEMBER

@shoyer - reading back in this thread (https://github.com/pydata/xarray/pull/401#issuecomment-96085330) you mentioned moving this fix to conventions.py and writing a dtype: bool attribute for bool typed variables. Do you still think that makes since?

Alternatively, we could just raise a warning when typecasting on write. This is the lazy but less intrusive way of operating.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Handle bool in NetCDF4 conversion 70805273
219183250 https://github.com/pydata/xarray/pull/401#issuecomment-219183250 https://api.github.com/repos/pydata/xarray/issues/401 MDEyOklzc3VlQ29tbWVudDIxOTE4MzI1MA== shoyer 1217238 2016-05-13T23:31:43Z 2016-05-13T23:31:43Z MEMBER

Karl -- if you or anyone else wants to pick up and finish this PR, that would be awesome. It is very close to being done.

On Fri, May 13, 2016 at 4:30 PM, Karl Lapo notifications@github.com wrote:

I also ran into this problem -- I wanted to save a netcdf with a boolean array. Casting the booleans as ints worked for my application.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/pydata/xarray/pull/401#issuecomment-219183082

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Handle bool in NetCDF4 conversion 70805273
147809605 https://github.com/pydata/xarray/pull/401#issuecomment-147809605 https://api.github.com/repos/pydata/xarray/issues/401 MDEyOklzc3VlQ29tbWVudDE0NzgwOTYwNQ== jhamman 2443309 2015-10-13T18:45:57Z 2015-10-13T18:45:57Z MEMBER

@khaeru - do you think you're going to come back to this?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Handle bool in NetCDF4 conversion 70805273
96085330 https://github.com/pydata/xarray/pull/401#issuecomment-96085330 https://api.github.com/repos/pydata/xarray/issues/401 MDEyOklzc3VlQ29tbWVudDk2MDg1MzMw shoyer 1217238 2015-04-24T22:34:15Z 2015-04-24T22:34:15Z MEMBER

This seems like a pragmatic choice -- but I agree, it's unfortunate that we can't roundtrip this faithfully.

One option would be to add the attribute dtype with the value 'bool' to the netCDF variable, and then teach xray to interpret that attribute when loading data. We already do some pretty similar things to handle datetime64 variables according to the CF conventions. If you're interested in doing this, the right place to put this would be conventions.py: https://github.com/xray/xray/blob/eed58d5cb4274f262e77277bc8fcf394a9fae77c/xray/conventions.py#L632 (for decode, put decoding dtypes after decoding times at the bottom) https://github.com/xray/xray/blob/eed58d5cb4274f262e77277bc8fcf394a9fae77c/xray/conventions.py#L603 (for encoding, write another little helper function and call it at the bottom here)

The other advantage of putting this in conventions is that then it works with all netCDF backends (including scipy and h5netcdf).

Also, this definitely needs tests :). This could be as simple as verifying that it works to roundtrip a Dataset with boolean data to disk and back. Here's an example of what those look like: https://github.com/xray/xray/blob/eed58d5cb4274f262e77277bc8fcf394a9fae77c/xray/test/test_backends.py#L156

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Handle bool in NetCDF4 conversion 70805273
96082283 https://github.com/pydata/xarray/pull/401#issuecomment-96082283 https://api.github.com/repos/pydata/xarray/issues/401 MDEyOklzc3VlQ29tbWVudDk2MDgyMjgz jhamman 2443309 2015-04-24T22:24:39Z 2015-04-24T22:24:39Z MEMBER

How does this handle the round trip conversion from Dataset to netCDF and back to Dataset. Do you now get an array of u1?

Also, it may be good to add a unit test addressing your previous ValueError.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Handle bool in NetCDF4 conversion 70805273

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