當前位置: 首頁>>代碼示例>>Python>>正文


Python PDFCalculator.ticker方法代碼示例

本文整理匯總了Python中diffpy.srreal.pdfcalculator.PDFCalculator.ticker方法的典型用法代碼示例。如果您正苦於以下問題:Python PDFCalculator.ticker方法的具體用法?Python PDFCalculator.ticker怎麽用?Python PDFCalculator.ticker使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在diffpy.srreal.pdfcalculator.PDFCalculator的用法示例。


在下文中一共展示了PDFCalculator.ticker方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_ticker_override

# 需要導入模塊: from diffpy.srreal.pdfcalculator import PDFCalculator [as 別名]
# 或者: from diffpy.srreal.pdfcalculator.PDFCalculator import ticker [as 別名]
 def test_ticker_override(self):
     """check method override for PeakProfile.ticker in a derived class.
     """
     pkf = MySawTooth()
     self.assertEqual(0, pkf.tcnt)
     et0 = pkf.ticker()
     self.assertEqual(1, pkf.tcnt)
     et1 = PeakProfile.ticker(pkf)
     self.assertEqual(1, pkf.tcnt)
     self.assertEqual(et0, et1)
     et0.click()
     self.assertEqual(et0, et1)
     # check that implicit ticker call from PDFCalculator is
     # handled by the Python ticker override.
     pc = PDFCalculator()
     pc.peakprofile = pkf
     pc.ticker()
     self.assertEqual(2, pkf.tcnt)
     return
開發者ID:hjjvandam,項目名稱:diffpy.srreal,代碼行數:21,代碼來源:testpeakprofile.py

示例2: test_ticker_override

# 需要導入模塊: from diffpy.srreal.pdfcalculator import PDFCalculator [as 別名]
# 或者: from diffpy.srreal.pdfcalculator.PDFCalculator import ticker [as 別名]
 def test_ticker_override(self):
     """check PeakWidthModel.ticker override in a Python-derived class.
     """
     pwm = MyPWM()
     self.assertEqual(0, pwm.tcnt)
     et0 = pwm.ticker()
     self.assertEqual(1, pwm.tcnt)
     et1 = PeakWidthModel.ticker(pwm)
     self.assertEqual(1, pwm.tcnt)
     self.assertEqual(et0, et1)
     et0.click()
     self.assertEqual(et0, et1)
     # check that implicit ticker call from PDFCalculator is
     # handled by the Python ticker override.
     pc = PDFCalculator()
     pc.peakwidthmodel = pwm
     pc.ticker()
     self.assertEqual(2, pwm.tcnt)
     return
開發者ID:hjjvandam,項目名稱:diffpy.srreal,代碼行數:21,代碼來源:testpeakwidthmodel.py

示例3: test_ticker_override

# 需要導入模塊: from diffpy.srreal.pdfcalculator import PDFCalculator [as 別名]
# 或者: from diffpy.srreal.pdfcalculator.PDFCalculator import ticker [as 別名]
 def test_ticker_override(self):
     """check Python override of ScatteringFactorTable.ticker.
     """
     from diffpy.srreal.pdfcalculator import PDFCalculator
     lsft = LocalTable()
     self.assertEqual(0, lsft.tcnt)
     et0 = lsft.ticker()
     self.assertEqual(1, lsft.tcnt)
     et1 = ScatteringFactorTable.ticker(lsft)
     self.assertEqual(1, lsft.tcnt)
     self.assertEqual(et0, et1)
     et0.click()
     self.assertEqual(et0, et1)
     # check that implicit ticker call from PDFCalculator is
     # handled by Python override of the ticker method.
     pc = PDFCalculator()
     pc.scatteringfactortable = lsft
     pc.ticker()
     self.assertEqual(2, lsft.tcnt)
     return
開發者ID:diffpy,項目名稱:diffpy.srreal,代碼行數:22,代碼來源:testscatteringfactortable.py


注:本文中的diffpy.srreal.pdfcalculator.PDFCalculator.ticker方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。