Skip to content

Fix the vertical dimension warning for horizontal advection - #4236

Open
kshptl wants to merge 1 commit into
Unidata:mainfrom
kshptl:fix/pr-engine-2370-fc834bfb6876
Open

kshptl wants to merge 1 commit into
Unidata:mainfrom
kshptl:fix/pr-engine-2370-fc834bfb6876

Conversation

@kshptl

@kshptl kshptl commented Dec 2, 2026

Copy link
Copy Markdown

Description Of Changes

On a 2-D xarray grid, horizontal advection warns that it can't find a vertical dimension. When w is None, advection only needs the horizontal axes, so this skips the vertical dimension lookup.

The existing test_advection_xarray now fails on that warning and still checks the calculated values.

  • With just the test change on the base commit, test_advection_xarray failed with Vertical dimension number not found. The focused advection run had 9 passes, 1 failure, and 72 deselected tests.
  • python -m pytest -q tests/calc/test_kinematics.py tests/calc/test_calc_tools.py ran 243 tests. All passed on the unmodified base and with the full patch. The independent review confirmed the patched result.
  • Ruff, Flake8 (--jobs=1), doc8, and the Codespell console script passed. The regenerated static data manifest matched the checked-in file.

The checks ran in an isolated environment on Python 3.12.3. The full test suite and CI matrix were outside this run.

Checklist

MetPy requires a CLA for acceptance. Its automated CLA check runs when a contributor opens a PR. Contribution guide

Signed-off-by: Kush Patel <56747429+kshptl@users.noreply.github.com>
@kshptl
kshptl requested a review from a team as a code owner December 2, 2026 14:31
@kshptl
kshptl requested review from dcamron and removed request for a team December 2, 2026 14:31

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unneeded warning from xarray dimension handling

1 participant