Skip to content

Commit 130de86

Browse files
committed
Fix bounds attributes
1 parent 6c7e30d commit 130de86

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/access_mopper/cmip6_cmoriser.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,12 @@ def select_and_process_variables(self):
296296
elif bnds_var in self.ds.coords:
297297
self.ds = self.ds.rename({bnds_var: out_bnds_name})
298298

299+
# Update "bounds" attribute in all variables and coordinates
300+
for var in list(self.ds.variables) + list(self.ds.coords):
301+
bounds_attr = self.ds[var].attrs.get("bounds")
302+
if bounds_attr and bounds_attr in bounds_rename_map:
303+
self.ds[var].attrs["bounds"] = bounds_rename_map[bounds_attr]
304+
299305
# Transpose the data variable according to the CMOR dimensions
300306
cmor_dims = self.vocab.variable["dimensions"].split()
301307
transpose_order = [

0 commit comments

Comments
 (0)