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


Python PDFCalculator.setStructure方法代码示例

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


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

示例1: test__customPQConfig

# 需要导入模块: from diffpy.srreal.pdfcalculator import PDFCalculator [as 别名]
# 或者: from diffpy.srreal.pdfcalculator.PDFCalculator import setStructure [as 别名]
 def test__customPQConfig(self):
     """check if DerivedCls._customPQConfig gets called.
     """
     self.assertEqual(0, self.adpt.cpqcount)
     pc = PDFCalculator()
     pc.setStructure(self.adpt)
     self.assertEqual(1, self.adpt.cpqcount)
     pc(self.adpt)
     self.assertEqual(2, self.adpt.cpqcount)
     return
开发者ID:pavoljuhas,项目名称:diffpy.srreal,代码行数:12,代码来源:teststructureadapter.py

示例2: test_pickling

# 需要导入模块: from diffpy.srreal.pdfcalculator import PDFCalculator [as 别名]
# 或者: from diffpy.srreal.pdfcalculator.PDFCalculator import setStructure [as 别名]
 def test_pickling(self):
     '''check pickling of DerivedCls instances.
     '''
     self.adpt.cpqcount = 1
     adpt1 = cPickle.loads(cPickle.dumps(self.adpt))
     self.assertTrue(self.DerivedCls is type(adpt1))
     self.assertFalse(self.adpt is adpt1)
     self.assertEqual(1, adpt1.cpqcount)
     pc = PDFCalculator()
     pc.setStructure(adpt1)
     self.assertEqual(2, adpt1.cpqcount)
     pc(adpt1)
     self.assertEqual(3, adpt1.cpqcount)
     return
开发者ID:pavoljuhas,项目名称:diffpy.srreal,代码行数:16,代码来源:teststructureadapter.py

示例3: test_pickling

# 需要导入模块: from diffpy.srreal.pdfcalculator import PDFCalculator [as 别名]
# 或者: from diffpy.srreal.pdfcalculator.PDFCalculator import setStructure [as 别名]
 def test_pickling(self):
     """check pickling of DerivedCls instances.
     """
     self.adpt.cpqcount = 1
     adpt1 = cPickle.loads(cPickle.dumps(self.adpt))
     self.failUnless(self.DerivedCls is type(adpt1))
     self.failIf(self.adpt is adpt1)
     self.assertEqual(1, adpt1.cpqcount)
     pc = PDFCalculator()
     pc.setStructure(adpt1)
     self.assertEqual(2, adpt1.cpqcount)
     pc(adpt1)
     self.assertEqual(3, adpt1.cpqcount)
     return
开发者ID:suwoonglee,项目名称:diffpy.srreal,代码行数:16,代码来源:teststructureadapter.py


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