home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 800118528

This data as json

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
800118528 MDU6SXNzdWU4MDAxMTg1Mjg= 4858 doctest failure with numpy 1.20 10194086 closed 0     4 2021-02-03T08:57:43Z 2021-02-07T21:57:34Z 2021-02-07T21:57:34Z MEMBER      

What happened:

Our doctests fail since numpy 1.20 came out:

https://github.com/pydata/xarray/pull/4760/checks?check_run_id=1818512841#step:8:69

What you expected to happen:

They don't ;-)

Minimal Complete Verifiable Example:

The following fails with numpy 1.20 while it converted np.NaN to an integer before (xarray.DataArray.pad at the bottom)

```python import numpy as np

x = np.arange(10) x = np.pad(x, 1, "constant", constant_values=np.nan) ``` requires numpy 1.20

Anything else we need to know?:

  • that's probably related to https://numpy.org/doc/stable/release/1.20.0-notes.html#numpy-scalars-are-cast-when-assigned-to-arrays
  • I asked if this behavior will stay: https://github.com/numpy/numpy/issues/16499#issuecomment-772342087
  • One possibility is to add a check np.can_cast(constant_values.dtype, array.dtype) (or similar) for a better error message.
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/4858/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 1 row from issues_id in issues_labels
  • 4 rows from issue in issue_comments
Powered by Datasette · Queries took 237.015ms · About: xarray-datasette