issues: 352999600
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
352999600 | MDU6SXNzdWUzNTI5OTk2MDA= | 2377 | Comparing scalar xarray with ma.masked fails with ValueError: assignment destination is read-only | 500246 | closed | 0 | 5 | 2018-08-22T15:11:54Z | 2023-05-17T16:06:01Z | 2023-05-17T16:06:01Z | CONTRIBUTOR | Code Sample, a copy-pastable example if possible
Problem descriptionThis results in ```ValueError Traceback (most recent call last) <ipython-input-102-f6226708b971> in <module>() ----> 1 xarray.DataArray(0) > numpy.ma.masked /group_workspaces/cems2/fiduceo/Users/gholl/anaconda3/envs/FCDR37a/lib/python3.7/site-packages/xarray/core/dataarray.py in func(self, other) 1808 1809 variable = (f(self.variable, other_variable) -> 1810 if not reflexive 1811 else f(other_variable, self.variable)) 1812 coords = self.coords._merge_raw(other_coords) /group_workspaces/cems2/fiduceo/Users/gholl/anaconda3/envs/FCDR37a/lib/python3.7/site-packages/xarray/core/variable.py in func(self, other) 1580 if not reflexive 1581 else f(other_data, self_data)) -> 1582 result = Variable(dims, new_data) 1583 return result 1584 return func /group_workspaces/cems2/fiduceo/Users/gholl/anaconda3/envs/FCDR37a/lib/python3.7/site-packages/xarray/core/variable.py in init(self, dims, data, attrs, encoding, fastpath) 260 unrecognized encoding items. 261 """ --> 262 self._data = as_compatible_data(data, fastpath=fastpath) 263 self._dims = self._parse_dimensions(dims) 264 self._attrs = None /group_workspaces/cems2/fiduceo/Users/gholl/anaconda3/envs/FCDR37a/lib/python3.7/site-packages/xarray/core/variable.py in as_compatible_data(data, fastpath) 177 dtype, fill_value = dtypes.maybe_promote(data.dtype) 178 data = np.asarray(data, dtype=dtype) --> 179 data[mask] = fill_value 180 else: 181 data = np.asarray(data) ValueError: assignment destination is read-only ``` Expected OutputTo be consistent, the result should be identical to the result of
which would be
Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/2377/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |