本文整理汇总了Python中Orange.canvas.report.owreport.OWReport.get_instance方法的典型用法代码示例。如果您正苦于以下问题:Python OWReport.get_instance方法的具体用法?Python OWReport.get_instance怎么用?Python OWReport.get_instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Orange.canvas.report.owreport.OWReport
的用法示例。
在下文中一共展示了OWReport.get_instance方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_report_widgets_visualize
# 需要导入模块: from Orange.canvas.report.owreport import OWReport [as 别名]
# 或者: from Orange.canvas.report.owreport.OWReport import get_instance [as 别名]
def test_report_widgets_visualize(self):
app = QApplication(sys.argv)
rep = OWReport.get_instance()
data = Table("zoo")
widgets = self.visu_widgets
self.assertEqual(len(widgets), 10)
self._create_report(widgets, rep, data, app)
示例2: test_report_widgets_all
# 需要导入模块: from Orange.canvas.report.owreport import OWReport [as 别名]
# 或者: from Orange.canvas.report.owreport.OWReport import get_instance [as 别名]
def test_report_widgets_all(self):
rep = OWReport.get_instance()
widgets = self.clas_widgets + self.data_widgets + self.eval_widgets + \
self.regr_widgets + self.unsu_widgets + self.dist_widgets + \
self.visu_widgets + self.spec_widgets
self.assertEqual(len(widgets), 52)
self._create_report(widgets, rep, None)
示例3: test_report_widgets_all
# 需要导入模块: from Orange.canvas.report.owreport import OWReport [as 别名]
# 或者: from Orange.canvas.report.owreport.OWReport import get_instance [as 别名]
def test_report_widgets_all(self):
app = QApplication(sys.argv)
rep = OWReport.get_instance()
widgets = self.clas_widgets + self.data_widgets + self.eval_widgets + \
self.regr_widgets + self.unsu_widgets + self.dist_widgets + \
self.visu_widgets + self.spec_widgets
self.assertEqual(len(widgets), 51)
self._create_report(widgets, rep, None, app)
示例4: test_report
# 需要导入模块: from Orange.canvas.report.owreport import OWReport [as 别名]
# 或者: from Orange.canvas.report.owreport.OWReport import get_instance [as 别名]
def test_report(self):
count = 5
app = QApplication(sys.argv)
for i in range(count):
rep = OWReport.get_instance()
file = OWFile()
file.create_report_html()
rep.make_report(file)
self.assertEqual(rep.table_model.rowCount(), count)
示例5: show_report
# 需要导入模块: from Orange.canvas.report.owreport import OWReport [as 别名]
# 或者: from Orange.canvas.report.owreport.OWReport import get_instance [as 别名]
def show_report(self):
"""
Raise the report window.
"""
from Orange.canvas.report.owreport import OWReport
report = OWReport.get_instance()
self.create_report_html()
report.make_report(self)
report.show()
report.raise_()
示例6: test_save_report_permission
# 需要导入模块: from Orange.canvas.report.owreport import OWReport [as 别名]
# 或者: from Orange.canvas.report.owreport.OWReport import get_instance [as 别名]
def test_save_report_permission(self):
"""
Permission Error may occur when trying to save report.
GH-2147
"""
rep = OWReport.get_instance()
patch_target_1 = "Orange.canvas.report.owreport.open"
patch_target_2 = "AnyQt.QtWidgets.QFileDialog.getSaveFileName"
patch_target_3 = "AnyQt.QtWidgets.QMessageBox.exec_"
filenames = ["f.report", "f.html"]
for filename in filenames:
with unittest.mock.patch(patch_target_1, create=True, side_effect=PermissionError),\
unittest.mock.patch(patch_target_2, return_value=(filename, 0)),\
unittest.mock.patch(patch_target_3, return_value=True):
rep.save_report()
示例7: test_save_report
# 需要导入模块: from Orange.canvas.report.owreport import OWReport [as 别名]
# 或者: from Orange.canvas.report.owreport.OWReport import get_instance [as 别名]
def test_save_report(self):
rep = OWReport.get_instance()
file = self.create_widget(OWFile)
file.create_report_html()
rep.make_report(file)
temp_dir = tempfile.mkdtemp()
temp_name = os.path.join(temp_dir, "f.report")
try:
with mock.patch("AnyQt.QtWidgets.QFileDialog.getSaveFileName",
return_value=(temp_name, 0)), \
mock.patch("AnyQt.QtWidgets.QMessageBox.exec_",
return_value=True):
rep.save_report()
finally:
os.remove(temp_name)
os.rmdir(temp_dir)
示例8: show_report_view
# 需要导入模块: from Orange.canvas.report.owreport import OWReport [as 别名]
# 或者: from Orange.canvas.report.owreport.OWReport import get_instance [as 别名]
def show_report_view(self):
from Orange.canvas.report.owreport import OWReport
inst = OWReport.get_instance()
inst.show()
inst.raise_()
示例9: test_report_widgets_all
# 需要导入模块: from Orange.canvas.report.owreport import OWReport [as 别名]
# 或者: from Orange.canvas.report.owreport.OWReport import get_instance [as 别名]
def test_report_widgets_all(self):
rep = OWReport.get_instance()
widgets = self.model_widgets + self.data_widgets + self.eval_widgets + \
self.unsu_widgets + self.dist_widgets + self.visu_widgets + \
self.spec_widgets
self._create_report(widgets, rep, None)