def test_arc_connect(od, faces, expected, acshape):
    ds = od._ds
    arc_faces, *a, ARCT = arct_connect(ds, "XG", faces)
    assert arc_faces == expected
    assert len(ARCT) == len(expected)
    if len(ARCT) > 0:
        assert ARCT[0].shape == acshape  # arctic crown
示例#2
0
def test_arc_connect(od, faces, expected, atype):
    ds = od._ds
    arc_faces, *a, DS = arct_connect(ds, "XG", faces)
    assert arc_faces == expected
    if len(DS) > 0:
        assert type(DS[0]) == atype
示例#3
0

DIMS_c = [dim for dim in od.dataset["XC"].dims if dim not in ["face"]]
DIMS_g = [dim for dim in od.dataset["XG"].dims if dim not in ["face"]]
dims_c = Dims(DIMS_c[::-1])
dims_g = Dims(DIMS_g[::-1])

ds2 = []
ds5 = []
ds7 = []
ds10 = []
ARCT = [ds2, ds5, ds7, ds10]
varlist = ["T", "U", "V"]
# create dataset
for var_name in varlist:
    *nnn, DS = arct_connect(od.dataset, var_name,
                            faces="all")  # horizontal only
    ARCT[0].append(DS[0])
    ARCT[1].append(DS[1])
    ARCT[2].append(DS[2])
    ARCT[3].append(DS[3])
for i in range(len(ARCT)):  # Not all faces survive the cutout
    if type(ARCT[i][0]) == _datype:
        ARCT[i] = _xr.merge(ARCT[i])

ds2, ds5, ds7, ds10 = ARCT


@pytest.mark.parametrize(
    "ds, dimc, dimg, init_c, final_c, init_g, final_g",
    [
        (ds2, dims_c.X, dims_g.X, [0, 44], [0, 44], [0, 44], [0, 44]),