File: test_35_xarray_backends_dask.py

package info (click to toggle)
xarray-sentinel 0.9.5%2Bds-4
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 21,540 kB
  • sloc: xml: 77,744; python: 2,076; makefile: 32; sh: 17
file content (20 lines) | stat: -rw-r--r-- 558 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import pathlib

import pytest
import xarray as xr

dask = pytest.importorskip("dask")

DATA_FOLDER = pathlib.Path(__file__).parent / "data"


def test_open_pol_dataset_preferred_chunks() -> None:
    product_path = (
        DATA_FOLDER
        / "S1B_IW_SLC__1SDV_20210401T052622_20210401T052650_026269_032297_EFA4.SAFE"
    )
    res = xr.open_dataset(product_path, engine="sentinel-1", group="IW1/VV", chunks={})

    assert isinstance(res, xr.Dataset)
    assert len(res.dims) == 2
    assert res.measurement.chunks[0][0] == res.attrs["lines_per_burst"]