當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。