本文整理汇总了Python中mantid.simpleapi.CreateWorkspace.getHistory方法的典型用法代码示例。如果您正苦于以下问题:Python CreateWorkspace.getHistory方法的具体用法?Python CreateWorkspace.getHistory怎么用?Python CreateWorkspace.getHistory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mantid.simpleapi.CreateWorkspace
的用法示例。
在下文中一共展示了CreateWorkspace.getHistory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_disable_history
# 需要导入模块: from mantid.simpleapi import CreateWorkspace [as 别名]
# 或者: from mantid.simpleapi.CreateWorkspace import getHistory [as 别名]
def test_disable_history(self):
ws_name = '__tmp_test_algorithm_history'
ws = CreateWorkspace([0, 1, 2], [0, 1, 2], OutputWorkspace=ws_name)
alg = self._run_algorithm('ParentAlg', child_algorithm=True, record_history=False, Workspace=ws_name)
history = ws.getHistory()
alg_hists = history.getAlgorithmHistories()
self.assertEquals(history.size(), 1)
self.assertEquals(len(alg_hists), 1)
示例2: test_nested_history
# 需要导入模块: from mantid.simpleapi import CreateWorkspace [as 别名]
# 或者: from mantid.simpleapi.CreateWorkspace import getHistory [as 别名]
def test_nested_history(self):
ws_name = '__tmp_test_algorithm_history'
ws = CreateWorkspace([0, 1, 2], [0, 1, 2], OutputWorkspace=ws_name)
alg = self._run_algorithm("ParentAlg", Workspace=ws_name)
history = ws.getHistory()
alg_hists = history.getAlgorithmHistories()
self.assertEquals(history.size(), 2)
self.assertEquals(len(alg_hists), 2)
parent_alg = history.getAlgorithmHistory(1)
self.assertEquals(parent_alg.name(), "ParentAlg")
self.assertEquals(parent_alg.version(), 1)
self.assertEquals(parent_alg.childHistorySize(), 1)
child_alg = parent_alg.getChildAlgorithmHistory(0)
self.assertEquals(child_alg.name(), "ChildAlg")
self.assertEquals(child_alg.version(), 1)
self.assertEquals(child_alg.childHistorySize(), 0)