本文整理汇总了Python中ipywidgets.VBox方法的典型用法代码示例。如果您正苦于以下问题:Python ipywidgets.VBox方法的具体用法?Python ipywidgets.VBox怎么用?Python ipywidgets.VBox使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ipywidgets
的用法示例。
在下文中一共展示了ipywidgets.VBox方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: download_mutation_images
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import VBox [as 别名]
def download_mutation_images(self):
# TODO: dunno if this works
import ipywidgets
import math
views = []
for g in self.reference_gempro.genes:
if g.protein.representative_structure:
view = g.protein.view_all_mutations(alignment_type='seqalign', grouped=False, structure_opacity=0.5,
opacity_range=(0.6, 1), scale_range=(.5, 5))
view._remote_call("setSize", target='Widget', args=['300px', '300px'])
view.download_image(filename='{}_{}_mutations.png'.format(g.id, g.name))
views.append(view)
hboxes = [ipywidgets.HBox(views[i * 3:i * 3 + 3])
for i in range(int(math.ceil(len(views) / 3.0)))]
vbox = ipywidgets.VBox(hboxes)
return vbox
示例2: define_site_description_time_series
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import VBox [as 别名]
def define_site_description_time_series(self):
'''Widgets for site description parameters'''
self.w_lat = widgets.BoundedFloatText(
value=self.lat, min=-90, max=90, description='Lat.', width=100)
self.w_lon = widgets.BoundedFloatText(
value=self.lon, min=-180, max=180, description='Lon.', width=100)
self.w_alt = widgets.FloatText(
value=self.alt, description='Alt.', width=100)
self.w_stdlon = widgets.BoundedFloatText(
value=self.stdlon, min=-180, max=180, description='Std. Lon.', width=100)
self.w_z_u = widgets.BoundedFloatText(
value=self.zu,
min=0.001,
description='Wind meas. height',
width=100)
self.w_z_T = widgets.BoundedFloatText(
value=self.zt, min=0.001, description='T meas. height', width=100)
self.site_page = widgets.VBox([widgets.HBox([self.w_lat,
self.w_lon,
self.w_alt,
self.w_stdlon]),
widgets.HBox([self.w_z_u,
self.w_z_T])],
background_color='#EEE')
示例3: spectral_properties_time_series
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import VBox [as 别名]
def spectral_properties_time_series(self):
'''Widgets for site spectral properties'''
self.w_rho_vis_C = widgets.BoundedFloatText(
value=self.rho_vis_C, min=0, max=1, description='Leaf refl. PAR', width=80)
self.w_tau_vis_C = widgets.BoundedFloatText(
value=self.tau_vis_C, min=0, max=1, description='Leaf trans. PAR', width=80)
self.w_rho_nir_C = widgets.BoundedFloatText(
value=self.rho_nir_C, min=0, max=1, description='Leaf refl. NIR', width=80)
self.w_tau_nir_C = widgets.BoundedFloatText(
value=self.tau_nir_C, min=0, max=1, description='Leaf trans. NIR', width=80)
self.w_rho_vis_S = widgets.BoundedFloatText(
value=self.rho_vis_S, min=0, max=1, description='Soil refl. PAR', width=80)
self.w_rho_nir_S = widgets.BoundedFloatText(
value=self.rho_nir_S, min=0, max=1, description='Soil refl. NIR', width=80)
self.w_emis_C = widgets.BoundedFloatText(
value=self.emis_C, min=0, max=1, description='Leaf emissivity', width=80)
self.w_emis_S = widgets.BoundedFloatText(
value=self.emis_S, min=0, max=1, description='Soil emissivity', width=80)
self.spec_page = widgets.VBox([widgets.HBox([self.w_rho_vis_C, self.w_tau_vis_C, self.w_rho_nir_C, self.w_tau_nir_C]), widgets.HBox(
[self.w_rho_vis_S, self.w_rho_nir_S, self.w_emis_C, self.w_emis_S])], background_color='#EEE')
示例4: show
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import VBox [as 别名]
def show(self):
box_io = widgets.HBox([self.button_save, self.button_load])
box_control = widgets.HBox([self.button_add, self.button_replace, self.button_remove])
display(
widgets.VBox(
[
self.button_record,
self.select_interpolation,
box_io,
box_control,
self.select_keyframes,
self.camera_action_box,
self.output,
]
)
)
示例5: __init__
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import VBox [as 别名]
def __init__(self, maxs):
"""Initialization.
Positional argument:
maxs - List containing the max value of each progress bar
"""
from IPython.display import display
from ipywidgets import HBox, VBox, IntProgress, Label
self.__bars = [
HBox(
[
IntProgress(0, 0, max, description="{:.2f}%".format(0)),
Label("{} / {}".format(0, max)),
]
)
for max in maxs
]
display(VBox(self.__bars))
示例6: __init__
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import VBox [as 别名]
def __init__(self):
"""IQXDashboard constructor."""
super().__init__()
# A list of job widgets. Each represents a job and has 5 children:
# close button, Job ID, backend, status, and estimated start time.
self.jobs = [] # type: List
self._init_subscriber()
self.dashboard = None # type: Optional[AccordionWithThread]
# Backend dictionary. The keys are the backend names and the values
# are named tuples of ``IBMQBackend`` instances and a list of provider names.
self.backend_dict = None # type: Optional[Dict[str, BackendWithProviders]]
# Jobs tab on the dashboard.
self.job_viewer = None # type: Optional[wid.VBox]
self._clear_jobs_button = make_clear_button(self) # type: wid.GridBox
self._jobs_labels = make_labels() # type: wid.HBox
self.refresh_jobs_board()
示例7: init_rs_ui
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import VBox [as 别名]
def init_rs_ui(self):
"""阻力支撑分析ui"""
with self._init_tip_label_with_step_x(
self._rs_line_analyse, u'支撑阻力线分析', with_step_x=False) as (widget_list, _):
self.rs_mode = widgets.RadioButtons(
options={u'只分析支撑线': 0, u'只分析阻力线': 1, u'支撑线和阻力线': 2},
value=0,
description=u'分析模式:',
disabled=False
)
widget_list.append(self.rs_mode)
self.only_last = widgets.RadioButtons(
options={u'最近的阻力线和支撑线': True, u'所有的阻力线和支撑线': False},
value=True,
description=u'最近的阻力线和支撑线',
disabled=False
)
widget_list.append(self.only_last)
return widgets.VBox(widget_list, # border='solid 1px',
layout=self.tool_layout)
示例8: init_shift_distance_ui
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import VBox [as 别名]
def init_shift_distance_ui(self):
"""位移路程比ui"""
with self._init_tip_label_with_step_x(
self._shift_distance_analyse, u'位移路程分析') as (widget_list, step_x):
self.shift_distance_step_x = step_x
self.shift_distance_mode = widgets.RadioButtons(
options={u'序列最后的元素做为路程基础': 0, u'极限值做为路程的计算基础': 1,
u'序列sum+极值做为路程计算基础': 2},
value=0,
description=u'路程模式:',
disabled=False
)
widget_list.append(self.shift_distance_mode)
return widgets.VBox(widget_list,
# border='solid 1px',
layout=self.tool_layout)
示例9: init_skeleton_ui
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import VBox [as 别名]
def init_skeleton_ui(self):
"""价格骨架ui"""
with self._init_tip_label_with_step_x(
self._skeleton_analyse, u'价格骨架分析') as (widget_list, step_x):
self.skeleton_step_x = step_x
self.skeleton_mode = widgets.RadioButtons(
options={u'骨架通道点位值': 200, u'三角骨架点位值': 100, u'最小值骨架点位值': 0,
u'最大值骨架点位值': 1, u'平均值骨架点位值': 2, u'中位数骨架点位值': 3,
u'最后元素骨架点位值': 4},
value=200,
description=u'骨架模式:',
disabled=False
)
widget_list.append(self.skeleton_mode)
return widgets.VBox(widget_list,
# border='solid 1px',
layout=self.tool_layout)
示例10: _init_widget
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import VBox [as 别名]
def _init_widget(self):
"""构建内置的仓位资金管理可视化组件,构造出self.factor_box"""
from ..WidgetBu.ABuWGPosition import AtrPosWidget, KellyPosWidget, PtPosition
self.pos_array = []
self.pos_array.append(AtrPosWidget(self))
self.pos_array.append(KellyPosWidget(self))
self.pos_array.append(PtPosition(self))
# ps() call用widget组list
children = [pos() for pos in self.pos_array]
if self.scroll_factor_box:
self.factor_box = widgets.Box(children=children,
layout=self.factor_layout)
else:
# 一行显示两个,n个为一组,组装sub_children_group序列,
sub_children_group = self._sub_children(children, len(children) / self._sub_children_group_cnt)
sub_children_box = [widgets.HBox(sub_children) for sub_children in sub_children_group]
self.factor_box = widgets.VBox(sub_children_box)
# 买入因子是特殊的存在,都需要买入因子的全局数据
self.buy_factor_manger = None
示例11: __init__
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import VBox [as 别名]
def __init__(self, wg_manager):
super(WidgetPositionBase, self).__init__(wg_manager)
self.add = widgets.Button(description=u'选定为全局资金管理策略', layout=widgets.Layout(width='98%'),
button_style='info')
# 选定全局资金管理略指令按钮
self.add.on_click(self.add_position)
# 运行混入的BFSubscriberMixin中ui初始化
self.subscriber_ui([u'点击\'已添加的买入策略\'框中的买入策略', u'资金管理做为买入策略的资金管理策略'])
# 买入策略框点击行为:将本卖出策略加到对应的买入策略做为附属
self.buy_factors.observe(self.add_position_to_buy_factor, names='value')
self.accordion.set_title(0, u'添加为指定买入因子的资金管理策略')
accordion_shut(self.accordion)
self.add_box = widgets.VBox([self.add, self.accordion])
# 具体子策略构建
self._init_widget()
示例12: _init_feature_ui
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import VBox [as 别名]
def _init_feature_ui(self):
"""裁判特征采集界面初始化"""
ml_feature_description = widgets.Textarea(
value=u'裁判特征采集\n'
u'裁判是建立在机器学习技术基础上的,所以必然会涉及到特征,abu量化系统支持在回测过程中生成特征数据,切分训练测试集,'
u'甚至成交买单快照图片,通过打开下面的开关即可在生成最终的输出结果数据订单信息上加上买入时刻的很多信息,'
u'比如价格位置、趋势走向、波动情况等等特征, 注意需要生成特征后回测速度效率会降低\n'
u'如在下拉选择中选中\'回测过程生成交易特征\'在回测完成后将保存回测结果,通过在\'裁判特征训练\'可进行查看并进行'
u'裁判训练',
disabled=False,
layout=widgets.Layout(height='150px')
)
self.enable_ml_feature = widgets.Dropdown(
options={u'回测过程不生成交易特征': 0,
u'回测过程生成交易特征': 1},
value=0,
description=u'特征生成:',
)
return widgets.VBox([ml_feature_description, self.enable_ml_feature])
示例13: __init__
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import VBox [as 别名]
def __init__(self,visuals,datasource,**kwargs):
Options.__init__(self,**kwargs)
widgets.VBox.__init__(self,layout=widgets.Layout(width=self.getOpt("width","95%"),height=self.getOpt("height","95%"),border=visuals.getOpt("border","0"),padding=visuals.getOpt("padding","10px"),margin=visuals.getOpt("margin","10px")))
self._visuals = visuals
self._datasource = datasource
self._figure = None
self._data = None
self._layout = None
self._controls = None
self._title = widgets.HTML(layout=widgets.Layout(overflow="hidden"))
self._banner = widgets.VBox([self._title])
示例14: __init__
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import VBox [as 别名]
def __init__(self,visuals,connection,**kwargs):
widgets.VBox.__init__(self,layout=widgets.Layout(border=visuals.getOpt("border","0"),padding=visuals.getOpt("padding","10px"),margin=visuals.getOpt("margin","10px")))
Options.__init__(self,**kwargs)
self._visuals = visuals
self._connection = connection
示例15: _create_widget
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import VBox [as 别名]
def _create_widget(self):
self.addbtn = Button(description='Add')
self.addbtn.on_click(self.add_row_handler)
vbox = VBox([self.addbtn])
vbox.add_class('repeat-innotation')
return vbox