code: def _detach_dim_scale(self, name):
          
          for var in self.variables.values():
              for n, dim in enumerate(var.dimensions):
                  if dim == name:
                      var._h5ds.dims[n].detach_scale(self._all_h5groups[dim])
  
          for subgroup in self.groups.values():
              if dim not in subgroup._h5group:
                  subgroup._detach_dim_scale(name)
docs: Detach the dimension scale corresponding to a dimension name.