docs: def collect(cls, sources):
          """
          :param sources: dictionaries with a key 'tectonicRegion'
          :returns: an ordered list of SourceGroup instances
          """
          source_stats_dict = {}
          for src in sources:
              trt = src['tectonicRegion']
              if trt not in source_stats_dict:
                  source_stats_dict[trt] = SourceGroup(trt)
              sg = source_stats_dict[trt]
              if not sg.sources:
                  # we append just one source per SourceGroup, so that
                  # the memory occupation is insignificant
                  sg.sources.append(src)
  
          # return SourceGroups, ordered by TRT string
          return sorted(source_stats_dict.values())