(use_dask, skipna)
| 1092 | @pytest.mark.parametrize("use_dask", [True, False]) |
| 1093 | @pytest.mark.parametrize("skipna", [True, False]) |
| 1094 | def test_least_squares(use_dask, skipna): |
| 1095 | if use_dask and (not has_dask or not has_scipy): |
| 1096 | pytest.skip("requires dask and scipy") |
| 1097 | lhs = np.array([[1, 2], [1, 2], [3, 2]]) |
| 1098 | rhs = DataArray(np.array([3, 5, 7]), dims=("y",)) |
| 1099 | |
| 1100 | if use_dask: |
| 1101 | rhs = rhs.chunk({"y": 1}) |
| 1102 | |
| 1103 | coeffs, residuals = least_squares(lhs, rhs.data, skipna=skipna) |
| 1104 | |
| 1105 | np.testing.assert_allclose(coeffs, [1.5, 1.25]) |
| 1106 | np.testing.assert_allclose(residuals, [2.0]) |
| 1107 | |
| 1108 | |
| 1109 | @requires_dask |
nothing calls this directly
no test coverage detected
searching dependent graphs…