Ejemplo n.º 1
0
        def verify_quantile_haz_curves_stored_to_kvs(hazengine):
            """ Make sure that the keys and non-empty values for quantile 
            hazard curves have been written to KVS."""

            quantiles = classical_psha._extract_quantiles_from_config(
                hazengine)

            LOG.debug("verifying KVS entries for quantile hazard curves, "\
                "%s quantile values" % len(quantiles))

            for quantile in quantiles:
                for site_list in hazengine.site_list_generator():
                    for site in site_list:
                        key = tokens.quantile_hazard_curve_key(hazengine.id, 
                            site, quantile)
                        value = self.kvs_client.get(key)
                        self.assertTrue(value is not None,
                            "no non-empty value found at KVS key")
Ejemplo n.º 2
0
        def verify_quantile_haz_curves_stored_to_nrml(hazengine):
            """Tests that quantile NRML files have been written,
            and that these file validate against the NRML schema.
            Does NOT test if results in NRML files are correct.
            """

            quantiles = classical_psha._extract_quantiles_from_config(
                hazengine)

            for quantile in quantiles:

                nrml_path = os.path.join(
                    "smoketests/classical_psha_simple/computed_output",
                    opensha.quantile_hc_filename(quantile))

                LOG.debug("validating NRML file for quantile hazard curve: "\
                    "%s" % nrml_path)

                self.assertTrue(validatesAgainstXMLSchema(
                    nrml_path, NRML_SCHEMA_PATH),
                    "NRML instance file %s does not validate against schema" \
                    % nrml_path)