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


Python SimulatedDensityOfStates.getItem方法代码示例

本文整理汇总了Python中mantid.simpleapi.SimulatedDensityOfStates.getItem方法的典型用法代码示例。如果您正苦于以下问题:Python SimulatedDensityOfStates.getItem方法的具体用法?Python SimulatedDensityOfStates.getItem怎么用?Python SimulatedDensityOfStates.getItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mantid.simpleapi.SimulatedDensityOfStates的用法示例。


在下文中一共展示了SimulatedDensityOfStates.getItem方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_isotopes_are_parsed_correctly

# 需要导入模块: from mantid.simpleapi import SimulatedDensityOfStates [as 别名]
# 或者: from mantid.simpleapi.SimulatedDensityOfStates import getItem [as 别名]
 def test_isotopes_are_parsed_correctly(self):
     """
     Test that isotopes in the file in the format `element:P` are valid
     """
     wks_grp = SimulatedDensityOfStates(PHONONFile=self._isotope_phonon,
                                        SpectrumType='DOS',
                                        Ions='H:P,C:P,O')
     self.assertEqual(3, wks_grp.size())
     self.assertEqual('wks_grp_C(13)', wks_grp.getItem(0).getName())
     self.assertEqual('(C13)', wks_grp.getItem(0).sample().getMaterial().name())
开发者ID:mducle,项目名称:mantid,代码行数:12,代码来源:SimulatedDensityOfStatesTest.py

示例2: test_non_isotpe_element_indices_loading

# 需要导入模块: from mantid.simpleapi import SimulatedDensityOfStates [as 别名]
# 或者: from mantid.simpleapi.SimulatedDensityOfStates import getItem [as 别名]
 def test_non_isotpe_element_indices_loading(self):
     """
     Test that the individual indices for each element can be loaded seperately
     Tests parse_chemical_and_ws_name for non-isotope + indices
     """
     wks_grp = SimulatedDensityOfStates(PHONONFile=self._phonon_file,
                                        SpectrumType='DOS',
                                        CalculateIonIndices=True,
                                        Ions='H,C,O')
     self.assertEqual(20, len(wks_grp))
     self.assertEqual('wks_grp_H_0' , wks_grp.getItem(0).getName())
     self.assertEqual('wks_grp_C_4' , wks_grp.getItem(4).getName())
     self.assertEqual('wks_grp_O_12', wks_grp.getItem(12).getName())
开发者ID:mducle,项目名称:mantid,代码行数:15,代码来源:SimulatedDensityOfStatesTest.py

示例3: test_isotope_element_indices_loading

# 需要导入模块: from mantid.simpleapi import SimulatedDensityOfStates [as 别名]
# 或者: from mantid.simpleapi.SimulatedDensityOfStates import getItem [as 别名]
 def test_isotope_element_indices_loading(self):
     """
     """
     wks_grp = SimulatedDensityOfStates(PHONONFile=self._isotope_phonon,
                                        SpectrumType='DOS',
                                        CalculateIonIndices=True,
                                        Ions='H:P,C:P')
     self.assertEqual(2, len(wks_grp))
     self.assertEqual('wks_grp_C(13)_0', wks_grp.getItem(0).getName())
     self.assertEqual('wks_grp_H(2)_1' , wks_grp.getItem(1).getName())
开发者ID:mducle,项目名称:mantid,代码行数:12,代码来源:SimulatedDensityOfStatesTest.py

示例4: test_bin_ranges_are_correct

# 需要导入模块: from mantid.simpleapi import SimulatedDensityOfStates [as 别名]
# 或者: from mantid.simpleapi.SimulatedDensityOfStates import getItem [as 别名]
 def test_bin_ranges_are_correct(self):
     """
     Test that the bin ranges are correct when draw peak function is called
     """
     bin_width = 3
     wks_grp = SimulatedDensityOfStates(PHONONFile=self._phonon_file,
                                        SpectrumType='DOS',
                                        BinWidth=bin_width,
                                        Ions='H,C,O')
     expected_x_min = -0.051481
     for idx in range(wks_grp.getNumberOfEntries()):
         ws = wks_grp.getItem(idx)
         self.assertAlmostEqual(expected_x_min,ws.readX(0)[0])
         self.assertAlmostEqual(bin_width,(ws.readX(0)[1] - ws.readX(0)[0]))
开发者ID:mducle,项目名称:mantid,代码行数:16,代码来源:SimulatedDensityOfStatesTest.py


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