Example #1
0
 def get_attr_dimension(self, attr_name):
     try:
         attr_dim = getattr(self.topology_var, attr_name)
     except AttributeError:
         attr_dim = None
         attr_padding = None
     else:
         attr_dim_padding = parse_padding(attr_dim, self.topology_variable)
         attr_padding = attr_dim_padding
     return attr_dim, attr_padding
Example #2
0
def test_one_padding_type(parse_pad):
    grid_topology, pad_1, pad_2, pad_no = parse_pad
    result = parse_padding(pad_1, grid_topology)
    expected_len = 1
    padding_datum_0 = result[0]
    padding_type = padding_datum_0.padding
    sub_dim = padding_datum_0.node_dim
    dim = padding_datum_0.face_dim
    expected_padding_type = 'high'
    expected_sub_dim = 'xi_psi'
    expected_dim = 'xi_v'
    assert len(result) == expected_len
    assert padding_type == expected_padding_type
    assert sub_dim == expected_sub_dim
    assert dim == expected_dim
Example #3
0
def test_no_padding(parse_pad):
    grid_topology, pad_1, pad_2, pad_no = parse_pad
    with pytest.raises(ValueError):
        parse_padding(padding_str=pad_no, mesh_topology_var=grid_topology)
Example #4
0
def test_mesh_name(parse_pad):
    grid_topology, pad_1, pad_2, pad_no = parse_pad
    result = parse_padding(pad_1, grid_topology)
    mesh_topology = result[0].mesh_topology_var
    expected = 'some_grid'
    assert mesh_topology == expected