@@ -807,13 +807,21 @@ def test_apply_non_polar_dtr_ceiling():
807807 apply_non_polar_dtr_ceiling (in_url , out = out_url , ceiling = ceiling )
808808 ds_dtr_corrected = repository .read (out_url )
809809
810+ # check values that should be capped
810811 assert all (
811812 x == ceiling
812813 for x in ds_dtr_corrected ["fakevariable" ].where (
813814 ds_dtr ["fakevariable" ] > ceiling , drop = True
814815 )
815816 )
816817
818+ # check values that should not be capped
819+ left = ds_dtr_corrected ["fakevariable" ].where (
820+ ds_dtr ["fakevariable" ] <= ceiling , drop = True
821+ )
822+ right = ds_dtr ["fakevariable" ].where (ds_dtr ["fakevariable" ] <= ceiling , drop = True )
823+ xr .testing .assert_equal (left , right )
824+
817825 # case 2 : polar regions, shouldn't be applied
818826 # Make some fake dtr data
819827 n = 10
@@ -827,7 +835,9 @@ def test_apply_non_polar_dtr_ceiling():
827835 apply_non_polar_dtr_ceiling (in_url , out = out_url , ceiling = ceiling )
828836 ds_dtr_corrected = repository .read (out_url )
829837
830- assert ds_dtr_corrected == ds_dtr
838+ np .testing .assert_equal (
839+ ds_dtr ["fakevariable" ].values , ds_dtr_corrected ["fakevariable" ].values
840+ )
831841
832842
833843def test_adjust_maximum_precipitation ():
0 commit comments