本文整理匯總了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)