本文整理汇总了Python中mantid.api.AnalysisDataService.retrieveWorkspaces方法的典型用法代码示例。如果您正苦于以下问题:Python AnalysisDataService.retrieveWorkspaces方法的具体用法?Python AnalysisDataService.retrieveWorkspaces怎么用?Python AnalysisDataService.retrieveWorkspaces使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mantid.api.AnalysisDataService
的用法示例。
在下文中一共展示了AnalysisDataService.retrieveWorkspaces方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_retrieve_workspaces_accepts_unrolling_groups_argument
# 需要导入模块: from mantid.api import AnalysisDataService [as 别名]
# 或者: from mantid.api.AnalysisDataService import retrieveWorkspaces [as 别名]
def test_retrieve_workspaces_accepts_unrolling_groups_argument(self):
ws_names = ["test_retrieve_workspaces_1", "test_retrieve_workspaces_2"]
for name in ws_names:
self._run_createws(name)
group_name = 'group1'
alg = run_algorithm('GroupWorkspaces', InputWorkspaces=ws_names,
OutputWorkspace=group_name)
workspaces = AnalysisDataService.retrieveWorkspaces([group_name], True)
self.assertEquals(2, len(workspaces))
self.assertTrue(isinstance(workspaces[0], MatrixWorkspace))
self.assertTrue(isinstance(workspaces[1], MatrixWorkspace))
示例2: pcolormesh_from_names
# 需要导入模块: from mantid.api import AnalysisDataService [as 别名]
# 或者: from mantid.api.AnalysisDataService import retrieveWorkspaces [as 别名]
def pcolormesh_from_names(names, fig=None):
"""
Create a figure containing pcolor subplots
:param names: A list of workspace names
:param fig: An optional figure to contain the new plots. Its current contents will be cleared
:returns: The figure containing the plots
"""
try:
return pcolormesh(AnalysisDataService.retrieveWorkspaces(names, unrollGroups=True),
fig=fig)
except Exception as exc:
LOGGER.warning(format(str(exc)))
return None
示例3: test_retrieve_workspaces_respects_default_not_unrolling_groups
# 需要导入模块: from mantid.api import AnalysisDataService [as 别名]
# 或者: from mantid.api.AnalysisDataService import retrieveWorkspaces [as 别名]
def test_retrieve_workspaces_respects_default_not_unrolling_groups(self):
ws_names = ["test_retrieve_workspaces_1", "test_retrieve_workspaces_2"]
for name in ws_names:
self._run_createws(name)
workspaces = AnalysisDataService.retrieveWorkspaces(ws_names)
self.assertEquals(2, len(workspaces))