wrf.decorators.check_args

wrf.decorators.check_args(refvaridx, refvarndim, rightdims, stagger=None, refstagdim=None)

A decorator to check that the wrapped function’s arguments are valid.

An exception is raised when an invalid argument is found.

Parameters:
  • refvaridx (int) – The wrapped function’s positional argument index to use as the reference variable.

  • refvarndim (int) – The number of dimensions for the reference variable that is expected by the wrapped function.

  • rightdims (sequence of int) – The expected number of right dimensions for each argument.

  • stagger (sequence of int or None, optional) – The dimension that is staggered for each argument in the wrapped function. Use None in the sequence to indicate no staggering for that argument. Default is None.

  • refstagdim (int, optional) – The staggered dimension for the reference variable, if applicable. Default is None.

Returns:

None

Raises:

ValueError – Raised when an invalid argument is detected.