home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

9 rows where author_association = "MEMBER" and issue = 371514413 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 3

  • alexamici 4
  • shoyer 4
  • jhamman 1

issue 1

  • ENH: Detect the GRIB files by the filename extension and suggest engine. · 9 ✖

author_association 1

  • MEMBER · 9 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
431868326 https://github.com/pydata/xarray/pull/2492#issuecomment-431868326 https://api.github.com/repos/pydata/xarray/issues/2492 MDEyOklzc3VlQ29tbWVudDQzMTg2ODMyNg== shoyer 1217238 2018-10-22T15:26:24Z 2018-10-22T15:26:24Z MEMBER

thanks @alexamici

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  ENH: Detect the GRIB files by the filename extension and suggest engine. 371514413
431559524 https://github.com/pydata/xarray/pull/2492#issuecomment-431559524 https://api.github.com/repos/pydata/xarray/issues/2492 MDEyOklzc3VlQ29tbWVudDQzMTU1OTUyNA== alexamici 226037 2018-10-20T08:11:03Z 2018-10-20T08:11:03Z MEMBER

@shoyer I consider https://github.com/pydata/xarray/pull/2492/commits/486a391915d3bf1af685ae9ef908c30d5e053851 in a mergiable state if you like it.

I updated the description of the PR to sync with the new aim.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  ENH: Detect the GRIB files by the filename extension and suggest engine. 371514413
431477498 https://github.com/pydata/xarray/pull/2492#issuecomment-431477498 https://api.github.com/repos/pydata/xarray/issues/2492 MDEyOklzc3VlQ29tbWVudDQzMTQ3NzQ5OA== alexamici 226037 2018-10-19T19:44:33Z 2018-10-19T19:45:48Z MEMBER

And we "refuse to guess"!

I broke the forrest of try / except to different functions with no real change (hopefully!) except _get_default_engine_grib.

Now opening a GRIB file without explicit engine raises an exception, but the error message suggests to the user to use the installed backend or to install one if none is present.

@shoyer if this too complex? Alternatively I can always return the same, generic, error message.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  ENH: Detect the GRIB files by the filename extension and suggest engine. 371514413
431428116 https://github.com/pydata/xarray/pull/2492#issuecomment-431428116 https://api.github.com/repos/pydata/xarray/issues/2492 MDEyOklzc3VlQ29tbWVudDQzMTQyODExNg== jhamman 2443309 2018-10-19T16:53:25Z 2018-10-19T16:53:25Z MEMBER

Totally agree with what @shoyer just wrote. I will add the pynio team is considering mothballing pynio in the relatively near future. So long term, we may not have to make a choice here but for now, I support asking the user to make an explicit decision.

cc @khallock

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  ENH: Detect the GRIB files by the filename extension and suggest engine. 371514413
431425504 https://github.com/pydata/xarray/pull/2492#issuecomment-431425504 https://api.github.com/repos/pydata/xarray/issues/2492 MDEyOklzc3VlQ29tbWVudDQzMTQyNTUwNA== shoyer 1217238 2018-10-19T16:44:19Z 2018-10-19T16:44:32Z MEMBER

As someone who hasn't opened up a grib file for several years, I'm not in a good position to choose which backend to use by default. For now, I would be inclined to hold off on making a default choice (unless there is a clear consensus among other xarray devs/users) in favor of requiring users to be explicit. This is somewhat inline with the Zen of Python: "In the face of ambiguity, refuse the temptation to guess."

Probably the best user experience would be to raise an informative error suggesting the use of cfgrib or pynio when opening a grib but no engine is specified, e.g., ```

xarray.open_dataset('data.grib') ValueError: cannot open GRIB files without explicitly setting engine='pynio' or engine='cfgrib' in xarray.open_dataset() ```

{
    "total_count": 3,
    "+1": 3,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  ENH: Detect the GRIB files by the filename extension and suggest engine. 371514413
431297953 https://github.com/pydata/xarray/pull/2492#issuecomment-431297953 https://api.github.com/repos/pydata/xarray/issues/2492 MDEyOklzc3VlQ29tbWVudDQzMTI5Nzk1Mw== alexamici 226037 2018-10-19T09:09:54Z 2018-10-19T09:38:30Z MEMBER

@shoyer you are right, the GRIB translation is not unique and with cfgrib we have no plan to keep compatibility with PyNIO. I also agree that this will be really poor user experience 😞in some circumstances (even if in general it will work just fine). Do not merge yet!

We may default to one of the two without fall-back if it is not present (you may guess that I have a bias on which one to choose 😄), or keep the current behaviour.

In any event we can improve the error message by suggesting to add the engine= corresponding to the installed backends.

I'll show you what I mean.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  ENH: Detect the GRIB files by the filename extension and suggest engine. 371514413
431166092 https://github.com/pydata/xarray/pull/2492#issuecomment-431166092 https://api.github.com/repos/pydata/xarray/issues/2492 MDEyOklzc3VlQ29tbWVudDQzMTE2NjA5Mg== shoyer 1217238 2018-10-18T21:15:10Z 2018-10-18T21:15:10Z MEMBER

Actually, thinking about this a little more, I'm not entirely sure it makes sense to fallback from using pynio to cfgrib. The problem is that these libraries may interpret GRIB files differently, e.g., with different variable names. It could make for a poor user experience for open_dataset('mydata.grib') to work differently when different dependencies are installed.

(please let me know if I'm mistaken here!)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  ENH: Detect the GRIB files by the filename extension and suggest engine. 371514413
431082419 https://github.com/pydata/xarray/pull/2492#issuecomment-431082419 https://api.github.com/repos/pydata/xarray/issues/2492 MDEyOklzc3VlQ29tbWVudDQzMTA4MjQxOQ== alexamici 226037 2018-10-18T16:50:00Z 2018-10-18T16:50:20Z MEMBER

Mm... the private functions in api.py are not unit tested as they are not part of the API, I'll add a test_backends_api.py for the _get_default_engine tests and then others can use it to unit test the other _ functions.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  ENH: Detect the GRIB files by the filename extension and suggest engine. 371514413
431053815 https://github.com/pydata/xarray/pull/2492#issuecomment-431053815 https://api.github.com/repos/pydata/xarray/issues/2492 MDEyOklzc3VlQ29tbWVudDQzMTA1MzgxNQ== shoyer 1217238 2018-10-18T15:28:06Z 2018-10-18T15:28:06Z MEMBER

The whole engine detection strategy looks a bit fragile as the .gz extension is recognised outside of _get_default_engine and the nested ifs and try / except blocks make the code poorly readable. I can add a bit of a refactor in this area if you think it is appropriate.

Agreed! Yes, this would be welcome.

I'm happy with this change, but it would be good to ensure we have test coverage. It looks like we currently don't have any unit tests, but I'm pretty sure the other code is exercised by integration tests. If you're up for adding unit tests for _get_default_engine that would be awesome.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  ENH: Detect the GRIB files by the filename extension and suggest engine. 371514413

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