code: def gen_outputs(self, riskinput, monitor, epspath=None, hazard=None):
          
          self.monitor = monitor
          hazard_getter = riskinput.hazard_getter
          if hazard is None:
              with monitor('getting hazard'):
                  hazard_getter.init()
                  hazard = hazard_getter.get_hazard()
          sids = hazard_getter.sids
          assert len(sids) == 1
          with monitor('computing risk', measuremem=False):
              # this approach is slow for event_based_risk since a lot of
              # small arrays are passed (one per realization) instead of
              # a long array with all realizations; ebrisk does the right
              # thing since it calls get_output directly
              assets_by_taxo = get_assets_by_taxo(riskinput.assets, epspath)
              for rlzi, haz in sorted(hazard[sids[0]].items()):
                  out = self.get_output(assets_by_taxo, haz, rlzi)
                  yield out
docs: Group the assets per taxonomy and compute the outputs by using the
          underlying riskmodels. Yield one output per realization.
  
          :param riskinput: a RiskInput instance
          :param monitor: a monitor object used to measure the performance