def verify_quantile_haz_maps_stored_to_kvs(hazengine): """ Make sure that the keys and non-empty values for quantile hazard maps have been written to KVS.""" quantiles = classical_psha._extract_values_from_config(hazengine, classical_psha.QUANTILE_PARAM_NAME) if (hazengine.params[classical_psha.POES_PARAM_NAME] != '' and len(quantiles) > 0): poes = classical_psha._extract_values_from_config(hazengine, classical_psha.POES_PARAM_NAME) LOG.debug("verifying KVS entries for quantile hazard maps, "\ "%s quantile values, %s PoEs" % ( len(quantiles), len(poes))) for quantile in quantiles: for poe in poes: for site in hazengine.sites_for_region(): key = tokens.quantile_hazard_map_key( hazengine.id, site, poe, quantile) value = self.kvs_client.get(key) self.assertTrue( value is not None, "no value found at KVS key %s" % key)
def verify_quantile_haz_maps_stored_to_kvs(the_job, calculator, keys): """ Make sure that the keys and non-empty values for quantile hazard maps have been written to KVS.""" quantiles = calculator.quantile_levels if (the_job.params[hazard_general.POES_PARAM_NAME] != '' and len(quantiles) > 0): poes = calculator.poes_hazard_maps LOG.debug("verifying KVS entries for quantile hazard maps, "\ "%s quantile values, %s PoEs" % ( len(quantiles), len(poes))) for quantile in quantiles: for poe in poes: for site in the_job.sites_to_compute(): key = tokens.quantile_hazard_map_key( the_job.job_id, site, poe, quantile) self.assertTrue( key in keys, "Missing key %s" % key)
def verify_quantile_haz_maps_stored_to_kvs(the_job, calculator, keys): """ Make sure that the keys and non-empty values for quantile hazard maps have been written to KVS.""" quantiles = calculator.quantile_levels if (the_job.params[hazard_general.POES_PARAM_NAME] != '' and len(quantiles) > 0): poes = calculator.poes_hazard_maps LOG.debug("verifying KVS entries for quantile hazard maps, "\ "%s quantile values, %s PoEs" % ( len(quantiles), len(poes))) for quantile in quantiles: for poe in poes: for site in the_job.sites_to_compute(): key = tokens.quantile_hazard_map_key( the_job.job_id, site, poe, quantile) self.assertTrue(key in keys, "Missing key %s" % key)