Ejemplo n.º 1
0
def test_format_dims_unsafe_dim_name():
    dims, coord_names = {"<x>": 3, "y": 2}, []
    formatted = fh.format_dims(dims, coord_names)
    assert "&lt;x&gt;" in formatted
Ejemplo n.º 2
0
def test_format_dims_index():
    dims, coord_names = {"x": 3, "y": 2}, ["x"]
    formatted = fh.format_dims(dims, coord_names)
    assert "class='xr-has-index'" in formatted
Ejemplo n.º 3
0
def test_format_dims_index() -> None:
    dims, dims_with_index = {"x": 3, "y": 2}, ["x"]
    formatted = fh.format_dims(dims, dims_with_index)
    assert "class='xr-has-index'" in formatted
Ejemplo n.º 4
0
def test_format_dims_no_dims():
    dims, coord_names = {}, []
    formatted = fh.format_dims(dims, coord_names)
    assert formatted == ""
Ejemplo n.º 5
0
def test_format_dims_unsafe_dim_name() -> None:
    dims = {"<x>": 3, "y": 2}
    dims_with_index: list = []
    formatted = fh.format_dims(dims, dims_with_index)
    assert "&lt;x&gt;" in formatted
Ejemplo n.º 6
0
def test_format_dims_no_dims() -> None:
    dims: dict = {}
    dims_with_index: list = []
    formatted = fh.format_dims(dims, dims_with_index)
    assert formatted == ""
Ejemplo n.º 7
0
def test_format_dims_non_index() -> None:
    dims, coord_names = {"x": 3, "y": 2}, ["time"]
    formatted = fh.format_dims(dims, coord_names)
    assert "class='xr-has-index'" not in formatted
Ejemplo n.º 8
0
def test_format_dims_unsafe_dim_name() -> None:
    dims = {"<x>": 3, "y": 2}
    coord_names: List = []
    formatted = fh.format_dims(dims, coord_names)
    assert "&lt;x&gt;" in formatted
Ejemplo n.º 9
0
def test_format_dims_no_dims() -> None:
    dims: Dict = {}
    coord_names: List = []
    formatted = fh.format_dims(dims, coord_names)
    assert formatted == ""