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


Python Store.lookup_options方法代码示例

本文整理汇总了Python中holoviews.core.options.Store.lookup_options方法的典型用法代码示例。如果您正苦于以下问题:Python Store.lookup_options方法的具体用法?Python Store.lookup_options怎么用?Python Store.lookup_options使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在holoviews.core.options.Store的用法示例。


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

示例1: test_apply_options_when_backend_switched

# 需要导入模块: from holoviews.core.options import Store [as 别名]
# 或者: from holoviews.core.options.Store import lookup_options [as 别名]
 def test_apply_options_when_backend_switched(self):
     obj = TestObj([])
     Store.current_backend = 'backend_2'
     obj.opts(style_opt1='A', plot_opt1='B')
     Store.current_backend = 'backend_1'
     obj.opts(style_opt1='C', plot_opt1='D', backend='backend_2')
     plot_opts = Store.lookup_options('backend_2', obj, 'plot')
     assert plot_opts.options == {'plot_opt1': 'D'}
     style_opts = Store.lookup_options('backend_2', obj, 'style')
     assert style_opts.options == {'style_opt1': 'C'}
开发者ID:basnijholt,项目名称:holoviews,代码行数:12,代码来源:testdimensioned.py

示例2: test_overlay_options_complete

# 需要导入模块: from holoviews.core.options import Store [as 别名]
# 或者: from holoviews.core.options.Store import lookup_options [as 别名]
    def test_overlay_options_complete(self):
        """
        Complete specification style.
        """
        data = [zip(range(10), range(10)), zip(range(5), range(5))]
        o = Overlay([Curve(c) for c in data])({"Curve.Curve": {"plot": {"show_grid": True}, "style": {"color": "b"}}})

        self.assertEqual(Store.lookup_options("matplotlib", o.Curve.I, "plot").kwargs["show_grid"], True)
        self.assertEqual(Store.lookup_options("matplotlib", o.Curve.II, "plot").kwargs["show_grid"], True)
        self.assertEqual(Store.lookup_options("matplotlib", o.Curve.I, "style").kwargs["color"], "b")
        self.assertEqual(Store.lookup_options("matplotlib", o.Curve.II, "style").kwargs["color"], "b")
开发者ID:prabhuramachandran,项目名称:holoviews,代码行数:13,代码来源:teststoreoptions.py

示例3: test_apply_options_explicit_backend_persists_other_backend_inverted

# 需要导入模块: from holoviews.core.options import Store [as 别名]
# 或者: from holoviews.core.options.Store import lookup_options [as 别名]
 def test_apply_options_explicit_backend_persists_other_backend_inverted(self):
     obj = TestObj([])
     obj.opts(style_opt1='A', plot_opt1='B', backend='backend_2')
     obj.opts(style_opt1='C', plot_opt1='D', backend='backend_1')
     plot_opts = Store.lookup_options('backend_1', obj, 'plot')
     assert plot_opts.options == {'plot_opt1': 'D'}
     style_opts = Store.lookup_options('backend_1', obj, 'style')
     assert style_opts.options == {'style_opt1': 'C'}
     plot_opts = Store.lookup_options('backend_2', obj, 'plot')
     assert plot_opts.options == {'plot_opt1': 'B'}
     style_opts = Store.lookup_options('backend_2', obj, 'style')
     assert style_opts.options == {'style_opt1': 'A'}
开发者ID:basnijholt,项目名称:holoviews,代码行数:14,代码来源:testdimensioned.py

示例4: test_overlay_options_partitioned

# 需要导入模块: from holoviews.core.options import Store [as 别名]
# 或者: from holoviews.core.options.Store import lookup_options [as 别名]
    def test_overlay_options_partitioned(self):
        """
        The new style introduced in #73
        """
        data = [zip(range(10), range(10)), zip(range(5), range(5))]
        o = Overlay([Curve(c) for c in data])(
            dict(plot={"Curve.Curve": {"show_grid": False}}, style={"Curve.Curve": {"color": "k"}})
        )

        self.assertEqual(Store.lookup_options("matplotlib", o.Curve.I, "plot").kwargs["show_grid"], False)
        self.assertEqual(Store.lookup_options("matplotlib", o.Curve.II, "plot").kwargs["show_grid"], False)
        self.assertEqual(Store.lookup_options("matplotlib", o.Curve.I, "style").kwargs["color"], "k")
        self.assertEqual(Store.lookup_options("matplotlib", o.Curve.II, "style").kwargs["color"], "k")
开发者ID:prabhuramachandran,项目名称:holoviews,代码行数:15,代码来源:teststoreoptions.py

示例5: test_dynamic_opts_link_inputs

# 需要导入模块: from holoviews.core.options import Store [as 别名]
# 或者: from holoviews.core.options.Store import lookup_options [as 别名]
 def test_dynamic_opts_link_inputs(self):
     stream = LinkedStream()
     inputs = [DynamicMap(lambda: None, streams=[stream])]
     dmap = DynamicMap(Callable(lambda X: TestObj(None), inputs=inputs),
                       kdims=['X']).redim.range(X=(0,10))
     styled_dmap = dmap.options(plot_opt1='red', clone=False)
     opts = Store.lookup_options('backend_1', dmap[0], 'plot')
     self.assertEqual(opts.options, {'plot_opt1': 'red'})
     self.assertIs(styled_dmap, dmap)
     self.assertTrue(dmap.callback.link_inputs)
     unstyled_dmap = dmap.callback.inputs[0].callback.inputs[0]
     opts = Store.lookup_options('backend_1', unstyled_dmap[0], 'plot')
     self.assertEqual(opts.options, {})
     original_dmap = unstyled_dmap.callback.inputs[0]
     self.assertIs(stream, original_dmap.streams[0])
开发者ID:basnijholt,项目名称:holoviews,代码行数:17,代码来源:testdynamic.py

示例6: test_layout_options_long_style

# 需要导入模块: from holoviews.core.options import Store [as 别名]
# 或者: from holoviews.core.options.Store import lookup_options [as 别名]
 def test_layout_options_long_style(self):
     """
     The old (longer) syntax in __call__
     """
     im = Image(np.random.rand(10, 10))
     layout = (im + im)({"Layout": dict(plot={"hspace": 10})})
     self.assertEqual(Store.lookup_options("matplotlib", layout, "plot").kwargs["hspace"], 10)
开发者ID:prabhuramachandran,项目名称:holoviews,代码行数:9,代码来源:teststoreoptions.py

示例7: test_layout_options_short_style

# 需要导入模块: from holoviews.core.options import Store [as 别名]
# 或者: from holoviews.core.options.Store import lookup_options [as 别名]
 def test_layout_options_short_style(self):
     """
     Short __call__ syntax.
     """
     im = Image(np.random.rand(10, 10))
     layout = (im + im)({"Layout": dict(plot={"hspace": 5})})
     self.assertEqual(Store.lookup_options("matplotlib", layout, "plot").kwargs["hspace"], 5)
开发者ID:prabhuramachandran,项目名称:holoviews,代码行数:9,代码来源:teststoreoptions.py

示例8: test_overlay_options_partitioned

# 需要导入模块: from holoviews.core.options import Store [as 别名]
# 或者: from holoviews.core.options.Store import lookup_options [as 别名]
    def test_overlay_options_partitioned(self):
        """
        The new style introduced in #73
        """
        data = [zip(range(10),range(10)), zip(range(5),range(5))]
        o = Overlay([Curve(c) for c in data])(
            dict(plot={'Curve.Curve':{'show_grid':False}},
                 style={'Curve.Curve':{'color':'k'}}))

        self.assertEqual(Store.lookup_options(
            o.Curve.I, 'plot').kwargs['show_grid'], False)
        self.assertEqual(Store.lookup_options(
            o.Curve.II, 'plot').kwargs['show_grid'], False)
        self.assertEqual(Store.lookup_options(
            o.Curve.I, 'style').kwargs['color'], 'k')
        self.assertEqual(Store.lookup_options(
            o.Curve.II, 'style').kwargs['color'], 'k')
开发者ID:cmiller8,项目名称:holoviews,代码行数:19,代码来源:teststoreoptions.py

示例9: test_layout_options_short_style

# 需要导入模块: from holoviews.core.options import Store [as 别名]
# 或者: from holoviews.core.options.Store import lookup_options [as 别名]
 def test_layout_options_short_style(self):
     """
     Short __call__ syntax.
     """
     im = Image(np.random.rand(10,10))
     layout = (im + im)({'Layout':dict(plot={'hspace':5})})
     self.assertEqual(Store.lookup_options(
         layout, 'plot').kwargs['hspace'], 5)
开发者ID:cmiller8,项目名称:holoviews,代码行数:10,代码来源:teststoreoptions.py

示例10: test_layout_options_long_style

# 需要导入模块: from holoviews.core.options import Store [as 别名]
# 或者: from holoviews.core.options.Store import lookup_options [as 别名]
 def test_layout_options_long_style(self):
     """
     The old (longer) syntax in __call__
     """
     im = Image(np.random.rand(10,10))
     layout = (im + im)({'Layout':dict(plot={'hspace':10})})
     self.assertEqual(Store.lookup_options(
         layout, 'plot').kwargs['hspace'], 10)
开发者ID:cmiller8,项目名称:holoviews,代码行数:10,代码来源:teststoreoptions.py

示例11: test_overlay_options_complete

# 需要导入模块: from holoviews.core.options import Store [as 别名]
# 或者: from holoviews.core.options.Store import lookup_options [as 别名]
    def test_overlay_options_complete(self):
        """
        Complete specification style.
        """
        data = [zip(range(10),range(10)), zip(range(5),range(5))]
        o = Overlay([Curve(c) for c in data])(
            {'Curve.Curve':{'plot':{'show_grid':True},
                            'style':{'color':'b'}}})

        self.assertEqual(Store.lookup_options(
            o.Curve.I, 'plot').kwargs['show_grid'], True)
        self.assertEqual(Store.lookup_options(
            o.Curve.II, 'plot').kwargs['show_grid'], True)
        self.assertEqual(Store.lookup_options(
            o.Curve.I, 'style').kwargs['color'], 'b')
        self.assertEqual(Store.lookup_options(
            o.Curve.II, 'style').kwargs['color'], 'b')
开发者ID:cmiller8,项目名称:holoviews,代码行数:19,代码来源:teststoreoptions.py

示例12: test_cell_opts_norm

# 需要导入模块: from holoviews.core.options import Store [as 别名]
# 或者: from holoviews.core.options.Store import lookup_options [as 别名]
    def test_cell_opts_norm(self):

        self.cell("mat1 = Image(np.random.rand(5,5), name='mat1')")

        self.assertEqual(self.get_object('mat1').id, None)
        self.cell_magic('opts', " Image {+axiswise}", 'mat1')
        self.assertEqual(self.get_object('mat1').id, 0)

        assert 0 in Store.custom_options, "Custom OptionTree creation failed"
        self.assertEqual(
            Store.lookup_options(self.get_object('mat1'), 'norm').options.get('axiswise',True), True)
开发者ID:aashish24,项目名称:holoviews,代码行数:13,代码来源:testmagics.py

示例13: test_cell_opts_style

# 需要导入模块: from holoviews.core.options import Store [as 别名]
# 或者: from holoviews.core.options.Store import lookup_options [as 别名]
    def test_cell_opts_style(self):

        self.cell("mat1 = Image(np.random.rand(5,5), name='mat1')")

        self.assertEqual(self.get_object('mat1').id, None)
        self.cell_magic('opts', " Image (cmap='hot')", 'mat1')
        self.assertEqual(self.get_object('mat1').id, 0)

        assert 0 in Store.custom_options, "Custom OptionTree creation failed"
        self.assertEqual(
            Store.lookup_options(self.get_object('mat1'), 'style').options.get('cmap',None),'hot')
开发者ID:aashish24,项目名称:holoviews,代码行数:13,代码来源:testmagics.py

示例14: test_cell_opts_plot

# 需要导入模块: from holoviews.core.options import Store [as 别名]
# 或者: from holoviews.core.options.Store import lookup_options [as 别名]
    def test_cell_opts_plot(self):

        self.cell("mat1 = Image(np.random.rand(5,5), name='mat1')")

        self.assertEqual(self.get_object('mat1').id, None)
        self.cell_magic('opts', " Image [show_title=False]", 'mat1')
        self.assertEqual(self.get_object('mat1').id, 0)

        assert 0 in Store.custom_options, "Custom OptionTree creation failed"
        self.assertEqual(
            Store.lookup_options(self.get_object('mat1'), 'plot').options.get('show_title',True),False)
开发者ID:aashish24,项目名称:holoviews,代码行数:13,代码来源:testmagics.py

示例15: test_cell_opts_plot_float_division

# 需要导入模块: from holoviews.core.options import Store [as 别名]
# 或者: from holoviews.core.options.Store import lookup_options [as 别名]
    def test_cell_opts_plot_float_division(self):

        self.cell("mat1 = Image(np.random.rand(5,5), name='mat1')")

        self.assertEqual(self.get_object('mat1').id, None)
        self.cell_magic('opts', " Image [aspect=3/4]", 'mat1')
        self.assertEqual(self.get_object('mat1').id, 0)

        assert 0 in Store.custom_options(), "Custom OptionTree creation failed"
        self.assertEqual(
            Store.lookup_options('matplotlib',
                                 self.get_object('mat1'), 'plot').options.get('aspect',False), 3/4.0)
开发者ID:mforbes,项目名称:holoviews,代码行数:14,代码来源:testmagics.py


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