home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

9 rows where issue = 390774883 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

  • dcherian 3
  • mark-boer 3
  • lanougue 2
  • jhamman 1

author_association 3

  • MEMBER 4
  • CONTRIBUTOR 3
  • NONE 2

issue 1

  • Pad method · 9 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
562654929 https://github.com/pydata/xarray/issues/2605#issuecomment-562654929 https://api.github.com/repos/pydata/xarray/issues/2605 MDEyOklzc3VlQ29tbWVudDU2MjY1NDkyOQ== lanougue 32069530 2019-12-06T17:02:05Z 2019-12-06T17:02:05Z NONE

Ho, sorry... I just see the PR...

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Pad method 390774883
562652648 https://github.com/pydata/xarray/issues/2605#issuecomment-562652648 https://api.github.com/repos/pydata/xarray/issues/2605 MDEyOklzc3VlQ29tbWVudDU2MjY1MjY0OA== lanougue 32069530 2019-12-06T16:56:20Z 2019-12-06T16:56:20Z NONE

Hi, I was looking to some xarray padding function and get this issue. For the moment, I made a function of my own based on numpy.pad and xr.apply_ufunc When possible, it also pad associated coordinates. If it can be of any help here... Here it is: ``` def xpad(ds, dims={}): """ Padding of xarray. Coordinate are linearly padded if original coordinates are evenly spaced. Otherwise, no new coordinates are affected to padded axis. Padded dimension is named with prefix 'padded_'

Args:
    ds (xarray): xarray
    dims (dict): keys are dimensions along which to pad and values are padding tuple (see np.pad). (ex {'pulse:(10,0)})

Returns:
    (xarray) : same as input with padded axis. 
"""
mypad = [(0,0) for n in ds.dims if n not in dims.keys()]
mypad+=list(dims.values())
padded_ds = xr.apply_ufunc(np.pad, ds, mypad,input_core_dims=[list(dims.keys()),[]], output_core_dims=[['padded_'+d for d in dims.keys()]], keep_attrs=True)

for var, ext in dims.items():
    dvar = np.diff(ds[var])
    if np.allclose(dvar, dvar[0]):
        dvar = dvar[0]
        left_bound, right_bound  = (np.min(ds[var]).data, np.max(ds[var]).data) if dvar>0. else (np.max(ds[var]).data, np.min(ds[var]).data)
        extended_var = np.append(ds[var].data, np.max(ds[var]).data+np.arange(1,ext[1]+1)*dvar)
        extended_var = np.append(np.min(ds[var]).data+np.arange(-ext[0],0)*dvar, extended_var)
        padded_ds = padded_ds.assign_coords(**{'padded_'+var:extended_var})
    else:
        print('Coordinates {} are not evenly spaced, padding is impossible'.format(var))
return padded_ds

```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Pad method 390774883
561372979 https://github.com/pydata/xarray/issues/2605#issuecomment-561372979 https://api.github.com/repos/pydata/xarray/issues/2605 MDEyOklzc3VlQ29tbWVudDU2MTM3Mjk3OQ== mark-boer 12862013 2019-12-03T21:50:53Z 2019-12-03T21:50:53Z CONTRIBUTOR

I will create a WIP pull request tommorow.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Pad method 390774883
561336318 https://github.com/pydata/xarray/issues/2605#issuecomment-561336318 https://api.github.com/repos/pydata/xarray/issues/2605 MDEyOklzc3VlQ29tbWVudDU2MTMzNjMxOA== dcherian 2448579 2019-12-03T20:10:54Z 2019-12-03T20:10:54Z MEMBER

Also see #3587

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Pad method 390774883
555065766 https://github.com/pydata/xarray/issues/2605#issuecomment-555065766 https://api.github.com/repos/pydata/xarray/issues/2605 MDEyOklzc3VlQ29tbWVudDU1NTA2NTc2Ng== dcherian 2448579 2019-11-18T15:28:18Z 2019-11-18T15:28:18Z MEMBER

You can copy over dask.array.pad to dask_array_compat.py and do something like

python if LooseVersion(dask_version) >= LooseVersion("1.7.0"): pad = dask.array.pad else: # copied from dask.array def pad(...): ...

mode="mean" converts an array of integers to floats in Dask, but in numpy it keeps it an array of integers.

That's weird. Open an issue at the dask repo with an example?

Feel free to open an in-progress PR. Thanks for working on this.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Pad method 390774883
554998976 https://github.com/pydata/xarray/issues/2605#issuecomment-554998976 https://api.github.com/repos/pydata/xarray/issues/2605 MDEyOklzc3VlQ29tbWVudDU1NDk5ODk3Ng== mark-boer 12862013 2019-11-18T12:41:33Z 2019-11-18T12:41:33Z CONTRIBUTOR

@dcherian Thx! I found the Variable.pad_with_fill_value already, but I will also have a look at rolling and coarsen.

I have some questions related to this issue, I hope this is the correct place to ask those:

Dask added the pad method in version 1.7.0 according to its documentation. What is the minimum version of Dask that should be supported, I found Dask=1.2 is the continuous integration requirements.

Also, how should I handle implementation differences between numpy and Dask? E.g. in the current version of Dask and numpy I'm using: mode="mean" converts an array of integers to floats in Dask, but in numpy it keeps it an array of integers.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Pad method 390774883
551984679 https://github.com/pydata/xarray/issues/2605#issuecomment-551984679 https://api.github.com/repos/pydata/xarray/issues/2605 MDEyOklzc3VlQ29tbWVudDU1MTk4NDY3OQ== dcherian 2448579 2019-11-08T20:49:33Z 2019-11-08T20:49:33Z MEMBER

@mark-boer Note that we have a Variable.pad_with_fill_value method and some other padding code in rolling and coarsen that could be consolidated.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Pad method 390774883
549068438 https://github.com/pydata/xarray/issues/2605#issuecomment-549068438 https://api.github.com/repos/pydata/xarray/issues/2605 MDEyOklzc3VlQ29tbWVudDU0OTA2ODQzOA== jhamman 2443309 2019-11-02T18:18:27Z 2019-11-02T18:18:27Z MEMBER

@mark-boer - I don't think so. Give it a go!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Pad method 390774883
549058104 https://github.com/pydata/xarray/issues/2605#issuecomment-549058104 https://api.github.com/repos/pydata/xarray/issues/2605 MDEyOklzc3VlQ29tbWVudDU0OTA1ODEwNA== mark-boer 12862013 2019-11-02T16:16:27Z 2019-11-02T16:16:27Z CONTRIBUTOR

Has some1 started working on this? I thought I might give it a try ;-)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Pad method 390774883

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