home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

7 rows where author_association = "MEMBER", issue = 936313924 and user = 14371165 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 1

  • Illviljan · 7 ✖

issue 1

  • Rely on NEP-18 to dispatch to dask in duck_array_ops · 7 ✖

author_association 1

  • MEMBER · 7 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
907414746 https://github.com/pydata/xarray/pull/5571#issuecomment-907414746 https://api.github.com/repos/pydata/xarray/issues/5571 IC_kwDOAMm_X842Fgza Illviljan 14371165 2021-08-27T19:08:38Z 2021-08-27T19:15:38Z MEMBER

I don't understand why doctests doesn't go through the if path, is it using tricks that can make around.__doc__ == None?

Anyway I think just ignoring these typing errors might be easier.

Readthedocs error: ```


/home/docs/checkouts/readthedocs.org/user_builds/xray/checkouts/5571/xarray/core/_typed_ops.py:docstring of xarray.core._typed_ops.DataArrayOpsMixin.round:65: WARNING: Explicit markup ends without a blank line; unexpected unindent. /home/docs/checkouts/readthedocs.org/user_builds/xray/checkouts/5571/xarray/core/_typed_ops.py:docstring of xarray.core._typed_ops.DataArrayOpsMixin.round:65: WARNING: Unexpected section title or transition. ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Rely on NEP-18 to dispatch to dask in duck_array_ops 936313924
907395913 https://github.com/pydata/xarray/pull/5571#issuecomment-907395913 https://api.github.com/repos/pydata/xarray/issues/5571 IC_kwDOAMm_X842FcNJ Illviljan 14371165 2021-08-27T18:34:42Z 2021-08-27T18:34:42Z MEMBER

I must say it gets kind of annoying having so pedantic doctests and doc generation when upstream modules aren't as picky.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Rely on NEP-18 to dispatch to dask in duck_array_ops 936313924
906634816 https://github.com/pydata/xarray/pull/5571#issuecomment-906634816 https://api.github.com/repos/pydata/xarray/issues/5571 IC_kwDOAMm_X842CiZA Illviljan 14371165 2021-08-26T18:16:51Z 2021-08-27T16:56:35Z MEMBER

Seems to be a problem in numpy np.around fails the doctest, see https://github.com/numpy/numpy/issues/19759.

I wonder if the docstring can be ignored if it is copied from somewhere else?

I think an easy workaround is simply replacing the docstring: https://github.com/pydata/xarray/blob/4fd81b51101aceaad08570f1368ad4b50a946da5/xarray/core/duck_array_ops.py#L75

```python around = _dask_or_eager_func("around") # np.around has failing doctests, overwrite it so they pass: around.__doc__ = """ Evenly round to the given number of decimals. Parameters ---------- a : array_like Input data. decimals : int, optional Number of decimal places to round to (default: 0). If decimals is negative, it specifies the number of positions to the left of the decimal point. out : ndarray, optional Alternative output array in which to place the result. It must have the same shape as the expected output, but the type of the output values will be cast if necessary. See :ref:`ufuncs-output-type` for more details. Returns ------- rounded_array : ndarray An array of the same type as `a`, containing the rounded values. Unless `out` was specified, a new array is created. A reference to the result is returned. The real and imaginary parts of complex numbers are rounded separately. The result of rounding a float is a float. See Also -------- ndarray.round : equivalent method ceil, fix, floor, rint, trunc Notes ----- For values exactly halfway between rounded decimal values, NumPy rounds to the nearest even value. Thus 1.5 and 2.5 round to 2.0, -0.5 and 0.5 round to 0.0, etc. ``np.around`` uses a fast but sometimes inexact algorithm to round floating-point datatypes. For positive `decimals` it is equivalent to ``np.true_divide(np.rint(a * 10**decimals), 10**decimals)``, which has error due to the inexact representation of decimal fractions in the IEEE floating point standard [1]_ and errors introduced when scaling by powers of ten. For instance, note the extra "1" in the following: >>> np.round(56294995342131.5, 3) 56294995342131.51 If your goal is to print such values with a fixed number of decimals, it is preferable to use numpy's float printing routines to limit the number of printed decimals: >>> np.format_float_positional(56294995342131.5, precision=3) '56294995342131.5' The float printing routines use an accurate but much more computationally demanding algorithm to compute the number of digits after the decimal point. Alternatively, Python's builtin `round` function uses a more accurate but slower algorithm for 64-bit floating point values: >>> round(56294995342131.5, 3) 56294995342131.5 >>> np.round(16.055, 2), round(16.055, 2) # equals 16.0549999999999997 (16.06, 16.05) References ---------- .. [1] "Lecture Notes on the Status of IEEE 754", William Kahan, https://people.eecs.berkeley.edu/~wkahan/ieee754status/IEEE754.PDF .. [2] "How Futile are Mindless Assessments of Roundoff in Floating-Point Computation?", William Kahan, https://people.eecs.berkeley.edu/~wkahan/Mindless.pdf Examples -------- >>> np.around([0.37, 1.64]) array([0., 2.]) >>> np.around([0.37, 1.64], decimals=1) array([0.4, 1.6]) >>> np.around([.5, 1.5, 2.5, 3.5, 4.5]) # rounds to nearest even value array([0., 2., 2., 4., 4.]) >>> np.around([1,2,3,11], decimals=1) # ndarray of ints is returned array([ 1, 2, 3, 11]) >>> np.around([1,2,3,11], decimals=-1) array([ 0, 0, 0, 10]) """ ```
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Rely on NEP-18 to dispatch to dask in duck_array_ops 936313924
907340223 https://github.com/pydata/xarray/pull/5571#issuecomment-907340223 https://api.github.com/repos/pydata/xarray/issues/5571 IC_kwDOAMm_X842FOm_ Illviljan 14371165 2021-08-27T16:55:12Z 2021-08-27T16:55:12Z MEMBER

Saw dask does similar fixes too: https://github.com/dask/dask/blob/85f0b14bd36a5135ce51aeee067b6207374b00c4/dask/array/wrap.py#L183

Here's a version inspired by that one: ```python around = _dask_or_eager_func("around")

np.around has failing doctests, overwrite it so they pass:

https://github.com/numpy/numpy/issues/19759

around.doc = test.doc.replace( "array([0., 2.])", "array([0., 2.])", ) around.doc = test.doc.replace( "array([0.4, 1.6])", "array([0.4, 1.6])", ) around.doc = test.doc.replace( "array([0., 2., 2., 4., 4.])", "array([0., 2., 2., 4., 4.])", ) ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Rely on NEP-18 to dispatch to dask in duck_array_ops 936313924
906092175 https://github.com/pydata/xarray/pull/5571#issuecomment-906092175 https://api.github.com/repos/pydata/xarray/issues/5571 IC_kwDOAMm_X842Ad6P Illviljan 14371165 2021-08-26T04:50:04Z 2021-08-26T04:50:04Z MEMBER

```python __ [doctest] xarray.core.typed_ops.DataArrayOpsMixin.round ___ EXAMPLE LOCATION UNKNOWN, not showing all tests of that example ??? >>> np.around([0.37, 1.64]) Expected: array([0., 2.]) Got: array([0., 2.])

/home/runner/work/xarray/xarray/xarray/core/_typed_ops.py:None: DocTestFailure ``` The expected had 2 spaces after the comma for some reason. I think the actual output makes more sense now so I think it's fine to just accept this difference and change the expected output.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Rely on NEP-18 to dispatch to dask in duck_array_ops 936313924
905947313 https://github.com/pydata/xarray/pull/5571#issuecomment-905947313 https://api.github.com/repos/pydata/xarray/issues/5571 IC_kwDOAMm_X841_6ix Illviljan 14371165 2021-08-25T23:42:08Z 2021-08-25T23:42:08Z MEMBER

@TomNicholas try merging main now. Let's see if there are any errors left.

{
    "total_count": 1,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 1
}
  Rely on NEP-18 to dispatch to dask in duck_array_ops 936313924
903140359 https://github.com/pydata/xarray/pull/5571#issuecomment-903140359 https://api.github.com/repos/pydata/xarray/issues/5571 IC_kwDOAMm_X8411NQH Illviljan 14371165 2021-08-21T16:23:26Z 2021-08-21T16:23:26Z MEMBER

The issue mentioned in dask_array_compat.pad was closed around may 2020 (https://github.com/dask/dask/pull/6213). The min version of dask can be bumped to 2.24 tomorrow (from 2.15 and 2.9), maybe that's enough to fix the errors?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Rely on NEP-18 to dispatch to dask in duck_array_ops 936313924

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