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

Add python 3.11 to CI #7353

Closed
wants to merge 26 commits into from
Closed

Add python 3.11 to CI #7353

wants to merge 26 commits into from

Conversation

Illviljan
Copy link
Contributor

@Illviljan Illviljan commented Dec 4, 2022

Waiting on:

  • Closes Support for python 3.11 #7316
  • Tests added
  • User visible changes (including notable bug fixes) are documented in whats-new.rst
  • New functions/methods are listed in api.rst

Feel free to push to this PR if you want.

@github-actions github-actions bot added the Automation Github bots, testing workflows, release automation label Dec 4, 2022
@github-actions github-actions bot added CI Continuous Integration tools dependencies Pull requests that update a dependency file labels Dec 4, 2022
@Illviljan
Copy link
Contributor Author

 error    libmamba Could not solve for environment specs
      Encountered problems while solving:
        - nothing provides hdf5 1.8.15* needed by netcdf4-1.2.4-np110py27_1
      
      The environment can't be solved, aborting the operation

It's a bit annoying the ci isn't showing which package has netcdf4 as a dependency. Is that possible?

@mathause
Copy link
Collaborator

mathause commented Dec 4, 2022

mamba repoquery whoneeds netcdf4

but that requires an already solved environment

@dcherian
Copy link
Contributor

dcherian commented Dec 7, 2022

I bet its cftime and/or pydap

Copy link
Collaborator

@keewis keewis left a comment

Choose a reason for hiding this comment

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

I just tried, and at least on linux a py311 build would only have to exclude cdms2, numba and numbagg

Edit: my recommendation would be to create separate files for py311 so we can merge this PR without waiting on the slower dependencies (numba and cdms2, I think)

Edit2: we unfortunately can't do too much about the DeprecationWarning in the doctests, that's from botocore. While this has been fixed in a newer version, the most recent version of aiobotocore pins it to a "fairly old" version (there's a release of botocore almost every day). I guess the easiest would be to only update the normal CI and switch the additional CI to py311 some time later?

ci/requirements/environment.yml Outdated Show resolved Hide resolved
ci/requirements/environment.yml Outdated Show resolved Hide resolved
ci/requirements/environment.yml Outdated Show resolved Hide resolved
ci/requirements/environment.yml Outdated Show resolved Hide resolved
@Illviljan
Copy link
Contributor Author

Deprecation warning in pydap failing the docstring tests:

ImportError while loading conftest '/home/runner/work/xarray/xarray/xarray/tests/conftest.py'.
xarray/tests/__init__.py:64: in <module>
    has_pydap, requires_pydap = _importorskip("pydap.client")
xarray/tests/__init__.py:51: in _importorskip
    mod = importlib.import_module(modname)
../../../micromamba-root/envs/xarray-tests/lib/python3.11/site-packages/pydap/client.py:52: in <module>
    from .net import GET, raise_for_status
../../../micromamba-root/envs/xarray-tests/lib/python3.11/site-packages/pydap/net.py:1: in <module>
    from webob.request import Request
../../../micromamba-root/envs/xarray-tests/lib/python3.11/site-packages/webob/__init__.py:1: in <module>
    from webob.datetime_utils import (  # noqa: F401
../../../micromamba-root/envs/xarray-tests/lib/python3.11/site-packages/webob/datetime_utils.py:18: in <module>
    from webob.compat import (
../../../micromamba-root/envs/xarray-tests/lib/python3.11/site-packages/webob/compat.py:5: in <module>
    from cgi import parse_header
../../../micromamba-root/envs/xarray-tests/lib/python3.11/cgi.py:57: in <module>
    warnings._deprecated(__name__, remove=(3,13))
../../../micromamba-root/envs/xarray-tests/lib/python3.11/warnings.py:514: in _deprecated
    warn(msg, DeprecationWarning, stacklevel=3)
E   DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13

@Illviljan
Copy link
Contributor Author

87d689a shows that we have issues with 3.8 when either of numba/cdms2/numbagg are not available, then we take a different code path that fails somehow. Hopefully with python 3.9 it's fixed.

Failing tests with only python 3.8 with windows, no numba/cdms2/numbagg:

FAILED xarray/tests/test_dataarray.py::TestNumpyCoercion::test_from_sparse - ValueError: Performing this operation would produce a dense result: <ufunc 'add'>
FAILED xarray/tests/test_dataset.py::TestDataset::test_unstack_sparse - TypeError: __init__() got an unexpected keyword argument 'fill_value'
FAILED xarray/tests/test_dataset.py::TestDataset::test_from_dataframe_sparse - TypeError: __init__() got an unexpected keyword argument 'fill_value'
FAILED xarray/tests/test_dataset.py::TestNumpyCoercion::test_from_sparse - ValueError: Performing this operation would produce a dense result: <ufunc 'add'>
FAILED xarray/tests/test_dataarray.py::TestDataArray::test_from_series_sparse - TypeError: __init__() got an unexpected keyword argument 'fill_value'
FAILED xarray/tests/test_dataarray.py::TestDataArray::test_from_multiindex_series_sparse - TypeError: from_numpy() takes 2 positional arguments but 3 were given
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.all(*(), **{})-False] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.any(*(), **{})-False] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.astype(*(), **{'dtype': <class 'int'>})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.clip(*(), **{'min': 0, 'max': 1})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.coarsen(*(), **{'windows': {'x': 2}, 'func': 'sum'})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.compute(*(), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.conj(*(), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.copy(*(), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.count(*(), **{})-False] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.get_axis_num(*(), **{'dim': 'x'})-False] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.isel(*(), **{'x': slice(2, 4, None)})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.isnull(*(), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.load(*(), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.mean(*(), **{})-False] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.notnull(*(), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.roll(*(), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.round(*(), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.set_dims(*(), **{'dims': ('x', 'y', 'z')})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.stack(*(), **{'dimensions': {'flat': ('x', 'y')}})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.to_base_variable(*(), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.transpose(*(), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.unstack(*(), **{'dimensions': {'x': {'x1': 5, 'x2': 2}}})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.broadcast_equals(*(<xarray.Variable (x: 10, y: 5)>\narray([[0.43758721, 0.        , 0.        , 0.891773  , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.96366276],\n       [0.        , 0.        , 0.        , 0.        , 0.4236548 ],\n       [0.        , 0.        , 0.64589411, 0.        , 0.        ]]),), **{})-False] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.equals(*(<xarray.Variable (x: 10, y: 5)>\narray([[0.43758721, 0.        , 0.        , 0.891773  , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.96366276],\n       [0.        , 0.        , 0.        , 0.        , 0.4236548 ],\n       [0.        , 0.        , 0.64589411, 0.        , 0.        ]]),), **{})-False] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.identical(*(<xarray.Variable (x: 10, y: 5)>\narray([[0.43758721, 0.        , 0.        , 0.891773  , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.96366276],\n       [0.        , 0.        , 0.        , 0.        , 0.4236548 ],\n       [0.        , 0.        , 0.64589411, 0.        , 0.        ]]),), **{})-False] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.fillna(*(0,), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.max(*(), **{})-False] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.min(*(), **{})-False] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.prod(*(), **{})-False] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.sum(*(), **{})-False] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_variable_method[obj.where(*(), **{'cond': <xarray.Variable (x: 10, y: 5)>\narray([[False, False, False,  True, False],\n       [False, False, False, False, False],\n       [False, False, False, False, False],\n       [False, False, False, False, False],\n       [False, False, False, False, False],\n       [False, False, False, False, False],\n       [False, False, False, False, False],\n       [False, False, False, False,  True],\n       [False, False, False, False, False],\n       [False, False,  True, False, False]])})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_1d_variable_method[func0-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::TestSparseVariable::test_nbytes - assert 192 == 120
 +  where 192 = <xarray.Variable (x: 4, y: 6)>\narray([[0.        , 0.87001215, 0.        , 0.        , 0.        ,\n        0.        ]...6147936,\n        0.63992102],\n       [0.        , 0.        , 0.77815675, 0.        , 0.0202184 ,\n        0.79915856]]).nbytes
 +    where <xarray.Variable (x: 4, y: 6)>\narray([[0.        , 0.87001215, 0.        , 0.        , 0.        ,\n        0.        ]...6147936,\n        0.63992102],\n       [0.        , 0.        , 0.77815675, 0.        , 0.0202184 ,\n        0.79915856]]) = <xarray.tests.test_sparse.TestSparseVariable object at 0x000001CD9F898520>.var
 +  and   120 = <COO: shape=(4, 6), dtype=float64, nnz=12, sorted=True, duplicates=False>.nbytes
 +    where <COO: shape=(4, 6), dtype=float64, nnz=12, sorted=True, duplicates=False> = <xarray.tests.test_sparse.TestSparseVariable object at 0x000001CD9F898520>.data
FAILED xarray/tests/test_sparse.py::TestSparseVariable::test_unary_op - AssertionError: assert False
 +  where False = isinstance(array([[-0.        , -0.87001215, -0.        , -0.        , -0.        ,\n        -0.        ],\n       [-0.11827443, -0...,\n        -0.63992102],\n       [-0.        , -0.        , -0.77815675, -0.        , -0.0202184 ,\n        -0.79915856]]), (<class 'sparse.sparse_array.SparseArray'>,))
FAILED xarray/tests/test_sparse.py::TestSparseVariable::test_univariate_ufunc - AssertionError: assert False
 +  where False = isinstance(array([[0.        , 0.76433677, 0.        , 0.        , 0.        ,\n        0.        ],\n       [0.11799887, 0.       ...4527321,\n        0.59713209],\n       [0.        , 0.        , 0.70196783, 0.        , 0.02021702,\n        0.7167696 ]]), (<class 'sparse.sparse_array.SparseArray'>,))
FAILED xarray/tests/test_sparse.py::TestSparseVariable::test_bivariate_ufunc - AssertionError: assert False
 +  where False = isinstance(array([[0.        , 0.87001215, 0.        , 0.        , 0.        ,\n        0.        ],\n       [0.11827443, 0.       ...6147936,\n        0.63992102],\n       [0.        , 0.        , 0.77815675, 0.        , 0.0202184 ,\n        0.79915856]]), (<class 'sparse.sparse_array.SparseArray'>,))
FAILED xarray/tests/test_sparse.py::TestSparseVariable::test_repr - AssertionError: assert '<xarray.Vari...ll_value=0.0>' == '<xarray.Vari...0.79915856]])'
    <xarray.Variable (x: 4, y: 6)>
  + <COO: shape=(4, 6), dtype=float64, nnz=12, fill_value=0.0>
  - array([[0.        , 0.87001215, 0.        , 0.        , 0.        ,
  -         0.        ],
  -        [0.11827443, 0.        , 0.78052918, 0.        , 0.0871293 ,
  -         0.07103606],
  -        [0.        , 0.97861834, 0.83261985, 0.        , 0.46147936,
  -         0.63992102],
  -        [0.        , 0.        , 0.77815675, 0.        , 0.0202184 ,
  -         0.79915856]])
FAILED xarray/tests/test_sparse.py::TestSparseVariable::test_pickle - AssertionError: assert False
 +  where False = isinstance(array([[0.        , 0.87001215, 0.        , 0.        , 0.        ,\n        0.        ],\n       [0.11827443, 0.       ...6147936,\n        0.63992102],\n       [0.        , 0.        , 0.77815675, 0.        , 0.0202184 ,\n        0.79915856]]), (<class 'sparse.sparse_array.SparseArray'>,))
FAILED xarray/tests/test_sparse.py::TestSparseVariable::test_missing_values - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.all(*(), **{})-False] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.any(*(), **{})-False] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.assign_attrs(*({'foo': 'bar'},), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.assign_coords(*(), **{'x': <xarray.DataArray 'x' (x: 10)>\narray([ 1,  2,  3,  4,  5,  6,  7,  8,  9, 10])\nCoordinates:\n  * x        (x) int32 0 1 2 3 4 5 6 7 8 9})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.astype(*(<class 'int'>,), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.clip(*(), **{'min': 0, 'max': 1})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.compute(*(), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.conj(*(), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.copy(*(), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.count(*(), **{})-False] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.diff(*('x',), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.drop_vars(*('x',), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.expand_dims(*({'z': 2},), **{'axis': 2})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.get_axis_num(*('x',), **{})-False] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.get_index(*('x',), **{})-False] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.identical(*(<xarray.DataArray 'test' (x: 5, y: 5)>\narray([[0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.71518937, 0.        , 0.        ],\n       [0.60276338, 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ]])\nCoordinates:\n  * x        (x) int32 0 1 2 3 4\n  * y        (y) int32 0 1 2 3 4,), **{})-False] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.integrate(*('x',), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.isel(*({'x': slice(0, 3, None), 'y': slice(2, 4, None)},), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.isnull(*(), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.load(*(), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.mean(*(), **{})-False] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.persist(*(), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.reindex(*({'x': [1, 2, 3]},), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.rename(*('foo',), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.reorder_levels(*(), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.reset_coords(*(), **{'drop': True})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.reset_index(*('x',), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.round(*(), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.sel(*(), **{'x': [0, 1, 2]})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.shift(*(), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.sortby(*('x',), **{'ascending': False})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.stack(*(), **{'z': ['x', 'y']})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.transpose(*(), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.broadcast_equals(*(<xarray.Variable (x: 10, y: 5)>\narray([[0.43758721, 0.        , 0.        , 0.891773  , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.96366276],\n       [0.        , 0.        , 0.        , 0.        , 0.4236548 ],\n       [0.        , 0.        , 0.64589411, 0.        , 0.        ]]),), **{})-False] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.equals(*(<xarray.Variable (x: 10, y: 5)>\narray([[0.43758721, 0.        , 0.        , 0.891773  , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.96366276],\n       [0.        , 0.        , 0.        , 0.        , 0.4236548 ],\n       [0.        , 0.        , 0.64589411, 0.        , 0.        ]]),), **{})-False] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.combine_first(*(<xarray.DataArray 'test' (x: 10, y: 5)>\narray([[0.43758721, 0.        , 0.        , 0.891773  , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.        ],\n       [0.        , 0.        , 0.        , 0.        , 0.96366276],\n       [0.        , 0.        , 0.        , 0.        , 0.4236548 ],\n       [0.        , 0.        , 0.64589411, 0.        , 0.        ]])\nCoordinates:\n  * x        (x) int32 0 1 2 3 4 5 6 7 8 9\n  * y        (y) int32 0 1 2 3 4,), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.fillna(*(0,), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.max(*(), **{})-False] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.min(*(), **{})-False] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.notnull(*(), **{})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.pipe(*(), **{'func': 'sum', 'axis': 1})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.prod(*(), **{})-False] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.roll(*(), **{'x': 2, 'roll_coords': True})-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dataarray_method[obj.sum(*(), **{})-False] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_datarray_1d_method[func0-True] - AttributeError: 'numpy.ndarray' object has no attribute 'todense'
FAILED xarray/tests/test_sparse.py::test_dask_token - AssertionError: assert False
 +  where False = isinstance(array([0, 0, 1, 2]), <class 'sparse.coo.COO'>)
 +    where array([0, 0, 1, 2]) = <xarray.DataArray (dim_0: 4)>\narray([0, 0, 1, 2])\nDimensions without coordinates: dim_0.data
 +    and   <class 'sparse.coo.COO'> = sparse.COO
FAILED xarray/tests/test_sparse.py::test_apply_ufunc_check_meta_coherence - AssertionError: assert False
 +  where False = isinstance(array([], dtype=int32), (<class 'sparse.sparse_array.SparseArray'>,))
FAILED xarray/tests/test_variable.py::TestVariableWithSparse::test_as_sparse - ValueError: coo is not a valid sparse format
ERROR xarray/tests/test_sparse.py::TestSparseDataArrayAndDataset::test_to_dataset_roundtrip - ValueError: could not broadcast input array from shape (4,6) into shape (4,1)
ERROR xarray/tests/test_sparse.py::TestSparseDataArrayAndDataset::test_align - ValueError: could not broadcast input array from shape (4,6) into shape (4,1)
ERROR xarray/tests/test_sparse.py::TestSparseDataArrayAndDataset::test_align_outer - ValueError: could not broadcast input array from shape (4,6) into shape (4,1)
ERROR xarray/tests/test_sparse.py::TestSparseDataArrayAndDataset::test_concat - ValueError: could not broadcast input array from shape (4,6) into shape (4,1)
ERROR xarray/tests/test_sparse.py::TestSparseDataArrayAndDataset::test_stack - ValueError: could not broadcast input array from shape (4,6) into shape (4,1)
ERROR xarray/tests/test_sparse.py::TestSparseDataArrayAndDataset::test_dataarray_repr - ValueError: could not broadcast input array from shape (4,6) into shape (4,1)
ERROR xarray/tests/test_sparse.py::TestSparseDataArrayAndDataset::test_dataset_repr - ValueError: could not broadcast input array from shape (4,6) into shape (4,1)
ERROR xarray/tests/test_sparse.py::TestSparseDataArrayAndDataset::test_sparse_dask_dataset_repr - ValueError: could not broadcast input array from shape (4,6) into shape (4,1)
ERROR xarray/tests/test_sparse.py::TestSparseDataArrayAndDataset::test_dataarray_pickle - ValueError: could not broadcast input array from shape (4,6) into shape (4,1)
ERROR xarray/tests/test_sparse.py::TestSparseDataArrayAndDataset::test_dataset_pickle - ValueError: could not broadcast input array from shape (4,6) into shape (4,1)
ERROR xarray/tests/test_sparse.py::TestSparseDataArrayAndDataset::test_coarsen - ValueError: could not broadcast input array from shape (4,6) into shape (4,1)
= 93 failed, 14715 passed, 1640 skipped, 211 xfailed, 66 xpassed, 327 warnings, 11 errors in 699.08s (0:11:39) =

@keewis
Copy link
Collaborator

keewis commented Jan 23, 2023

In the interest of moving this forward, should we use a separate environment file for the main CI with python=3.11 and move all the other environments once these issues have been resolved? Up to you if that would be done here or in a new PR should you want to use this one for the switch to a different default python version.

@keewis
Copy link
Collaborator

keewis commented Jan 23, 2023

The failing sparse tests when numba seem to be due to the environment containing sparse=0.3.1, which is a really old version of sparse (and the only one on conda-forge that does not depend on numba), so I'd say we don't really care? Especially since we're about to drop python=3.8.

We need to remove sparse from the python=3.11 environments anyways, since it is implemented using numba.

@Illviljan
Copy link
Contributor Author

Creating a separate environment file seems like a good idea. Feel free to push the changes you want, @keewis.
I was thinking of coming back to this once 3.8 was dropped.

@keewis
Copy link
Collaborator

keewis commented Jan 23, 2023

It seemed cleaner to just open a separate PR, so we can use this one to change the python version of the other CI jobs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Automation Github bots, testing workflows, release automation CI Continuous Integration tools dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for python 3.11
4 participants