Two things #1663 left behind.
1. divergence is eager on dask input. The metric term uses other.values where its companion in curl uses self.data, so u.curl(v) returns a dask.array.Array and u.divergence(v) returns an ndarray for the same chunked input. #1588's .values → .data sweep reached the curl side during a conflict resolution on the #1663 branch and missed this one. One-word fix; there is no dask coverage anywhere in test/core/test_vector_calculus.py to have caught it.
2. docs/user-guide/vector_calculus.ipynb still teaches the planar operators. Cells 14 and 27 give ∂v/∂x − ∂u/∂y and ∂u/∂x + ∂v/∂y with no metric term, and eight code cells (16, 18, 20, 22, 29, 31, 35, 37) hand-roll the operators from gradient() components instead of calling curl()/divergence(). So every worked example demonstrates pre-#1663 physics while the library computes something else. Cell 43's "curl of gradient ≈ 0" is stated for the hand-rolled version.
Switching those cells to the API changes one result materially: curl and divergence of a constant field are no longer exactly zero, they are u·tan(φ)/a and −v·tan(φ)/a — 4.8e-09 and 9.6e-09 on this ±2° MPAS subset. That is correct spherical behaviour and worth saying out loud in the notebook rather than deleting. The other examples move by less than a part in 10⁴, except the two "≈ 0" residuals which go from 2.8e-10 to 4.0e-09 and stay ≈ 0.
Two things #1663 left behind.
1.
divergenceis eager on dask input. The metric term usesother.valueswhere its companion incurlusesself.data, sou.curl(v)returns adask.array.Arrayandu.divergence(v)returns anndarrayfor the same chunked input. #1588's.values→.datasweep reached the curl side during a conflict resolution on the #1663 branch and missed this one. One-word fix; there is no dask coverage anywhere intest/core/test_vector_calculus.pyto have caught it.2.
docs/user-guide/vector_calculus.ipynbstill teaches the planar operators. Cells 14 and 27 give∂v/∂x − ∂u/∂yand∂u/∂x + ∂v/∂ywith no metric term, and eight code cells (16, 18, 20, 22, 29, 31, 35, 37) hand-roll the operators fromgradient()components instead of callingcurl()/divergence(). So every worked example demonstrates pre-#1663 physics while the library computes something else. Cell 43's "curl of gradient ≈ 0" is stated for the hand-rolled version.Switching those cells to the API changes one result materially: curl and divergence of a constant field are no longer exactly zero, they are
u·tan(φ)/aand−v·tan(φ)/a—4.8e-09and9.6e-09on this ±2° MPAS subset. That is correct spherical behaviour and worth saying out loud in the notebook rather than deleting. The other examples move by less than a part in 10⁴, except the two "≈ 0" residuals which go from2.8e-10to4.0e-09and stay ≈ 0.