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