home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

8 rows where issue = 1319621859 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 4

  • jsignell 3
  • keewis 3
  • jhamman 1
  • dcherian 1

author_association 2

  • MEMBER 5
  • CONTRIBUTOR 3

issue 1

  • Clarify difference between `.load()` and `.compute()` · 8 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1197439408 https://github.com/pydata/xarray/issues/6837#issuecomment-1197439408 https://api.github.com/repos/pydata/xarray/issues/6837 IC_kwDOAMm_X85HX3mw keewis 14808389 2022-07-27T22:30:22Z 2022-07-27T22:30:22Z MEMBER

note that the implementation of compute is currently: python def compute(self, **kwargs): new = self.copy(deep=False) return new.load(**kwargs) which means that the inplace vs. "pure function" is literally the only difference (though I don't know whether doing a shallow copy has other implications).

{
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Clarify difference between `.load()` and `.compute()` 1319621859
1197325700 https://github.com/pydata/xarray/issues/6837#issuecomment-1197325700 https://api.github.com/repos/pydata/xarray/issues/6837 IC_kwDOAMm_X85HXb2E jsignell 4806877 2022-07-27T20:21:36Z 2022-07-27T20:21:36Z CONTRIBUTOR

I should say that there might very well be other uses of load that I am not aware of. The inplace vs not is just the only difference that I noticed in the context of dask-backed xarray objects.

From this discussion I think for dask-backed objects we should recommend using compute. Maybe that is enough of a decision.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Clarify difference between `.load()` and `.compute()` 1319621859
1197113605 https://github.com/pydata/xarray/issues/6837#issuecomment-1197113605 https://api.github.com/repos/pydata/xarray/issues/6837 IC_kwDOAMm_X85HWoEF jhamman 2443309 2022-07-27T18:02:39Z 2022-07-27T18:02:39Z MEMBER

While there is overlap in the behavior here, I've always thought of these two methods as having distinct applications. .compute() is a Dask collection method. .load(), which predates Xarray's Dask integration, was originally meant to load data from our lazy loading backend arrays (e.g. a netCDF file).

Edit: up until I read this issue, I somehow assumed compute would only work with dask while load would also load our lazy array implementation into memory. Not sure how I got that impression, but maybe that's another argument to remove / align load?

This was my impression as well but now I understand that the primary difference is that load is inplace while compute is not.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Clarify difference between `.load()` and `.compute()` 1319621859
1197078424 https://github.com/pydata/xarray/issues/6837#issuecomment-1197078424 https://api.github.com/repos/pydata/xarray/issues/6837 IC_kwDOAMm_X85HWfeY jsignell 4806877 2022-07-27T17:27:43Z 2022-07-27T17:27:43Z CONTRIBUTOR

I can imagine a scenario where load is de-emphasized in the narrative docs, and compute is used instead. It wouldn't have to be a formal deprecation, but it could be that compute is best practice.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Clarify difference between `.load()` and `.compute()` 1319621859
1196915377 https://github.com/pydata/xarray/issues/6837#issuecomment-1196915377 https://api.github.com/repos/pydata/xarray/issues/6837 IC_kwDOAMm_X85HV3qx dcherian 2448579 2022-07-27T15:32:08Z 2022-07-27T15:32:08Z MEMBER

👍🏾 for updating the docstring.

IME load is commonly used so I don't know that it's worth removing.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Clarify difference between `.load()` and `.compute()` 1319621859
1196891233 https://github.com/pydata/xarray/issues/6837#issuecomment-1196891233 https://api.github.com/repos/pydata/xarray/issues/6837 IC_kwDOAMm_X85HVxxh keewis 14808389 2022-07-27T15:13:45Z 2022-07-27T15:15:46Z MEMBER

Are there lazy array implementations other than dask in xarray?

No, sorry, I mistyped. What I was referring to is the lazy loading mechanism that will load the data into memory once you try to actually do something with it.

However, it might be possible to wrap other lazy array implementations if they implement either __array_ufunc__ and __array_function__, or __array_namespace__ (see #6807).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Clarify difference between `.load()` and `.compute()` 1319621859
1196874535 https://github.com/pydata/xarray/issues/6837#issuecomment-1196874535 https://api.github.com/repos/pydata/xarray/issues/6837 IC_kwDOAMm_X85HVtsn jsignell 4806877 2022-07-27T15:00:43Z 2022-07-27T15:00:43Z CONTRIBUTOR

Thanks for engaging with this! I think removing load probably makes the most sense. Making load an alias for compute would just continue the confusion since there wouldn't be a clear right way to do things.

I somehow assumed compute would only work with dask while load would also load our lazy array implementation into memory. Not sure how I got that impression, but maybe that's another argument to remove / align load?

I'm not quite sure I follow. Are there lazy array implementations other than dask in xarray?

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Clarify difference between `.load()` and `.compute()` 1319621859
1196850508 https://github.com/pydata/xarray/issues/6837#issuecomment-1196850508 https://api.github.com/repos/pydata/xarray/issues/6837 IC_kwDOAMm_X85HVn1M keewis 14808389 2022-07-27T14:40:54Z 2022-07-27T14:43:31Z MEMBER

Yeah, deprecating return values is not fun. We somewhat recently did that for Dataset.update and found that we could only mention this in the documentation / release notes, which is not great for visibility.

Interestingly, the docstring of Dataset.compute and Dataset.load compare with each other, while for the methods on DataArray and Variable that comparison is missing. None of them actually link to the other method, though.

Given that we have been removing inplace operations as much as possible, I'd vote to remove load entirely or make it an alias of compute.

Edit: up until I read this issue, I somehow assumed compute would only work with dask while load would also load our lazy array implementation into memory. Not sure how I got that impression, but maybe that's another argument to remove / align load?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Clarify difference between `.load()` and `.compute()` 1319621859

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