本文整理汇总了Python中SANSUtility.rename_monitors_for_multiperiod_event_data方法的典型用法代码示例。如果您正苦于以下问题:Python SANSUtility.rename_monitors_for_multiperiod_event_data方法的具体用法?Python SANSUtility.rename_monitors_for_multiperiod_event_data怎么用?Python SANSUtility.rename_monitors_for_multiperiod_event_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SANSUtility
的用法示例。
在下文中一共展示了SANSUtility.rename_monitors_for_multiperiod_event_data方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_monitors_are_renamed_correctly
# 需要导入模块: import SANSUtility [as 别名]
# 或者: from SANSUtility import rename_monitors_for_multiperiod_event_data [as 别名]
def test_monitors_are_renamed_correctly(self):
#Arrange
ws_1 = CreateSampleWorkspace()
ws_2 = CreateSampleWorkspace()
ws_3 = CreateSampleWorkspace()
ws_mon_1 = CreateSampleWorkspace()
ws_mon_2 = CreateSampleWorkspace()
ws_mon_3 = CreateSampleWorkspace()
ws_group = GroupWorkspaces(InputWorkspaces=[ws_1, ws_2, ws_3])
ws_mon_group = GroupWorkspaces(InputWorkspaces=[ws_mon_1, ws_mon_2, ws_mon_3])
# Act
su.rename_monitors_for_multiperiod_event_data(ws_mon_group, ws_group, self.monitor_appendix)
# Assert
self.assertTrue(ws_mon_1.name() == ws_1.name() + self.monitor_appendix, "Monitors should be renamed to xxxx_monitors")
self.assertTrue(ws_mon_2.name() == ws_2.name() + self.monitor_appendix, "Monitors should be renamed to xxxx_monitors")
self.assertTrue(ws_mon_3.name() == ws_3.name() + self.monitor_appendix, "Monitors should be renamed to xxxx_monitors")
# Clean up
for element in mtd.getObjectNames():
if element in mtd:
DeleteWorkspace(element)