本文整理汇总了Python中nansat.domain.Domain._compound_row_col_vectors方法的典型用法代码示例。如果您正苦于以下问题:Python Domain._compound_row_col_vectors方法的具体用法?Python Domain._compound_row_col_vectors怎么用?Python Domain._compound_row_col_vectors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nansat.domain.Domain
的用法示例。
在下文中一共展示了Domain._compound_row_col_vectors方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_compound_row_col_vectors
# 需要导入模块: from nansat.domain import Domain [as 别名]
# 或者: from nansat.domain.Domain import _compound_row_col_vectors [as 别名]
def test_compound_row_col_vectors(self):
result = Domain._compound_row_col_vectors(30, 40, list(range(0, 33, 3)), list(range(0, 44, 4)))
output_col, output_row = result
self.assertIsInstance(result, tuple)
self.assertEqual(len(result), 2)
test_col = [0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 30, 30, 30, 30, 30,
30, 30, 30, 30, 30, 30, 30, 27, 24, 21, 18, 15, 12, 9, 6, 3,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
test_row = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 8, 12, 16, 20, 24,
28, 32, 36, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
40, 36, 32, 28, 24, 20, 16, 12, 8, 4, 0]
self.assertEqual(output_col, test_col)
self.assertEqual(output_row, test_row)