예제 #1
0
def test_load_from_varnames_bad_mapping():
    mapping = {'attribute_check': ('grid_type', 'triangular'),
               'faces': 'nv',
               'nodes_lon': 'longitude',
               'nodes_lat': 'latitude',
               'boundaries': 'bnd',
               'face_face_connectivity': 'nbe'}

    fname = 'non_compliant_ugrid.nc'
    with non_compliante_mesh(fname):
        with pytest.raises(KeyError):
            load_from_varnames(fname, mapping)
예제 #2
0
def test_load_from_varnames_bad_mapping():
    mapping = {
        'attribute_check': ('grid_type', 'triangular'),
        'faces': 'nv',
        'nodes_lon': 'longitude',
        'nodes_lat': 'latitude',
        'boundaries': 'bnd',
        'face_face_connectivity': 'nbe'
    }

    fname = 'non_compliant_ugrid.nc'
    with non_compliante_mesh(fname):
        with pytest.raises(KeyError):
            load_from_varnames(fname, mapping)
예제 #3
0
def test_load_from_varnames_good_mapping():
    mapping = {'attribute_check': ('grid_type', 'triangular'),
               'faces': 'nv',
               'nodes_lon': 'lon',
               'nodes_lat': 'lat',
               'boundaries': 'bnd',
               'face_face_connectivity': 'nbe'}

    fname = 'non_compliant_ugrid.nc'
    with non_compliante_mesh(fname):
        ug = load_from_varnames(fname, mapping)
    assert isinstance(ug, UGrid)
예제 #4
0
def test_load_from_varnames_good_mapping():
    mapping = {
        'attribute_check': ('grid_type', 'triangular'),
        'faces': 'nv',
        'nodes_lon': 'lon',
        'nodes_lat': 'lat',
        'boundaries': 'bnd',
        'face_face_connectivity': 'nbe'
    }

    fname = 'non_compliant_ugrid.nc'
    with non_compliante_mesh(fname):
        ug = load_from_varnames(fname, mapping)
    assert isinstance(ug, UGrid)