code: def load_riskmodel(self):
          # to be called before read_exposure
          # NB: this is called even if there is no risk model
          
          logging.info('Reading the risk model if present')
          self.riskmodel = readinput.get_risk_model(self.oqparam)
          if not self.riskmodel:
              parent = self.datastore.parent
              if 'risk_model' in parent:
                  self.riskmodel = riskinput.CompositeRiskModel.read(parent)
              return
          if self.oqparam.ground_motion_fields and not self.oqparam.imtls:
              raise InvalidFile('No intensity_measure_types specified in %s' %
                                self.oqparam.inputs['job_ini'])
          self.save_params()
docs: Read the risk model and set the attribute .riskmodel.
          The riskmodel can be empty for hazard calculations.
          Save the loss ratios (if any) in the datastore.