當前位置: 首頁>>代碼示例>>Python>>正文


Python Job._partition方法代碼示例

本文整理匯總了Python中openquake.job.Job._partition方法的典型用法代碼示例。如果您正苦於以下問題:Python Job._partition方法的具體用法?Python Job._partition怎麽用?Python Job._partition使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在openquake.job.Job的用法示例。


在下文中一共展示了Job._partition方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_prepares_blocks_using_the_exposure

# 需要導入模塊: from openquake.job import Job [as 別名]
# 或者: from openquake.job.Job import _partition [as 別名]
    def test_prepares_blocks_using_the_exposure(self):
        a_job = Job({EXPOSURE: os.path.join(helpers.SCHEMA_EXAMPLES_DIR,
                                            EXPOSURE_TEST_FILE)})
        a_job._partition()
        blocks_keys = a_job.blocks_keys

        expected_block = job.Block((shapes.Site(9.15000, 45.16667),
            shapes.Site(9.15333, 45.12200), shapes.Site(9.14777, 45.17999)))

        self.assertEqual(1, len(blocks_keys))
        self.assertEqual(expected_block, job.Block.from_kvs(blocks_keys[0]))
開發者ID:danciul,項目名稱:openquake,代碼行數:13,代碼來源:job_unittest.py

示例2: test_with_no_partition_we_just_process_a_single_block

# 需要導入模塊: from openquake.job import Job [as 別名]
# 或者: from openquake.job.Job import _partition [as 別名]
    def test_with_no_partition_we_just_process_a_single_block(self):
        job.SITES_PER_BLOCK = 1

        # test exposure has 6 assets
        a_job = Job({EXPOSURE: os.path.join(test.DATA_DIR, EXPOSURE_TEST_FILE)})

        self.generated_files.append(a_job.super_config_path)

        a_job._partition()
        blocks_keys = a_job.blocks_keys

        # but we have 1 block instead of 6
        self.assertEqual(1, len(blocks_keys))
開發者ID:VSilva,項目名稱:openquake,代碼行數:15,代碼來源:job_unittest.py

示例3: test_prepares_blocks_using_the_exposure_and_filtering

# 需要導入模塊: from openquake.job import Job [as 別名]
# 或者: from openquake.job.Job import _partition [as 別名]
    def test_prepares_blocks_using_the_exposure_and_filtering(self):
        a_job = Job({EXPOSURE: os.path.join(helpers.SCHEMA_EXAMPLES_DIR,
                                            EXPOSURE_TEST_FILE),
                 INPUT_REGION: helpers.get_data_path(REGION_EXPOSURE_TEST_FILE)})
        self.generated_files.append(a_job.super_config_path)
        a_job._partition()
        blocks_keys = a_job.blocks_keys

        expected_block = job.Block((shapes.Site(9.15, 45.16667),
                                    shapes.Site(9.15333, 45.122),
                                    shapes.Site(9.14777, 45.17999)))

        self.assertEqual(1, len(blocks_keys))
        self.assertEqual(expected_block, job.Block.from_kvs(blocks_keys[0]))
開發者ID:danciul,項目名稱:openquake,代碼行數:16,代碼來源:job_unittest.py

示例4: test_prepares_blocks_using_the_exposure

# 需要導入模塊: from openquake.job import Job [as 別名]
# 或者: from openquake.job.Job import _partition [as 別名]
    def test_prepares_blocks_using_the_exposure(self):
        a_job = Job({EXPOSURE: os.path.join(test.DATA_DIR, EXPOSURE_TEST_FILE)})
        a_job._partition()
        blocks_keys = a_job.blocks_keys

        expected_block = job.Block(
            (
                shapes.Site(9.15000, 45.16667),
                shapes.Site(9.15333, 45.12200),
                shapes.Site(9.14777, 45.17999),
                shapes.Site(9.15765, 45.13005),
                shapes.Site(9.15934, 45.13300),
                shapes.Site(9.15876, 45.13805),
            )
        )

        self.assertEqual(1, len(blocks_keys))
        self.assertEqual(expected_block, job.Block.from_kvs(blocks_keys[0]))
開發者ID:VSilva,項目名稱:openquake,代碼行數:20,代碼來源:job_unittest.py

示例5: test_prepares_blocks_using_the_exposure_and_filtering

# 需要導入模塊: from openquake.job import Job [as 別名]
# 或者: from openquake.job.Job import _partition [as 別名]
    def test_prepares_blocks_using_the_exposure_and_filtering(self):
        a_job = Job(
            {EXPOSURE: test.test_file(EXPOSURE_TEST_FILE), INPUT_REGION: test.test_file(REGION_EXPOSURE_TEST_FILE)}
        )
        self.generated_files.append(a_job.super_config_path)
        a_job._partition()
        blocks_keys = a_job.blocks_keys

        expected_block = job.Block(
            (
                shapes.Site(9.15, 45.16667),
                shapes.Site(9.15333, 45.122),
                shapes.Site(9.14777, 45.17999),
                shapes.Site(9.15765, 45.13005),
                shapes.Site(9.15934, 45.133),
                shapes.Site(9.15876, 45.13805),
            )
        )

        self.assertEqual(1, len(blocks_keys))
        self.assertEqual(expected_block, job.Block.from_kvs(blocks_keys[0]))
開發者ID:VSilva,項目名稱:openquake,代碼行數:23,代碼來源:job_unittest.py


注:本文中的openquake.job.Job._partition方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。