docs: def export_ruptures_csv(ekey, dstore):
      """
      :param ekey: export key, i.e. a pair (datastore key, fmt)
      :param dstore: datastore object
      """
      oq = dstore['oqparam']
      if 'scenario' in oq.calculation_mode:
          return []
      dest = dstore.export_path('ruptures.csv')
      header = ('rupid multiplicity mag centroid_lon centroid_lat '
                'centroid_depth trt strike dip rake boundary').split()
      rows = []
      for rgetter in gen_rupture_getters(dstore):
          rups = rgetter.get_ruptures()
          rup_data = calc.RuptureData(rgetter.trt, rgetter.rlzs_by_gsim)
          for r in rup_data.to_array(rups):
              rows.append(
                  (r['rup_id'], r['multiplicity'], r['mag'],
                   r['lon'], r['lat'], r['depth'],
                   rgetter.trt, r['strike'], r['dip'], r['rake'],
                   r['boundary']))
      rows.sort()  # by rupture serial
      comment = 'investigation_time=%s, ses_per_logic_tree_path=%s' % (
          oq.investigation_time, oq.ses_per_logic_tree_path)
      writers.write_csv(dest, rows, header=header, sep='\t', comment=comment)
      return [dest]