コード例 #1
0
    def test_shp_to_xml_validation(self):
        """
        """
        # Build shapefiles
        gem_unlink("dummy1.xml")
        gem_rmtree("source_shp")
        os.mkdir("source_shp")

        gem_run_script(self.prog, [
            "--input-nrml-file",
            self.input_file,
            "--output-file",
            os.path.join("source_shp", "src_model_files"),
            "--validate"])

        # Run test for all shapefiles
        point_file = os.path.join("source_shp", "src_model_files" + "_point")
        area_file = os.path.join("source_shp", "src_model_files" + "_area")
        simple_file = os.path.join("source_shp", "src_model_files" + "_simple")
        complex_file = os.path.join("source_shp",
                                    "src_model_files" + "_complex")
        gem_run_script(self.prog, ["--input-shp-files",
                                   point_file,
                                   area_file,
                                   simple_file,
                                   complex_file,
                                   "--output-file",
                                   "dummy1.xml",
                                   "--validate"])
        # cleanup
        gem_unlink("dummy1.xml", True)
        gem_rmtree("source_shp", True)
コード例 #2
0
    def test_disaggregation_converter(self):
        """
        Tests the execution of the disaggregation converter
        """
        gem_rmtree("dummy_disag")

        gem_run_script(self.prog, ["--input-file",
                                   self.input_file,
                                   "--output-dir",
                                   "dummy_disag"])

        # Cleanup
        gem_rmtree("dummy_disag", True)
コード例 #3
0
    def test_gmf_set_converter(self):
        """
        Tests the execution of the gmf set converter
        """
        gem_rmtree("dummy_event_set")

        gem_run_script(self.prog, ["--input-file",
                                   self.input_file,
                                   "--output-dir",
                                   "dummy_event_set"])

        # Cleanup
        gem_rmtree("dummy_event_set", True)
コード例 #4
0
    def test_gmf_scenario_converter(self):
        """
        Tests scenario gmf execution
        """
        gem_rmtree("dummy_scenario_gmf")

        gem_run_script(self.prog, ["--input-file",
                                   self.input_file,
                                   "--output-dir",
                                   "dummy_scenario_gmf"])

        # Cleanup
        gem_rmtree("dummy_scenario_gmf", True)
コード例 #5
0
 def test_xml_to_shp_with_validation(self):
     """
     Tests the conversion to shapefile - with validation
     """
     #output_dir = os.path.join(os.path.dirname(__file__), "outputs")
     gem_rmtree("source_shp")
     os.mkdir("source_shp")
     gem_run_script(self.prog, [
         "--input-nrml-file",
         self.input_file,
         "--output-file",
         os.path.join("source_shp", "src_model_files"),
         "--validate"])
     # Cleanup
     gem_rmtree("source_shp", True)
コード例 #6
0
    def test_plotting(self):
        """
        Tests the execution with plotting
        """
        gem_rmtree("dummy_hazard_curve")
        gem_unlink("dummy_hazard_curve.csv")

        gem_run_script(self.prog, ["--input-file",
                                   self.input_file,
                                   "--output-file",
                                   "dummy_hazard_curve",
                                   "--plot-curves",
                                   "True"])

        # Cleanup
        gem_rmtree("dummy_hazard_curve", True)
        gem_unlink("dummy_hazard_curve.csv", True)
コード例 #7
0
    def test_uhs_converter_plotting(self):
        """
        Tests the execution with plotting
        """
        gem_rmtree("dummy_uhs")
        gem_unlink("dummy_uhs.csv")

        gem_run_script(self.prog, ["--input-file",
                                   self.input_file,
                                   "--output-file",
                                   "dummy_uhs",
                                   "--plot-spectra",
                                   "True"])

        # Cleanup
        gem_rmtree("dummy_uhs", True)
        gem_unlink("dummy_uhs.csv", True)