Skip to content

Commit

Permalink
support for uda
Browse files Browse the repository at this point in the history
  • Loading branch information
veenstrajelmer committed Feb 5, 2025
1 parent 0fad695 commit ce3197c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
5 changes: 1 addition & 4 deletions dfm_tools/xugrid_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ def get_vertical_dimensions(uds): #TODO: maybe add layer_dimension and interface
processing MB_02_0*_map.nc
>> found layer/interface dimensions in file: mesh2d_nLayers mesh2d_nInterfaces
"""

if not isinstance(uds,(xr.Dataset,xu.UgridDataset)):
raise TypeError(f'uds should be of type xr.Dataset or xu.UgridDataset, but is {type(uds)}')


if not hasattr(uds,'grid'): #early return in case of e.g. hisfile
return None, None

Expand Down
5 changes: 0 additions & 5 deletions tests/test_xugrid_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,6 @@ def test_get_vertical_dimensions():
assert dimn_layer is None
assert dimn_interface is None

# incorrect type
with pytest.raises(TypeError) as e:
get_vertical_dimensions(1)
assert 'uds should be of type xr.Dataset or xu.UgridDataset' in str(e.value)


@pytest.mark.systemtest
def test_uda_edges_to_faces_interfaces_to_centers():
Expand Down

0 comments on commit ce3197c

Please sign in to comment.