issues: 2203250238
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2203250238 | PR_kwDOAMm_X85qh2s8 | 8867 | Avoid in-place multiplication of a large value to an array with small integer dtype | 14371165 | closed | 0 | 3 | 2024-03-22T20:22:22Z | 2024-03-29T15:26:38Z | 2024-03-29T15:26:38Z | MEMBER | 0 | pydata/xarray/pulls/8867 | Upstream numpy has become a bit more particular with which types you can use for inplace operations. This PR fixes ``` __ TestImshow.test_imshow_rgb_values_in_valid_range __ self = <xarray.tests.test_plot.TestImshow object at 0x7f88320c2780>
/home/runner/work/xarray/xarray/xarray/tests/test_plot.py:2034: /home/runner/work/xarray/xarray/xarray/plot/accessor.py:421: in imshow return dataarray_plot.imshow(self._da, args, kwargs) /home/runner/work/xarray/xarray/xarray/plot/dataarray_plot.py:1601: in newplotfunc primitive = plotfunc( /home/runner/work/xarray/xarray/xarray/plot/dataarray_plot.py:1853: in imshow alpha = 255 self = masked_array( data=[[[1], [1], [1], [1], [1]],
mask=False, fill_value=np.int64(999999), dtype=uint8) other = 255
/home/runner/micromamba/envs/xarray-tests/lib/python3.12/site-packages/numpy/ma/core.py:4415: UFuncTypeError ``` Some curious behaviors seen while debugging: ```python alpha = np.array([1], dtype=np.int8) alpha *= 255 repr(alpha) # 'array([-1], dtype=int8)' alpha = np.array([1], dtype=np.int16) alpha *= 255 repr(alpha) # 'array([255], dtype=int16)' ``` xref: #8844 |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/8867/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
13221727 | pull |