home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

6 rows where issue = 577283480 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 2

  • keewis 4
  • max-sixty 2

issue 1

  • Doctests fixes · 6 ✖

author_association 1

  • MEMBER 6
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
597085649 https://github.com/pydata/xarray/pull/3846#issuecomment-597085649 https://api.github.com/repos/pydata/xarray/issues/3846 MDEyOklzc3VlQ29tbWVudDU5NzA4NTY0OQ== keewis 14808389 2020-03-10T13:29:04Z 2020-03-10T13:29:04Z MEMBER

sounds good. By then I might also have the CLI ready so we hopefully could then use it the same way we use black.

Also note that it currently requires valid doctest lines. There is at least one instance in the code where that is not true (a missing continuation line prompt (...) in the docstring of DataArray.swap_dims) so these issues would need to be fixed first, anyways.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Doctests fixes 577283480
596883896 https://github.com/pydata/xarray/pull/3846#issuecomment-596883896 https://api.github.com/repos/pydata/xarray/issues/3846 MDEyOklzc3VlQ29tbWVudDU5Njg4Mzg5Ng== max-sixty 5635139 2020-03-10T03:30:49Z 2020-03-10T03:30:49Z MEMBER

That's awesome @keewis ! Cool tool...

Shall I merge this and then you do a PR with those changes on top? And from there we can start adding subset of the files to run in CI?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Doctests fixes 577283480
596859274 https://github.com/pydata/xarray/pull/3846#issuecomment-596859274 https://api.github.com/repos/pydata/xarray/issues/3846 MDEyOklzc3VlQ29tbWVudDU5Njg1OTI3NA== keewis 14808389 2020-03-10T01:45:22Z 2020-03-10T01:45:22Z MEMBER

The tool is at https://github.com/keewis/black-doctest. It is still experimental and is missing a lot of the features black has (e.g. no CLI, yet) but here's the output for dataarray.py:

changes for xarray/core/dataarray.py ```diff diff --git a/xarray/core/dataarray.py b/xarray/core/dataarray.py index 7a95aedc..0fafd69b 100644 --- a/xarray/core/dataarray.py +++ b/xarray/core/dataarray.py @@ -875,8 +875,7 @@ class DataArray(AbstractArray, DataWithCoords): Shallow versus deep copy - >>> array = xr.DataArray([1, 2, 3], dims='x', - ... coords={'x': ['a', 'b', 'c']}) + >>> array = xr.DataArray([1, 2, 3], dims="x", coords={"x": ["a", "b", "c"]}) >>> array.copy() <xarray.DataArray (x: 3)> array([1, 2, 3]) @@ -1344,7 +1343,7 @@ class DataArray(AbstractArray, DataWithCoords): Examples -------- - >>> da = xr.DataArray([1, 3], [('x', np.arange(2))]) + >>> da = xr.DataArray([1, 3], [("x", np.arange(2))]) >>> da.interp(x=0.5) <xarray.DataArray ()> array(2.0) @@ -1475,8 +1474,9 @@ class DataArray(AbstractArray, DataWithCoords): Examples -------- - >>> arr = xr.DataArray(data=[0, 1], dims="x", - coords={"x": ["a", "b"], "y": ("x", [0, 1])}) + >>> arr = xr.DataArray( + ... data=[0, 1], dims="x", coords={"x": ["a", "b"], "y": ("x", [0, 1])} + ... ) >>> arr <xarray.DataArray (x: 2)> array([0, 1]) @@ -1589,12 +1589,11 @@ class DataArray(AbstractArray, DataWithCoords): Examples -------- - >>> arr = xr.DataArray(data=np.ones((2, 3)), - ... dims=['x', 'y'], - ... coords={'x': - ... range(2), 'y': - ... range(3), 'a': ('x', [3, 4]) - ... }) + >>> arr = xr.DataArray( + ... data=np.ones((2, 3)), + ... dims=["x", "y"], + ... coords={"x": range(2), "y": range(3), "a": ("x", [3, 4])}, + ... ) >>> arr <xarray.DataArray (x: 2, y: 3)> array([[1., 1., 1.], @@ -1603,7 +1602,7 @@ class DataArray(AbstractArray, DataWithCoords): * x (x) int64 0 1 * y (y) int64 0 1 2 a (x) int64 3 4 - >>> arr.set_index(x='a') + >>> arr.set_index(x="a") <xarray.DataArray (x: 2, y: 3)> array([[1., 1., 1.], [1., 1., 1.]]) @@ -1718,8 +1717,9 @@ class DataArray(AbstractArray, DataWithCoords): Examples -------- - >>> arr = DataArray(np.arange(6).reshape(2, 3), - ... coords=[('x', ['a', 'b']), ('y', [0, 1, 2])]) + >>> arr = DataArray( + ... np.arange(6).reshape(2, 3), coords=[("x", ["a", "b"]), ("y", [0, 1, 2])] + ... ) >>> arr <xarray.DataArray (x: 2, y: 3)> array([[0, 1, 2], @@ -1727,8 +1727,8 @@ class DataArray(AbstractArray, DataWithCoords): Coordinates: * x (x) |S1 'a' 'b' * y (y) int64 0 1 2 - >>> stacked = arr.stack(z=('x', 'y')) - >>> stacked.indexes['z'] + >>> stacked = arr.stack(z=("x", "y")) + >>> stacked.indexes["z"] MultiIndex(levels=[['a', 'b'], [0, 1, 2]], codes=[[0, 0, 0, 1, 1, 1], [0, 1, 2, 0, 1, 2]], names=['x', 'y']) @@ -1768,8 +1768,9 @@ class DataArray(AbstractArray, DataWithCoords): Examples -------- - >>> arr = DataArray(np.arange(6).reshape(2, 3), - ... coords=[('x', ['a', 'b']), ('y', [0, 1, 2])]) + >>> arr = DataArray( + ... np.arange(6).reshape(2, 3), coords=[("x", ["a", "b"]), ("y", [0, 1, 2])] + ... ) >>> arr <xarray.DataArray (x: 2, y: 3)> array([[0, 1, 2], @@ -1777,8 +1778,8 @@ class DataArray(AbstractArray, DataWithCoords): Coordinates: * x (x) |S1 'a' 'b' * y (y) int64 0 1 2 - >>> stacked = arr.stack(z=('x', 'y')) - >>> stacked.indexes['z'] + >>> stacked = arr.stack(z=("x", "y")) + >>> stacked.indexes["z"] MultiIndex(levels=[['a', 'b'], [0, 1, 2]], codes=[[0, 0, 0, 1, 1, 1], [0, 1, 2, 0, 1, 2]], names=['x', 'y']) @@ -1817,9 +1818,10 @@ class DataArray(AbstractArray, DataWithCoords): Examples -------- >>> import xarray as xr - >>> arr = DataArray(np.arange(6).reshape(2, 3), - ... coords=[('x', ['a', 'b']), ('y', [0, 1, 2])]) - >>> data = xr.Dataset({'a': arr, 'b': arr.isel(y=0)}) + >>> arr = DataArray( + ... np.arange(6).reshape(2, 3), coords=[("x", ["a", "b"]), ("y", [0, 1, 2])] + ... ) + >>> data = xr.Dataset({"a": arr, "b": arr.isel(y=0)}) >>> data <xarray.Dataset> Dimensions: (x: 2, y: 3) @@ -1829,12 +1831,12 @@ class DataArray(AbstractArray, DataWithCoords): Data variables: a (x, y) int64 0 1 2 3 4 5 b (x) int64 0 3 - >>> stacked = data.to_stacked_array("z", ['y']) - >>> stacked.indexes['z'] + >>> stacked = data.to_stacked_array("z", ["y"]) + >>> stacked.indexes["z"] MultiIndex(levels=[['a', 'b'], [0, 1, 2]], labels=[[0, 0, 0, 1], [0, 1, 2, -1]], names=['variable', 'y']) - >>> roundtripped = stacked.to_unstacked_dataset(dim='z') + >>> roundtripped = stacked.to_unstacked_dataset(dim="z") >>> data.identical(roundtripped) True @@ -2694,13 +2696,13 @@ class DataArray(AbstractArray, DataWithCoords): Examples -------- - >>> arr = xr.DataArray([5, 5, 6, 6], [[1, 2, 3, 4]], ['x']) - >>> arr.diff('x') + >>> arr = xr.DataArray([5, 5, 6, 6], [[1, 2, 3, 4]], ["x"]) + >>> arr.diff("x") <xarray.DataArray (x: 3)> array([0, 1, 0]) Coordinates: * x (x) int64 2 3 4 - >>> arr.diff('x', 2) + >>> arr.diff("x", 2) <xarray.DataArray (x: 2)> array([ 1, -1]) Coordinates: @@ -2750,7 +2752,7 @@ class DataArray(AbstractArray, DataWithCoords): Examples -------- - >>> arr = xr.DataArray([5, 6, 7], dims='x') + >>> arr = xr.DataArray([5, 6, 7], dims="x") >>> arr.shift(x=1) <xarray.DataArray (x: 3)> array([ nan, 5., 6.]) @@ -2800,7 +2802,7 @@ class DataArray(AbstractArray, DataWithCoords): Examples -------- - >>> arr = xr.DataArray([5, 6, 7], dims='x') + >>> arr = xr.DataArray([5, 6, 7], dims="x") >>> arr.roll(x=1) <xarray.DataArray (x: 3)> array([7, 5, 6]) @@ -2849,9 +2851,9 @@ class DataArray(AbstractArray, DataWithCoords): -------- >>> da_vals = np.arange(6 * 5 * 4).reshape((6, 5, 4)) - >>> da = DataArray(da_vals, dims=['x', 'y', 'z']) + >>> da = DataArray(da_vals, dims=["x", "y", "z"]) >>> dm_vals = np.arange(4) - >>> dm = DataArray(dm_vals, dims=['z']) + >>> dm = DataArray(dm_vals, dims=["z"]) >>> dm.dims ('z') @@ -2909,9 +2911,11 @@ class DataArray(AbstractArray, DataWithCoords): Examples -------- - >>> da = xr.DataArray(np.random.rand(5), - ... coords=[pd.date_range('1/1/2000', periods=5)], - ... dims='time') + >>> da = xr.DataArray( + ... np.random.rand(5), + ... coords=[pd.date_range("1/1/2000", periods=5)], + ... dims="time", + ... ) >>> da <xarray.DataArray (time: 5)> array([ 0.965471, 0.615637, 0.26532 , 0.270962, 0.552878]) @@ -3052,8 +3056,8 @@ class DataArray(AbstractArray, DataWithCoords): Examples -------- - >>> arr = xr.DataArray([5, 6, 7], dims='x') - >>> arr.rank('x') + >>> arr = xr.DataArray([5, 6, 7], dims="x") + >>> arr.rank("x") <xarray.DataArray (x: 3)> array([ 1., 2., 3.]) Dimensions without coordinates: x @@ -3093,8 +3097,11 @@ class DataArray(AbstractArray, DataWithCoords): Examples -------- - >>> da = xr.DataArray(np.arange(12).reshape(4, 3), dims=['x', 'y'], - ... coords={'x': [0, 0.1, 1.1, 1.2]}) + >>> da = xr.DataArray( + ... np.arange(12).reshape(4, 3), + ... dims=["x", "y"], + ... coords={"x": [0, 0.1, 1.1, 1.2]}, + ... ) >>> da <xarray.DataArray (x: 4, y: 3)> array([[ 0, 1, 2], @@ -3105,7 +3112,7 @@ class DataArray(AbstractArray, DataWithCoords): * x (x) float64 0.0 0.1 1.1 1.2 Dimensions without coordinates: y >>> - >>> da.differentiate('x') + >>> da.differentiate("x") <xarray.DataArray (x: 4, y: 3)> array([[30. , 30. , 30. ], [27.545455, 27.545455, 27.545455], @@ -3147,8 +3154,11 @@ class DataArray(AbstractArray, DataWithCoords): Examples -------- - >>> da = xr.DataArray(np.arange(12).reshape(4, 3), dims=['x', 'y'], - ... coords={'x': [0, 0.1, 1.1, 1.2]}) + >>> da = xr.DataArray( + ... np.arange(12).reshape(4, 3), + ... dims=["x", "y"], + ... coords={"x": [0, 0.1, 1.1, 1.2]}, + ... ) >>> da <xarray.DataArray (x: 4, y: 3)> array([[ 0, 1, 2], @@ -3159,7 +3169,7 @@ class DataArray(AbstractArray, DataWithCoords): * x (x) float64 0.0 0.1 1.1 1.2 Dimensions without coordinates: y >>> - >>> da.integrate('x') + >>> da.integrate("x") <xarray.DataArray (y: 3)> array([5.4, 6.6, 7.8]) Dimensions without coordinates: y ```
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Doctests fixes 577283480
596199930 https://github.com/pydata/xarray/pull/3846#issuecomment-596199930 https://api.github.com/repos/pydata/xarray/issues/3846 MDEyOklzc3VlQ29tbWVudDU5NjE5OTkzMA== keewis 14808389 2020-03-08T12:25:27Z 2020-03-08T12:25:27Z MEMBER

I wouldn't vendor exactly that script since it looks more like a proof-of-concept. I'm currently trying to rewrite it so if that works out I'd propose to use that instead.

In the future, we might be able to use the black executable for this since they're currently considering it: psf/black#144

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Doctests fixes 577283480
596159599 https://github.com/pydata/xarray/pull/3846#issuecomment-596159599 https://api.github.com/repos/pydata/xarray/issues/3846 MDEyOklzc3VlQ29tbWVudDU5NjE1OTU5OQ== max-sixty 5635139 2020-03-08T02:38:30Z 2020-03-08T02:38:30Z MEMBER

would it make sense to apply black to the doctest lines? The only thing I found was a script which from a quick glance over the code extracts the doctest lines one by one, strips the prompt, applies black to it and puts back the prompt. It is not as convenient as the black executable but it could help with bringing the comfort of black to the doctest lines.

If we do want to use something like that, it would probably be good to find a maintained tool.

For sure! I'm not sure there is a maintained tool... We could vendor the script?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Doctests fixes 577283480
596151353 https://github.com/pydata/xarray/pull/3846#issuecomment-596151353 https://api.github.com/repos/pydata/xarray/issues/3846 MDEyOklzc3VlQ29tbWVudDU5NjE1MTM1Mw== keewis 14808389 2020-03-08T00:17:21Z 2020-03-08T00:17:21Z MEMBER

would it make sense to apply black to the doctest lines? The only thing I found was a script which from a quick glance over the code extracts the doctest lines one by one, strips the prompt, applies black to it and puts back the prompt. It is not as convenient as the black executable but it could help with bringing the comfort of black to the doctest lines.

If we do want to use something like that, it would probably be good to find a maintained tool.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Doctests fixes 577283480

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