@@ -919,8 +919,8 @@ def test_read_write_netcdf(self, hydro_data, hydro_data_new):
919
919
assert hydro_data .equals (hydro_data_new )
920
920
921
921
922
- class TestCheckLinearDamping :
923
- """Test function :python:`check_linear_damping `."""
922
+ class TestCheckRadiationDamping :
923
+ """Test function :python:`check_radiation_damping `."""
924
924
925
925
@pytest .fixture (scope = "class" )
926
926
def data (self , hydro_data ):
@@ -933,44 +933,39 @@ def data(self, hydro_data):
933
933
934
934
@pytest .fixture (scope = "class" )
935
935
def tol (self , data ):
936
- """Tolerance for function :python:`check_linear_damping `."""
936
+ """Tolerance for function :python:`check_radiation_damping `."""
937
937
return 0.01
938
938
939
939
@pytest .fixture (scope = "class" )
940
940
def data_new_uniform (self , data , tol ):
941
941
"""Hydrodynamic data structure for which the function
942
- :python:`check_linear_damping ` has been called.
942
+ :python:`check_radiation_damping ` has been called.
943
943
"""
944
- return wot .check_linear_damping (data , tol , True )
944
+ return wot .check_radiation_damping (data , tol , True )
945
945
946
946
@pytest .fixture (scope = "class" )
947
947
def data_new_nonuniform (self , data , tol ):
948
948
"""Hydrodynamic data structure for which the function
949
- :python:`check_linear_damping ` has been called.
949
+ :python:`check_radiation_damping ` has been called.
950
950
"""
951
- return wot .check_linear_damping (data , tol , False )
951
+ return wot .check_radiation_damping (data , tol , False )
952
952
953
- def test_friction (self , data_new_uniform , tol ):
953
+ def test_radiation (self , data , data_new_uniform , tol ):
954
954
"""Test that the modified friction diagonal has the expected
955
955
value for a uniform shift.
956
956
"""
957
- assert np .allclose (np .diagonal (data_new_uniform .friction .values ), tol )
957
+ radiation_diff = (data_new_uniform .radiation_damping .values
958
+ - data .radiation_damping .values )
959
+ assert np .allclose (radiation_diff , radiation_diff [0 ], tol )
958
960
959
- def test_only_diagonal_friction (self , data , data_new_uniform ):
960
- """Test that only the diagonal was changed for a uniform shift."""
961
- data_org = data .copy (deep = True )
962
- def nodiag (x ):
963
- return x .friction .values - np .diag (np .diagonal (x .friction .values ))
964
- assert np .allclose (nodiag (data_new_uniform ), nodiag (data_org ))
965
-
966
- def test_only_friction (self , data , data_new_uniform ):
967
- """Test that only the friction is changed in the hydrodynamic
961
+ def test_only_radiation (self , data , data_new_uniform ):
962
+ """Test that only the radiation is changed in the hydrodynamic
968
963
data for a uniform shift.
969
964
"""
970
- data_new_nofric = data_new_uniform .copy (deep = True
971
- ).drop_vars ('friction ' )
972
- data_org_nofric = data .copy (deep = True ).drop_vars ('friction ' )
973
- assert data_new_nofric .equals (data_org_nofric )
965
+ data_new_norad = data_new_uniform .copy (deep = True
966
+ ).drop_vars ('radiation_damping ' )
967
+ data_org_norad = data .copy (deep = True ).drop_vars ('radiation_damping ' )
968
+ assert data_new_norad .equals (data_org_norad )
974
969
975
970
def test_damping (self , data_new_nonuniform , tol ):
976
971
"""Test that the modified radiation damping diagonal has the expected
0 commit comments