@@ -279,11 +279,6 @@ def _run_diag_annual_cycle(parameter: ARMDiagsParameter) -> ARMDiagsParameter:
279279 vars_funcs = _get_vars_funcs_for_derived_var (ds_ref , var )
280280 target_var = list (vars_funcs .keys ())[0 ][0 ]
281281
282- # NOTE: The bounds dimension can be "nv", which is not
283- # currently recognized as a valid bounds dimension
284- # by xcdat. We rename it to "bnds" to make it compatible.
285- ds_ref = _rename_bounds_dim (ds_ref )
286-
287282 ds_ref_climo = ds_ref .temporal .climatology (target_var , "month" )
288283 da_ref = vars_funcs [(target_var ,)](ds_ref_climo [target_var ]).rename (
289284 var
@@ -536,33 +531,3 @@ def _save_metrics_to_json(parameter: ARMDiagsParameter, metrics_dict: dict[str,
536531 json .dump (metrics_dict , outfile )
537532
538533 logger .info (f"Metrics saved in: { abs_path } " )
539-
540-
541- def _rename_bounds_dim (ds : xr .Dataset ) -> xr .Dataset :
542- """
543- Renames the bounds dimension "nv" to "bnds" in the given xarray.Dataset for
544- xCDAT compatibility.
545-
546- This is a temporary workaround to ensure compatibility with xCDAT's bounds
547- handling. The bounds dimension "nv" is commonly used in datasets to
548- represent the number of vertices in a polygon, but xCDAT expects the
549- bounds dimension to be in `xcdat.bounds.VALID_BOUNDS_DIMS`. This function
550- renames "nv" to "bnds" to align with xCDAT's expectations.
551-
552- Parameters
553- ----------
554- ds : xr.Dataset
555- The input xarray.Dataset which may contain a bounds dimension named "nv".
556-
557- Returns
558- -------
559- xr.Dataset
560- A new xarray.Dataset with the "nv" dimension renamed to "bnds" if it
561- existed; otherwise, the original dataset copy.
562- """
563- ds_new = ds .copy ()
564-
565- if "nv" in ds_new .dims :
566- ds_new = ds_new .rename ({"nv" : "bnds" })
567-
568- return ds_new
0 commit comments