Skip to content

Unneeded warning from xarray dimension handling #2370

Open

Description

@dopplershift

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...

Activity

  1. added
    Type: Bug
    Area: Calc
    Area: Xarray
    on Mar 2, 2022
  2. added this to the May 2022 milestone on Apr 11, 2022
  3. dopplershift commented on Jun 1, 2022

    @dopplershift
    MemberAuthor

    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".

  4. modified the milestones: 1.4.1, April 2023 on Mar 16, 2023
  5. modified the milestones: 1.7.0, 1.8.0 on Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: CalcArea: XarrayType: Bug

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions