complex_model/HailAUSKeysLookup.py
def _pre_validate(self, record, coverage_type: int):
        """This validates the record forwarded by the oasislmf framework is supported

        :param record:
        :return: raises an exception if record is not supported
        """
        # OED: locperilscovered is required
        if 'locperilscovered' not in record or record['locperilscovered'] is None:
            raise LocationLookupException('LocPerilsCovered is required', error_code=101)
        loc_peril_covered_ids = get_covered_ids(record['locperilscovered'])
        if self._peril_id not in loc_peril_covered_ids:
            raise LocationLookupException('Location not covered for ' + str(oed_to_rf_peril(self._peril_id)),
                                          error_code=122)

        # OASIS: loc_id is uniquely generated for each location by oasis
        if 'loc_id' not in record or record['loc_id'] is None:
            raise LocationLookupException("Location ID is required but is missing",
                                          error_code=102)

        # Unsupported coverage (Other TIV is not supported)
        if coverage_type == COVERAGE_TYPES['other']['id']:  # Other TIV is not supported anymore
            if float(record["othertiv"]) > 0:
                raise LocationNotModelledException("Other coverage is not modelled. MotorTIV is parsed from BuildingTIV",
                                                   error_code=210)

        # Unsupported occupancy code

        # Unsupported construction code
        if coverage_type in self._supported_coverage_types and self._is_unsupported_construction_code(record):
            raise LocationNotModelledException("Unsupported construction code", error_code=230)
This validates the record forwarded by the oasislmf framework is supported

        :param record:
        :return: raises an exception if record is not supported
        
This validates the record forwarded by the oasislmf framework is supported
This validates the record forwarded by the oasislmf framework is supported
def _pre_validate(self, record, coverage_type: int):
        if 'locperilscovered' not in record or record['locperilscovered'] is None:
            raise LocationLookupException('LocPerilsCovered is required', error_code=101)
        loc_peril_covered_ids = get_covered_ids(record['locperilscovered'])
        if self._peril_id not in loc_peril_covered_ids:
            raise LocationLookupException('Location not covered for ' + str(oed_to_rf_peril(self._peril_id)),
                                          error_code=122)
        if 'loc_id' not in record or record['loc_id'] is None:
            raise LocationLookupException("Location ID is required but is missing",
                                          error_code=102)
        if coverage_type == COVERAGE_TYPES['other']['id']:  
            if float(record["othertiv"]) > 0:
                raise LocationNotModelledException("Other coverage is not modelled. MotorTIV is parsed from BuildingTIV",
                                                   error_code=210)
        if coverage_type in self._supported_coverage_types and self._is_unsupported_construction_code(record):
            raise LocationNotModelledException("Unsupported construction code", error_code=230)
def _pre_validate ( self , record , coverage_type : int ) : if 'locperilscovered' not in record or record [ 'locperilscovered' ] is None : raise LocationLookupException ( 'LocPerilsCovered is required' , error_code = 101 ) loc_peril_covered_ids = get_covered_ids ( record [ 'locperilscovered' ] ) if self . _peril_id not in loc_peril_covered_ids : raise LocationLookupException ( 'Location not covered for ' + str ( oed_to_rf_peril ( self . _peril_id ) ) , error_code = 122 ) if 'loc_id' not in record or record [ 'loc_id' ] is None : raise LocationLookupException ( "Location ID is required but is missing" , error_code = 102 ) if coverage_type == COVERAGE_TYPES [ 'other' ] [ 'id' ] : if float ( record [ "othertiv" ] ) > 0 : raise LocationNotModelledException ( "Other coverage is not modelled. MotorTIV is parsed from BuildingTIV" , error_code = 210 ) if coverage_type in self . _supported_coverage_types and self . _is_unsupported_construction_code ( record ) : raise LocationNotModelledException ( "Unsupported construction code" , error_code = 230 )
This validates the record forwarded by the oasislmf framework is supported
This validates the record forwarded by the oasislmf framework is supported
"""This validates the record forwarded by the oasislmf framework is supported

        :param record:
        :return: raises an exception if record is not supported
        """ # OED: locperilscovered is required # OASIS: loc_id is uniquely generated for each location by oasis # Unsupported coverage (Other TIV is not supported) # Other TIV is not supported anymore # Unsupported occupancy code # Unsupported construction code
raises an exception if record is not supported
raises an exception if record is not supported
self
record
None
coverage_type
int