本文整理汇总了Python中pypet.Trajectory.ff方法的典型用法代码示例。如果您正苦于以下问题:Python Trajectory.ff方法的具体用法?Python Trajectory.ff怎么用?Python Trajectory.ff使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pypet.Trajectory
的用法示例。
在下文中一共展示了Trajectory.ff方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_new_assignment_method
# 需要导入模块: from pypet import Trajectory [as 别名]
# 或者: from pypet.Trajectory import ff [as 别名]
#.........这里部分代码省略.........
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')
with self.assertRaises(TypeError):
traj.jj = ParameterGroup('jj', comment='mi')
traj.par.jj = ParameterGroup('jj', comment='mi')
traj.res.jj = ResultGroup('jj', comment='mi')
traj.jj = NNGroupNode('jj')
cg = ConfigGroup('a.g')
traj.conf.a = cg
self.assertTrue(traj.f_get('conf.a.g', shortcuts=False) is cg)
dg = DerivedParameterGroup('ttt')
traj.dpar.ttt = dg
self.assertTrue(traj.f_get('dpar.ttt', shortcuts=False) is dg)
traj.mylink = traj.par
self.assertTrue(traj.mylink is traj.par)
traj.vvv = NNGroupNode('', comment='kkk')
self.assertTrue(traj.vvv.v_full_name == 'vvv')
self.assertTrue(traj.par.jj.v_name == 'jj')
traj.ff = MyParamGroup('ff')
traj.par.g = MyParamGroup('')
pg = traj.f_add_parameter_group(comment='gg', full_name='me')
self.assertTrue(traj.par.me is pg)
traj.f_store()
traj = load_trajectory(index=-1, filename=filename, dynamic_imports=MyParamGroup)
self.assertTrue(isinstance(traj.ff, MyParamGroup))
self.assertTrue(isinstance(traj.par.g, MyParamGroup))
traj.par.hiho = Parameter('hiho', 42, comment='you')
traj.par.g1 = Parameter('g1.g2.g3.g4.g5', 43)
self.assertTrue(traj.hiho == 42)
self.assertTrue(isinstance(traj.par.g1, ParameterGroup ))
self.assertTrue(isinstance(traj.par.g3, ParameterGroup ))
self.assertTrue(traj.g3.g5 == 43)