home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

9 rows where user = 9312831 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

issue 4

  • consecutive time selection 3
  • missing empty group when iterate over groupby_bins 2
  • DataArray.plot.pcolormesh with kwarg shading='gouraud' 2
  • boundary conditions for differentiate() 2

user 1

  • miniufo · 9 ✖

author_association 1

  • NONE 9
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1105918933 https://github.com/pydata/xarray/issues/6493#issuecomment-1105918933 https://api.github.com/repos/pydata/xarray/issues/6493 IC_kwDOAMm_X85B6vvV miniufo 9312831 2022-04-22T01:40:46Z 2022-04-22T01:40:46Z NONE

Oh, I see the release of xgcm of 0.7.0. It is really a great update! I also find the boundary condition and grid_ufunc examples on the docs (still 0.6.0), which indeed may solve many of my problems. The grid-ufunc provides flexible building blocks for complicated cases. I'll spend some times trying the new version, re-think my cases in this great architecture, and report soon if I have problems with that. Thanks to you guys' great work!

A quite question is that has the xgcm been refactored using grid_ufunc? (I hope I could catch up with you guys).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  boundary conditions for differentiate() 1206634329
1102107532 https://github.com/pydata/xarray/issues/6493#issuecomment-1102107532 https://api.github.com/repos/pydata/xarray/issues/6493 IC_kwDOAMm_X85BsNOM miniufo 9312831 2022-04-19T05:43:05Z 2022-04-19T05:43:05Z NONE

Thanks to you guys here @Illviljan @TomNicholas @dcherian. I've been a user of xgcm for quite a time. So you can see my proposal just follows the style of xgcm.

I am working on my xinvert package, in which I may need some partial differential calculations. This can be done by xgcm quite well, but I am still worried about the metrics concept introduced by xgcm. I think this should be discussed over xgcm's repo.

For most of the cases, lat/lon-type grids are uniform and on the Arakawa A grid. So xarray's differentiate() is good enough with pad() (although it is experimental) for BCs, as suggested by @dcherian. We don't need stagged grid point and metrics, as in xgcm, but centered difference (a[i+1]-a[i-1]) will be good enough for A grid. This is simpler and do not make heavy dependence of the third-party package like xgcm.

I'll give a try with differentiate() and pad() to implement grad/div/vor... But some designs in xgcm also inspire me to make things much natural.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  boundary conditions for differentiate() 1206634329
1074983948 https://github.com/pydata/xarray/issues/6399#issuecomment-1074983948 https://api.github.com/repos/pydata/xarray/issues/6399 IC_kwDOAMm_X85AEvQM miniufo 9312831 2022-03-22T10:14:17Z 2022-03-22T10:14:17Z NONE

OK, thanks again. This is clear to me now. So this should be a matplotlib problem. I am closing this now.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  DataArray.plot.pcolormesh with kwarg shading='gouraud' 1176172498
1074939174 https://github.com/pydata/xarray/issues/6399#issuecomment-1074939174 https://api.github.com/repos/pydata/xarray/issues/6399 IC_kwDOAMm_X85AEkUm miniufo 9312831 2022-03-22T09:39:10Z 2022-03-22T09:39:10Z NONE

Thanks @mathause , that works well. After searching the doc on infer_intervals, I still don't know why this is happening.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  DataArray.plot.pcolormesh with kwarg shading='gouraud' 1176172498
621317315 https://github.com/pydata/xarray/issues/4011#issuecomment-621317315 https://api.github.com/repos/pydata/xarray/issues/4011 MDEyOklzc3VlQ29tbWVudDYyMTMxNzMxNQ== miniufo 9312831 2020-04-29T16:20:54Z 2020-04-29T16:20:54Z NONE

Thanks @dcherian. I use the get_group function and solve my problem. But a warning arises at the line if name not in self.groups: as: DeprecationWarning: elementwise comparison failed; this will raise an error in the future.

When the group contains nothing, I may assign nan or 0 to the corresponding bin. If it is dropped silently, then I need to find out which bin is missing its group. I like this PR #1027 by Ryan with a kwarg drop_empty_bins but not sure this option is eventually merged into master or not.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  missing empty group when iterate over groupby_bins 607718350
620581409 https://github.com/pydata/xarray/issues/4011#issuecomment-620581409 https://api.github.com/repos/pydata/xarray/issues/4011 MDEyOklzc3VlQ29tbWVudDYyMDU4MTQwOQ== miniufo 9312831 2020-04-28T12:41:43Z 2020-04-28T12:41:43Z NONE

When I use counts = grouped.count(), I can get all the bins and counts in the correct order, and the empty bin just returns nan. But I don't want aggregation operations here. I need the samples in each group to index another array. Maybe this is not the best solution. But my case do need all the groups in the same order as the given bins, including possible empty ones.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  missing empty group when iterate over groupby_bins 607718350
605456013 https://github.com/pydata/xarray/issues/3896#issuecomment-605456013 https://api.github.com/repos/pydata/xarray/issues/3896 MDEyOklzc3VlQ29tbWVudDYwNTQ1NjAxMw== miniufo 9312831 2020-03-28T14:39:06Z 2020-03-28T14:39:06Z NONE

Minor comment / nit: you don't really need the astype(np.float), the result should already be of dtype float since there are missing values after the rolling sum.

You're right. That is used for debuging the intermediate results.

Thanks again @keewis @max-sixty.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  consecutive time selection 588126763
605395619 https://github.com/pydata/xarray/issues/3896#issuecomment-605395619 https://api.github.com/repos/pydata/xarray/issues/3896 MDEyOklzc3VlQ29tbWVudDYwNTM5NTYxOQ== miniufo 9312831 2020-03-28T05:02:59Z 2020-03-28T05:02:59Z NONE

Hi @keewis, this is really a smart way, using rolling twice. I've refactored the code slightly as: ```python def continuous_meet(cond, count, dim): """ Continuously meet a given condition along a dimension. """ _found = cond.rolling(dim={dim:count}, center=True).sum().fillna(0).astype(np.float)

detected = (
    _found.rolling(dim={dim:count}, center=True) 
    .reduce(lambda a, axis: (a == count).any(axis=axis)) 
    .fillna(False) 
    .astype(bool) 
)

if count % 2 == 0:
    return detected.shift({dim:-1}).fillna(False)

return detected

sst = xr.DataArray( np.array( [0., 0., 0., 0., 0., 1., 1., 1., 1., 1., 0., 0., 1., 0., 0., 1., 1., 1., 1., 1., 1., 0., 0., 0.] ), dims="time", coords={"time": np.arange(24)}, name="sst", )

ElNino = continuous_meet(sst > 0.5, count=5, dim='time')

sst.plot.step(linewidth=3) sst.where(ElNino).plot.step(linewidth=2) `` Note that whencountis a even number, truly centeredrollingcannot be obtained. So we need toshift` the result by -1. Is this perfect? I didn't check the performance.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  consecutive time selection 588126763
604776072 https://github.com/pydata/xarray/issues/3896#issuecomment-604776072 https://api.github.com/repos/pydata/xarray/issues/3896 MDEyOklzc3VlQ29tbWVudDYwNDc3NjA3Mg== miniufo 9312831 2020-03-27T02:01:54Z 2020-03-27T02:01:54Z NONE

Hi @max-sixty, thanks for your kind help. But I found it works not as I expected. If the SST has the values [..., 0, 0, 1, 1, 1, 1, 1, 0, 0, ...], then the method you suggested will give [..., F, F, F, F, T, F, F, F, F, ...]. That is only one True for a 5 consecutive 1s. But I would expect five True like [..., F, F, T, T, T, T, T, F, F, ...]. Any suggestion?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  consecutive time selection 588126763

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