File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 1717
1818from xcdat import bounds # noqa: F401
1919from xcdat ._logger import _setup_custom_logger
20- from xcdat .axis import get_dim_coords
20+ from xcdat .axis import center_times , get_dim_coords
2121from xcdat .dataset import _get_data_var
2222
2323logger = _setup_custom_logger (__name__ )
@@ -885,6 +885,10 @@ def _averager(
885885 ds = ds .drop_dims (self .dim )
886886 ds [dv_avg .name ] = dv_avg
887887
888+ if self ._mode == "group_average" :
889+ ds = ds .bounds .add_missing_bounds (axes = "T" )
890+ ds = center_times (ds )
891+
888892 if keep_weights :
889893 ds = self ._keep_weights (ds )
890894
@@ -1884,6 +1888,8 @@ def _convert_df_to_dt(self, df: pd.DataFrame) -> np.ndarray:
18841888 """
18851889 df_new = df .copy ()
18861890
1891+ # TODO: This is where the result should be in the middle, not the
1892+ # beginning.
18871893 dt_components_defaults = {"year" : 1 , "month" : 1 , "day" : 1 , "hour" : 0 }
18881894 for component , default_val in dt_components_defaults .items ():
18891895 if component not in df_new .columns :
You can’t perform that action at this time.
0 commit comments