From 57bb1e7de329b7aa0e7912e6492d0035f6dcc360 Mon Sep 17 00:00:00 2001 From: Jon Thielen Date: Tue, 15 Sep 2020 22:13:32 -0500 Subject: [PATCH] Attempted cleanups from CI --- src/metpy/calc/kinematics.py | 6 +++--- src/metpy/xarray.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/metpy/calc/kinematics.py b/src/metpy/calc/kinematics.py index f168afb0170..12166dc09ce 100644 --- a/src/metpy/calc/kinematics.py +++ b/src/metpy/calc/kinematics.py @@ -348,7 +348,7 @@ def advection( v=None, w=None, *, - dx=None, + dx=None, # noqa: RST213 dy=None, dz=None, x_dim=-1, @@ -367,8 +367,8 @@ def advection( N-dimensional arrays with units of velocity representing the flow, with a component of the wind in each dimension. For 1D advection, use 1 positional argument (with `dx` for grid spacing and `x_dim` to specify axis if not the default of -1) or use 1 applicable - keyword argument (u, v, or w) for proper physical dimension (with corresponding `d*` - for grid spacing and `*_dim` to specify axis). For 2D/horizontal advection, use 2 + keyword argument (u, v, or w) for proper physical dimension (with corresponding `d\*` + for grid spacing and `\*_dim` to specify axis). For 2D/horizontal advection, use 2 positional arguments in order for u and v winds respectively (with `dx` and `dy` for grid spacings and `x_dim` and `y_dim` keyword arguments to specify axes), or specify u and v as keyword arguments (grid spacings and axes likewise). For 3D advection, diff --git a/src/metpy/xarray.py b/src/metpy/xarray.py index 69122daeece..aa06be06a67 100644 --- a/src/metpy/xarray.py +++ b/src/metpy/xarray.py @@ -1117,9 +1117,9 @@ def wrapper(*args, **kwargs): if isinstance(wrap_like, str): match = bound_args.arguments[wrap_like] elif isinstance(wrap_like, tuple): - for i in range(len(wrap_like)): - if isinstance(wrap_like[i], str): - match[i] = bound_args.arguments[wrap_like[i]] + for i, arg in enumerate(wrap_like): + if isinstance(arg, str): + match[i] = bound_args.arguments[arg] # Cast all DataArrays to Pint Quantities for arg_name in bound_args.arguments: