Skip to content

Commit c34ef8a

Browse files
authored
change polyval dim ordering (#6601)
1 parent fc282d5 commit c34ef8a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

xarray/core/computation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1909,7 +1909,7 @@ def polyval(
19091909

19101910
# using Horner's method
19111911
# https://en.wikipedia.org/wiki/Horner%27s_method
1912-
res = coeffs.isel({degree_dim: max_deg}, drop=True) + zeros_like(coord)
1912+
res = zeros_like(coord) + coeffs.isel({degree_dim: max_deg}, drop=True)
19131913
for deg in range(max_deg - 1, -1, -1):
19141914
res *= coord
19151915
res += coeffs.isel({degree_dim: deg}, drop=True)

xarray/tests/test_computation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1951,7 +1951,7 @@ def test_where_attrs() -> None:
19511951
xr.DataArray(
19521952
[[0, 1], [0, 1]], dims=("y", "degree"), coords={"degree": [0, 1]}
19531953
),
1954-
xr.DataArray([[1, 2, 3], [1, 2, 3]], dims=("y", "x")),
1954+
xr.DataArray([[1, 1], [2, 2], [3, 3]], dims=("x", "y")),
19551955
id="broadcast-x",
19561956
),
19571957
pytest.param(

0 commit comments

Comments
 (0)