geocat.f2py.checks¶
Module Contents¶
Functions¶
|
Function of data checks for use in wrapper functions. |
- geocat.f2py.checks.check(user_variable, var_name='variable', data_type=None, max_dimensions=None, min_dimensions=None, dimensions=None, shape=None, is_xarray=None, is_none=None, is_numpy=None, is_chunked=None, comparison=None, unchunked_dims=None, exceptions=True)¶
Function of data checks for use in wrapper functions.
- user_variable
xarray.DataArrayornumpy.ndarray Variable of interest
- data_type
typeor :type:`tuple of types` Desired
data_typeofuser_variableex:data_type=np.ndarray- max_dimensions
tuple Maximum number of dimensions needed from
user_variablefor function ex:max_dimensions=(3)ormax_dimensions=3- min_dimensions
tuple Minimum number of dimensions needed from
user_variablefor function ex:min_dimensions=(3)ormin_dimensions=3- dimensions
tuple Number of dimensions needed from
user_variablefor function ex:dimensions=(3)ordimensions=3- shape
tuple Checks
user_variable’s shape ex:shape=(3, 3, 3)- is_xarray
bool Checking whether
user_variableis of classxarray.DataArray. Valid inputs are True or False- is_none
bool Checking whether
user_variableis of classNoneType. Valid input is True or False- comparison
n/a Compares user variable against item passed in as comparison Valid input is anything
- unchunked_dims
tuple Checks for unchunked dimensions in user_variable ex:
check(user_variable, unchunked_dims=[3])must include brackets- exceptions
bool Allows user to turn off exceptions in the check functions Valid input is True or False
- is_numpy
bool Checks whether variable is of class
numpy.ndarrayValid input is True or False- is_chunked
bool Checks whether variable is chunked Valid input is True or False
- user_variable