当前位置: 首页>>代码示例>>Python>>正文


Python landlab.Palette类代码示例

本文整理汇总了Python中landlab.Palette的典型用法代码示例。如果您正苦于以下问题:Python Palette类的具体用法?Python Palette怎么用?Python Palette使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Palette类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_provides

    def test_provides(self):
        palette = Palette(one=Sample1, two=Sample2)

        provides = palette.provides()
        provides.sort()
        self.assertListEqual(['air__temperature',
                              'deposition__rate',
                              'surface__elevation'], provides)
开发者ID:JianweiHan,项目名称:landlab,代码行数:8,代码来源:test_collections.py

示例2: test_find_providers

    def test_find_providers(self):
        palette = Palette(one=Sample1, two=Sample2)

        providers = palette.find_provider('air__temperature')
        self.assertListEqual(['two'], providers)

        providers = palette.find_provider('deposition__rate')
        self.assertEqual(['one'], providers)
开发者ID:JianweiHan,项目名称:landlab,代码行数:8,代码来源:test_collections.py

示例3: test_2_components_find_providers

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
开发者ID:landlab,项目名称:landlab,代码行数:8,代码来源:test_collections.py

示例4: test_2_components_find_connections

def test_2_components_find_connections():
    palette = Palette(one=Sample1, two=Sample2)

    connections = {
        "one": {"deposition__rate": ["two"]},
        "two": {"air__temperature": ["one"], "surface__elevation": ["one"]},
    }
    assert connections == palette.find_connections()
开发者ID:landlab,项目名称:landlab,代码行数:8,代码来源:test_collections.py

示例5: test_1_component_find_providers

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'])
开发者ID:Kirubaharan,项目名称:landlab,代码行数:8,代码来源:test_collections.py

示例6: test_1_component_find_providers

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"]
开发者ID:landlab,项目名称:landlab,代码行数:8,代码来源:test_collections.py

示例7: test_2_components_provides

def test_2_components_provides():
    palette = Palette(one=Sample1, two=Sample2)

    provides = palette.provides()
    provides.sort()
    assert_list_equal(['air__temperature',
                       'deposition__rate',
                       'surface__elevation'], provides)
开发者ID:Kirubaharan,项目名称:landlab,代码行数:8,代码来源:test_collections.py

示例8: test_2_components_find_providers

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)
开发者ID:Kirubaharan,项目名称:landlab,代码行数:8,代码来源:test_collections.py

示例9: test_find_connections

    def test_find_connections(self):
        palette = Palette(one=Sample1, two=Sample2)

        connections = {
            'one': {'deposition__rate': ['two']},
            'two': {'air__temperature': ['one'],
                    'surface__elevation': ['one']},
        }
        self.assertDictEqual(connections, palette.find_connections())
开发者ID:JianweiHan,项目名称:landlab,代码行数:9,代码来源:test_collections.py

示例10: test_2_components_find_connections

def test_2_components_find_connections():
    palette = Palette(one=Sample1, two=Sample2)

    connections = {
        'one': {'deposition__rate': ['two']},
        'two': {'air__temperature': ['one'],
                'surface__elevation': ['one']},
    }
    assert_dict_equal(connections, palette.find_connections())
开发者ID:Kirubaharan,项目名称:landlab,代码行数:9,代码来源:test_collections.py

示例11: test_1_component_dict_interface

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]
开发者ID:landlab,项目名称:landlab,代码行数:10,代码来源:test_collections.py

示例12: test_1_component_dict_interface

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])
开发者ID:Kirubaharan,项目名称:landlab,代码行数:10,代码来源:test_collections.py

示例13: test_dict_interface

    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])
开发者ID:JianweiHan,项目名称:landlab,代码行数:10,代码来源:test_collections.py

示例14: test_2_components_dict_interface

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]
开发者ID:landlab,项目名称:landlab,代码行数:19,代码来源:test_collections.py

示例15: test_2_components_dict_interface

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])
开发者ID:Kirubaharan,项目名称:landlab,代码行数:19,代码来源:test_collections.py


注:本文中的landlab.Palette类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。