Skip to content

Couldn't change values for on-disk datasets opened by open_mfdataset() (xarray > 0.8.2) #1805

Closed
@AlexeyPechnikov

Description

@AlexeyPechnikov

It doesn't work:

test = ds.TEST
test.values.flags

  C_CONTIGUOUS : True
  F_CONTIGUOUS : False
  OWNDATA : True
  WRITEABLE : True
  ALIGNED : True
  UPDATEIFCOPY : False

test.values

  array([ 1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.])

test.values = 0*test.values
test.values

  array([ 1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.])
...

But it works:

test = xr.DataArray(np.ones(10),
                coords={
                    'x': range(10)
                },
                dims=['x']
    )
test.values

  array([ 1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.])

test.values = 0*test.values
test.values

  array([ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.])

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs mcvehttps://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reportsstale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions