home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

3 rows where author_association = "MEMBER" and issue = 1621385466 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 2

  • keewis 2
  • TomNicholas 1

issue 1

  • don't use `issubdtype` to check for integer dtypes in `polyval` · 3 ✖

author_association 1

  • MEMBER · 3 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1470154910 https://github.com/pydata/xarray/pull/7619#issuecomment-1470154910 https://api.github.com/repos/pydata/xarray/issues/7619 IC_kwDOAMm_X85XoMie TomNicholas 35968931 2023-03-15T14:54:10Z 2023-03-15T14:54:10Z MEMBER

@Ravenin7 do you need some guidance on how to add a test for this? Happy to help if so. It would be great to get this fix merged soon because a number of other people have encountered the same bug!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  don't use `issubdtype` to check for integer dtypes in `polyval` 1621385466
1466134208 https://github.com/pydata/xarray/pull/7619#issuecomment-1466134208 https://api.github.com/repos/pydata/xarray/issues/7619 IC_kwDOAMm_X85XY27A keewis 14808389 2023-03-13T13:20:15Z 2023-03-13T13:20:15Z MEMBER

this looks good to me, but we'd need some tests to make sure we don't reintroduce this issue. I'd probably extend the "simple" case of xarray/tests/test_computation.py::test_polyval by creating two versions: one with int32 values for degree and one with int64 values

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  don't use `issubdtype` to check for integer dtypes in `polyval` 1621385466
1466127429 https://github.com/pydata/xarray/pull/7619#issuecomment-1466127429 https://api.github.com/repos/pydata/xarray/issues/7619 IC_kwDOAMm_X85XY1RF keewis 14808389 2023-03-13T13:15:40Z 2023-03-13T13:15:40Z MEMBER

this happens with any code that calls polyval on coefficients with int32 dtypes. The example from the docs: ```python In [19]: import xarray as xr ...: ...: x = xr.DataArray(np.arange(10), dims=["x"], name="x") ...: a = xr.DataArray(3 + 4 * x, dims=["x"], coords={"x": x}) ...: out = a.polyfit(dim="x", deg=1, full=True) ...: out Out[19]: <xarray.Dataset> Dimensions: (degree: 2) Coordinates: * degree (degree) int64 1 0 Data variables: x_matrix_rank int64 2 x_singular_values (degree) float64 1.358 0.3963 polyfit_coefficients (degree) float64 4.0 3.0 polyfit_residuals float64 4.522e-28

In [20]: xr.polyval(coord=x, coeffs=out.assign_coords(degree=out.degree.astype("int64"))) Out[20]: <xarray.Dataset> Dimensions: (x: 10) Dimensions without coordinates: x Data variables: x_matrix_rank (x) int64 2 4 6 8 10 12 14 16 18 20 x_singular_values (x) float64 0.3963 1.754 3.111 ... 9.899 11.26 12.61 polyfit_coefficients (x) float64 3.0 7.0 11.0 15.0 ... 27.0 31.0 35.0 39.0 polyfit_residuals (x) float64 4.522e-28 9.044e-28 ... 4.07e-27 4.522e-27

In [21]: xr.polyval(coord=x, coeffs=out.assign_coords(degree=out.degree.astype("int32")))

ValueError Traceback (most recent call last) Cell In[21], line 1 ----> 1 xr.polyval(coord=x, coeffs=out.assign_coords(degree=out.degree.astype("int32")))

File .../xarray/core/computation.py:1972, in polyval(coord, coeffs, degree_dim) 1968 raise ValueError( 1969 f"Dimension {degree_dim} should be a coordinate variable with labels." 1970 ) 1971 if not np.issubdtype(coeffs[degree_dim].dtype, int): -> 1972 raise ValueError( 1973 f"Dimension {degree_dim} should be of integer dtype. Received {coeffs[degree_dim].dtype} instead." 1974 ) 1975 max_deg = coeffs[degree_dim].max().item() 1976 coeffs = coeffs.reindex( 1977 {degree_dim: np.arange(max_deg + 1)}, fill_value=0, copy=False 1978 )

ValueError: Dimension degree should be of integer dtype. Received int32 instead. ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  don't use `issubdtype` to check for integer dtypes in `polyval` 1621385466

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