testing
Utility functions used in tsdat tests.
Functions#
assert_close #
assert_close(
a: xr.Dataset,
b: xr.Dataset,
check_attrs: bool = True,
check_fill_value: bool = True,
**kwargs: Any
) -> None
Thin wrapper around xarray.assert_allclose.
Also checks dataset and variable attrs. Removes global attributes that are allowed to be different, which are currently just the 'history' attribute and the 'code_version' attribute. Also handles some obscure edge cases for variable attributes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
a |
Dataset
|
The first dataset to compare. |
required |
b |
Dataset
|
The second dataset to compare. |
required |
check_attrs |
bool
|
Check global and variable attributes in addition to the data. Defaults to True. |
True
|
check_fill_value |
bool
|
Check the _FillValue attribute. This is a special case because xarray moves the _FillValue from a variable's attributes to its encoding upon saving the dataset. Defaults to True. |
True
|