# xarray.testing.assert_allclose

### xarray.testing.assert_allclose(a, b, rtol=1e-05, atol=1e-08, decode_bytes=True, check_dim_order=True)[[source]](https://github.com/pydata/xarray/blob/main/xarray/testing/assertions.py#L209-L280)

Like [`numpy.testing.assert_allclose()`](https://numpy.org/doc/stable/reference/generated/numpy.testing.assert_allclose.html#numpy.testing.assert_allclose), but for xarray objects.

Raises an AssertionError if two objects are not equal up to desired
tolerance.

* **Parameters:**
  * **a** ([`xarray.Dataset`](xarray.Dataset.html.md#xarray.Dataset), [`xarray.DataArray`](xarray.DataArray.html.md#xarray.DataArray) or [`xarray.Variable`](xarray.Variable.html.md#xarray.Variable)) – The first object to compare.
  * **b** ([`xarray.Dataset`](xarray.Dataset.html.md#xarray.Dataset), [`xarray.DataArray`](xarray.DataArray.html.md#xarray.DataArray) or [`xarray.Variable`](xarray.Variable.html.md#xarray.Variable)) – The second object to compare.
  * **rtol** ([`float`](https://docs.python.org/3/builtins/functions.html#float), *optional*) – Relative tolerance.
  * **atol** ([`float`](https://docs.python.org/3/builtins/functions.html#float), *optional*) – Absolute tolerance.
  * **decode_bytes** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool), *optional*) – Whether byte dtypes should be decoded to strings as UTF-8 or not.
    This is useful for testing serialization methods on Python 3 that
    return saved strings as bytes.
  * **check_dim_order** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool), *optional*, *default* `is True`) – Whether dimensions must be in the same order.

#### SEE ALSO
[`assert_identical`](xarray.testing.assert_identical.html.md#xarray.testing.assert_identical), [`assert_equal`](xarray.testing.assert_equal.html.md#xarray.testing.assert_equal), [`numpy.testing.assert_allclose`](https://numpy.org/doc/stable/reference/generated/numpy.testing.assert_allclose.html#numpy.testing.assert_allclose)
