home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 755607271

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
755607271 MDU6SXNzdWU3NTU2MDcyNzE= 4644 astype method lost its order parameter 32801740 closed 0     7 2020-12-02T21:02:02Z 2020-12-16T16:33:00Z 2020-12-16T16:33:00Z CONTRIBUTOR      

What happened: I upgraded from xarray 0.15.1 to 0.16.2 and the astype method seems to have lost the order parameter.

```python In [1]: import xarray as xr

In [2]: xr.version Out[2]: '0.16.2'

In [3]: xr.DataArray([[1.0, 2.0], [3.0, 4.0]]).astype(dtype='d', order='F').values.strides

TypeError Traceback (most recent call last) <ipython-input-3-208ab49008ef> in <module> ----> 1 xr.DataArray([[1.0, 2.0], [3.0, 4.0]]).astype(dtype='d', order='F').values.strides

TypeError: astype() got an unexpected keyword argument 'order' ```

What you expected to happen: I was expecting to get the same result as with xarray 0.15.1:

```python In [1]: import xarray as xr

In [2]: xr.version Out[2]: '0.15.1'

In [3]: xr.DataArray([[1.0, 2.0], [3.0, 4.0]]).astype(dtype='d', order='F').values.strides Out[3]: (8, 16) ```

Anything else we need to know?: Looking at the documentation it seems it disappeared between 0.16.0 and 0.16.1. The documentation at http://xarray.pydata.org/en/v0.16.0/generated/xarray.DataArray.astype.html still has this snippet

order ({'C', 'F', 'A', 'K'}, optional) – Controls the memory layout order of the result. ‘C’ means C order, ‘F’ means Fortran order, ‘A’ means ‘F’ order if all the arrays are Fortran contiguous, ‘C’ order otherwise, and ‘K’ means as close to the order the array elements appear in memory as possible. Default is ‘K’.

(which was identical to the documentation from numpy.ndarray.astype at https://numpy.org/doc/stable/reference/generated/numpy.ndarray.astype.html)

while http://xarray.pydata.org/en/v0.16.1/generated/xarray.DataArray.astype.html seems to lack that part.

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

Links from other tables

  • 2 rows from issues_id in issues_labels
  • 7 rows from issue in issue_comments
Powered by Datasette · Queries took 0.777ms · About: xarray-datasette