本文整理汇总了Python中landlab.Palette.find_provider方法的典型用法代码示例。如果您正苦于以下问题:Python Palette.find_provider方法的具体用法?Python Palette.find_provider怎么用?Python Palette.find_provider使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类landlab.Palette
的用法示例。
在下文中一共展示了Palette.find_provider方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_1_component_find_providers
# 需要导入模块: from landlab import Palette [as 别名]
# 或者: from landlab.Palette import find_provider [as 别名]
def test_1_component_find_providers():
palette = Palette(sample=Sample1)
providers = palette.find_provider('air__temperature')
assert_equal(providers, [])
providers = palette.find_provider('deposition__rate')
assert_equal(providers, ['sample'])
示例2: test_find_providers
# 需要导入模块: from landlab import Palette [as 别名]
# 或者: from landlab.Palette import find_provider [as 别名]
def test_find_providers(self):
palette = Palette(sample=Sample1)
providers = palette.find_provider('air__temperature')
self.assertEqual(providers, [])
providers = palette.find_provider('deposition__rate')
self.assertEqual(providers, ['sample'])
示例3: test_2_components_find_providers
# 需要导入模块: from landlab import Palette [as 别名]
# 或者: from landlab.Palette import find_provider [as 别名]
def test_2_components_find_providers():
palette = Palette(one=Sample1, two=Sample2)
providers = palette.find_provider('air__temperature')
assert_list_equal(['two'], providers)
providers = palette.find_provider('deposition__rate')
assert_equal(['one'], providers)
示例4: test_2_components_find_providers
# 需要导入模块: from landlab import Palette [as 别名]
# 或者: from landlab.Palette import find_provider [as 别名]
def test_2_components_find_providers():
palette = Palette(one=Sample1, two=Sample2)
providers = palette.find_provider("air__temperature")
assert ["two"] == providers
providers = palette.find_provider("deposition__rate")
assert ["one"] == providers
示例5: test_1_component_find_providers
# 需要导入模块: from landlab import Palette [as 别名]
# 或者: from landlab.Palette import find_provider [as 别名]
def test_1_component_find_providers():
palette = Palette(sample=Sample1)
providers = palette.find_provider("air__temperature")
assert providers == []
providers = palette.find_provider("deposition__rate")
assert providers == ["sample"]
示例6: test_empty_palette
# 需要导入模块: from landlab import Palette [as 别名]
# 或者: from landlab.Palette import find_provider [as 别名]
def test_empty_palette():
"""Create a palette without components."""
palette = Palette()
assert len(palette) == 0
assert list(palette.list()) == []
assert list(palette.keys()) == []
assert palette.uses() == []
assert palette.provides() == []
providers = palette.find_provider("air__temperature")
assert providers == []
users = palette.find_user("air__temperature")
assert users == []
connections = palette.find_connections()
assert connections == {}
示例7: test_empty_palette
# 需要导入模块: from landlab import Palette [as 别名]
# 或者: from landlab.Palette import find_provider [as 别名]
def test_empty_palette():
"""Create a palette without components."""
palette = Palette()
assert_equal(len(palette), 0)
assert_equal(list(palette.list()), [])
assert_equal(list(palette.keys()), [])
assert_equal(palette.uses(), [])
assert_equal(palette.provides(), [])
providers = palette.find_provider('air__temperature')
assert_equal(providers, [])
users = palette.find_user('air__temperature')
assert_equal(users, [])
connections = palette.find_connections()
assert_dict_equal(connections, {})