docs: def check_precalc(self, precalc_mode):
          """
          Defensive programming against users providing an incorrect
          pre-calculation ID (with ``--hazard-calculation-id``).
  
          :param precalc_mode:
              calculation_mode of the previous calculation
          """
          calc_mode = self.oqparam.calculation_mode
          ok_mode = self.accept_precalc
          if calc_mode != precalc_mode and precalc_mode not in ok_mode:
              raise InvalidCalculationID(
                  'In order to run a calculation of kind %r, '
                  'you need to provide a calculation of kind %r, '
                  'but you provided a %r instead' %
                  (calc_mode, ok_mode, precalc_mode))