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


Python Trajectory.jj方法代码示例

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


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

示例1: test_new_assignment_method

# 需要导入模块: from pypet import Trajectory [as 别名]
# 或者: from pypet.Trajectory import jj [as 别名]
    def test_new_assignment_method(self):
        filename = make_temp_dir('newassignment.hdf5')
        traj = Trajectory(filename=filename, add_time=True)

        comment = 'A number'
        traj.par.x = Parameter('', 44, comment)

        self.assertTrue(traj.f_get('x').v_comment == comment)

        traj.x = 45
        self.assertTrue(traj.par.f_get('x').f_get() == 45)

        self.assertTrue(isinstance(traj.f_get('x'), Parameter))

        with self.assertRaises(AttributeError):
            traj.f = Parameter('lll', 444, 'lll')


        traj.f = Parameter('', 444, 'lll')

        self.assertTrue(traj.f_get('f').v_name == 'f')


        conf = traj.conf
        with self.assertRaises(AttributeError):
            conf = traj.conf.jjjj
        traj.f_set_properties(fast_access=True)


        traj.crun = Result('', k=43, m='JJJ')
        self.assertTrue(traj.run_A['k'] == 43)

        with self.assertRaises(AttributeError):
            traj.f_set_properties(j=7)

        with self.assertRaises(AttributeError):
            traj.f_set_properties(depth=7)

        traj.hui = Result('hui', ('444', 'kkkk',), 'l')



        self.assertTrue(traj.f_get('hui')[1] == 'l')


        traj.f_get('hui').f_set(('445', 'kkkk',))

        self.assertTrue(traj.f_get('hui')[1] == 'l')

        self.assertTrue(traj.hui[0] == ('445', 'kkkk',))

        traj.f_add_link('klkikju', traj.par) # for shizzle


        traj.meee = Result('meee.h', 43, hui = 3213, comment='du')

        self.assertTrue(traj.meee.h.h == 43)

        with self.assertRaises(TypeError):
            traj.par.jj = NNGroupNode('jj', comment='mi')
        with self.assertRaises(TypeError):
            traj.res.jj = NNGroupNode('jj', comment='mi')
        with self.assertRaises(TypeError):
            traj.conf.jj = NNGroupNode('jj', comment='mi')
        with self.assertRaises(TypeError):
            traj.dpar.jj = NNGroupNode('jj', comment='mi')

        with self.assertRaises(TypeError):
            traj.par.jj = ResultGroup('jj', comment='mi')
        with self.assertRaises(TypeError):
            traj.dpar.jj = ResultGroup('jj', comment='mi')
        with self.assertRaises(TypeError):
            traj.conf.jj = ResultGroup('jj', comment='mi')
        with self.assertRaises(TypeError):
            traj.jj = ResultGroup('jj', comment='mi')

        with self.assertRaises(TypeError):
            traj.par.jj = ConfigGroup('jj', comment='mi')
        with self.assertRaises(TypeError):
            traj.dpar.jj = ConfigGroup('jj', comment='mi')
        with self.assertRaises(TypeError):
            traj.res.jj = ConfigGroup('jj', comment='mi')
        with self.assertRaises(TypeError):
            traj.jj = ConfigGroup('jj', comment='mi')

        with self.assertRaises(TypeError):
            traj.par.jj = DerivedParameterGroup('jj', comment='mi')
        with self.assertRaises(TypeError):
            traj.conf.jj = DerivedParameterGroup('jj', comment='mi')
        with self.assertRaises(TypeError):
            traj.res.jj = DerivedParameterGroup('jj', comment='mi')
        with self.assertRaises(TypeError):
            traj.jj = DerivedParameterGroup('jj', comment='mi')

        with self.assertRaises(TypeError):
            traj.dpar.jj = ParameterGroup('jj', comment='mi')
        with self.assertRaises(TypeError):
            traj.res.jj = ParameterGroup('jj', comment='mi')
        with self.assertRaises(TypeError):
            traj.conf.jj = ParameterGroup('jj', comment='mi')
#.........这里部分代码省略.........
开发者ID:femtotrader,项目名称:pypet,代码行数:103,代码来源:storage_test.py


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