当前位置: 首页>>代码示例>>Python>>正文


Python Options.detectors['det3']方法代码示例

本文整理汇总了Python中pymontecarlo.options.options.Options.detectors['det3']方法的典型用法代码示例。如果您正苦于以下问题:Python Options.detectors['det3']方法的具体用法?Python Options.detectors['det3']怎么用?Python Options.detectors['det3']使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pymontecarlo.options.options.Options的用法示例。


在下文中一共展示了Options.detectors['det3']方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setUpClass

# 需要导入模块: from pymontecarlo.options.options import Options [as 别名]
# 或者: from pymontecarlo.options.options.Options import detectors['det3'] [as 别名]
    def setUpClass(cls):
        super(TestResultsReader, cls).setUpClass()

        ops1 = Options(name='test1')
        ops1.detectors['det1'] = PhotonIntensityDetector((0, 1), (0, 1))
        ops1.detectors['det2'] = TimeDetector()
        ops1.detectors['det3'] = ElectronFractionDetector()

        results1 = {}
        results1['det1'] = PhotonIntensityResult()
        results1['det2'] = TimeResult()
        results1['det3'] = ElectronFractionResult()

        ops2 = Options(name='test2')
        ops2.detectors['det1'] = PhotonIntensityDetector((0, 1), (0, 1))

        results2 = {}
        results2['det1'] = PhotonIntensityResult()

        cls.results = Results(Options(name='base'),
                              [(ops1, results1), (ops2, results2)])

        cls.group = h5py.File('test.h5', 'a', driver='core', backing_store=False)

        writer = ResultsWriter()
        writer.convert(cls.results, cls.group)
        writer.join()
开发者ID:silrichter,项目名称:pymontecarlo,代码行数:29,代码来源:test_results.py

示例2: setUp

# 需要导入模块: from pymontecarlo.options.options import Options [as 别名]
# 或者: from pymontecarlo.options.options.Options import detectors['det3'] [as 别名]
    def setUp(self):
        unittest.TestCase.setUp(self)

        ops1 = Options(name='test1')
        ops1.detectors['det1'] = PhotonIntensityDetector((0, 1), (0, 1))
        ops1.detectors['det2'] = TimeDetector()
        ops1.detectors['det3'] = ElectronFractionDetector()

        results1 = {}
        results1['det1'] = PhotonIntensityResult()
        results1['det2'] = TimeResult()
        results1['det3'] = ElectronFractionResult()

        ops2 = Options(name='test2')
        ops2.detectors['det1'] = PhotonIntensityDetector((0, 1), (0, 1))

        results2 = {}
        results2['det1'] = PhotonIntensityResult()

        self.obj = Results(Options(name='base'),
                           [(ops1, results1), (ops2, results2)])
开发者ID:silrichter,项目名称:pymontecarlo,代码行数:23,代码来源:test_results.py


注:本文中的pymontecarlo.options.options.Options.detectors['det3']方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。