home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 778069594

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
778069594 MDExOlB1bGxSZXF1ZXN0NTQ4MjI1MDQz 4760 WIP: testing.assert_* check dtype 10194086 closed 0     8 2021-01-04T12:45:00Z 2022-01-26T08:41:17Z 2021-10-18T14:06:38Z MEMBER   1 pydata/xarray/pulls/4760
  • [x] Closes #4727
  • [ ] Tests added
  • [ ] Passes isort . && black . && mypy . && flake8
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] New functions/methods are listed in api.rst

This adds a dtype check for equal, identical, broadcast_equal, and the xr.testing.assert_* functions. It is far from complete: tests and documentation are still missing, but I wanted to get it online for feedback.

When I set check_dtype=True there are around 600 failures. Fixing that is for another PR. #4759 should help a bit.

  • [ ] I added the checks to lazy_array_equiv, however, sometimes dask can get the dtype wrong before the compute (see below). Do you think I need to put it in the non-lazy part?

```python import numpy as np import xarray as xr

da = xr.DataArray(np.array([0, np.nan], dtype=object)).chunk()

da.prod().dtype # -> dtype('O') da.prod().compute().dtype # -> dtype('int64')

```

  • [ ] check_dtype is still missing from assert_duckarray_allclose & assert_duckarray_equal - do you think there are required?

  • [ ] The dtypes of array elements are not tested (see below). I don't think I'll implement that here.

```python da0 = xr.DataArray(np.array([0], dtype=object)) da1 = xr.DataArray(np.array([0.], dtype=object))

xr.testting.assert_equal(da0, da1, check_dtype=True) ```

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/4760/reactions",
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    13221727 pull

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 8 rows from issue in issue_comments
Powered by Datasette · Queries took 0.594ms · About: xarray-datasette