本文整理匯總了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