@@ -138,10 +138,10 @@ def test_resample_reduces_time_dimension(gridpath):
138138 uxds = ux .UxDataset (ds , uxgrid = ux .open_grid (gridpath ("ugrid" , "outCSne30" , "outCSne30.ug" )))
139139
140140 # Test monthly resampling reduces from 365 days to 12 months
141- monthly = uxds .resample (time = "1M " ).mean ()
141+ monthly = uxds .resample (time = "1ME " ).mean ()
142142 assert "time" in monthly .dims , "time dimension missing after resample"
143- assert monthly .dims ["time" ] < uxds .dims ["time" ], "time dimension not reduced"
144- assert monthly .dims ["time" ] <= 12 , "monthly resampling should give 12 or fewer time points"
143+ assert monthly .sizes ["time" ] < uxds .sizes ["time" ], "time dimension not reduced"
144+ assert monthly .sizes ["time" ] <= 12 , "monthly resampling should give 12 or fewer time points"
145145
146146
147147def test_resample_with_cftime (gridpath ):
@@ -166,10 +166,10 @@ def test_resample_with_cftime(gridpath):
166166 uxds = ux .UxDataset (ds , uxgrid = ux .open_grid (gridpath ("ugrid" , "outCSne30" , "outCSne30.ug" )))
167167
168168 # Test that quarterly resampling works with cftime
169- quarterly = uxds .resample (time = "Q " ).mean ()
169+ quarterly = uxds .resample (time = "QE " ).mean ()
170170 assert hasattr (quarterly , "uxgrid" ), "uxgrid not preserved with cftime resampling"
171171 assert "time" in quarterly .dims , "time dimension missing after cftime resample"
172- assert quarterly .dims ["time" ] < uxds .dims ["time" ], "time dimension not reduced with cftime"
172+ assert quarterly .sizes ["time" ] < uxds .sizes ["time" ], "time dimension not reduced with cftime"
173173
174174
175175def test_rolling_preserves_uxgrid (gridpath ):
@@ -237,7 +237,7 @@ def test_coarsen_preserves_uxgrid(gridpath):
237237
238238 # Test that coarsen reduces dimension correctly
239239 assert len (da_result .time ) == 8 , "coarsen by 3 should reduce 24 points to 8"
240- assert ds_result .dims ["time" ] == 8 , "coarsen should reduce time dimension"
240+ assert ds_result .sizes ["time" ] == 8 , "coarsen should reduce time dimension"
241241
242242
243243def test_weighted_preserves_uxgrid (gridpath , datasetpath ):
@@ -251,7 +251,7 @@ def test_weighted_preserves_uxgrid(gridpath, datasetpath):
251251 gridpath ("ugrid" , "outCSne30" , "outCSne30.ug" ),
252252 datasetpath ("ugrid" , "outCSne30" , "outCSne30_var2.nc" )
253253 )
254- n_face = uxds_base .dims ["n_face" ]
254+ n_face = uxds_base .sizes ["n_face" ]
255255
256256 # Create data with time and face dimensions
257257 temp_data = np .random .rand (10 , n_face )
0 commit comments