code: def close(self):
          
          if 'ruptures' not in self.datastore:  # for UCERF
              return
          codes = numpy.unique(self.datastore['ruptures']['code'])
          attr = {'code_%d' % code: ' '.join(
              cls.__name__ for cls in BaseRupture.types[code])
                  for code in codes}
          self.datastore.set_attrs('ruptures', **attr)
docs: Save information about the rupture codes as attributes of the
          'ruptures' dataset.