Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test dev releases of numpy 2.0 and numba 0.60.0 #1332

Merged
merged 26 commits into from
May 23, 2024
Merged

Test dev releases of numpy 2.0 and numba 0.60.0 #1332

merged 26 commits into from
May 23, 2024

Conversation

hoxbro
Copy link
Member

@hoxbro hoxbro commented May 18, 2024

Resolves #1324

@hoxbro hoxbro marked this pull request as draft May 19, 2024 09:24
@hoxbro
Copy link
Member Author

hoxbro commented May 20, 2024

Okay, the last failing tests seem to be related to xarray:

import numpy as np
import xarray as xr

arr = np.array([1,2,3,4])
xarr = xr.DataArray(arr, coords=[('x', arr)])
np.linspace(xarr[0], xarr[-1], len(xarr))
Traceback (most recent call last):
  File "/home/shh/projects/holoviz/repos/datashader/example.py", line 6, in <module>
    np.linspace(xarr[0], xarr[-1], len(xarr))
  File "/home/shh/miniconda3/envs/datashader-dev/lib/python3.12/site-packages/numpy/_core/function_base.py", line 189, in linspace
    y = conv.wrap(y.astype(dtype, copy=False))
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/shh/miniconda3/envs/datashader-dev/lib/python3.12/site-packages/xarray/core/dataarray.py", line 4685, in __array_wrap__
    new_var = self.variable.__array_wrap__(obj, context)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/shh/miniconda3/envs/datashader-dev/lib/python3.12/site-packages/xarray/core/variable.py", line 2294, in __array_wrap__
    return Variable(self.dims, obj)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/shh/miniconda3/envs/datashader-dev/lib/python3.12/site-packages/xarray/core/variable.py", line 397, in __init__
    super().__init__(
  File "/home/shh/miniconda3/envs/datashader-dev/lib/python3.12/site-packages/xarray/namedarray/core.py", line 264, in __init__
    self._dims = self._parse_dimensions(dims)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/shh/miniconda3/envs/datashader-dev/lib/python3.12/site-packages/xarray/namedarray/core.py", line 490, in _parse_dimensions
    raise ValueError(
ValueError: dimensions () must have the same length as the number of data dimensions, ndim=1

@dcherian, should I open an issue in xarray? Or are you already aware of it? We have worked around it, so we do no need to get this fixed.

@hoxbro hoxbro added this to the v0.16.2 milestone May 20, 2024
datashader/datatypes.py Outdated Show resolved Hide resolved
datashader/datatypes.py Outdated Show resolved Hide resolved
@hoxbro hoxbro marked this pull request as ready for review May 21, 2024 10:36
@hoxbro hoxbro requested a review from philippjfr May 21, 2024 11:24
Copy link
Member

@philippjfr philippjfr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@hoxbro hoxbro merged commit 6741ae7 into main May 23, 2024
17 checks passed
@hoxbro hoxbro deleted the numpy2 branch May 23, 2024 10:54
@dcherian
Copy link

Sorry I missed your ping @hoxbro

An issue would be helpful. Even if it's a wontfix, it would be nicer to document it on the xarrAy repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NumPy 2.0 support
3 participants