本文整理汇总了Python中mantid.api.AnalysisDataService.addToGroup方法的典型用法代码示例。如果您正苦于以下问题:Python AnalysisDataService.addToGroup方法的具体用法?Python AnalysisDataService.addToGroup怎么用?Python AnalysisDataService.addToGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mantid.api.AnalysisDataService
的用法示例。
在下文中一共展示了AnalysisDataService.addToGroup方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_group_updated_in_ads_calls_any_change_handle
# 需要导入模块: from mantid.api import AnalysisDataService [as 别名]
# 或者: from mantid.api.AnalysisDataService import addToGroup [as 别名]
def test_group_updated_in_ads_calls_any_change_handle(self):
CreateSampleWorkspace(OutputWorkspace="ws1")
CreateSampleWorkspace(OutputWorkspace="ws2")
GroupWorkspaces(InputWorkspaces="ws1,ws2", OutputWorkspace="NewGroup")
CreateSampleWorkspace(OutputWorkspace="ws3")
self.project.anyChangeHandle = mock.MagicMock()
ADS.addToGroup("NewGroup", "ws3")
self.assertEqual(1, self.project.anyChangeHandle.call_count)
示例2: test_observeGroupUpdated_calls_groupUpdateHandle_when_set_on_ads_and_a_group_in_the_ads_is_updated
# 需要导入模块: from mantid.api import AnalysisDataService [as 别名]
# 或者: from mantid.api.AnalysisDataService import addToGroup [as 别名]
def test_observeGroupUpdated_calls_groupUpdateHandle_when_set_on_ads_and_a_group_in_the_ads_is_updated(self):
CreateSampleWorkspace(OutputWorkspace="ws1")
CreateSampleWorkspace(OutputWorkspace="ws2")
CreateSampleWorkspace(OutputWorkspace="ws3")
GroupWorkspaces(InputWorkspaces="ws1,ws2", OutputWorkspace="NewGroup")
self.fake_class.observeGroupUpdate(True)
self.fake_class.groupUpdateHandle = mock.MagicMock()
ADS.addToGroup("NewGroup", "ws3")
self.assertEqual(self.fake_class.groupUpdateHandle.call_count, 1)
示例3: test_addToGroup_adds_workspace_to_group
# 需要导入模块: from mantid.api import AnalysisDataService [as 别名]
# 或者: from mantid.api.AnalysisDataService import addToGroup [as 别名]
def test_addToGroup_adds_workspace_to_group(self):
from mantid.simpleapi import CreateSampleWorkspace, GroupWorkspaces
CreateSampleWorkspace(OutputWorkspace="ws1")
CreateSampleWorkspace(OutputWorkspace="ws2")
GroupWorkspaces(InputWorkspaces="ws1,ws2", OutputWorkspace="NewGroup")
CreateSampleWorkspace(OutputWorkspace="ws3")
AnalysisDataService.addToGroup("NewGroup", "ws3")
group = mtd['NewGroup']
self.assertEquals(group.size(), 3)
six.assertCountEqual(self, group.getNames(), ["ws1", "ws2", "ws3"])
示例4: test_observeAll_calls_anyChangeHandle_when_set_on_ads_group_updated
# 需要导入模块: from mantid.api import AnalysisDataService [as 别名]
# 或者: from mantid.api.AnalysisDataService import addToGroup [as 别名]
def test_observeAll_calls_anyChangeHandle_when_set_on_ads_group_updated(self):
self.fake_class.observeAll(True)
CreateSampleWorkspace(OutputWorkspace="ws1")
expected_count = 1
CreateSampleWorkspace(OutputWorkspace="ws2")
expected_count += 1
CreateSampleWorkspace(OutputWorkspace="ws3")
expected_count += 1
GroupWorkspaces(InputWorkspaces="ws1,ws2", OutputWorkspace="NewGroup")
# One for grouping the workspace
expected_count += 1
# One for adding it to the ADS
expected_count += 1
# Will update group
ADS.addToGroup("NewGroup", "ws3")
expected_count += 1
self.assertEqual(self.fake_class.anyChangeHandle.call_count, expected_count)