本文整理汇总了Python中ipywidgets.Textarea方法的典型用法代码示例。如果您正苦于以下问题:Python ipywidgets.Textarea方法的具体用法?Python ipywidgets.Textarea怎么用?Python ipywidgets.Textarea使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ipywidgets
的用法示例。
在下文中一共展示了ipywidgets.Textarea方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _init_feature_ui
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import Textarea [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])
示例2: _init_widget
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import Textarea [as 别名]
def _init_widget(self):
"""构建AbuFactorSellBreak策略参数界面"""
self.description = widgets.Textarea(
value=u'海龟向下趋势突破卖出策略:\n'
u'趋势突破定义为当天收盘价格低于N天内的最低价,作为卖出信号,卖出操作',
description=u'海龟卖出',
disabled=False,
layout=self.description_layout
)
self.xd_label = widgets.Label(u'突破周期参数:比如21,30,42天....突破',
layout=self.label_layout)
self.xd = widgets.IntSlider(
value=10,
min=3,
max=120,
step=1,
description=u'周期',
disabled=False,
orientation='horizontal',
readout=True,
readout_format='d'
)
self.xd_box = widgets.VBox([self.xd_label, self.xd])
self.widget = widgets.VBox([self.description, self.xd_box, self.add_box], # border='solid 1px',
layout=self.widget_layout)
示例3: _init_widget
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import Textarea [as 别名]
def _init_widget(self):
"""构建AbuFactorBuyBreak策略参数界面"""
self.description = widgets.Textarea(
value=u'海龟向上趋势突破买入策略:\n'
u'趋势突破定义为当天收盘价格超过N天内的最高价,超过最高价格作为买入信号买入股票持有',
description=u'海龟买入',
disabled=False,
layout=self.description_layout
)
self.xd_label = widgets.Label(u'突破周期参数:比如21,30,42天....突破', layout=self.label_layout)
self.xd = widgets.IntSlider(
value=21,
min=3,
max=120,
step=1,
description=u'周期',
disabled=False,
orientation='horizontal',
readout=True,
readout_format='d'
)
self.xd_box = widgets.VBox([self.xd_label, self.xd])
self.widget = widgets.VBox([self.description, self.xd_box, self.add], # border='solid 1px',
layout=self.widget_layout)
示例4: _create_widget
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import Textarea [as 别名]
def _create_widget(self):
if self.multiline:
return Textarea(layout=self.layout, disabled=self.disabled)
return Text(layout=self.layout, disabled=self.disabled)
示例5: create_widgets
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import Textarea [as 别名]
def create_widgets(self):
"""
Returns:
"""
select = widgets.Select # Multiple
self.w_group = select(description="Groups:")
self.w_node = select(description="Nodes:")
self.w_file = select(description="Files:")
self.w_text = widgets.HTML()
# self.w_text = widgets.Textarea()
self.w_text.layout.height = "330px"
self.w_text.layout.width = "580px"
self.w_text.disabled = True
# self.w_plot = self.fig
w_list = widgets.VBox([self.w_group, self.w_node, self.w_file])
self.w_tab = widgets.HBox([w_list, self.w_text])
# tab = widgets.Tab(children=[self.w_group, self.w_node, self.w_file, self.w_text])
# [tab.set_title(num, name) for num, name in enumerate(['groups', 'nodes', 'files', 'text'])]
# self.w_tab = tab
self.w_path = widgets.Text(name="Path: ")
self.w_path.layout.width = "680px"
self.w_type = widgets.Text(name="Type: ")
self.refresh_view()
示例6: __init__
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import Textarea [as 别名]
def __init__(self):
self.ch = bioservices.ChEBI()
self.kegg = bioservices.KEGG()
self.wOntologySelect = w.Dropdown(description='Ontology:', options=['ChEBI', 'KEGG.Reaction'])
self.wSearchTerm = w.Text(description='Search Term:', value="glucose")
self.wSearchTerm.on_submit(self.search)
self.wSearchButton = w.Button(description='Search')
self.wSearchButton.on_click(self.search)
self.wResultsSelect = w.Select(description='Results:', width='100%')
self.wResultsSelect.on_trait_change(self.selectedTerm)
self.wResultsURL = w.Textarea(description='URL:', width='100%')
self.wResults = w.VBox(children=[
self.wResultsSelect,
self.wResultsURL
], width='100%')
for ch in self.wResults.children:
ch.font_family = 'monospace'
ch.color = '#AAAAAA'
ch.background_color = 'black'
# <Container>
self.wContainer = w.VBox([
self.wOntologySelect,
self.wSearchTerm,
self.wSearchButton,
self.wResults
])
# display the container
display(self.wContainer)
self.init_display()
示例7: __init__
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import Textarea [as 别名]
def __init__(self):
from pip._vendor.packaging import version
super().__init__()
self.version = ipy.HTML('<div class="nbv-loader"></div>')
self.textarea = ipy.Textarea(layout=ipy.Layout(width='700px', height='300px'))
threading.Thread(target=self.version_check).start()
p1 = os.path.join(mdt.PACKAGEPATH, "HISTORY.rst")
p2 = os.path.join(mdt.PACKAGEPATH, "..", "HISTORY.rst")
if os.path.exists(p1):
path = p1
elif os.path.exists(p2):
path = p2
else:
path = None
if path is not None:
with open(path, 'r') as infile:
self.textarea.value = infile.read()
else:
self.textarea.value = 'HISTORY.rst not found'
self.textarea.disabled = True
self.children = (self.version, self.textarea)
示例8: __init__
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import Textarea [as 别名]
def __init__(self, paramlist, paramdefs, title=None):
super(Configurator, self).__init__(layout=ipy.Layout(display='flex',
flex_flow='column',
align_self='flex-start',
align_items='stretch',
max_width='100%'))
self.paramlist = paramlist
self.paramdefs = paramdefs
self.apply_button = ipy.Button(description='Apply')
self.apply_button.on_click(self.apply_values)
self.reset_button = ipy.Button(description='Reset')
self.reset_button.on_click(self.reset_values)
self.buttons = ipy.Box([self.reset_button, self.apply_button],
layout=ipy.Layout(align_self='center'))
self.selectors = collections.OrderedDict([(p.name, ParamSelector(p)) for p in paramdefs])
self.reset_values()
title = utils.if_not_none(title, 'Configuration')
self.title = ipy.HTML('<center><h4>%s</h4></center><hr>' % title,
align_self='center')
self.currentconfig = ipy.Textarea(description='<i>Current params</i>',
disabled=True,
value=self._pretty_print_config(),
layout=ipy.Layout(width='350px', min_height='300px',
max_height='500px',
display='flex', flex_flow='column'))
self.middle = HBox([VBox(list(self.selectors.values())), self.currentconfig])
self.children = [self.title, self.middle, self.buttons]
示例9: __init__
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import Textarea [as 别名]
def __init__(self, widget=None):
"""
Initialize the handler.
If stream is not specified, sys.stderr is used.
"""
super(WidgetValueHandler, self).__init__()
self.buffer = []
if widget is None:
self.widget = ipy.Textarea()
else:
self.widget = widget
示例10: init_regress_ui
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import Textarea [as 别名]
def init_regress_ui(self):
"""线性拟合ui"""
with self._init_tip_label_with_step_x(
self._regress_analyse, u'线性拟合分析') as (widget_list, step_x):
self.regress_step_x = step_x
self.regress_mode_description = widgets.Textarea(
value=u'1. 技术线最少拟合次数:\n'
u'检测至少多少次拟合曲线可以代表原始曲线y的走势,'
u'通过度量始y值和均线y_roll_mean的距离和原始y值和拟合回归的趋势曲线y_fit的距离的方法,默认使用metrics_rmse\n'
u'2. 技术线最优拟合次数:\n'
u'寻找多少次多项式拟合回归的趋势曲线可以完美的代表原始曲线y的走势\n'
u'3. 可视化技术线拟合曲线:\n'
u'通过步长参数在子金融序列中进行走势拟合,形成拟合曲线及上下拟合通道曲线,返回三条拟合曲线,组成拟合通道',
disabled=False,
layout=self.description_layout
)
widget_list.append(self.regress_mode_description)
self.regress_mode = widgets.RadioButtons(
options={u'技术线最少拟合次数': 0, u'技术线最优拟合次数': 1,
u'可视化技术线拟合曲线': 2},
value=0,
description=u'拟合模式:',
disabled=False
)
widget_list.append(self.regress_mode)
return widgets.VBox(widget_list,
# border='solid 1px',
layout=self.tool_layout)
示例11: _init_manager_ui
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import Textarea [as 别名]
def _init_manager_ui(self):
"""裁判数据管理界面初始化"""
description = widgets.Textarea(
value=u'删除选择的裁判本地数据:\n'
u'删除所选择的已训练好的本地裁判数据,谨慎操作!\n'
u'分享选择的裁判:\n'
u'将训练好的裁判数据分享到交易社区,供其他交易者使用\n'
u'下载更多的裁判:\n'
u'从交易社区,下载更多训练好的裁判数据\n',
disabled=False,
layout=widgets.Layout(height='150px')
)
self.manager_umps = widgets.Select(
options=[],
description=u'本地裁判:',
disabled=False,
layout=widgets.Layout(width='100%', align_items='stretch')
)
self.load_train_ump(self.manager_umps)
delete_bt = widgets.Button(description=u'删除选择的裁判本地数据', layout=widgets.Layout(width='98%'),
button_style='warning')
delete_bt.on_click(self._do_delete_ump)
share_bt = widgets.Button(description=u'分享选择的裁判', layout=widgets.Layout(width='98%'),
button_style='info')
share_bt.on_click(permission_denied)
down_bt = widgets.Button(description=u'下载更多的裁判', layout=widgets.Layout(width='98%'),
button_style='info')
down_bt.on_click(permission_denied)
return widgets.VBox([description, self.manager_umps, delete_bt, share_bt, down_bt])
示例12: _init_train_ui
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import Textarea [as 别名]
def _init_train_ui(self):
"""裁判特征训练面初始化"""
description = widgets.Textarea(
value=u'裁判特征训练:\n'
u'通过在\'裁判特征采集\'选中\'回测过程生成交易特征\'可在回测完成后保存当此回测结果\n'
u'所有回测的结果将显示在下面的\'备选回测:\'框中\n'
u'通过\'开始训练裁判\'进行指定的回测裁判训练,训练后的裁判在\'裁判预测拦截\'下可进行选择,选中的裁判将在对应的'
u'回测中生效,即开始在回测中对交易进行预测拦截等智能交易干涉行为',
disabled=False,
layout=widgets.Layout(height='150px')
)
self.abu_result = widgets.Select(
options=[],
description=u'备选回测:',
disabled=False,
layout=widgets.Layout(width='100%', align_items='stretch')
)
self.load_abu_result()
train_bt = widgets.Button(description=u'开始训练裁判', layout=widgets.Layout(width='98%'),
button_style='info')
train_bt.on_click(self._do_train)
delete_bt = widgets.Button(description=u'删除选择的备选回测本地数据', layout=widgets.Layout(width='98%'),
button_style='warning')
delete_bt.on_click(self._do_delete_abu_result)
return widgets.VBox([description, self.abu_result, train_bt, delete_bt])
示例13: init_coint_corr_ui
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import Textarea [as 别名]
def init_coint_corr_ui(self):
"""全市场协整相关分析ui"""
with self._init_widget_list_action(self.coint_corr_market_analyse, u'全市场协整相关分析', 1) as widget_list:
coint_similar_description = widgets.Textarea(
value=u'全市场协整相关分析: \n'
u'综合利用相关和协整的特性返回查询的股票是否有统计套利的交易机会\n'
u'1. 通过相关性分析筛选出与查询股票最相关的前100支股票作为种子\n'
u'2. 从种子中通过计算协整程度来度量查询股票是否存在统计套利机会\n'
u'3. 可视化整个过程\n',
disabled=False,
layout=self.description_layout
)
widget_list.append(coint_similar_description)
tip_label1 = widgets.Label(u'全市场相对相关分析不支持实时网络数据模式', layout=self.label_layout)
tip_label2 = widgets.Label(u'非沙盒模式需先用\'数据下载界面操作\'进行下载', layout=self.label_layout)
self.coint_corr_data_mode = widgets.RadioButtons(
options={u'沙盒数据模式': True, u'本地数据模式': False},
value=True,
description=u'数据模式:',
disabled=False
)
corr_market_box = widgets.VBox([tip_label1, tip_label2, self.coint_corr_data_mode])
widget_list.append(corr_market_box)
return widgets.VBox(widget_list, # border='solid 1px',
layout=self.tool_layout)
示例14: init_relative_corr_ui
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import Textarea [as 别名]
def init_relative_corr_ui(self):
"""全市场相对相关分析ui"""
with self._init_widget_list_action(self.corr_relative_market_analyse, u'全市场相对相关分析', 2) as widget_list:
relative_description = widgets.Textarea(
value=u'全市场相对相关分析: \n'
u'度量的是两目标(a,b)相对整个市场的相关性评级,它不关心某一个股票具体相关性的数值的大小\n'
u'1. 计算a与市场中所有股票的相关性\n'
u'2. 将所有相关性进行rank排序\n'
u'3. 查询股票b在rank序列中的位置,此位置值即为结果\n',
disabled=False,
layout=self.description_layout
)
widget_list.append(relative_description)
tip_label1 = widgets.Label(u'全市场相对相关分析不支持实时网络数据模式', layout=self.label_layout)
tip_label2 = widgets.Label(u'非沙盒模式需先用\'数据下载界面操作\'进行下载', layout=self.label_layout)
self.relative_corr_data_mode = widgets.RadioButtons(
options={u'沙盒数据模式': True, u'本地数据模式': False},
value=True,
description=u'数据模式:',
disabled=False
)
corr_market_box = widgets.VBox([tip_label1, tip_label2, self.relative_corr_data_mode])
widget_list.append(corr_market_box)
return widgets.VBox(widget_list, # border='solid 1px',
layout=self.tool_layout)
示例15: _init_widget
# 需要导入模块: import ipywidgets [as 别名]
# 或者: from ipywidgets import Textarea [as 别名]
def _init_widget(self):
"""构建AbuPickStockNTop策略参数界面"""
self.description = widgets.Textarea(
value=u'涨跌幅top N选股因子策略:\n'
u'选股周期上对多只股票涨跌幅进行排序,选取top n个股票做为交易目标:\n'
u'(只对在股池中选定的symbol序列生效,对全市场回测暂时不生效)\n',
description=u'top N涨跌',
disabled=False,
layout=self.description_layout
)
n_top_label = widgets.Label(u'设定选取top个交易目标数量,默认3', layout=self.label_layout)
self.n_top = widgets.IntText(
value=3,
description=u'TOP N',
disabled=False
)
self.n_top_box = widgets.VBox([n_top_label, self.n_top])
direction_top_label1 = widgets.Label(u'direction_top参数的意义为选取方向:', layout=self.label_layout)
direction_top_label2 = widgets.Label(u'默认值为正:即选取涨幅最高的n_top个股票', layout=self.label_layout)
direction_top_label3 = widgets.Label(u'可设置为负:即选取跌幅最高的n_top个股票', layout=self.label_layout)
self.direction_top = widgets.Dropdown(
options={u'正(涨幅)': 1, u'负(跌幅)': -1},
value=1,
description=u'选取方向:',
)
self.direction_top_box = widgets.VBox([direction_top_label1, direction_top_label2, direction_top_label3,
self.direction_top])
self.widget = widgets.VBox([self.description, self.n_top_box, self.direction_top_box,
self.xd_box, self.reversed_box, self.add_box],
# border='solid 1px',
layout=self.widget_layout)