本文整理汇总了Python中landlab.Palette.values方法的典型用法代码示例。如果您正苦于以下问题:Python Palette.values方法的具体用法?Python Palette.values怎么用?Python Palette.values使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类landlab.Palette
的用法示例。
在下文中一共展示了Palette.values方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_1_component_dict_interface
# 需要导入模块: from landlab import Palette [as 别名]
# 或者: from landlab.Palette import values [as 别名]
def test_1_component_dict_interface():
palette = Palette(sample=Sample1)
assert_dict_equal(dict(sample=Sample1), palette)
assert_equal(len(palette), 1)
assert_equal(palette.keys(), ['sample'])
assert_equal(palette.values(), [Sample1])
items = palette.items()
assert_tuple_equal(('sample', Sample1), items[0])
示例2: test_dict_interface
# 需要导入模块: from landlab import Palette [as 别名]
# 或者: from landlab.Palette import values [as 别名]
def test_dict_interface(self):
palette = Palette(sample=Sample1)
self.assertDictEqual(dict(sample=Sample1), palette)
self.assertEqual(len(palette), 1)
self.assertEqual(palette.keys(), ['sample'])
self.assertEqual(palette.values(), [Sample1])
items = palette.items()
self.assertTupleEqual(('sample', Sample1), items[0])
示例3: test_1_component_dict_interface
# 需要导入模块: from landlab import Palette [as 别名]
# 或者: from landlab.Palette import values [as 别名]
def test_1_component_dict_interface():
palette = Palette(sample=Sample1)
assert dict(sample=Sample1) == palette
assert len(palette) == 1
assert list(palette.keys()) == ["sample"]
assert list(palette.values()) == [Sample1]
items = list(palette.items())
assert ("sample", Sample1) == items[0]
示例4: test_2_components_dict_interface
# 需要导入模块: from landlab import Palette [as 别名]
# 或者: from landlab.Palette import values [as 别名]
def test_2_components_dict_interface():
palette = Palette(one=Sample1, two=Sample2)
assert_dict_equal(dict(one=Sample1, two=Sample2), palette)
assert_equal(len(palette), 2)
keys = palette.keys()
keys.sort()
assert_list_equal(['one', 'two'], keys)
values = palette.values()
assert_equal(2, len(values))
assert_true(Sample1 in values and Sample2 in values)
items = palette.items()
items.sort()
assert_equal(2, len(items))
assert_tuple_equal(('one', Sample1), items[0])
assert_tuple_equal(('two', Sample2), items[1])
示例5: test_2_components_dict_interface
# 需要导入模块: from landlab import Palette [as 别名]
# 或者: from landlab.Palette import values [as 别名]
def test_2_components_dict_interface():
palette = Palette(one=Sample1, two=Sample2)
assert dict(one=Sample1, two=Sample2) == palette
assert len(palette) == 2
keys = list(palette.keys())
keys.sort()
assert ["one", "two"] == keys
values = palette.values()
assert 2 == len(values)
assert Sample1 in values and Sample2 in values
items = list(palette.items())
items.sort()
assert 2 == len(items)
assert ("one", Sample1) == items[0]
assert ("two", Sample2) == items[1]