MetPy icon indicating copy to clipboard operation
MetPy copied to clipboard

Unneeded warning from xarray dimension handling

Open dopplershift opened this issue 4 years ago • 1 comments

The following code:

mpcalc.advection(isen_press, u=isen_u, v=isen_v)

produces a warning:

/Users/rmay/repos/metpy/src/metpy/xarray.py:1473: UserWarning: Vertical dimension number not found. Defaulting to (..., Z, Y, X) order.

when isen_press, isen_u, and isen_v are all 2D and matching shape. That seems unneeded for this case and probably a bit confusing to users. Not sure how much of a pain it would be to fix that though...

dopplershift avatar Mar 02 '22 06:03 dopplershift

So the problem for advection is that the function takes vertical_dim, to support anyone wanting to do vertical advection. It falls out of the call when we go to calculate, but at the time the warning is made it's not known this isn't really needed.

That puts this squarely in the pile of "painful to fix".

dopplershift avatar Jun 01 '22 20:06 dopplershift