当前位置: 首页>>代码示例>>Python>>正文


Python AnalysisDataService.addToGroup方法代码示例

本文整理汇总了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)
开发者ID:samueljackson92,项目名称:mantid,代码行数:12,代码来源:test_project.py

示例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)
开发者ID:mantidproject,项目名称:mantid,代码行数:13,代码来源:AnalysisDataServiceObserverTest.py

示例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"])
开发者ID:mantidproject,项目名称:mantid,代码行数:15,代码来源:AnalysisDataServiceTest.py

示例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)
开发者ID:mantidproject,项目名称:mantid,代码行数:21,代码来源:AnalysisDataServiceObserverTest.py


注:本文中的mantid.api.AnalysisDataService.addToGroup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。