We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Running the test suite of 0.7.0 with numpy 2 installed (without numba):
[ 28s] + pytest-3.10 --ignore=_build.python310 --ignore=_build.python312 --ignore=_build.python311 -v --ignore tests/test_einops.py --ignore tests/test_numba.py [ 29s] ============================= test session starts ============================== [ 29s] platform linux -- Python 3.10.14, pytest-8.3.2, pluggy-1.5.0 -- /usr/bin/python3.10 [ 29s] cachedir: .pytest_cache [ 29s] hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase(PosixPath('/home/abuild/rpmbuild/BUILD/xarray-einstats-0.7.0/.hypothesis/examples')) [ 29s] rootdir: /home/abuild/rpmbuild/BUILD/xarray-einstats-0.7.0 [ 29s] configfile: pyproject.toml [ 29s] testpaths: tests [ 29s] plugins: hypothesis-6.111.1 [ 29s] collecting ... collected 235 it
[ 30s] =================================== FAILURES =================================== [ 30s] __________________________ test_linalg_accessor_solve __________________________ [ 30s] [ 30s] hermitian = <xarray.DataArray (batch: 3, dim: 2, dim2: 2)> Size: 96B [ 30s] array([[[ 2. , 1. ], [ 30s] [ 1. , 2. ]], [ 30s] [ 30s] [[ 5. , ... [ 30s] [ 3. , 5. ]], [ 30s] [ 30s] [[ 4. , -0.7], [ 30s] [-0.7, 4. ]]]) [ 30s] Dimensions without coordinates: batch, dim, dim2 [ 30s] [ 30s] def test_linalg_accessor_solve(hermitian): [ 30s] db = hermitian.std("dim2") [ 30s] > da_ac = hermitian.linalg.solve(db, dims=("dim", "dim2")) [ 30s] [ 30s] tests/test_accessors.py:75: [ 30s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ [ 30s] ../../BUILDROOT/python-xarray-einstats-0.7.0-0.x86_64/usr/lib/python3.10/site-packages/xarray_einstats/accessors.py:116: in solve [ 30s] return solve(self._obj, db, dims=dims, **kwargs) [ 30s] ../../BUILDROOT/python-xarray-einstats-0.7.0-0.x86_64/usr/lib/python3.10/site-packages/xarray_einstats/linalg.py:722: in solve [ 30s] return xr.apply_ufunc( [ 30s] /usr/lib/python3.10/site-packages/xarray/core/computation.py:1268: in apply_ufunc [ 30s] return apply_dataarray_vfunc( [ 30s] /usr/lib/python3.10/site-packages/xarray/core/computation.py:312: in apply_dataarray_vfunc [ 30s] result_var = func(*data_vars) [ 30s] /usr/lib/python3.10/site-packages/xarray/core/computation.py:821: in apply_variable_ufunc [ 30s] result_data = func(*input_data) [ 30s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ [ 30s] [ 30s] a = array([[[ 2. , 1. ], [ 30s] [ 1. , 2. ]], [ 30s] [ 30s] [[ 5. , 3. ], [ 30s] [ 3. , 5. ]], [ 30s] [ 30s] [[ 4. , -0.7], [ 30s] [-0.7, 4. ]]]) [ 30s] b = array([[0.5 , 0.5 ], [ 30s] [1. , 1. ], [ 30s] [2.35, 2.35]]) [ 30s] [ 30s] @array_function_dispatch(_solve_dispatcher) [ 30s] def solve(a, b): [ 30s] """ [ 30s] Solve a linear matrix equation, or system of linear scalar equations. [ 30s] [ 30s] Computes the "exact" solution, `x`, of the well-determined, i.e., full [ 30s] rank, linear matrix equation `ax = b`. [ 30s] [ 30s] Parameters [ 30s] ---------- [ 30s] a : (..., M, M) array_like [ 30s] Coefficient matrix. [ 30s] b : {(M,), (..., M, K)}, array_like [ 30s] Ordinate or "dependent variable" values. [ 30s] [ 30s] Returns [ 30s] ------- [ 30s] x : {(..., M,), (..., M, K)} ndarray [ 30s] Solution to the system a x = b. Returned shape is (..., M) if b is [ 30s] shape (M,) and (..., M, K) if b is (..., M, K), where the "..." part is [ 30s] broadcasted between a and b. [ 30s] [ 30s] Raises [ 30s] ------ [ 30s] LinAlgError [ 30s] If `a` is singular or not square. [ 30s] [ 30s] See Also [ 30s] -------- [ 30s] scipy.linalg.solve : Similar function in SciPy. [ 30s] [ 30s] Notes [ 30s] ----- [ 30s] [ 30s] .. versionadded:: 1.8.0 [ 30s] [ 30s] Broadcasting rules apply, see the `numpy.linalg` documentation for [ 30s] details. [ 30s] [ 30s] The solutions are computed using LAPACK routine ``_gesv``. [ 30s] [ 30s] `a` must be square and of full-rank, i.e., all rows (or, equivalently, [ 30s] columns) must be linearly independent; if either is not true, use [ 30s] `lstsq` for the least-squares best "solution" of the [ 30s] system/equation. [ 30s] [ 30s] .. versionchanged:: 2.0 [ 30s] [ 30s] The b array is only treated as a shape (M,) column vector if it is [ 30s] exactly 1-dimensional. In all other instances it is treated as a stack [ 30s] of (M, K) matrices. Previously b would be treated as a stack of (M,) [ 30s] vectors if b.ndim was equal to a.ndim - 1. [ 30s] [ 30s] References [ 30s] ---------- [ 30s] .. [1] G. Strang, *Linear Algebra and Its Applications*, 2nd Ed., Orlando, [ 30s] FL, Academic Press, Inc., 1980, pg. 22. [ 30s] [ 30s] Examples [ 30s] -------- [ 30s] Solve the system of equations: [ 30s] ``x0 + 2 * x1 = 1`` and [ 30s] ``3 * x0 + 5 * x1 = 2``: [ 30s] [ 30s] >>> import numpy as np [ 30s] >>> a = np.array([[1, 2], [3, 5]]) [ 30s] >>> b = np.array([1, 2]) [ 30s] >>> x = np.linalg.solve(a, b) [ 30s] >>> x [ 30s] array([-1., 1.]) [ 30s] [ 30s] Check that the solution is correct: [ 30s] [ 30s] >>> np.allclose(np.dot(a, x), b) [ 30s] True [ 30s] [ 30s] """ [ 30s] a, _ = _makearray(a) [ 30s] _assert_stacked_2d(a) [ 30s] _assert_stacked_square(a) [ 30s] b, wrap = _makearray(b) [ 30s] t, result_t = _commonType(a, b) [ 30s] [ 30s] # We use the b = (..., M,) logic, only if the number of extra dimensions [ 30s] # match exactly [ 30s] if b.ndim == 1: [ 30s] gufunc = _umath_linalg.solve1 [ 30s] else: [ 30s] gufunc = _umath_linalg.solve [ 30s] [ 30s] signature = 'DD->D' if isComplexType(t) else 'dd->d' [ 30s] with errstate(call=_raise_linalgerror_singular, invalid='call', [ 30s] over='ignore', divide='ignore', under='ignore'): [ 30s] > r = gufunc(a, b, signature=signature) [ 30s] E ValueError: solve: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (m,m),(m,n)->(m,n) (size 3 is different from 2) [ 30s] [ 30s] /usr/lib64/python3.10/site-packages/numpy/linalg/_linalg.py:413: ValueError [ 30s] ___________________________ TestWrappers.test_solve ____________________________ [ 30s] [ 30s] self = <tests.test_linalg.TestWrappers object at 0x7f0217262710> [ 30s] matrices = <xarray.DataArray (batch: 10, experiment: 3, dim: 4, dim2: 4)> Size: 4kB [ 30s] 0.11 0.3897 1.4 2.2 0.3435 0.2578 0.4345 ... 0.3557 1.105 2.256 2.58 1.683 1.311 [ 30s] Dimensions without coordinates: batch, experiment, dim, dim2 [ 30s] [ 30s] def test_solve(self, matrices): [ 30s] b = matrices.std("dim2") [ 30s] > y = solve(matrices, b, dims=("dim", "dim2")) [ 30s] [ 30s] tests/test_linalg.py:277: [ 30s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ [ 30s] ../../BUILDROOT/python-xarray-einstats-0.7.0-0.x86_64/usr/lib/python3.10/site-packages/xarray_einstats/linalg.py:722: in solve [ 30s] return xr.apply_ufunc( [ 30s] /usr/lib/python3.10/site-packages/xarray/core/computation.py:1268: in apply_ufunc [ 30s] return apply_dataarray_vfunc( [ 30s] /usr/lib/python3.10/site-packages/xarray/core/computation.py:312: in apply_dataarray_vfunc [ 30s] result_var = func(*data_vars) [ 30s] /usr/lib/python3.10/site-packages/xarray/core/computation.py:821: in apply_variable_ufunc [ 30s] result_data = func(*input_data) [ 30s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ [ 30s] [ 30s] a = array([[[[1.10014813e-01, 3.89656874e-01, 1.39954096e+00, [ 30s] 2.20014810e+00], [ 30s] [3.43493819e-01, 2.57835...-01, [ 30s] 1.10546137e+00], [ 30s] [2.25591889e+00, 2.57958002e+00, 1.68260005e+00, [ 30s] 1.31130995e+00]]]]) [ 30s] b = array([[[0.83098024, 0.12226531, 1.27443529, 0.69294934], [ 30s] [0.52431474, 0.48759741, 0.03113587, 0.9050297 ], [ 30s] ..., [ 30s] [1.17554304, 1.2982992 , 0.85877319, 0.15673694], [ 30s] [0.68007424, 1.21224985, 0.35092172, 0.49223187]]]) [ 30s] [ 30s] @array_function_dispatch(_solve_dispatcher) [ 30s] def solve(a, b): [ 30s] """ [ 30s] Solve a linear matrix equation, or system of linear scalar equations. [ 30s] [ 30s] Computes the "exact" solution, `x`, of the well-determined, i.e., full [ 30s] rank, linear matrix equation `ax = b`. [ 30s] [ 30s] Parameters [ 30s] ---------- [ 30s] a : (..., M, M) array_like [ 30s] Coefficient matrix. [ 30s] b : {(M,), (..., M, K)}, array_like [ 30s] Ordinate or "dependent variable" values. [ 30s] [ 30s] Returns [ 30s] ------- [ 30s] x : {(..., M,), (..., M, K)} ndarray [ 30s] Solution to the system a x = b. Returned shape is (..., M) if b is [ 30s] shape (M,) and (..., M, K) if b is (..., M, K), where the "..." part is [ 30s] broadcasted between a and b. [ 30s] [ 30s] Raises [ 30s] ------ [ 30s] LinAlgError [ 30s] If `a` is singular or not square. [ 30s] [ 30s] See Also [ 30s] -------- [ 30s] scipy.linalg.solve : Similar function in SciPy. [ 30s] [ 30s] Notes [ 30s] ----- [ 30s] [ 30s] .. versionadded:: 1.8.0 [ 30s] [ 30s] Broadcasting rules apply, see the `numpy.linalg` documentation for [ 30s] details. [ 30s] [ 30s] The solutions are computed using LAPACK routine ``_gesv``. [ 30s] [ 30s] `a` must be square and of full-rank, i.e., all rows (or, equivalently, [ 30s] columns) must be linearly independent; if either is not true, use [ 30s] `lstsq` for the least-squares best "solution" of the [ 30s] system/equation. [ 30s] [ 30s] .. versionchanged:: 2.0 [ 30s] [ 30s] The b array is only treated as a shape (M,) column vector if it is [ 30s] exactly 1-dimensional. In all other instances it is treated as a stack [ 30s] of (M, K) matrices. Previously b would be treated as a stack of (M,) [ 30s] vectors if b.ndim was equal to a.ndim - 1. [ 30s] [ 30s] References [ 30s] ---------- [ 30s] .. [1] G. Strang, *Linear Algebra and Its Applications*, 2nd Ed., Orlando, [ 30s] FL, Academic Press, Inc., 1980, pg. 22. [ 30s] [ 30s] Examples [ 30s] -------- [ 30s] Solve the system of equations: [ 30s] ``x0 + 2 * x1 = 1`` and [ 30s] ``3 * x0 + 5 * x1 = 2``: [ 30s] [ 30s] >>> import numpy as np [ 30s] >>> a = np.array([[1, 2], [3, 5]]) [ 30s] >>> b = np.array([1, 2]) [ 30s] >>> x = np.linalg.solve(a, b) [ 30s] >>> x [ 30s] array([-1., 1.]) [ 30s] [ 30s] Check that the solution is correct: [ 30s] [ 30s] >>> np.allclose(np.dot(a, x), b) [ 30s] True [ 30s] [ 30s] """ [ 30s] a, _ = _makearray(a) [ 30s] _assert_stacked_2d(a) [ 30s] _assert_stacked_square(a) [ 30s] b, wrap = _makearray(b) [ 30s] t, result_t = _commonType(a, b) [ 30s] [ 30s] # We use the b = (..., M,) logic, only if the number of extra dimensions [ 30s] # match exactly [ 30s] if b.ndim == 1: [ 30s] gufunc = _umath_linalg.solve1 [ 30s] else: [ 30s] gufunc = _umath_linalg.solve [ 30s] [ 30s] signature = 'DD->D' if isComplexType(t) else 'dd->d' [ 30s] with errstate(call=_raise_linalgerror_singular, invalid='call', [ 30s] over='ignore', divide='ignore', under='ignore'): [ 30s] > r = gufunc(a, b, signature=signature) [ 30s] E ValueError: solve: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (m,m),(m,n)->(m,n) (size 3 is different from 4) [ 30s] [ 30s] /usr/lib64/python3.10/site-packages/numpy/linalg/_linalg.py:413: ValueError [ 30s] =============================== warnings summary =============================== [ 30s] tests/test_stats.py::TestMvNormal::test_rvs_method[vals0] [ 30s] tests/test_stats.py::TestMvNormal::test_rvs_method[vals1] [ 30s] /home/abuild/rpmbuild/BUILDROOT/python-xarray-einstats-0.7.0-0.x86_64/usr/lib/python3.10/site-packages/xarray_einstats/stats.py:384: PendingDeprecationWarning: The `dims` argument has been renamed to `dim`, and will be removed in the future. This renaming is taking place throughout xarray over the next few releases. [ 30s] return mean + xr.dot(cov_chol, samples, dims=dim2) [ 30s] [ 30s] tests/test_stats.py::TestMvNormal::test_pdf_method[vals0] [ 30s] tests/test_stats.py::TestMvNormal::test_pdf_method[vals1] [ 30s] /home/abuild/rpmbuild/BUILDROOT/python-xarray-einstats-0.7.0-0.x86_64/usr/lib/python3.10/site-packages/xarray_einstats/stats.py:397: PendingDeprecationWarning: The `dims` argument has been renamed to `dim`, and will be removed in the future. This renaming is taking place throughout xarray over the next few releases. [ 30s] maha = np.square(xr.dot(x_mu.rename({dim1: dim2}), u_mat, dims=dim2)).sum(dim=dim1) [ 30s] [ 30s] -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html [ 30s] =========================== short test summary info ============================ [ 30s] FAILED tests/test_accessors.py::test_linalg_accessor_solve - ValueError: solv... [ 30s] FAILED tests/test_linalg.py::TestWrappers::test_solve - ValueError: solve: In... [ 30s] ============= 2 failed, 230 passed, 3 skipped, 4 warnings in 1.59s =============
The text was updated successfully, but these errors were encountered:
Thanks for reporting, will try to fix asap.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Running the test suite of 0.7.0 with numpy 2 installed (without numba):
The text was updated successfully, but these errors were encountered: