本文整理汇总了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
示例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
示例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