home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

18 rows where 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 4

  • nbren12 10
  • fmaussion 5
  • shoyer 2
  • stickler-ci 1

author_association 2

  • CONTRIBUTOR 11
  • MEMBER 7

issue 1

  • Raise when pcolormesh coordinate is not sorted · 18 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
366540505 https://github.com/pydata/xarray/pull/1885#issuecomment-366540505 https://api.github.com/repos/pydata/xarray/issues/1885 MDEyOklzc3VlQ29tbWVudDM2NjU0MDUwNQ== nbren12 1386642 2018-02-18T19:26:31Z 2018-02-18T19:26:31Z CONTRIBUTOR

cool! Thanks

{
    "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
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
366468848 https://github.com/pydata/xarray/pull/1885#issuecomment-366468848 https://api.github.com/repos/pydata/xarray/issues/1885 MDEyOklzc3VlQ29tbWVudDM2NjQ2ODg0OA== nbren12 1386642 2018-02-17T20:24:36Z 2018-02-17T20:24:36Z CONTRIBUTOR

I just rebased onto master.

{
    "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
366468662 https://github.com/pydata/xarray/pull/1885#issuecomment-366468662 https://api.github.com/repos/pydata/xarray/issues/1885 MDEyOklzc3VlQ29tbWVudDM2NjQ2ODY2Mg== stickler-ci 16011037 2018-02-17T20:21:12Z 2018-02-17T20:21:12Z CONTRIBUTOR

I couldn't find a .stickler.yml file in this repository. I can make one for you, or you can create one by following the documentation.

{
    "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
365372937 https://github.com/pydata/xarray/pull/1885#issuecomment-365372937 https://api.github.com/repos/pydata/xarray/issues/1885 MDEyOklzc3VlQ29tbWVudDM2NTM3MjkzNw== nbren12 1386642 2018-02-13T19:15:30Z 2018-02-13T19:15:47Z CONTRIBUTOR

no problem. I have always preferred putting operators on new lines though. Didn't realize that was against pep8. oh well 🤷‍♂️ .

{
    "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
365332360 https://github.com/pydata/xarray/pull/1885#issuecomment-365332360 https://api.github.com/repos/pydata/xarray/issues/1885 MDEyOklzc3VlQ29tbWVudDM2NTMzMjM2MA== nbren12 1386642 2018-02-13T17:01:26Z 2018-02-13T17:01:26Z CONTRIBUTOR

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

Hopefully, the commit I just pushed fixes this. I had some global flake8 settings that were messing with my local linting.

Note that currently the test for monotonic coords is for pcolormesh only, while it could be for all 2d plots as well.

I don't think I was having any issues with contour or contourf when I first opened the issue, but it probably does break imshow.

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.

Maybe we could leave this to a later PR.

{
    "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
363533796 https://github.com/pydata/xarray/pull/1885#issuecomment-363533796 https://api.github.com/repos/pydata/xarray/issues/1885 MDEyOklzc3VlQ29tbWVudDM2MzUzMzc5Ng== nbren12 1386642 2018-02-06T19:17:40Z 2018-02-06T19:17:40Z CONTRIBUTOR

Yah. I knew my solution before was probably too cute.

On Tue, Feb 6, 2018 at 11:14 AM, Fabien Maussion notifications@github.com wrote:

Thanks! This looks good.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pydata/xarray/pull/1885#issuecomment-363532796, or mute the thread https://github.com/notifications/unsubscribe-auth/ABUokvVDiWCnX_JPa5TsDtW8JtQxdTDEks5tSKSZgaJpZM4R4EWU .

{
    "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
363531759 https://github.com/pydata/xarray/pull/1885#issuecomment-363531759 https://api.github.com/repos/pydata/xarray/issues/1885 MDEyOklzc3VlQ29tbWVudDM2MzUzMTc1OQ== nbren12 1386642 2018-02-06T19:11:04Z 2018-02-06T19:11:04Z CONTRIBUTOR

There. I think this code should work for all dtypes and 2D coords.

{
    "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
362992657 https://github.com/pydata/xarray/pull/1885#issuecomment-362992657 https://api.github.com/repos/pydata/xarray/issues/1885 MDEyOklzc3VlQ29tbWVudDM2Mjk5MjY1Nw== nbren12 1386642 2018-02-05T06:24:40Z 2018-02-05T06:24:40Z CONTRIBUTOR

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

For me at least, plt.pcolormesh automatically displays in increasing order even if one of the input arrays is sorted in descending order. This happens all the time with meteorological data available in pressure coordinates (pressure goes down with height). I usually have to manually call plt.gca().invert_yaxis() to flip the y axis. Does xarray.plot's behave differently?

{
    "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
362990917 https://github.com/pydata/xarray/pull/1885#issuecomment-362990917 https://api.github.com/repos/pydata/xarray/issues/1885 MDEyOklzc3VlQ29tbWVudDM2Mjk5MDkxNw== nbren12 1386642 2018-02-05T06:12:08Z 2018-02-05T06:12:08Z CONTRIBUTOR

@shoyer That would work with me. Is there any chance people would want to make heatmaps involving categorical variables though?

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

On Sun, Feb 4, 2018 at 4:00 PM, Stephan Hoyer notifications@github.com wrote:

@shoyer commented on this pull request.

In xarray/plot/plot.py https://github.com/pydata/xarray/pull/1885#discussion_r165863769:

@@ -750,6 +767,13 @@ def _infer_interval_breaks(coord, axis=0): [ 2.5, 3.5, 4.5]]) """ coord = np.asarray(coord) + + if not _is_monotonic(coord, axis=axis): + warnings.warn("The input coordinate is not sorted in increasing order "

Rather an a warning, why not make this an error? I don't see any use-cases for 2d plots with non-monotonic coordinates. With the current version of xarray, these plots always end up wrong in some way, either by not plotting everything or with bad axis labels.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pydata/xarray/pull/1885#pullrequestreview-93863697, or mute the thread https://github.com/notifications/unsubscribe-auth/ABUokuMwNBc8JRgafrF7HNmGfgzxi64Qks5tRkSbgaJpZM4R4EWU .

{
    "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
362853059 https://github.com/pydata/xarray/pull/1885#issuecomment-362853059 https://api.github.com/repos/pydata/xarray/issues/1885 MDEyOklzc3VlQ29tbWVudDM2Mjg1MzA1OQ== nbren12 1386642 2018-02-03T20:47:30Z 2018-02-03T20:47:30Z CONTRIBUTOR

Ok. I think everything is ready now.

{
    "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
362836782 https://github.com/pydata/xarray/pull/1885#issuecomment-362836782 https://api.github.com/repos/pydata/xarray/issues/1885 MDEyOklzc3VlQ29tbWVudDM2MjgzNjc4Mg== nbren12 1386642 2018-02-03T17:21:16Z 2018-02-03T17:21:16Z CONTRIBUTOR

Thanks for your help @fmaussion. Hopefully the commit I just pushed fixes the failing tests. I will work on adding a test and fixing the formatting.

{
    "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 17.25ms · About: xarray-datasette