wrf.from_var

class wrf.from_var(varname, attribute)

A callable class that retrieves attributes from the function argument.

If the function argument is not of type xarray.DataArray, then None will be returned.

It is assumed that the function has been wrapped using the wrapt module.

__call__(wrapped, *args, **kwargs)

Return the attribute found in the function arguments.

Parameters:
  • wrapped – The wrapped function, as used by the wrapt module.

  • *args – The function arguments.

  • **kwargs – The function keyword arguments.

Returns:

The requested attribute.

Return type:

object

varname

The variable name.

Type:

str

attribute

The attribute name.

Type:

str

__init__(varname, attribute)

Initialize a from_var object.

Parameters:
  • varname (str) – The variable name.

  • attribute (str) – The attribute name.

Methods

__init__(varname, attribute)

Initialize a from_var object.