Skip to content

sparse upstream-dev test failures #4146

Closed
@dcherian

Description

@dcherian

Full log here: https://dev.azure.com/xarray/xarray/_build/results?buildId=3023&view=logs&jobId=2280efed-fda1-53bd-9213-1fa8ec9b4fa8&j=2280efed-fda1-53bd-9213-1fa8ec9b4fa8&t=175181ee-1928-5a6b-f537-168f7a8b7c2d

Here are three of the errors:

 /usr/share/miniconda/envs/xarray-tests/lib/python3.8/site-packages/sparse/_coo/umath.py:739: SystemError
_ test_variable_method[obj.where(*(), **{'cond': <xarray.Variable (x: 10, y: 5)>\n<COO: shape=(10, 5), dtype=bool, nnz=3, fill_value=False>})-True] _
TypeError: expected dtype object, got 'numpy.dtype[uint64]'
    def _match_coo(*args, **kwargs):
        """
        Matches the coordinates for any number of input :obj:`COO` arrays.
        Equivalent to "sparse" broadcasting for all arrays.
    
        Parameters
        ----------
        args : Tuple[COO]
            The input :obj:`COO` arrays.
        return_midx : bool
            Whether to return matched indices or matched arrays. Matching
            only supported for two arrays. ``False`` by default.
        cache : dict
            Cache of things already matched. No cache by default.
    
        Returns
        -------
        matched_idx : List[ndarray]
            The indices of matched elements in the original arrays. Only returned if
            ``return_midx`` is ``True``.
        matched_arrays : List[COO]
            The expanded, matched :obj:`COO` objects. Only returned if
            ``return_midx`` is ``False``.
        """
        from .core import COO
        from .common import linear_loc
    
        cache = kwargs.pop("cache", None)
        return_midx = kwargs.pop("return_midx", False)
        broadcast_shape = kwargs.pop("broadcast_shape", None)
    
        if kwargs:
            linear = [idx[s] for idx, s in zip(linear, sorted_idx)]
>           matched_idx = _match_arrays(*linear)
E           SystemError: CPUDispatcher(<function _match_arrays at 0x7f66b6272af0>) returned a result with an error set

_______________________________ test_dask_token ________________________________

    @requires_dask
    def test_dask_token():
        import dask
    
        s = sparse.COO.from_numpy(np.array([0, 0, 1, 2]))
    
        # https://github.com/pydata/sparse/issues/300
        s.__dask_tokenize__ = lambda: dask.base.normalize_token(s.__dict__)
    
        a = DataArray(s)
        t1 = dask.base.tokenize(a)
        t2 = dask.base.tokenize(a)
        t3 = dask.base.tokenize(a + 1)
        assert t1 == t2
        assert t3 != t2
        assert isinstance(a.data, sparse.COO)
    
        ac = a.chunk(2)
        t4 = dask.base.tokenize(ac)
        t5 = dask.base.tokenize(ac + 1)
        assert t4 != t5
>       assert isinstance(ac.data._meta, sparse.COO)
E       AssertionError: assert False
E        +  where False = isinstance(array([], dtype=int64), <class 'sparse._coo.core.COO'>)
E        +    where array([], dtype=int64) = dask.array<xarray-<this-array>, shape=(4,), dtype=int64, chunksize=(2,), chunktype=numpy.ndarray>._meta
E        +      where dask.array<xarray-<this-array>, shape=(4,), dtype=int64, chunksize=(2,), chunktype=numpy.ndarray> = <xarray.DataArray (dim_0: 4)>\ndask.array<xarray-<this-array>, shape=(4,), dtype=int64, chunksize=(2,), chunktype=numpy.ndarray>\nDimensions without coordinates: dim_0.data
E        +    and   <class 'sparse._coo.core.COO'> = sparse.COO

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions