本文整理汇总了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]))
示例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))
示例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]))
示例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]))
示例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]))