home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

10 rows where issue = 117002929 and user = 10050469 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 1

  • fmaussion · 10 ✖

issue 1

  • Plotting on map projection much slower on v0.6.1 than 0.6.0 · 10 ✖

author_association 1

  • MEMBER 10
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
226274164 https://github.com/pydata/xarray/issues/657#issuecomment-226274164 https://api.github.com/repos/pydata/xarray/issues/657 MDEyOklzc3VlQ29tbWVudDIyNjI3NDE2NA== fmaussion 10050469 2016-06-15T18:17:51Z 2016-06-15T18:17:51Z MEMBER

OK, on the current master and with a cartopy installed from conda-forge I am not able to reproduce the problem any more:

imshow xray: 3.30 s pcolormesh xray: 13.13 s pcolormesh cartopy: 12.85 s

I don't really understand what happened in between... The factor 4 between imshow and pcolormesh remains, but at least the show-killer 30sec plotting time I had before is gone. I'm closing this now, and this will remain a mystery.

(note: on my laptop I'm getting faster plotting results in a virtualenv configured with pip install than with pandas...)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Plotting on map projection much slower on v0.6.1 than 0.6.0 117002929
170220499 https://github.com/pydata/xarray/issues/657#issuecomment-170220499 https://api.github.com/repos/pydata/xarray/issues/657 MDEyOklzc3VlQ29tbWVudDE3MDIyMDQ5OQ== fmaussion 10050469 2016-01-09T10:06:44Z 2016-01-09T10:06:44Z MEMBER

I had little time to spend on this lately but I'll try to get back to it in the next days. Any idea on where it could come from? I found it quite hard to debug because of the many decorators... From the profiling and the number of function calls above there seems to be something quite big happening in between xray and cartopy. Could it be something as trivial as a double function call or something?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Plotting on map projection much slower on v0.6.1 than 0.6.0 117002929
157828150 https://github.com/pydata/xarray/issues/657#issuecomment-157828150 https://api.github.com/repos/pydata/xarray/issues/657 MDEyOklzc3VlQ29tbWVudDE1NzgyODE1MA== fmaussion 10050469 2015-11-18T19:19:32Z 2015-11-18T19:19:32Z MEMBER

See the number of calls:

faster.txt: 4099953 function calls (4093947 primitive calls) in 14.571 seconds

slower.txt: 10316809 function calls (10303964 primitive calls) in 34.330 seconds

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Plotting on map projection much slower on v0.6.1 than 0.6.0 117002929
157779612 https://github.com/pydata/xarray/issues/657#issuecomment-157779612 https://api.github.com/repos/pydata/xarray/issues/657 MDEyOklzc3VlQ29tbWVudDE1Nzc3OTYxMg== fmaussion 10050469 2015-11-18T17:04:21Z 2015-11-18T17:04:21Z MEMBER

Changing the input to np.ma.asarray(l1 + l2) did not change anything as far as I can see...

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Plotting on map projection much slower on v0.6.1 than 0.6.0 117002929
157768356 https://github.com/pydata/xarray/issues/657#issuecomment-157768356 https://api.github.com/repos/pydata/xarray/issues/657 MDEyOklzc3VlQ29tbWVudDE1Nzc2ODM1Ng== fmaussion 10050469 2015-11-18T16:28:28Z 2015-11-18T16:28:28Z MEMBER

Was someone able to reproduce this or is it just me?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Plotting on map projection much slower on v0.6.1 than 0.6.0 117002929
157642290 https://github.com/pydata/xarray/issues/657#issuecomment-157642290 https://api.github.com/repos/pydata/xarray/issues/657 MDEyOklzc3VlQ29tbWVudDE1NzY0MjI5MA== fmaussion 10050469 2015-11-18T08:24:23Z 2015-11-18T08:24:45Z MEMBER

Thanks @pelson ! So now this is when it becomes funny: I've been able to make three similar plots using xray's imshow, pcolormesh and cartopy's pcolormesh. Xray's pcolormesh takes twice the time as cartopy's:

``` python import matplotlib.pyplot as plt from matplotlib.colors import Normalize import xray import numpy as np import cartopy.crs as ccrs import time

nlats, nlons = (241, 480) lats = np.linspace(90, -90, nlats) lons = np.linspace(0, 360-0.75, nlons) l1, l2 = np.meshgrid(lons, lats) data = xray.DataArray(l1 + l2, [('latitude', lats), ('longitude', lons)])

cmap = plt.get_cmap('viridis') norm = Normalize(vmin=0, vmax=data.max().values)

start_time = time.time() fig = plt.figure() ax = plt.axes(projection=ccrs.Robinson()) data.plot.imshow(ax=ax, transform=ccrs.PlateCarree(), add_colorbar=False, cmap=cmap, vmin=0) ax.coastlines() plt.savefig('imshow_xray.png') print("imshow xray: {:.2f} s".format(time.time() - start_time))

start_time = time.time() fig = plt.figure() ax = plt.axes(projection=ccrs.Robinson()) data.plot.pcolormesh(ax=ax, transform=ccrs.PlateCarree(), add_colorbar=False, cmap=cmap, vmin=0) ax.coastlines() plt.savefig('pcolormesh_xray.png') print("pcolormesh xray: {:.2f} s".format(time.time() - start_time))

start_time = time.time() fig = plt.figure() ax = plt.axes(projection=ccrs.Robinson()) ax.pcolormesh(lons, lats, l1 + l2, transform=ccrs.PlateCarree(), cmap=cmap, norm=norm) ax.coastlines() plt.savefig('pcolormesh_cartopy.png') print("pcolormesh cartopy: {:.2f} s".format(time.time() - start_time))

```

imshow xray: 3.06 s pcolormesh xray: 27.50 s pcolormesh cartopy: 12.14 s

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Plotting on map projection much slower on v0.6.1 than 0.6.0 117002929
157413923 https://github.com/pydata/xarray/issues/657#issuecomment-157413923 https://api.github.com/repos/pydata/xarray/issues/657 MDEyOklzc3VlQ29tbWVudDE1NzQxMzkyMw== fmaussion 10050469 2015-11-17T16:02:10Z 2015-11-17T16:02:10Z MEMBER

Hi again,

I've made a self-contained example below. I have no clue about how cartopy works (blind xray user, sorry :-() and was not able to remove the dependency to xray without getting different plots for imshow() and pcolormesh()... If one of the xray gurus could help me to remove the xray part of the code I could open an issue in cartopy. I wonder if the problem comes from the fact that ERA-Interim lons are spanning 0-360?

``` python import matplotlib.pyplot as plt import xray import numpy as np import cartopy.crs as ccrs import time

nlats, nlons = (241, 480) lats = np.linspace(90, -90, nlats) lons = np.linspace(0, 360-0.75, nlons) l1, l2 = np.meshgrid(lons, lats) data = xray.DataArray(l1 + l2, [('latitude', lats), ('longitude', lons)])

start_time = time.time() fig = plt.figure() ax = plt.axes(projection=ccrs.Robinson()) data.plot.imshow(ax=ax, transform=ccrs.PlateCarree()) ax.coastlines() plt.savefig('imshow.png') print("imshow: {:.2f} s".format(time.time() - start_time))

start_time = time.time() fig = plt.figure() ax = plt.axes(projection=ccrs.Robinson()) data.plot.pcolormesh(ax=ax, transform=ccrs.PlateCarree()) ax.coastlines() plt.savefig('pcolormesh.png') print("pcolormesh: {:.2f} s".format(time.time() - start_time)) ```

imshow: 3.09 s pcolormesh: 27.53 s

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Plotting on map projection much slower on v0.6.1 than 0.6.0 117002929
156991224 https://github.com/pydata/xarray/issues/657#issuecomment-156991224 https://api.github.com/repos/pydata/xarray/issues/657 MDEyOklzc3VlQ29tbWVudDE1Njk5MTIyNA== fmaussion 10050469 2015-11-16T10:55:09Z 2015-11-16T10:55:09Z MEMBER

I guess it's OK to leave it as is, as long as the performance loss is documented. I like the automatic plot() function because it hides the boring mpl internals to my students and (until now) always did what I expected it to do.

30 seconds to generate a plot in a Notebook is definitely a fun killer. Maybe I should still upgrade to 0.6.1 and explain to my students that they should use imshow() instead of plot().

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Plotting on map projection much slower on v0.6.1 than 0.6.0 117002929
156851221 https://github.com/pydata/xarray/issues/657#issuecomment-156851221 https://api.github.com/repos/pydata/xarray/issues/657 MDEyOklzc3VlQ29tbWVudDE1Njg1MTIyMQ== fmaussion 10050469 2015-11-15T20:33:24Z 2015-11-15T20:33:24Z MEMBER

If I remove the projection stuff imshow and pcolormesh are equally fast. Both functions must handle the projection differently, somehow?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Plotting on map projection much slower on v0.6.1 than 0.6.0 117002929
156849447 https://github.com/pydata/xarray/issues/657#issuecomment-156849447 https://api.github.com/repos/pydata/xarray/issues/657 MDEyOklzc3VlQ29tbWVudDE1Njg0OTQ0Nw== fmaussion 10050469 2015-11-15T20:13:46Z 2015-11-15T20:13:46Z MEMBER

Thanks for the quick answer. changing to imshow indeed reduced the execution time back to normal. I wouldn't expect a factor 10 between imshow and pcolormesh, though...

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Plotting on map projection much slower on v0.6.1 than 0.6.0 117002929

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