home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

9 rows where issue = 484863660 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 4
  • shoyer 3
  • crusaderky 1
  • pep8speaks 1

author_association 3

  • CONTRIBUTOR 4
  • MEMBER 4
  • NONE 1

issue 1

  • [WIP] Implement 1D to ND interpolation · 9 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
747145009 https://github.com/pydata/xarray/pull/3262#issuecomment-747145009 https://api.github.com/repos/pydata/xarray/issues/3262 MDEyOklzc3VlQ29tbWVudDc0NzE0NTAwOQ== nbren12 1386642 2020-12-17T01:29:12Z 2020-12-17T01:29:12Z CONTRIBUTOR

I'm going to close this since I won't be working on it any longer.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  [WIP] Implement 1D to ND interpolation 484863660
524581747 https://github.com/pydata/xarray/pull/3262#issuecomment-524581747 https://api.github.com/repos/pydata/xarray/issues/3262 MDEyOklzc3VlQ29tbWVudDUyNDU4MTc0Nw== pep8speaks 24736507 2019-08-24T21:23:23Z 2020-06-10T23:33:02Z NONE

Hello @nbren12! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

  • In the file xarray/tests/test_interp.py:

Line 670:5: F841 local variable 'old_coord' is assigned to but never used Line 676:36: E226 missing whitespace around arithmetic operator Line 676:51: E226 missing whitespace around arithmetic operator Line 679:21: E226 missing whitespace around arithmetic operator Line 693:31: E231 missing whitespace after ',' Line 711:1: F811 redefinition of unused 'test_interp_1d_nd_targ' from line 704 Line 718:1: E302 expected 2 blank lines, found 1 Line 729:1: W391 blank line at end of file

Comment last updated at 2020-06-10 23:33:02 UTC
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  [WIP] Implement 1D to ND interpolation 484863660
549088791 https://github.com/pydata/xarray/pull/3262#issuecomment-549088791 https://api.github.com/repos/pydata/xarray/issues/3262 MDEyOklzc3VlQ29tbWVudDU0OTA4ODc5MQ== shoyer 1217238 2019-11-02T23:01:30Z 2019-11-02T23:01:30Z MEMBER

No worries! You were a great help already!

On Sat, Nov 2, 2019 at 3:01 PM Noah D Brenowitz notifications@github.com wrote:

Unfortunately, I don’t think I have much time now to contribute to a general purpose solution leveraging xarray’s built-in indexing. So feel free to add to or close this PR. To be successful, I would need to study xarray’s indexing internals more since I don’t think it is as easily implemented as a routine calling DataArray methods. Some custom numba code I wrote fits in my brain much better, and is general enough for my purposes when wrapped with xr.apply_ufunc. I encourage someone else to pick up where I left off, or we could close this PR.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pydata/xarray/pull/3262?email_source=notifications&email_token=AAJJFVQEA7HP77G2FKRYYATQRX2CPA5CNFSM4IPHIIXKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEC5F7HI#issuecomment-549085085, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJJFVXSUO5GOMC67PPGBGDQRX2CPANCNFSM4IPHIIXA .

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  [WIP] Implement 1D to ND interpolation 484863660
549085085 https://github.com/pydata/xarray/pull/3262#issuecomment-549085085 https://api.github.com/repos/pydata/xarray/issues/3262 MDEyOklzc3VlQ29tbWVudDU0OTA4NTA4NQ== nbren12 1386642 2019-11-02T22:01:10Z 2019-11-02T22:01:10Z CONTRIBUTOR

Unfortunately, I don’t think I have much time now to contribute to a general purpose solution leveraging xarray’s built-in indexing. So feel free to add to or close this PR. To be successful, I would need to study xarray’s indexing internals more since I don’t think it is as easily implemented as a routine calling DataArray methods. Some custom numba code I wrote fits in my brain much better, and is general enough for my purposes when wrapped with xr.apply_ufunc. I encourage someone else to pick up where I left off, or we could close this PR.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  [WIP] Implement 1D to ND interpolation 484863660
549084085 https://github.com/pydata/xarray/pull/3262#issuecomment-549084085 https://api.github.com/repos/pydata/xarray/issues/3262 MDEyOklzc3VlQ29tbWVudDU0OTA4NDA4NQ== shoyer 1217238 2019-11-02T21:46:32Z 2019-11-02T21:46:32Z MEMBER

One missing part of the algorithm I wrote in https://github.com/pydata/xarray/pull/3262#issuecomment-525154116 was looping over all index/weight combinations. I recently wrote a version of this for another project that might be a good starting point here: ```python def prod(items): out = 1 for item in items: out *= item return out

def index_by_linear_interpolation(array, float_indices): all_indices_and_weights = [] for origin in float_indices: lower = np.floor(origin) upper = np.ceil(origin) l_index = xlower.astype(np.int32) u_index = upper.astype(np.int32) l_weight = origin - lower u_weight = 1 - l_weight all_indices_and_weights.append( ((l_index, l_weight), (u_index, u_weight)) )

out = 0 for items in itertools.product(all_indices_and_weights): indices, weights = zip(items) indices = tuple(index % size for index, size in zip(indices, array.shape)) out += prod(weights) * array[indices] return out ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  [WIP] Implement 1D to ND interpolation 484863660
525303808 https://github.com/pydata/xarray/pull/3262#issuecomment-525303808 https://api.github.com/repos/pydata/xarray/issues/3262 MDEyOklzc3VlQ29tbWVudDUyNTMwMzgwOA== crusaderky 6213168 2019-08-27T13:34:50Z 2019-08-27T13:34:50Z MEMBER

For highly optimized interpolation of an N-dimensional array along any one dimension, see also https://xarray-extras.readthedocs.io/en/latest/api/interpolate.html

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  [WIP] Implement 1D to ND interpolation 484863660
525157967 https://github.com/pydata/xarray/pull/3262#issuecomment-525157967 https://api.github.com/repos/pydata/xarray/issues/3262 MDEyOklzc3VlQ29tbWVudDUyNTE1Nzk2Nw== nbren12 1386642 2019-08-27T06:26:49Z 2019-08-27T06:26:49Z CONTRIBUTOR

Thanks so much for the help. This is a good learning experience for me.

That potentially would let you avoid redundant operations on the entire Dataset object.

Yes. This is where I got stuck TBH.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  [WIP] Implement 1D to ND interpolation 484863660
525154116 https://github.com/pydata/xarray/pull/3262#issuecomment-525154116 https://api.github.com/repos/pydata/xarray/issues/3262 MDEyOklzc3VlQ29tbWVudDUyNTE1NDExNg== shoyer 1217238 2019-08-27T06:12:14Z 2019-08-27T06:12:14Z MEMBER

Feel free to refactor as you see fit, but it may still make sense to do indexing at the Variable rather than Dataset level. That potentially would let you avoid redundant operations on the entire Dataset object.

Take a look at the _localize() helper function in missing.py for an example of how to do stuff with in the underlying index. I think something like the following helper function could do the trick: python def linear_interp(var, indexes_coords): lower_indices = {} upper_indices = {} for dim, [x, new_x] in indexes_coords.items(): index = x.to_index() # ideally should precompute these, rather than calling get_indexer_nd for each # variable separately lower_indices[dim] = get_indexer_nd(index, new_x.values, method="ffill") upper_indices[dim] = get_indexer_nd(index, new_x.values, method="bfill") result = 0 for weight, indexes in ... # need to compute weights and all lower/upper combinations result += weight * var.isel(**indexes) return result

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  [WIP] Implement 1D to ND interpolation 484863660
525025890 https://github.com/pydata/xarray/pull/3262#issuecomment-525025890 https://api.github.com/repos/pydata/xarray/issues/3262 MDEyOklzc3VlQ29tbWVudDUyNTAyNTg5MA== nbren12 1386642 2019-08-26T20:47:33Z 2019-08-26T20:48:03Z CONTRIBUTOR

@shoyer Thanks for the comments. I was struggling to incorporate it into Dataset.interp since core.missing is a pretty complicated. Would it be worth refactoring that module to clarify how interp calls are mapped to a given function? Also, most of the methods in interp work like Dataset -> Variables -> Numpy arrays, but the method you proposed above operates on the Dataset level, so it doesn't quite fit into core.missing.interp.

The interpolation code I was working with doesn't regrid the coordinates appropriately, so we would need to do that too.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  [WIP] Implement 1D to ND interpolation 484863660

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