home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

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

  • fmaussion 5
  • shoyer 2

issue 1

  • Raise when pcolormesh coordinate is not sorted · 7 ✖

author_association 1

  • MEMBER · 7 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
366538974 https://github.com/pydata/xarray/pull/1885#issuecomment-366538974 https://api.github.com/repos/pydata/xarray/issues/1885 MDEyOklzc3VlQ29tbWVudDM2NjUzODk3NA== shoyer 1217238 2018-02-18T19:06:36Z 2018-02-18T19:06:36Z MEMBER

Thanks @nbren12 !

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Raise when pcolormesh coordinate is not sorted 294089233
365359131 https://github.com/pydata/xarray/pull/1885#issuecomment-365359131 https://api.github.com/repos/pydata/xarray/issues/1885 MDEyOklzc3VlQ29tbWVudDM2NTM1OTEzMQ== fmaussion 10050469 2018-02-13T18:28:25Z 2018-02-13T18:28:25Z MEMBER

Sorry, our new flake8 tool can be quite strict ;)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Raise when pcolormesh coordinate is not sorted 294089233
365064764 https://github.com/pydata/xarray/pull/1885#issuecomment-365064764 https://api.github.com/repos/pydata/xarray/issues/1885 MDEyOklzc3VlQ29tbWVudDM2NTA2NDc2NA== fmaussion 10050469 2018-02-12T21:16:55Z 2018-02-12T21:16:55Z MEMBER

Sorry @nbren12 there is still a pep8 error somewhere, and you can freely make it an error as @shoyer suggests.

Note that currently the test for monotonic coords is for pcolormesh only, while it could be for all 2d plots as well. What I like with the current implementation is that the check happens in _infer_interval_breaks, which is only called when certain conditions are met (1D coords, or 2D coords without transform kwarg). If this check lives in the common 2d function the same conditions should be applied.

If we start to check input for sanity we might as well raise an error when coordinates are not regularly spaced in the imshow case, although I can imagine this might be more difficult to check.

Thoughts?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Raise when pcolormesh coordinate is not sorted 294089233
363532796 https://github.com/pydata/xarray/pull/1885#issuecomment-363532796 https://api.github.com/repos/pydata/xarray/issues/1885 MDEyOklzc3VlQ29tbWVudDM2MzUzMjc5Ng== fmaussion 10050469 2018-02-06T19:14:31Z 2018-02-06T19:14:31Z MEMBER

Thanks! This looks good.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Raise when pcolormesh coordinate is not sorted 294089233
363528599 https://github.com/pydata/xarray/pull/1885#issuecomment-363528599 https://api.github.com/repos/pydata/xarray/issues/1885 MDEyOklzc3VlQ29tbWVudDM2MzUyODU5OQ== fmaussion 10050469 2018-02-06T19:00:45Z 2018-02-06T19:01:21Z MEMBER

Which, I guess, illustrates our point quite well: while it's easy for users to find out when their data is messy, it's much harder to find a robust and logical way to handle all cases for a general library like xarray. I guess it's the reason why matplotlib also doesn't warn or error when unordered data is given to pcolormesh.

Don't get me wrong: I think it would be valuable to be able to provide a better "service" than matplotlib. Probably we should even error earlier, at the 2d plot level (and not only at the pcolormesh level like it is now). It's just going to be a bit hard because of all the special cases (dtypes, 2d coords, and map projections moslty).

Ordering "per default" might be the most straightforward way, but: - what about performance issues? - I don't like the idea of silently doing things with user data

I'll let @shoyer decide on what's best here. I am slightly in favor of doing nothing and giving the responsibility to the user.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Raise when pcolormesh coordinate is not sorted 294089233
362991345 https://github.com/pydata/xarray/pull/1885#issuecomment-362991345 https://api.github.com/repos/pydata/xarray/issues/1885 MDEyOklzc3VlQ29tbWVudDM2Mjk5MTM0NQ== shoyer 1217238 2018-02-05T06:15:12Z 2018-02-05T06:15:12Z MEMBER

Is there any chance people would want to make heatmaps involving categorical variables though?

Certainly, but the currently version of 2D plots in xarray doesn't work for these!

If they want to make plots involving categorical variables, I would currently recommend using seaborn.heatmap (we can mention it in the error message, too).

If we do decide to raise an error, why not go one step further and just sort the coordinates automatically?

One reason is that it's not obvious if they would like increasing or decreasing coordinates.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Raise when pcolormesh coordinate is not sorted 294089233
362796338 https://github.com/pydata/xarray/pull/1885#issuecomment-362796338 https://api.github.com/repos/pydata/xarray/issues/1885 MDEyOklzc3VlQ29tbWVudDM2Mjc5NjMzOA== fmaussion 10050469 2018-02-03T10:28:27Z 2018-02-03T10:28:27Z MEMBER

Thanks a lot @nbren12 ! Indeed _infer_interval_breaks is probably the right place to add this warning.

A few comments: - the tests are now failing, likely because of a type issue with time coordinates - coordinates don't have to be ascending for pcolormesh to work (see example below). Monotonically ascending and descending coordinates should work. - we need a test for this new behavior (asserting warnings) - we follow the pep8 conventions, and I think your lines are longer than the 79 character rule

python import numpy as np import xarray as xr x = np.arange(5)[::-1] y = np.arange(6)[::-1] x = xr.DataArray(x, dims=['x'], coords={'x': x}) y = xr.DataArray(y, dims=['y'], coords={'y': y}) z = x + y z.plot();

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Raise when pcolormesh coordinate is not sorted 294089233

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