home / github

Menu
  • Search all tables
  • GraphQL API

issues

Table actions
  • GraphQL API for issues

2 rows where state = "open" and user = 9312831 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

type 1

  • issue 2

state 1

  • open · 2 ✖

repo 1

  • xarray 2
id node_id number title user state locked assignee milestone comments created_at updated_at ▲ closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
1206634329 I_kwDOAMm_X85H68dZ 6493 boundary conditions for differentiate() miniufo 9312831 open 0     9 2022-04-18T04:07:32Z 2022-04-26T14:48:33Z   NONE      

Is your feature request related to a problem?

I need to take centered finite difference of data of length N along the dimension 'X', with boundary conditions (BCs) specified in flexible ways. Before this, we need to pad data with BCs (length becoming N+2) so that the indicing will not be out-of-range.

Commonly used BCs are: 1. fixed - fill with fixed values so derivatives at BCs are (BC - data[-1])/dx and (data[0] - BC)/dx; 2. extend - fill BCs with second outer-most values so that derivatives at BCs are exactly zero; 3. periodic - fill BCs cyclic so that the derivatives are also cyclic.

Describe the solution you'd like

The implementation of differentiate('X') would be like: ```python

padded with BCs into N+2

data_pad = pad_BCs(data, type='periodic')

it is safe to take finite difference

for i in range(len(data)) diff[i] = data_pad [i+1] - data_pad [i-1] ```

The pad_BCs function could be easily implemented with np.pad() function.

Then we can call: python data.differentiate('X', BCs='periodic') We may also specify different kind of BCs at the two boundaries:

python data.differentiate('X', BCs=['extend', 'fixed'], fill_values=0)

Describe alternatives you've considered

No response

Additional context

I am not clear how differentiate() is implemented and just want to know if this can be implemented in a straightforward way.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6493/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 issue
607718350 MDU6SXNzdWU2MDc3MTgzNTA= 4011 missing empty group when iterate over groupby_bins miniufo 9312831 open 0     4 2020-04-27T17:22:31Z 2022-04-09T03:08:14Z   NONE      

When I try to iterate over the object grouped returned by groupby_bins, I found that the empty group is missing silently. Here is a simple case: ```python array = xr.DataArray(np.arange(4), dims='dim_0')

one of these bins will be empty

bins = [0,4,5] grouped = array.groupby_bins('dim_0', bins)

for i, group in enumerate(grouped): print(str(i)+' '+group) ``` When a bin contains no samples (bin of (4, 5]), the empty group will be dropped. Then how to iterate over the full bins even when some bins contain nothing? I've read this related issue #1019. But my case here need the correct order in grouped and empty groups need to be iterated over.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/4011/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 issue

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issues] (
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [number] INTEGER,
   [title] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [state] TEXT,
   [locked] INTEGER,
   [assignee] INTEGER REFERENCES [users]([id]),
   [milestone] INTEGER REFERENCES [milestones]([id]),
   [comments] INTEGER,
   [created_at] TEXT,
   [updated_at] TEXT,
   [closed_at] TEXT,
   [author_association] TEXT,
   [active_lock_reason] TEXT,
   [draft] INTEGER,
   [pull_request] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [state_reason] TEXT,
   [repo] INTEGER REFERENCES [repos]([id]),
   [type] TEXT
);
CREATE INDEX [idx_issues_repo]
    ON [issues] ([repo]);
CREATE INDEX [idx_issues_milestone]
    ON [issues] ([milestone]);
CREATE INDEX [idx_issues_assignee]
    ON [issues] ([assignee]);
CREATE INDEX [idx_issues_user]
    ON [issues] ([user]);
Powered by Datasette · Queries took 22.814ms · About: xarray-datasette