docs: def serialize(self, data):
          """
          :param data:
  
              A sequence of data where each datum has the following attributes:
  
              * matrix: N-dimensional numpy array containing the disaggregation
                histogram.
              * dim_labels: A list of strings which label the dimensions of a
                given histogram. For example, for a Magnitude-Distance-Epsilon
                histogram, we would expect `dim_labels` to be
                ``['Mag', 'Dist', 'Eps']``.
              * poe: The disaggregation Probability of Exceedance level for which
                these results were produced.
              * iml: Intensity measure level, interpolated from the source hazard
                curve at the given ``poe``.
          """
  
          with open(self.dest, 'wb') as fh, floatformat('%.6E'):
              root = et.Element('nrml')
  
              diss_matrices = et.SubElement(root, 'disaggMatrices')
  
              _set_metadata(diss_matrices, self.metadata, _ATTR_MAP)
  
              transform = lambda val: ', '.join(map(scientificformat, val))
              _set_metadata(diss_matrices, self.metadata, self.BIN_EDGE_ATTR_MAP,
                            transform=transform)
  
              for result in data:
                  diss_matrix = et.SubElement(diss_matrices, 'disaggMatrix')
  
                  # Check that we have bin edges defined for each dimension label
                  # (mag, dist, lon, lat, eps, TRT)
                  for label in result.dim_labels:
                      bin_edge_attr = self.DIM_LABEL_TO_BIN_EDGE_MAP.get(label)
                      assert self.metadata.get(bin_edge_attr) is not None, (
                          "Writer is missing '%s' metadata" % bin_edge_attr
                      )
  
                  result_type = ','.join(result.dim_labels)
                  diss_matrix.set('type', result_type)
  
                  dims = ','.join(str(x) for x in result.matrix.shape)
                  diss_matrix.set('dims', dims)
  
                  diss_matrix.set('poE', scientificformat(result.poe))
                  diss_matrix.set('iml', scientificformat(result.iml))
  
                  for idxs, value in numpy.ndenumerate(result.matrix):
                      prob = et.SubElement(diss_matrix, 'prob')
  
                      index = ','.join([str(x) for x in idxs])
                      prob.set('index', index)
                      prob.set('value', scientificformat(value))
  
              nrml.write(list(root), fh)